Skip to content

Commit 78821e4

Browse files
committed
returned to .nii.gz; will deal with .nii later
1 parent 0807cdb commit 78821e4

File tree

4 files changed

+41
-26
lines changed

4 files changed

+41
-26
lines changed

nipype/interfaces/dtitk/registration.py

Lines changed: 30 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class RigidTask(CommandLineDtitk):
4444
>>> import nipype.interfaces.dtitk as dtitk
4545
>>> node = dtitk.RigidTask()
4646
>>> node.inputs.fixed_file = 'diffusion.nii.gz'
47-
>>> node.inputs.moving_file = 'diffusion.nii.gz'
47+
>>> node.inputs.moving_file = 'diffusion2.nii.gz'
4848
>>> node.inputs.similarity_metric = 'EDS'
4949
>>> node.inputs.samplingX = 4
5050
>>> node.inputs.samplingY = 4
@@ -106,7 +106,7 @@ class AffineTask(CommandLineDtitk):
106106
>>> import nipype.interfaces.dtitk as dtitk
107107
>>> node = dtitk.AffineTask()
108108
>>> node.inputs.fixed_file = 'diffusion.nii.gz'
109-
>>> node.inputs.moving_file = 'diffusion.nii.gz'
109+
>>> node.inputs.moving_file = 'diffusion2.nii.gz'
110110
>>> node.inputs.similarity_metric = 'EDS'
111111
>>> node.inputs.samplingX = 4
112112
>>> node.inputs.samplingY = 4
@@ -129,16 +129,23 @@ def _list_outputs(self):
129129

130130

131131
class DiffeoInputSpec(CommandLineInputSpec):
132-
in_fixed_tensor = traits.Str(desc="fixed diffusion tensor image",
133-
exists=True, mandatory=False, position=0,
134-
argstr="%s")
135-
in_moving_txt = traits.Str(desc="moving list of diffusion tensor image "
136-
"paths", exists=True, mandatory=False,
137-
position=1, argstr="%s")
138-
in_mask = traits.Str(desc="mask", exists=True, mandatory=False, position=2,
139-
argstr="%s")
140-
in_numbers = traits.Str(desc='#iters ftol', exists=True, mandatory=False,
141-
position=3, argstr="%s")
132+
fixed_file = traits.Str(desc="fixed diffusion tensor image",
133+
exists=True, mandatory=False, position=0,
134+
argstr="%s")
135+
moving_file = traits.Str(desc="moving diffusion tensor image",
136+
exists=True, mandatory=False,
137+
position=1, argstr="%s")
138+
mask = traits.Str(desc="mask", exists=True, mandatory=False, position=2,
139+
argstr="%s")
140+
legacy = traits.Float(desc="legacy parameter; always set to 1",
141+
exists=True, mandatory=True,
142+
position=3, default_value=1, argstr="%s")
143+
n_iters = traits.Float(desc="number of iterations",
144+
exists=True, mandatory=True,
145+
position=4, default_value=6, argstr="%s")
146+
ftol = traits.Float(desc="iteration for the optimization to stop",
147+
exists=True, mandatory=True,
148+
position=5, default_value=0.002, argstr="%s")
142149

143150

