Skip to content

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 31 commits into from
Nov 9, 2016
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
Oct 6, 2016
e811b96
save outputs to cwd
Oct 6, 2016
0c7c649
explicity check + error out if mask file and func file don't match in…
Oct 7, 2016
8313923
python3, pep8
Oct 7, 2016
974a42b
use abs paths; +appropriate way to test this
Oct 7, 2016
741405f
make transforms arg in ApplyTransforms opt
Oct 8, 2016
d38562c
allow ANTS ApplyTransforms to use identity transform
Oct 8, 2016
a512faf
traits mandatory=False is incorrect; ignore unicode in doctests
Oct 8, 2016
6448ee8
test specs auto
Oct 8, 2016
e98bd95
Add more informative error msg
Oct 8, 2016
4f27943
less mysterious error messages
Oct 10, 2016
b04d4e7
better test
Oct 10, 2016
7c7dcd2
check and error if input to fsl ApplyTopUp is not 4 dimensional
Oct 11, 2016
8cfa00f
don't load the whole thing into memory
Oct 11, 2016
dd8dfb4
make specs
Oct 12, 2016
a0a31c4
merge with master
Oct 12, 2016
7f84dff
Merge branch 'master' of http://github.com/nipy/nipype into debugging
Oct 12, 2016
b3187f3
pull from nipy/nipype master
Oct 15, 2016
bba591b
add headers to outputs of compcor, framewise displacement + test fix
Oct 17, 2016
8a660dc
Merge http://github.com/nipy/nipype into debugging
Oct 17, 2016
89b9856
revert 4d validation, fix input spec desc
Oct 18, 2016
a42439f
chdir back to original dir before deleting tempdir
Oct 18, 2016
b85fd5f
fix up test (e.g. pep8)
Oct 18, 2016
35a0bb3
Merge http://github.com/nipy/nipype into debugging
Oct 19, 2016
4f80b2a
use from io import open
Oct 24, 2016
c217a23
revert identity transform
Oct 24, 2016
cd5385e
Merge http://github.com/nipy/nipype into debugging
Oct 24, 2016
9239f7b
try longer timeout
Oct 25, 2016
d5e1a0b
specify tab delimiter
Oct 26, 2016
b48395d
don't let divide by zero errors pass by
Oct 28, 2016
fb3c550
don't calculate var/stddev twice
Oct 31, 2016
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
8 changes: 4 additions & 4 deletions nipype/interfaces/fsl/epi.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Copy link
Contributor

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

Copy link
Contributor Author

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 in testing/data that has the appropriate dimensions. It is a little hacky but consistent with the rest of nipype's testing infrastructure.

Copy link
Contributor

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:

def _run_interface(self, runtime):
    ... your inputs sanity checks ...
    return super(ApplyTopup, self).__run_interface(runtime)

This way the doctests will pass with empty files and we don't alter the expected behavior of _parse_inputs.

Copy link
Contributor Author

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

>>> 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

"""
Expand All @@ -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]
Copy link
Contributor

Choose a reason for hiding this comment

The 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))
Expand Down