Skip to content

Commit fff34ae

Browse files
committed
Update dcm2nii.py
1 parent 13e131f commit fff34ae

File tree

1 file changed

+0
-13
lines changed

1 file changed

+0
-13
lines changed

nipype/interfaces/dcm2nii.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,6 @@ def _gen_filename(self, name):
181181
return config_file
182182
return None
183183

184-
## dcm2niix update
185184

186185
class Dcm2niixInputSpec(CommandLineInputSpec):
187186
source_names = InputMultiPath(File(exists=True), argstr="%s", position=-1,
@@ -197,7 +196,6 @@ class Dcm2niixInputSpec(CommandLineInputSpec):
197196
verbose = traits.Bool(False, argstr='-v', usedefault=True)
198197

199198

200-
201199
class Dcm2niixOutputSpec(TraitedSpec):
202200
converted_files = OutputMultiPath(File(exists=True))
203201
bvecs = OutputMultiPath(File(exists=True))
@@ -224,9 +222,7 @@ class Dcm2niix(CommandLine):
224222

225223
def _format_arg(self, opt, spec, val):
226224
if opt in ['bids_format', 'merge_imgs', 'single_file', 'verbose']:
227-
228225
spec = deepcopy(spec)
229-
230226
if val:
231227
spec.argstr += ' y'
232228
else:
@@ -249,43 +245,34 @@ def _parse_stdout(self, stdout):
249245
bids = []
250246
skip = False
251247
find_b = False
252-
253248
for line in stdout.split("\n"):
254249
if not skip:
255250
out_file = None
256251
if line.startswith("Convert "): # output
257252
fname = str(re.search('\S+/\S+', line).group(0))
258-
259253
if isdefined(self.inputs.output_dir):
260254
output_dir = self.inputs.output_dir
261255
else:
262256
output_dir = self._gen_filename('output_dir')
263257

264258
out_file = os.path.abspath(os.path.join(output_dir, fname))
265-
266259
# extract bvals
267260
if find_b:
268261
bvecs.append(out_file + ".bvec")
269262
bvals.append(out_file + ".bval")
270263
find_b = False
271-
272264
# next scan will have bvals/bvecs
273265
elif 'DTI gradient directions' in line:
274266
find_b = True
275-
276267
else:
277268
pass
278-
279269
if out_file:
280270
files.append(out_file + ".nii.gz")
281271

282272
if self.inputs.bids_format:
283273
bids.append(out_file + ".bids")
284-
285274
continue
286-
287275
skip = False
288-
289276
# just return what was done
290277
if not bids:
291278
return files, bvecs, bvals

0 commit comments

Comments
 (0)