144151
class DiffeoOutputSpec(TraitedSpec):
@@ -155,22 +162,24 @@ class DiffeoTask(CommandLineDtitk):
155162
156163
>>> import nipype.interfaces.dtitk as dtitk
157164
>>> node = dtitk.DiffeoTask()
158-
>>> node.inputs.in_fixed_tensor = 'diffusion.nii'
159-
>>> node.inputs.in_moving_txt = 'dirs.txt'
160-
>>> node.inputs.in_mask = 'mask.nii'
161-
>>> node.inputs.in_numbers = '6 0.002'
165+
>>> node.inputs.fixed_file = 'diffusion.nii.gz'
166+
>>> node.inputs.moving_file = 'diffusion2.nii.gz'
167+
>>> node.inputs.mask = 'mask.nii.gz'
168+
>>> node.inputs.legacy = 1
169+
>>> node.inputs.n_iters = 6
170+
>>> node.inputs.ftol = 0.002
162171
>>> node.run() # doctest: +SKIP
163172
"""
164173
input_spec = DiffeoInputSpec
165174
output_spec = DiffeoOutputSpec
166-
_cmd = 'dti_diffeomorphic_sn'
175+
_cmd = 'dti_diffeomorphic_reg'
167176

168177
def _list_outputs(self):
169178
outputs = self.output_spec().get()
170-
outputs['out_file_xfm'] = self.inputs.in_fixed_tensor.replace(
171-
'.nii.gz', '_aff_diffeo.df.nii.gz')
172-
outputs['out_file'] = self.inputs.in_fixed_tensor.replace(
173-
'.nii.gz', '_aff_diffeo.nii.gz')
179+
outputs['out_file_xfm'] = self.inputs.moving_file.replace(
180+
'.nii.gz', '_diffeo.df.nii.gz')
181+
outputs['out_file'] = self.inputs.moving_file.replace(
182+
'.nii.gz', '_diffeo.nii.gz')
174183
return outputs
175184

176185

nipype/interfaces/dtitk/utils.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ class SVAdjustVoxSpTask(CommandLineDtitk):
138138
139139
>>> import nipype.interfaces.dtitk as dtitk
140140
>>> node = dtitk.SVAdjustVoxSpTask()
141-
>>> node.inputs.in_file = 'diffusion.nii'
141+
>>> node.inputs.in_file = 'diffusion.nii.gz'
142142
>>> node.run() # doctest: +SKIP
143143
"""
144144
input_spec = SVAdjustVoxSpInputSpec
@@ -156,8 +156,8 @@ def _list_outputs(self):
156156
outputs['out_file'] = self.inputs.out_file
157157
if not isdefined(self.inputs.out_file):
158158
outputs["out_file"] = self._gen_filename(self.inputs.in_file,
159-
suffix=self._suffix,
160-
ext='.' + '.'.join(
159+
suffix=self._suffix,
160+
ext='.' + '.'.join(
161161
self.inputs.in_file.
162162
split(".")[1:]))
163163
outputs["out_file"] = os.path.abspath(outputs["out_file"])
@@ -171,7 +171,7 @@ class TVResampleInputSpec(CommandLineInputSpec):
171171
mandatory=False, position=1, argstr="-size %s")
172172
in_voxsz = traits.Str(desc='resampled voxel size', exists=True,
173173
mandatory=False, position=2, argstr="-vsize %s")
174-
out_path = traits.Str(desc='output path', exists=True, mandatory=False,
174+
out_file = traits.Str(desc='output path', exists=True, mandatory=False,
175175
position=3, argstr="-out %s",
176176
name_source="in_file",
177177
name_template="%s_resampled.nii.gz")
@@ -190,7 +190,7 @@ class TVResampleTask(CommandLineDtitk):
190190
191191
>>> import nipype.interfaces.dtitk as dtitk
192192
>>> node = dtitk.TVResampleTask()
193-
>>> node.inputs.in_file = 'diffusion.nii'
193+
>>> node.inputs.in_file = 'diffusion.nii.gz'
194194
>>> node.run() # doctest: +SKIP
195195
"""
196196
input_spec = TVResampleInputSpec

stderr.nipype

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/Users/kesshijordan/repos/dtitk-2.3.3-Darwin-x86_64/scripts/dti_diffeomorphic_reg: line 191: [: 1.0: integer expression expected
2+
/Users/kesshijordan/repos/dtitk-2.3.3-Darwin-x86_64/scripts/dti_diffeomorphic_reg: line 197: [: 6.0: integer expression expected
3+
/Users/kesshijordan/repos/dtitk-2.3.3-Darwin-x86_64/scripts/dti_diffeomorphic_reg: line 205: [: 6.0: integer expression expected

stdout.nipype

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
registering /Users/kesshijordan/ref_data/interscan_dys/Trio/IC004-1_dti_b2000_EC_tensorx1000_aff.nii.gz to /Users/kesshijordan/ref_data/interscan_dys/Prisma/IC004-4_dti_b2500_SC_EC_tensorx1000.nii.gz ...
2+
starting at Mon Oct 30 18:05:41 PDT 2017
3+
ending at Mon Oct 30 18:05:41 PDT 2017

0 commit comments

Comments
 (0)