Skip to content
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]: Add functions to mrtrix3 interface #3613

Merged
merged 19 commits into from
Mar 20, 2024
28 changes: 16 additions & 12 deletions .zenodo.json
Original file line number Diff line number Diff line change
Expand Up @@ -891,16 +891,6 @@
"name": "Mihai, Paul Glad",
"orcid": "0000-0001-5715-6442"
},
{
"affiliation": "Department of Psychology, Stanford University",
"name": "Gorgolewski, Krzysztof J.",
"orcid": "0000-0003-3321-7583"
},
{
"affiliation": "MIT, HMS",
"name": "Ghosh, Satrajit",
"orcid": "0000-0002-5312-6729"
},
{
"affiliation": "University of Tübingen and MPI for Biological Cybernertics",
"name": "Bannert, Michael M.",
Expand All @@ -909,13 +899,27 @@
{
"affiliation": "Research Centre Juelich",
"name": "Wu, Jianxiao",
"orcid": "0000-0002-4866-272X",
"orcid": "0000-0002-4866-272X"
},
{
"affiliation": "Department of Neurology, BG-University Hospital Bergmannsheil Bochum, Germany",
"name": "Butry, Lionel"
},
{
"affiliation": "Lund University",
"name": "Anijärv, Toomas Erik",
"orcid": "0000-0002-3650-4230",
"orcid": "0000-0002-3650-4230"
},
{
"affiliation": "Department of Psychology, Stanford University",
"name": "Gorgolewski, Krzysztof J.",
"orcid": "0000-0003-3321-7583"
},
{
"affiliation": "MIT, HMS",
"name": "Ghosh, Satrajit",
"orcid": "0000-0002-5312-6729"
}
],
"keywords": [
"neuroimaging",
Expand Down
3 changes: 3 additions & 0 deletions nipype/interfaces/mrtrix3/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,7 @@
SHConv,
TensorMetrics,
TransformFSLConvert,
MaskFilter,
MTNormalise,
Generate5tt2gmwmi,
)
1 change: 0 additions & 1 deletion nipype/interfaces/mrtrix3/tests/test_auto_Generate5tt.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ def test_Generate5tt_inputs():
),
in_file=dict(
argstr="%s",
extensions=None,
mandatory=True,
position=-2,
),
Expand Down
79 changes: 79 additions & 0 deletions nipype/interfaces/mrtrix3/tests/test_auto_Generate5tt2gmwmi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from ..utils import Generate5tt2gmwmi


def test_Generate5tt2gmwmi_inputs():
input_map = dict(
args=dict(
argstr="%s",
),
bval_scale=dict(
argstr="-bvalue_scaling %s",
),
environ=dict(
nohash=True,
usedefault=True,
),
grad_file=dict(
argstr="-grad %s",
extensions=None,
xor=["grad_fsl"],
),
grad_fsl=dict(
argstr="-fslgrad %s %s",
xor=["grad_file"],
),
in_bval=dict(
extensions=None,
),
in_bvec=dict(
argstr="-fslgrad %s %s",
extensions=None,
),
in_file=dict(
argstr="%s",
extensions=None,
mandatory=True,
position=-2,
),
mask_in=dict(
argstr="-mask_in %s",
extensions=None,
position=-3,
),
mask_out=dict(
argstr="%s",
extensions=None,
mandatory=True,
position=-1,
),
nthreads=dict(
argstr="-nthreads %d",
nohash=True,
),
out_bval=dict(
extensions=None,
),
out_bvec=dict(
argstr="-export_grad_fsl %s %s",
extensions=None,
),
)
inputs = Generate5tt2gmwmi.input_spec()

for key, metadata in list(input_map.items()):
for metakey, value in list(metadata.items()):
assert getattr(inputs.traits()[key], metakey) == value


def test_Generate5tt2gmwmi_outputs():
output_map = dict(
mask_out=dict(
extensions=None,
),
)
outputs = Generate5tt2gmwmi.output_spec()

for key, metadata in list(output_map.items()):
for metakey, value in list(metadata.items()):
assert getattr(outputs.traits()[key], metakey) == value
103 changes: 103 additions & 0 deletions nipype/interfaces/mrtrix3/tests/test_auto_MTNormalise.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from ..utils import MTNormalise


def test_MTNormalise_inputs():
input_map = dict(
args=dict(
argstr="%s",
),
bval_scale=dict(
argstr="-bvalue_scaling %s",
),
csf_fod=dict(
argstr="%s",
extensions=None,
position=5,
),
environ=dict(
nohash=True,
usedefault=True,
),
gm_fod=dict(
argstr="%s",
extensions=None,
position=3,
),
grad_file=dict(
argstr="-grad %s",
extensions=None,
xor=["grad_fsl"],
),
grad_fsl=dict(
argstr="-fslgrad %s %s",
xor=["grad_file"],
),
in_bval=dict(
extensions=None,
),
in_bvec=dict(
argstr="-fslgrad %s %s",
extensions=None,
),
mask=dict(
argstr="-mask %s",
extensions=None,
position=-1,
),
nthreads=dict(
argstr="-nthreads %d",
nohash=True,
),
out_bval=dict(
extensions=None,
),
out_bvec=dict(
argstr="-export_grad_fsl %s %s",
extensions=None,
),
out_file_csf=dict(
argstr="%s",
extensions=None,
position=6,
),
out_file_gm=dict(
argstr="%s",
extensions=None,
position=4,
),
out_file_wm=dict(
argstr="%s",
extensions=None,
position=2,
),
wm_fod=dict(
argstr="%s",
extensions=None,
position=1,
),
)
inputs = MTNormalise.input_spec()

for key, metadata in list(input_map.items()):
for metakey, value in list(metadata.items()):
assert getattr(inputs.traits()[key], metakey) == value


def test_MTNormalise_outputs():
output_map = dict(
out_file_csf=dict(
extensions=None,
),
out_file_gm=dict(
extensions=None,
),
out_file_wm=dict(
extensions=None,
),
)
outputs = MTNormalise.output_spec()

for key, metadata in list(output_map.items()):
for metakey, value in list(metadata.items()):
assert getattr(outputs.traits()[key], metakey) == value
54 changes: 54 additions & 0 deletions nipype/interfaces/mrtrix3/tests/test_auto_MaskFilter.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from ..utils import MaskFilter


def test_MaskFilter_inputs():
input_map = dict(
args=dict(
argstr="%s",
),
environ=dict(
nohash=True,
usedefault=True,
),
filter=dict(
argstr="%s",
mandatory=True,
position=-2,
),
in_file=dict(
argstr="%s",
extensions=None,
mandatory=True,
position=-3,
),
npass=dict(
argstr="-npass %d",
position=1,
),
out_file=dict(
argstr="%s",
extensions=None,
mandatory=True,
name_source=["input_image"],
position=-1,
),
)
inputs = MaskFilter.input_spec()

for key, metadata in list(input_map.items()):
for metakey, value in list(metadata.items()):
assert getattr(inputs.traits()[key], metakey) == value


def test_MaskFilter_outputs():
output_map = dict(
out_file=dict(
extensions=None,
),
)
outputs = MaskFilter.output_spec()

for key, metadata in list(output_map.items()):
for metakey, value in list(metadata.items()):
assert getattr(outputs.traits()[key], metakey) == value
Loading