Skip to content

Commit 3e326f1

Browse files
committed
add interface for fs_parc_replace_sgm_first
1 parent 50168f5 commit 3e326f1

File tree

4 files changed

+49
-3
lines changed

4 files changed

+49
-3
lines changed

nipype/interfaces/mrtrix3/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# -*- coding: utf-8 -*-
44

55
from utils import Mesh2PVE, Generate5tt, BrainMask, TensorMetrics, ComputeTDI
6-
from preprocess import ResponseSD, ACTPrepareFSL
6+
from preprocess import ResponseSD, ACTPrepareFSL, ReplaceFSwithFIRST
77
from tracking import Tractography
88
from reconst import FitTensor, EstimateFOD
99
from connectivity import LabelConfig

nipype/interfaces/mrtrix3/connectivity.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,7 @@ class LabelConfigOutputSpec(TraitedSpec):
5757
class LabelConfig(MRTrix3Base):
5858

5959
"""
60-
Generate anatomical information necessary for Anatomically
61-
Constrained Tractography (ACT).
60+
Re-configure parcellation to be incrementally defined.
6261
6362
Example
6463
-------

nipype/interfaces/mrtrix3/preprocess.py

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,3 +153,50 @@ def _list_outputs(self):
153153
outputs = self.output_spec().get()
154154
outputs['out_file'] = op.abspath(self.inputs.out_file)
155155
return outputs
156+
157+
158+
class ReplaceFSwithFIRSTInputSpec(CommandLineInputSpec):
159+
in_file = File(exists=True, argstr='%s', mandatory=True, position=-4,
160+
desc='input anatomical image')
161+
in_t1w = File(exists=True, argstr='%s', mandatory=True, position=-3,
162+
desc='input T1 image')
163+
in_config = File(exists=True, argstr='%s', position=-2,
164+
desc='connectome configuration file')
165+
166+
out_file = File(
167+
'aparc+first.mif', argstr='%s', mandatory=True, position=-1,
168+
usedefault=True, desc='output file after processing')
169+
170+
171+
class ReplaceFSwithFIRSTOutputSpec(TraitedSpec):
172+
out_file = File(exists=True, desc='the output response file')
173+
174+
175+
class ReplaceFSwithFIRST(CommandLine):
176+
177+
"""
178+
Replace deep gray matter structures segmented with FSL FIRST in a
179+
FreeSurfer parcellation.
180+
181+
Example
182+
-------
183+
184+
>>> import nipype.interfaces.mrtrix3 as mrt
185+
>>> prep = mrt.ReplaceFSwithFIRST()
186+
>>> prep.inputs.in_file = 'aparc+aseg.nii.gz'
187+
>>> prep.inputs.in_t1w = 'T1.nii.gz'
188+
>>> prep.inputs.in_config = 'mrtrix3_labelconfig.txt'
189+
>>> prep.cmdline # doctest: +ELLIPSIS
190+
'fs_parc_replace_sgm_first aparc+aseg.nii.gz T1.nii.gz \
191+
mrtrix3_labelconfig.txt aparc+first.mif'
192+
>>> prep.run() # doctest: +SKIP
193+
"""
194+
195+
_cmd = 'fs_parc_replace_sgm_first'
196+
input_spec = ReplaceFSwithFIRSTInputSpec
197+
output_spec = ReplaceFSwithFIRSTOutputSpec
198+
199+
def _list_outputs(self):
200+
outputs = self.output_spec().get()
201+
outputs['out_file'] = op.abspath(self.inputs.out_file)
202+
return outputs

nipype/testing/data/mrtrix3_labelconfig.txt

Whitespace-only changes.

0 commit comments

Comments
 (0)