8000 [ENH]: Add functions to mrtrix3 interface by lbutry · Pull Request #3613 · nipy/nipype · GitHub
[go: up one dir, main page]

Skip to content

[ENH]: Add functions to mrtrix3 interface #3613

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 19 commits into from
Mar 20, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
added 5ttgmwmi
  • Loading branch information
Lionel Butry committed Oct 24, 2023
commit 20c09951a5e681048c1608889427f01dd272ff51
1 change: 1 addition & 0 deletions nipype/interfaces/mrtrix3/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,5 @@
TransformFSLConvert,
MaskFilter,
MTNormalise,
Generate5tt2gmwmi,
)
54 changes: 54 additions & 0 deletions nipype/interfaces/mrtrix3/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1331,4 +1331,58 @@ def _list_outputs(self):
outputs["out_file_wm"] = op.abspath(self.inputs.out_file_wm)
outputs["out_file_gm"] = op.abspath(self.inputs.out_file_gm)
outputs["out_file_csf"] = op.abspath(self.inputs.out_file_csf)
return outputs


class Generate5tt2gmwmiInputSpec(MRTrix3BaseInputSpec):
in_file = File(
exists=True,
argstr="%s",
mandatory=True,
position=-2,
desc="the input 5TT segmented anatomical image",
)
mask_out = File(
"mask_gmwmi.mif"
argstr="%s",
mandatory=True,
position=-1,
desc="the output mask image",
)
mask_in = File(
argstr="-mask_in %s",
position=-3,
desc="filter an imput mask image according to those voxels that lie upon the grey matter - white matter boundary",
)


class Generate5tt2gmwmiOutputSpec(TraitedSpec):
mask_out = File(exists=True, desc="the output mask file")


class Generate5tt2gmwmi(CommandLine):
"""
Generate a mask image appropriate for seeding streamlines on
the grey matter-white matter interface


Example
-------

>>> import nipype.interfaces.mrtrix3 as mrt
>>> gmwmi = mrt.Generate5TT2GMWMI()
>>> gmwmi.inputs.in_file = '5tt_in.mif'
>>> gmwmi.inputs.mask_out = 'mask_gmwmi.mif'
>>> gmwmi.cmdline
'5tt2gmwmi 5tt_in.mif mask_gmwmi.mif'
>>> gmwmi.run()
"""

_cmd = "5tt2gmwmi"
input_spec = Generate5tt2gmwmiInputSpec
output_spec = Generate5tt2gmwmiOutputSpec

def _list_outputs(self):
outputs = self.output_spec().get()
outputs["mask_out"] = op.abspath(self.inputs.mask_out)
return outputs
0