-
Notifications
You must be signed in to change notification settings - Fork 535
WIP logging and validations in CompCor, SignalExtraction, ApplyTopUp #1676
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
73b9a0e
debug tcompcor, add log messages and tests
e811b96
save outputs to cwd
0c7c649
explicity check + error out if mask file and func file don't match in…
8313923
python3, pep8
974a42b
use abs paths; +appropriate way to test this
741405f
make transforms arg in ApplyTransforms opt
d38562c
allow ANTS ApplyTransforms to use identity transform
a512faf
traits mandatory=False is incorrect; ignore unicode in doctests
6448ee8
test specs auto
e98bd95
Add more informative error msg
4f27943
less mysterious error messages
b04d4e7
better test
7c7dcd2
check and error if input to fsl ApplyTopUp is not 4 dimensional
8cfa00f
don't load the whole thing into memory
dd8dfb4
make specs
a0a31c4
merge with master
7f84dff
Merge branch 'master' of http://github.com/nipy/nipype into debugging
b3187f3
pull from nipy/nipype master
bba591b
add headers to outputs of compcor, framewise displacement + test fix
8a660dc
Merge http://github.com/nipy/nipype into debugging
89b9856
revert 4d validation, fix input spec desc
a42439f
chdir back to original dir before deleting tempdir
b85fd5f
fix up test (e.g. pep8)
35a0bb3
Merge http://github.com/nipy/nipype into debugging
4f80b2a
use from io import open
c217a23
revert identity transform
cd5385e
Merge http://github.com/nipy/nipype into debugging
9239f7b
try longer timeout
d5e1a0b
specify tab delimiter
b48395d
don't let divide by zero errors pass by
fb3c550
don't calculate var/stddev twice
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -354,14 +354,14 @@ class ApplyTOPUP(FSLCommand): | |
|
||
>>> from nipype.interfaces.fsl import ApplyTOPUP | ||
>>> applytopup = ApplyTOPUP() | ||
>>> applytopup.inputs.in_files = ["epi.nii", "epi_rev.nii"] | ||
>>> applytopup.inputs.in_files = ["ds003_sub-01_mc.nii.gz", "ds003_sub-01_mc.nii.gz"] | ||
>>> applytopup.inputs.encoding_file = "topup_encoding.txt" | ||
>>> applytopup.inputs.in_topup_fieldcoef = "topup_fieldcoef.nii.gz" | ||
>>> applytopup.inputs.in_topup_movpar = "topup_movpar.txt" | ||
>>> applytopup.inputs.output_type = "NIFTI_GZ" | ||
>>> applytopup.cmdline # doctest: +ELLIPSIS +IGNORE_UNICODE | ||
'applytopup --datain=topup_encoding.txt --imain=epi.nii,epi_rev.nii \ | ||
--inindex=1,2 --topup=topup --out=epi_corrected.nii.gz' | ||
'applytopup --datain=topup_encoding.txt --imain=ds003_sub-01_mc.nii.gz,ds003_sub-01_mc.nii.gz \ | ||
--inindex=1,2 --topup=topup --out=ds003_sub-01_mc_corrected.nii.gz' | ||
>>> res = applytopup.run() # doctest: +SKIP | ||
|
||
""" | ||
|
@@ -374,7 +374,7 @@ def _parse_inputs(self, skip=None): | |
skip = [] | ||
|
||
for filename in self.inputs.in_files: | ||
ndims = nib.load(filename).get_data().ndim | ||
ndims = nib.load(filename).header['dim'][0] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. see comment above |
||
if ndims != 4: | ||
raise ValueError('Input in_files for ApplyTopUp must be 4-D. {} is {}-D.' | ||
.format(filename, ndims)) | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why this? epi.nii and epi_rev.nii are empty files in testing/data
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bc I added the check for dimensionality, empty files were causing the tests to fail.
ds003_sub-01_mc.nii.gz
is an already-existing file intesting/data
that has the appropriate dimensions. It is a little hacky but consistent with the rest of nipype's testing infrastructure.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I see. The
_parse_inputs
method is probably not the best place to this kind of check. I think it would be better placed the_run_interface
method. Something like:This way the doctests will pass with empty files and we don't alter the expected behavior of _parse_inputs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm removing the test for dimensionality based on others' comments