Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
329c74d
add variance-driven component selection, return component metadata
rciric Jan 19, 2019
17f3e12
expose metadata to interface, fix component selection for multiple masks
rciric Jan 19, 2019
114e6d4
propagate failure mode if provided
rciric Jan 19, 2019
6f4fc19
allow mask naming in metadata
rciric Jan 19, 2019
4d2208e
add contributor
rciric Jan 19, 2019
bfbde82
include component index in metadata
rciric Jan 19, 2019
0373879
update autotests and make naming consistent
rciric Jan 19, 2019
2c551d0
(CompCor) more intuitive interface following review from @effigies
rciric Jan 20, 2019
a53cd46
manually set `num_components` in test
rciric Jan 20, 2019
b811d47
manually set `num_components` in test
rciric Jan 20, 2019
2743189
Merge branch 'master' of https://github.com/rciric/nipype
rciric Jan 21, 2019
577e395
add unit test for variance_threshold condition
rciric Jan 21, 2019
66c7540
provide mask name to circumvent test failure
rciric Jan 21, 2019
0bb0096
(CompCor) try using an OrderedDict for metadata
rciric Jan 21, 2019
94bea4a
first-pass refactor CompCor to SimpleInterface
rciric Feb 4, 2019
addb0e9
return metadata for all components regardless of retention criterion
rciric Feb 6, 2019
b04c9ca
@oesteban: limit np array use, clean up conditionals, remove invalid obj
rciric Feb 8, 2019
e957e87
less np array use; unique names for dropped components
rciric Feb 9, 2019
797801e
ensure absolute path to components file
rciric Feb 9, 2019
67a3276
(CompCor) try BaseInterface
rciric Feb 9, 2019
fe430f5
ensure absolute path to components file
rciric Feb 9, 2019
1625bdb
update per @oesteban 's review
rciric Feb 15, 2019
9afb3f5
assign output to _results
rciric Feb 15, 2019
689d064
assign output to _results
rciric Feb 15, 2019
f390bc6
some fixes
oesteban Feb 16, 2019
ad3d440
testing pickling of variance_threshold
oesteban Feb 16, 2019
fd41b74
``traits.Range`` cannot be pickled with traits>=5 and python 2.7
oesteban Feb 16, 2019
01a78ec
Merge pull request #1 from oesteban/rciric-patch-1
rciric Feb 16, 2019
a742c9c
pacify codacy
rciric Feb 16, 2019
518a489
revert unnecessary squeeze, correct docs
rciric Feb 21, 2019
deceb95
revise in accordance with @effigies review
rciric Feb 22, 2019
fa64907
revise in accordance with @effigies review
rciric Feb 23, 2019
e6dfe7d
ensure s is defined, support NaN failure mode with empty mask
rciric Mar 1, 2019
27ed03f
filter handles empty masks, use `squeeze_image`
rciric Mar 27, 2019
422c04c
Merge branch 'master' of https://github.com/nipy/nipype
rciric Mar 27, 2019
144fca3
Merge branch 'master' of https://github.com/nipy/nipype
rciric Mar 28, 2019
82a25c2
default to old behaviour for temporal filters
rciric Mar 28, 2019
4c1af8a
Merge branch 'master' into master
effigies Apr 11, 2019
79e840d
integrate @effigies review comments
rciric Apr 19, 2019
1b1b6fa
propagate retention status to metadata; use list instead of generator…
rciric Apr 19, 2019
89ba3b4
Merge branch 'master' of https://github.com/rciric/nipype
rciric Apr 19, 2019
b80a3d7
update unit test to include new metadata field
rciric Apr 19, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
propagate retention status to metadata; use list instead of generator…
…; correct var name
  • Loading branch information
rciric committed Apr 19, 2019
commit 1b1b6fa2b342acd500f599fe6890b2d683f2ec57
12 changes: 6 additions & 6 deletions nipype/algorithms/confounds.py
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,7 @@ def _run_interface(self, runtime):
f.write('\t'.join(['component'] + list(metadata.keys())) + '\n')
for i in zip(components_names, *metadata.values()):
f.write('{0[0]}\t{0[1]}\t{0[2]:.10f}\t'
'{0[3]:.10f}\t{0[4]:.10f}\n'.format(i))
'{0[3]:.10f}\t{0[4]:.10f}\t{0[5]}\n'.format(i))

return runtime

Expand Down Expand Up @@ -1268,7 +1268,7 @@ def compute_noise_components(imgseries, mask_images, components_criterion=0.5,
components_criterion = -1
mask_names = mask_names or range(len(mask_images))

comp_list = []
components = []
md_mask = []
md_sv = []
md_var = []
Expand Down Expand Up @@ -1345,8 +1345,8 @@ def compute_noise_components(imgseries, mask_images, components_criterion=0.5,
md_sv.append(s)
md_var.append(variance_explained)
md_cumvar.append(cumulative_variance_explained)
md_retained.append(i < num_components for i in range(len(s)))
md_retained.append([i < num_components for i in range(len(s))])

if len(components) > 0:
components = np.hstack(components)
else:
Expand All @@ -1355,13 +1355,13 @@ def compute_noise_components(imgseries, mask_images, components_criterion=0.5,
components = np.full((M.shape[0], num_components),
np.nan, dtype=np.float32)

metadata = OrderedDict(
metadata = OrderedDict([
('mask', list(chain(*md_mask))),
('singular_value', np.hstack(md_sv)),
('variance_explained', np.hstack(md_var)),
('cumulative_variance_explained', np.hstack(md_cumvar)),
('retained', list(chain(*md_retained)))
)
])

return components, basis, metadata

Expand Down