Skip to content

ENH: added 'hsvs' option to 5ttgen + mrtransform fix #3630

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 5 commits into from
Mar 17, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
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
5 changes: 5 additions & 0 deletions .zenodo.json
Original file line number Diff line number Diff line change
Expand Up @@ -911,6 +911,11 @@
"name": "Wu, Jianxiao",
"orcid": "0000-0002-4866-272X",
},
{
"affiliation": "Lund University",
"name": "Anijärv, Toomas Erik",
"orcid": "0000-0002-3650-4230",
},
],
"keywords": [
"neuroimaging",
Expand Down
5 changes: 3 additions & 2 deletions nipype/interfaces/mrtrix3/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,13 +224,14 @@ class Generate5ttInputSpec(MRTrix3BaseInputSpec):
"fsl",
"gif",
"freesurfer",
"hsvs",
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"
Copy link
Member

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

Copy link
Contributor Author

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. :)

)
out_file = File(argstr="%s", mandatory=True, position=-1, desc="output image")

Expand Down Expand Up @@ -822,7 +823,7 @@ class MRTransformInputSpec(MRTrix3BaseInputSpec):
)
invert = traits.Bool(
argstr="-inverse",
position=1,
position=2,
Copy link
Member

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?

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

desc="Invert the specified transform before using it",
)
linear_transform = File(
Expand Down