Skip to content

Commit

Permalink
Merge pull request #3613 from lbutry/added_mrtrix3_functions
Browse files Browse the repository at this point in the history
[ENH]: Add functions to mrtrix3 interface
  • Loading branch information
effigies authored Mar 20, 2024
2 parents 1b5793a + 5599348 commit 28973c5
Show file tree
Hide file tree
Showing 10 changed files with 436 additions and 12 deletions.
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,
)
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

0 comments on commit 28973c5

Please sign in to comment.