@@ -21,7 +21,7 @@ class DWIDenoiseInputSpec(MRTrix3BaseInputSpec):
2121 mask = File (
2222 exists = True ,
2323 argstr = '-mask %s' ,
24- position = 1 ,
24+ #osition =1,
2525 desc = 'mask image' )
2626 extent = traits .Tuple ((traits .Int , traits .Int , traits .Int ),
2727 argstr = '-extent %d,%d,%d' ,
@@ -75,6 +75,149 @@ class DWIDenoise(MRTrix3Base):
7575 output_spec = DWIDenoiseOutputSpec
7676
7777
78+ class MRDeGibbsInputSpec (MRTrix3BaseInputSpec ):
79+ in_file = File (
80+ exists = True ,
81+ argstr = '%s' ,
82+ position = - 2 ,
83+ mandatory = True ,
84+ desc = 'input DWI image' )
85+ axes = InputMultiObject (
86+ traits .Int ,
87+ value = [0 ],
88+ usedefault = True ,
89+ argstr = '-axes %d' ,
90+ desc = 'select the slice axes (default = 0)' )
91+ nshifts = InputMultiObject (
92+ traits .Int ,
93+ value = [20 ],
94+ usedefault = True ,
95+ argstr = '-nshifts %d' ,
96+ desc = 'discretizaiton of subpixel spacing (default = 20)' )
97+ minW = InputMultiObject (
98+ traits .Int ,
99+ value = [1 ],
100+ usedefault = True ,
101+ argstr = '-minW %d' ,
102+ desc = 'left border of window used for TV computation (default = 1)' )
103+ maxW = InputMultiObject (
104+ traits .Int ,
105+ value = [3 ],
106+ usedefault = True ,
107+ argstr = '-maxW %d' ,
108+ desc = 'right border of window used for TV computation (default = 3)' )
109+ out_file = File (name_template = '%s_unring' ,
110+ name_source = 'in_file' ,
111+ keep_extension = True ,
112+ argstr = "%s" ,
113+ position = - 1 ,
114+ desc = "the output unringed DWI image" )
115+
116+ class MRDeGibbsOutputSpec (TraitedSpec ):
117+ out_file = File (desc = "the output unringed DWI image" , exists = True )
118+
119+ class MRDeGibbs (MRTrix3Base ):
120+ """
121+ Remove Gibbs ringing artifacts.
122+
123+ This application attempts to remove Gibbs ringing artefacts from MRI images
124+ using the method of local subvoxel-shifts proposed by Kellner et al.
125+
126+ This command is designed to run on data directly after it has been
127+ reconstructed by the scanner, before any interpolation of any kind has
128+ taken place. You should not run this command after any form of motion
129+ correction (e.g. not after dwipreproc). Similarly, if you intend running
130+ dwidenoise, you should run this command afterwards, since it has the
131+ potential to alter the noise structure, which would impact on dwidenoise’s
132+ performance.
133+
134+ Note that this method is designed to work on images acquired with full
135+ k-space coverage. Running this method on partial Fourier (‘half-scan’) data
136+ may lead to suboptimal and/or biased results, as noted in the original
137+ reference below. There is currently no means of dealing with this; users
138+ should exercise caution when using this method on partial Fourier data, and
139+ inspect its output for any obvious artefacts.
140+
141+ For more information, see
142+ <https://mrtrix.readthedocs.io/en/latest/reference/commands/mrdegibbs.html>
143+
144+ Example
145+ -------
146+
147+ >>> import nipype.interfaces.mrtrix3 as mrt
148+ >>> unring = mrt.MRDeGibbs()
149+ >>> unring.inputs.in_file = 'dwi.mif'
150+ >>> unring.cmdline
151+ 'mrdegibbs dwi.mif dwi_unring.mif'
152+ >>> unring.run()
153+ """
154+
155+ _cmd = 'mrdegibbs'
156+ input_spec = MRDeGibbsInputSpec
157+ output_spec = MRDeGibbsOutputSpec
158+
159+
160+ class DWIBiasCorrectInputSpec (MRTrix3BaseInputSpec ):
161+ in_file = File (
162+ exists = True ,
163+ argstr = '%s' ,
164+ position = - 2 ,
165+ mandatory = True ,
166+ desc = 'input DWI image' )
167+ mask = File (
168+ argstr = '-mask %s' ,
169+ desc = 'mask image' )
170+ bias = File (
171+ argstr = '-bias %s' ,
172+ desc = 'bias field' )
173+ ants = traits .Bool (
174+ True ,
175+ argstr = '-ants' ,
176+ desc = 'use ANTS N4' )
177+ fsl = traits .Bool (
178+ False ,
179+ argstr = '-fsl' ,
180+ desc = 'use FSL FAST' ,
181+ min_ver = '5.0.10' )
182+ grad = File (
183+ argstr = '-grad %s' ,
184+ desc = 'diffusion gradient table in MRtrix format' )
185+ fslgrad = File (
186+ argstr = '-fslgrad %s %s' ,
187+ desc = 'diffusion gradient table in FSL bvecs/bvals format' )
188+ out_file = File (name_template = '%s_unbias' ,
189+ name_source = 'in_file' ,
190+ keep_extension = True ,
191+ argstr = "%s" ,
192+ position = - 1 ,
193+ desc = "the output bias corrected DWI image" )
194+
195+ class DWIBiasCorrectOutputSpec (TraitedSpec ):
196+ out_file = File (desc = "the output bias corrected DWI image" , exists = True )
197+
198+ class DWIBiasCorrect (MRTrix3Base ):
199+ """
200+ Perform B1 field inhomogeneity correction for a DWI volume series.
201+
202+ For more information, see
203+ <https://mrtrix.readthedocs.io/en/latest/reference/scripts/dwibiascorrect.html>
204+
205+ Example
206+ -------
207+
208+ >>> import nipype.interfaces.mrtrix3 as mrt
209+ >>> bias_correct = mrt.DWIBiasCorrect()
210+ >>> bias_correct.inputs.in_file = 'dwi.mif'
211+ >>> bias_correct.cmdline
212+ 'dwibiascorrect dwi.mif dwi_unbias.mif'
213+ >>> bias_correct.run()
214+ """
215+
216+ _cmd = 'dwibiascorrect'
217+ input_spec = DWIBiasCorrectInputSpec
218+ output_spec = DWIBiasCorrectOutputSpec
219+
220+
78221class ResponseSDInputSpec (MRTrix3BaseInputSpec ):
79222 algorithm = traits .Enum (
80223 'msmt_5tt' ,
0 commit comments