Skip to content

Commit 588599c

Browse files
committed
Added epi_reg interface
1 parent 394ac0d commit 588599c

File tree

1 file changed

+66
-1
lines changed

1 file changed

+66
-1
lines changed

nipype/interfaces/fsl/epi.py

Lines changed: 66 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class PrepareFieldmapInputSpec(FSLCommandInputSpec):
4646
usedefault=True,
4747
desc=('do not perform sanity checks for image '
4848
'size/range/dimensions'))
49-
out_fieldmap = File(argstr='%s', position=5,
49+
out_fieldmap = File(argstr='%s', position=4,
5050
desc='output name for prepared fieldmap')
5151

5252

@@ -709,3 +709,68 @@ def _run_interface(self, runtime):
709709
if runtime.stderr:
710710
self.raise_exception(runtime)
711711
return runtime
712+
713+
714+
class EpiRegInputSpec(FSLCommandInputSpec):
715+
716+
epi = File(exists=True, argstr='--epi=%s', mandatory=True, position=-4, desc='EPI image')
717+
t1_head = File(exists=True, argstr='--t1=%s', mandatory=True, position=-3, desc='wholehead T1 image')
718+
t1_brain = File(exists=True, argstr='--t1brain=%s', mandatory=True, position=-2, desc='brain extracted T1 image')
719+
out_base = traits.String(desc='output base name', argstr='--out=%s', position=-1)
720+
fmap = File(exists=True, argstr='--fmap=%s', desc='fieldmap image (in rad/s)')
721+
fmapmag = File(exists=True, argstr='--fmapmag=%s', desc='fieldmap magnitude image - wholehead extracted')
722+
fmapmagbrain = File(exists=True, argstr='--fmapmagbrain=%s', desc='fieldmap magnitude image - brain extracted')
723+
wmseg = File(exists=True, argstr='--wmseg=%s', desc='white matter segmentation of T1 image, has to be named like the t1brain plus ending _wmseg')
724+
echospacing = traits.Float(argstr='--echospacing=%f', desc='Effective EPI echo spacing (sometimes called dwell time) - in seconds')
725+
pedir = traits.Enum('x', 'y', 'z', '-x', '-y', '-z',argstr='--pedir=%s',desc='phase encoding direction, dir = x/y/z/-x/-y/-z')
726+
727+
class EpiRegOutputSpec( TraitedSpec ):
728+
729+
out_file = File(exists=True, desc='epi input unwarped and registered to anatomy')
730+
out_flirt_file = File(exists=True, desc='output of last flirt bbr fieldmap registration, basically the same as out_file but different interpolation?')
731+
fmap2str_mat = File(exists=True, desc='affine fieldmap to structural transformation')
732+
fmap2epi_mat = File(exists=True, desc='affine fieldmap to epi transformation')
733+
fmap_epi = File(exists=True, desc='fielmap in epi space')
734+
fmap_str = File(exists=True, desc='fieldmap in structural space')
735+
epi2str_inv = File(exists=True, desc='affine structural to epi transformation')
736+
epi2str_mat = File(exists=True, desc='affine epi to structural transformation')
737+
fullwarp = File(exists=True, desc='warpfield to unwarp epi and transform into structural space')
738+
wmedge = File(exists=True, desc='white matter edges used in flirt bbr')
739+
shiftmap = File(exists=True, desc='shiftmap in epi space')
740+
# _init.mat
741+
# _fieldmap2str.nii.gz
742+
# _fieldmaprads2str_pad0.nii.gz
743+
# _fieldmap2str_init.mat
744+
# _fieldmaprads2str_dilated.nii.gz
745+
746+
class EpiReg(FSLCommand):
747+
_cmd = 'epi_reg'
748+
input_spec = EpiRegInputSpec
749+
output_spec = EpiRegOutputSpec
750+
751+
def _list_outputs(self):
752+
outputs = self.output_spec().get()
753+
outputs['out_file'] = os.path.join(os.getcwd(),
754+
self.inputs.out_base + '.nii.gz')
755+
outputs['out_flirt_file'] = os.path.join(os.getcwd(),
756+
self.inputs.out_base + '_1vol.nii.gz')
757+
outputs['fmap2str_mat'] = os.path.join(os.getcwd(),
758+
self.inputs.out_base + '_fieldmap2str.mat')
759+
outputs['fmap2epi_mat'] = os.path.join(os.getcwd(),
760+
self.inputs.out_base + '_fieldmaprads2epi.mat')
761+
outputs['fmap_epi'] = os.path.join(os.getcwd(),
762+
self.inputs.out_base + '_fieldmaprads2epi.nii.gz')
763+
outputs['fmap_str'] = os.path.join(os.getcwd(),
764+
self.inputs.out_base + '_fieldmaprads2str.nii.gz')
765+
outputs['epi2str_inv'] = os.path.join(os.getcwd(),
766+
self.inputs.out_base + '_inv.mat')
767+
outputs['epi2str_mat'] = os.path.join(os.getcwd(),
768+
self.inputs.out_base + '.mat')
769+
outputs['fullwarp'] = os.path.join(os.getcwd(),
770+
self.inputs.out_base + '_warp.nii.gz')
771+
outputs['wmedge'] = os.path.join(os.getcwd(),
772+
self.inputs.out_base + '_fast_wmedge.nii.gz')
773+
outputs['shiftmap'] = os.path.join(os.getcwd(),
774+
self.inputs.out_base + '_fieldmaprads2epi_shift.nii.gz')
775+
776+
return outputs

0 commit comments

Comments
 (0)