Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/zachlindsey/nipype
Browse files Browse the repository at this point in the history
Zach Lindsey committed Mar 21, 2024
2 parents 0953e5b + edf7a4a commit 6b81d26
Showing 23 changed files with 555 additions and 54 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/contrib.yml
Original file line number Diff line number Diff line change
@@ -31,10 +31,10 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ['ubuntu-latest']
os: ["ubuntu-latest"]
python-version: [3.8]
nipype-extras: ['dev']
check: ['specs', 'style']
nipype-extras: ["dev"]
check: ["specs", "style"]
env:
DEPENDS: ""
CHECK_TYPE: ${{ matrix.check }}
34 changes: 17 additions & 17 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@ on:
- maint/*
schedule:
# 8am EST / 9am EDT Mondays
- cron: '0 13 * * 1'
- cron: "0 13 * * 1"

defaults:
run:
@@ -57,7 +57,7 @@ jobs:
needs: [build]
strategy:
matrix:
package: ['wheel', 'sdist']
package: ["wheel", "sdist"]
steps:
- uses: actions/download-artifact@v4
with:
@@ -90,28 +90,28 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ['ubuntu-22.04']
python-version: ['3.8', '3.9', '3.10', '3.11']
check: ['test']
pip-flags: ['']
depends: ['REQUIREMENTS']
os: ["ubuntu-22.04"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
check: ["test"]
pip-flags: [""]
depends: ["REQUIREMENTS"]
deb-depends: [false]
nipype-extras: ['doc,tests,profiler']
nipype-extras: ["doc,tests,profiler"]
include:
- os: ubuntu-22.04
python-version: '3.8'
python-version: "3.8"
check: test
pip-flags: ''
pip-flags: ""
depends: REQUIREMENTS
deb-depends: true
nipype-extras: doc,tests,profiler,duecredit,ssh
# - os: ubuntu-20.04
# python-version: 3.8
# check: test
# pip-flags: ''
# depends: NUMPY123
# deb-depends: true
# nipype-extras: doc,tests,nipy,profiler,duecredit,ssh
- os: ubuntu-20.04
python-version: 3.8
check: test
pip-flags: ""
depends: REQUIREMENTS
deb-depends: true
nipype-extras: doc,tests,nipy,profiler,duecredit,ssh
env:
DEPENDS: ${{ matrix.depends }}
CHECK_TYPE: ${{ matrix.check }}
2 changes: 1 addition & 1 deletion .github/workflows/tutorials.yml
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@ name: Test tutorials
on:
push:
branches:
- 'rel/*'
- "rel/*"

concurrency:
group: tutorials-${{ github.ref }}
28 changes: 16 additions & 12 deletions .zenodo.json
Original file line number Diff line number Diff line change
@@ -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.",
@@ -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",
1 change: 1 addition & 0 deletions nipype/info.py
Original file line number Diff line number Diff line change
@@ -58,6 +58,7 @@ def get_nipype_gitversion():
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Scientific/Engineering",
]
PYTHON_REQUIRES = ">= 3.8"
8 changes: 8 additions & 0 deletions nipype/interfaces/freesurfer/model.py
Original file line number Diff line number Diff line change
@@ -420,6 +420,14 @@ class GLMFitInputSpec(FSTraitedSpec):
argstr="--logan %s %s %f",
desc="RefTac TimeSec tstar : perform Logan kinetic modeling",
)
bp_clip_neg = traits.Bool(
argstr="--bp-clip-neg",
desc="set negative BP voxels to zero",
)
bp_clip_max = traits.Float(
argstr="--bp-clip-max %f",
desc="set BP voxels above max to max",
)
force_perm = traits.Bool(
argstr="--perm-force",
desc="force perumtation test, even when design matrix is not orthog",
44 changes: 34 additions & 10 deletions nipype/interfaces/freesurfer/petsurfer.py
Original file line number Diff line number Diff line change
@@ -458,10 +458,25 @@ class GTMPVCOutputSpec(TraitedSpec):
yhat_with_noise = File(
desc="4D PET file with full FOV of signal estimate (yhat) with noise after PVC (smoothed with PSF)",
)
eres = File(
desc="4D PET file of residual error after PVC (smoothed with PSF)",
)
tissue_fraction = File(
desc="4D PET file of tissue fraction before PVC",
)
tissue_fraction_psf = File(
desc="4D PET file of tissue fraction after PVC (smoothed with PSF)",
)
seg = File(
desc="Segmentation file of regions used for PVC",
)
seg_ctab = File(
desc="Color table file for segmentation file",
)


class GTMPVC(FSCommand):
"""create an anatomical segmentation for the geometric transfer matrix (GTM).
"""Perform Partial Volume Correction (PVC) to PET Data.
Examples
--------
@@ -536,6 +551,15 @@ def _list_outputs(self):
outputs["gtm_stats"] = os.path.join(pvcdir, "gtm.stats.dat")
outputs["reg_pet2anat"] = os.path.join(pvcdir, "aux", "bbpet2anat.lta")
outputs["reg_anat2pet"] = os.path.join(pvcdir, "aux", "anat2bbpet.lta")
outputs["eres"] = os.path.join(pvcdir, "eres.nii.gz")
outputs["tissue_fraction"] = os.path.join(
pvcdir, "aux", "tissue.fraction.nii.gz"
)
outputs["tissue_fraction_psf"] = os.path.join(
pvcdir, "aux", "tissue.fraction.psf.nii.gz"
)
outputs["seg"] = os.path.join(pvcdir, "aux", "seg.nii.gz")
outputs["seg_ctab"] = os.path.join(pvcdir, "aux", "seg.ctab")

# Assign the conditional outputs
if self.inputs.save_input:
@@ -562,7 +586,7 @@ def _list_outputs(self):
return outputs


class MRTMInputSpec(GLMFitInputSpec):
class MRTM1InputSpec(GLMFitInputSpec):
mrtm1 = traits.Tuple(
File(exists=True),
File(exists=True),
@@ -572,20 +596,20 @@ class MRTMInputSpec(GLMFitInputSpec):
)


class MRTM(GLMFit):
class MRTM1(GLMFit):
"""Perform MRTM1 kinetic modeling.
Examples
--------
>>> mrtm = MRTM()
>>> mrtm = MRTM1()
>>> mrtm.inputs.in_file = 'tac.nii'
>>> mrtm.inputs.mrtm1 = ('ref_tac.dat', 'timing.dat')
>>> mrtm.inputs.glm_dir = 'mrtm'
>>> mrtm.cmdline
'mri_glmfit --glmdir mrtm --y tac.nii --mrtm1 ref_tac.dat timing.dat'
"""

input_spec = MRTMInputSpec
input_spec = MRTM1InputSpec


class MRTM2InputSpec(GLMFitInputSpec):
@@ -614,7 +638,7 @@ class MRTM2(GLMFit):
input_spec = MRTM2InputSpec


class LoganRefInputSpec(GLMFitInputSpec):
class LoganInputSpec(GLMFitInputSpec):
logan = traits.Tuple(
File(exists=True),
File(exists=True),
@@ -625,16 +649,16 @@ class LoganRefInputSpec(GLMFitInputSpec):
)


class LoganRef(GLMFit):
"""Perform Logan reference kinetic modeling.
class Logan(GLMFit):
"""Perform Logan kinetic modeling.
Examples
--------
>>> logan = LoganRef()
>>> logan = Logan()
>>> logan.inputs.in_file = 'tac.nii'
>>> logan.inputs.logan = ('ref_tac.dat', 'timing.dat', 2600)
>>> logan.inputs.glm_dir = 'logan'
>>> logan.cmdline
'mri_glmfit --glmdir logan --y tac.nii --logan ref_tac.dat timing.dat 2600'
"""

input_spec = LoganRefInputSpec
input_spec = LoganInputSpec
6 changes: 6 additions & 0 deletions nipype/interfaces/freesurfer/tests/test_auto_GLMFit.py
Original file line number Diff line number Diff line change
@@ -13,6 +13,12 @@ def test_GLMFit_inputs():
args=dict(
argstr="%s",
),
bp_clip_max=dict(
argstr="--bp-clip-max %f",
),
bp_clip_neg=dict(
argstr="--bp-clip-neg",
),
calc_AR1=dict(
argstr="--tar1",
),
15 changes: 15 additions & 0 deletions nipype/interfaces/freesurfer/tests/test_auto_GTMPVC.py
Original file line number Diff line number Diff line change
@@ -207,6 +207,9 @@ def test_GTMPVC_inputs():

def test_GTMPVC_outputs():
output_map = dict(
eres=dict(
extensions=None,
),
gtm_file=dict(
extensions=None,
),
@@ -256,6 +259,18 @@ def test_GTMPVC_outputs():
reg_rbvpet2anat=dict(
extensions=None,
),
seg=dict(
extensions=None,
),
seg_ctab=dict(
extensions=None,
),
tissue_fraction=dict(
extensions=None,
),
tissue_fraction_psf=dict(
extensions=None,
),
yhat=dict(
extensions=None,
),
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from ..petsurfer import LoganRef
from ..petsurfer import Logan


def test_LoganRef_inputs():
def test_Logan_inputs():
input_map = dict(
allow_ill_cond=dict(
argstr="--illcond",
@@ -13,6 +13,12 @@ def test_LoganRef_inputs():
args=dict(
argstr="%s",
),
bp_clip_max=dict(
argstr="--bp-clip-max %f",
),
bp_clip_neg=dict(
argstr="--bp-clip-neg",
),
calc_AR1=dict(
argstr="--tar1",
),
@@ -214,14 +220,14 @@ def test_LoganRef_inputs():
xor=("weight_file", "weight_inv", "weight_sqrt"),
),
)
inputs = LoganRef.input_spec()
inputs = Logan.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_LoganRef_outputs():
def test_Logan_outputs():
output_map = dict(
beta_file=dict(
extensions=None,
@@ -271,7 +277,7 @@ def test_LoganRef_outputs():
extensions=None,
),
)
outputs = LoganRef.output_spec()
outputs = Logan.output_spec()

for key, metadata in list(output_map.items()):
for metakey, value in list(metadata.items()):
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from ..petsurfer import MRTM
from ..petsurfer import MRTM1


def test_MRTM_inputs():
def test_MRTM1_inputs():
input_map = dict(
allow_ill_cond=dict(
argstr="--illcond",
@@ -13,6 +13,12 @@ def test_MRTM_inputs():
args=dict(
argstr="%s",
),
bp_clip_max=dict(
argstr="--bp-clip-max %f",
),
bp_clip_neg=dict(
argstr="--bp-clip-neg",
),
calc_AR1=dict(
argstr="--tar1",
),
@@ -214,14 +220,14 @@ def test_MRTM_inputs():
xor=("weight_file", "weight_inv", "weight_sqrt"),
),
)
inputs = MRTM.input_spec()
inputs = MRTM1.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_MRTM_outputs():
def test_MRTM1_outputs():
output_map = dict(
beta_file=dict(
extensions=None,
@@ -271,7 +277,7 @@ def test_MRTM_outputs():
extensions=None,
),
)
outputs = MRTM.output_spec()
outputs = MRTM1.output_spec()

for key, metadata in list(output_map.items()):
for metakey, value in list(metadata.items()):
6 changes: 6 additions & 0 deletions nipype/interfaces/freesurfer/tests/test_auto_MRTM2.py
Original file line number Diff line number Diff line change
@@ -13,6 +13,12 @@ def test_MRTM2_inputs():
args=dict(
argstr="%s",
),
bp_clip_max=dict(
argstr="--bp-clip-max %f",
),
bp_clip_neg=dict(
argstr="--bp-clip-neg",
),
calc_AR1=dict(
argstr="--tar1",
),
Original file line number Diff line number Diff line change
@@ -13,6 +13,12 @@ def test_OneSampleTTest_inputs():
args=dict(
argstr="%s",
),
bp_clip_max=dict(
argstr="--bp-clip-max %f",
),
bp_clip_neg=dict(
argstr="--bp-clip-neg",
),
calc_AR1=dict(
argstr="--tar1",
),
3 changes: 3 additions & 0 deletions nipype/interfaces/mrtrix3/__init__.py
Original file line number Diff line number Diff line change
@@ -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
181 changes: 181 additions & 0 deletions nipype/interfaces/mrtrix3/utils.py
Original file line number Diff line number Diff line change
@@ -1185,3 +1185,184 @@ def _list_outputs(self):
outputs = self.output_spec().get()
outputs["out_file"] = op.abspath(self.inputs.out_file)
return outputs


class MaskFilterInputSpec(CommandLineInputSpec):
in_file = File(
exists=True,
mandatory=True,
argstr="%s",
position=-3,
desc="Input mask",
)
filter = traits.Str(
mandatory=True,
argstr="%s",
position=-2,
desc="Filter to perform (e.g. dilate, erode)",
)
out_file = File(
name_source=["input_image"],
mandatory=True,
argstr="%s",
position=-1,
desc="Output mask",
)
npass = traits.Int(argstr="-npass %d", position=1, desc="Number of passes")


class MaskFilterOutputSpec(TraitedSpec):
out_file = File(exists=True, desc="the filtered output mask")


class MaskFilter(CommandLine):
"""
Perform filtering operations on 3D / 4D mask images.
Only supports dilate / erode filters at the moment.
For more information see: https://mrtrix.readthedocs.io/en/latest/reference/commands/maskfilter.html
Example
-------
>>> import nipype.interfaces.mrtrix3 as mrt
>>> mf = mrt.MaskFilter()
>>> mf.inputs.in_file = 'mask.mif'
>>> mf.inputs.filter = 'dilate'
>>> mf.inputs.npass = 2
>>> mf.inputs.out_file = 'mask_filtered.mif'
>>> mf.cmdline
'maskfilter -npass 2 mask.mif dilate mask_filtered.mif'
>>> mf.run() # doctest: +SKIP
"""

_cmd = "maskfilter"
input_spec = MaskFilterInputSpec
output_spec = MaskFilterOutputSpec

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


class MTNormaliseInputSpec(MRTrix3BaseInputSpec):
wm_fod = File(
argstr="%s",
exists=True,
position=1,
desc="input fod of white matter tissue compartment",
)
out_file_wm = File(
argstr="%s", position=2, desc="output file of white matter tissue compartment"
)
gm_fod = File(
argstr="%s",
exists=True,
position=3,
desc="input fod of grey matter tissue compartment",
)
out_file_gm = File(
argstr="%s", position=4, desc="output file of grey matter tissue compartment"
)
csf_fod = File(
argstr="%s", exists=True, position=5, desc="input fod of CSF tissue compartment"
)
out_file_csf = File(
argstr="%s", position=6, desc="output file of CSF tissue compartment 3"
)
mask = File(argstr="-mask %s", exists=True, position=-1, desc="input brain mask")


class MTNormaliseOutputSpec(TraitedSpec):
out_file_wm = File(exists=True, desc="the normalized white matter fod")
out_file_gm = File(exists=True, desc="the normalized grey matter fod")
out_file_csf = File(exists=True, desc="the normalized csf fod")


class MTNormalise(CommandLine):
"""
Multi-tissue informed log-domain intensity normalisation
Example
-------
>>> import nipype.interfaces.mrtrix3 as mrt
>>> mtn = mrt.MTNormalise()
>>> mtn.inputs.wm_fod = 'wmfod.mif'
>>> mtn.inputs.gm_fod = 'gmfod.mif'
>>> mtn.inputs.csf_fod = 'csffod.mif'
>>> mtn.inputs.out_file_wm = 'wmfod_norm.mif'
>>> mtn.inputs.out_file_gm = 'gmfod_norm.mif'
>>> mtn.inputs.out_file_csf = 'csffod_norm.mif'
>>> mtn.inputs.mask = 'mask.mif'
>>> mtn.cmdline
'mtnormalise wmfod.mif wmfod_norm.mif gmfod.mif gmfod_norm.mif csffod.mif csffod_norm.mif -mask mask.mif'
>>> mtn.run() # doctest: +SKIP
"""

_cmd = "mtnormalise"
input_spec = MTNormaliseInputSpec
output_spec = MTNormaliseOutputSpec

def _list_outputs(self):
outputs = self.output_spec().get()
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 input 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() # doctest: +SKIP
"""

_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
Empty file added nipype/testing/data/5tt_in.mif
Empty file.
Empty file added nipype/testing/data/csffod.mif
Empty file.
Empty file added nipype/testing/data/gmfod.mif
Empty file.
Empty file added nipype/testing/data/wmfod.mif
Empty file.
1 change: 0 additions & 1 deletion tools/ci/env.sh
Original file line number Diff line number Diff line change
@@ -4,7 +4,6 @@ SETUP_REQUIRES="pip setuptools>=30.3.0 wheel"
REQUIREMENTS="-r requirements.txt"
# Minimum versions of minimum requirements
MIN_REQUIREMENTS="-r min-requirements.txt"
NUMPY123="numpy<1.24 -r requirements.txt"

# Numpy and scipy upload nightly/weekly/intermittent wheels
NIGHTLY_WHEELS="https://pypi.anaconda.org/scipy-wheels-nightly/simple"

0 comments on commit 6b81d26

Please sign in to comment.