-
Notifications
You must be signed in to change notification settings - Fork 532
[ENH] Add interface to SPM realign_unwarp #2635
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
Conversation
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.
Hi @qtabs , thank you for the contribution! I left a couple comments + suggestions to get past the CI errors you're encountering - if you have any questions let me know!
EDIT: can you also run make specs
and add the new autotest?
nipype/interfaces/spm/preprocess.py
Outdated
@@ -437,6 +437,251 @@ def _list_outputs(self): | |||
return outputs | |||
|
|||
|
|||
class RealignUnwarpInputSpec(SPMCommandInputSpec): | |||
in_files = InputMultiPath( |
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.
InputMultiPath
is in the process of replaced by InputMultiObject
, let's use that instead
nipype/interfaces/spm/preprocess.py
Outdated
@@ -437,6 +437,251 @@ def _list_outputs(self): | |||
return outputs | |||
|
|||
|
|||
class RealignUnwarpInputSpec(SPMCommandInputSpec): | |||
in_files = InputMultiPath( | |||
traits.Either(traits.List(File(exists=True)), |
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.
and you could use ImageFileSPM
for image files
nipype/nipype/interfaces/spm/base.py
Line 599 in 7ea4f1b
class ImageFileSPM(ImageFile): |
instead of File
, since it will not allow compressed niftis as well
Examples | ||
-------- | ||
|
||
>>> import nipype.interfaces.spm as spm |
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.
you'll have to add RealignUnwarp
to
nipype/nipype/interfaces/spm/__init__.py
Lines 8 to 10 in 7ea4f1b
from .preprocess import (FieldMap, SliceTiming, Realign, Coregister, Normalize, | |
Normalize12, Segment, Smooth, NewSegment, DARTEL, | |
DARTELNorm2MNI, CreateWarped, VBMSegment) |
in order to import this way
nipype/interfaces/spm/preprocess.py
Outdated
>>> import nipype.interfaces.spm as spm | ||
>>> realignUnwarp = spm.RealignUnwarp() | ||
>>> realignUnwarp.inputs.in_files = ['func-run01.nii', func-run02.nii'] | ||
>>> realignUnwarp.inputs.phase_map = 'phasemap.vdm' |
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.
IIRC, these files must exist to satisfy the traits requirements - we have quite a bit included in the repo already, but for the sake of interface clarity if you cannot reuse any existing files, feel free to add necessary (empty) files
Hi @qtabs, do you have time to finish this up this week? |
Thanks a lot for the help! :) I'm sorry I didn't reply any earlier, I left for vacation right after the request and couldn't check my mailbox until now. I'll try to implement your suggestions and run the tests again next week :). |
Hi @qtabs. Please let us know if you need anything from us. Just a heads up that we'll try to release on August 27, so it'd be great to have this within the next two weeks (by August 20). |
…e to InputMultiObject
…into addSPMrealingUnwarp
Codecov Report
@@ Coverage Diff @@
## master #2635 +/- ##
========================================
Coverage ? 66.5%
========================================
Files ? 340
Lines ? 43140
Branches ? 5348
========================================
Hits ? 28691
Misses ? 13679
Partials ? 770
Continue to review full report at Codecov.
|
Hi guys! I tried to fix the problems you hinted above but I still get some errors. I think (sorry, it's my first time dealing with automated tests!) the tests are failing to load the new module:
but I have added RealignUnwarp to Thanks a lot for your help! |
I'm not seeing this issue in the logs. I am seeing:
Which just means you need to import You should also merge master to fix the |
Merged master for you. If this passes it'll make it into 1.1.2 (we need to do an emergency release). If not, we'll push it off to 1.1.3 next month. For reference I did the following:
git remote add upstream [email protected]:nipy/nipype.git
git remote add qtabs [email protected]:qtabs/nipype.git (You wouldn't need to add your own.)
git fetch --all
git checkout add addSPMrealingUnwarp
git merge upstream/master
git push |
Thanks a lot @effigies! I'm trying my best but I'm still quite new to all this stuff, sorry for my noobie incompetence! O:) |
No worries. I'd usually try to be a little more helpful and give newbies a chance to practice, but with a shortened release window, I figured we could squeeze this one in. I hope you keep your eyes out for some more practice opportunities. :-) |
Well, the latest failures aren't related to this PR. I'm fixing them in #2679. |
Thanks a lot! :) Please let me know if there's anything else from here causing problems! |
Adds am interface to SPM's realing & unwarp function.