-
Notifications
You must be signed in to change notification settings - Fork 532
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
ENH: added 'hsvs' option to 5ttgen + mrtransform fix #3630
Conversation
teanijarv
commented
Feb 20, 2024
•
edited
Loading
edited
- added Hybrid Surface and Volume Segmentation ('hsvs') option to the 5TT image generation class
- removed the in_file existing requirement (exists=True -> exists=False) for 5ttgen because hsvs requires a directory not a file as input
- changed '-inverse' parameter location from 1 to 2 in mrtransform class (to make it possible to insert it in the command together with other parameters)
- Added 'hsvs' option for 5ttgen function
- Changed '-inverse' parameter location from 1 to 2 (otherwise cannot use together with -linear)
nipype/interfaces/mrtrix3/utils.py
Outdated
argstr="%s", | ||
position=-3, | ||
mandatory=True, | ||
desc="tissue segmentation algorithm", | ||
) | ||
in_file = File( | ||
exists=True, argstr="%s", mandatory=True, position=-2, desc="input image" | ||
exists=False, argstr="%s", mandatory=True, position=-2, desc="input image" |
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.
So it seems like you need either a file or a directory, not a missing file.
in_file = traits.Either(
File(exists=True),
Directory(exists=True),
argstr="%s", mandatory=True, position=-2, desc="input image / directory"
)
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.
Thanks! I added this solution now. :)
nipype/interfaces/mrtrix3/utils.py
Outdated
@@ -822,7 +823,7 @@ class MRTransformInputSpec(MRTrix3BaseInputSpec): | |||
) | |||
invert = traits.Bool( | |||
argstr="-inverse", | |||
position=1, | |||
position=2, |
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.
This means -invert
will appear after all of the things with position=1
. Does it need to come last, before in_files/out_file?
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 removed the position change for now, but I just added this previously because if I wanted to use -inverse with some other parameter and they both had 'position=1' then only one would show up on the command. But it can also be fixed by just using inputs.args string.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #3630 +/- ##
=======================================
Coverage 63.15% 63.15%
=======================================
Files 308 308
Lines 40825 40825
Branches 5656 5656
=======================================
Hits 25781 25781
Misses 14031 14031
Partials 1013 1013 ☔ View full report in Codecov by Sentry. |