@@ -57,6 +57,7 @@ class PrepareFieldmap(FSLCommand):
57
57
>>> prepare = PrepareFieldmap()
58
58
>>> prepare.inputs.in_phase = "phase.nii"
59
59
>>> prepare.inputs.in_magnitude = "magnitude.nii"
60
+ >>> prepare.cmdline
60
61
>>> res = prepare.run() # doctest: +SKIP
61
62
62
63
@@ -147,6 +148,7 @@ class TOPUP( FSLCommand ):
147
148
>>> topup = TOPUP()
148
149
>>> topup.inputs.in_file = "b0_b0rev.nii"
149
150
>>> topup.inputs.encoding_file = "topup_encoding.txt"
151
+ >>> topup.cmdline
150
152
>>> res = topup.run() # doctest: +SKIP
151
153
152
154
"""
@@ -251,6 +253,7 @@ class ApplyTOPUP( FSLCommand ):
251
253
>>> applytopup.inputs.encoding_file = "topup_encoding.txt"
252
254
>>> applytopup.inputs.in_index = [ 1,2 ]
253
255
>>> applytopup.inputs.in_topup = "my_topup_results"
256
+ >>> applytopup.cmdline
254
257
>>> res = applytopup.run() # doctest: +SKIP
255
258
256
259
"""
@@ -288,7 +291,66 @@ def _list_outputs(self):
288
291
289
292
290
293
294
+ class EddyInputSpec ( FSLCommandInputSpec ):
295
+ in_file = File (exists = True , mandatory = True , desc = 'File containing all the images to estimate distortions for' , argstr = '--imain=%s' )
296
+ in_mask = File (exists = True , mandatory = True , desc = 'Mask to indicate brain' , argstr = '--mask=%s' )
297
+ in_index = File (exists = True , mandatory = True , desc = 'File containing indices for all volumes in --imain into --acqp and --topup' , argstr = '--index=%s' )
298
+ in_acqp = File (exists = True , mandatory = True , desc = 'File containing acquisition parameters' , argstr = '--acqp=%s' )
299
+ in_bvec = File (exists = True , mandatory = True , desc = 'File containing the b-vectors for all volumes in --imain' , argstr = '--bvecs=%s' )
300
+ in_bval = File (exists = True , mandatory = True , desc = 'File containing the b-values for all volumes in --imain' , argstr = '--bvals=%s' )
301
+
302
+ out_base = File ( desc = 'basename for output (warped) image' , argstr = '--out=%s' )
303
+
304
+
305
+ session = File (exists = True , desc = 'File containing session indices for all volumes in --imain' , argstr = '--session=%s' )
306
+ in_topup = File (exists = True , desc = 'Base name for output files from topup' , argstr = '--topup=%s' )
307
+ flm = traits .Enum ( ('linear' ,'quadratic' ,'cubic' ), desc = 'First level EC model' , argstr = '--flm=%s' )
308
+ fwhm = traits .Float ( desc = 'FWHM for conditioning filter when estimating the parameters' , argstr = '--fwhm=%s' )
309
+ niter = traits .Int ( 5 , desc = 'Number of iterations' , argstr = '--niter=%s' )
310
+ method = traits .Enum ( ('jac' ,'lsr' ), argstr = '--resamp=%s' , desc = 'Final resampling method (jacobian/least squeares)' )
311
+ repol = traits .Bool ( False , desc = 'Detect and replace outlier slices' , argstr = '--repol' )
312
+
313
+ class EddyOutputSpec ( TraitedSpec ):
314
+ out_corrected = File ( exists = True , desc = '4D image file containing all the corrected volumes' )
315
+ out_parameter = File ( exists = True , desc = 'text file with parameters definining the field and movement for each scan' )
316
+
317
+ class Eddy ( FSLCommand ):
318
+ """ Interface for FSL eddy, a tool for estimating and correcting eddy currents induced distortions
319
+ User guide: http://fsl.fmrib.ox.ac.uk/fsl/fslwiki/Eddy/UsersGuide
320
+ Regarding acqp file: http://fsl.fmrib.ox.ac.uk/fsl/fslwiki/eddy/Faq#How_do_I_know_what_to_put_into_my_--acqp_file
291
321
322
+ Examples
323
+ --------
324
+ >>> eddy = Eddy()
325
+ >>> eddy.inputs.in_files = 'epi.nii'
326
+ >>> eddy.inputs.in_mask = 'epi_mask.nii'
327
+ >>> eddy.inputs.in_index = 'epi_index.txt'
328
+ >>> eddy.inputs.in_acqp = 'epi_acqp.txt'
329
+ >>> eddy.inputs.in_bvec = 'bvecs'
330
+ >>> eddy.inputs.in_bval = 'bvals'
331
+ >>> eddy.cmdline
332
+ >>> res = eddy.run() # doctest: +SKIP
333
+
334
+
335
+ """
336
+ _cmd = 'eddy'
337
+ input_spec = EddyInputSpec
338
+ output_spec = EddyOutputSpec
339
+
340
+ def _parse_inputs ( self , skip = None ):
341
+ if skip is None :
342
+ skip = []
343
+
344
+ if not isdefined (self .inputs .out_base ):
345
+ self .inputs .out_base = os .path .abspath ( './eddy_corrected' )
346
+ return super (Eddy , self )._parse_inputs (skip = skip )
347
+
348
+
349
+ def _list_outputs (self ):
350
+ outputs = self .output_spec ().get ()
351
+ outputs ['out_corrected' ] = '%s.nii.gz' % self .inputs .out_base
352
+ outputs ['out_parameter' ] = '%s..eddy_parameters' % self .inputs .out_base
353
+ return outputs
292
354
293
355
294
356
class EPIDeWarpInputSpec (FSLCommandInputSpec ):
@@ -343,6 +405,7 @@ class EPIDeWarp(FSLCommand):
343
405
>>> dewarp.inputs.epi_file = "functional.nii"
344
406
>>> dewarp.inputs.mag_file = "magnitude.nii"
345
407
>>> dewarp.inputs.dph_file = "phase.nii"
408
+ >>> dewarp.cmdline
346
409
>>> res = dewarp.run() # doctest: +SKIP
347
410
348
411
References
@@ -426,6 +489,7 @@ class SigLoss(FSLCommand):
426
489
>>> sigloss = SigLoss()
427
490
>>> sigloss.inputs.in_file = "phase.nii"
428
491
>>> sigloss.inputs.echo_time = 0.03
492
+ >>> sigloss.cmdline
429
493
>>> res = sigloss.run() # doctest: +SKIP
430
494
"""
431
495
input_spec = SigLossInputSpec
0 commit comments