Skip to content


Subversion checkout URL

You can clone with
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: kastman/nipype
head fork: kastman/nipype
  • 8 commits
  • 12 files changed
  • 0 commit comments
  • 4 contributors
Commits on May 27, 2012
@kastman BUG: Properly convert argstr 'reorient' inputs
Although 'reorient' and 'reorient_and_crop' were
included in the spec, they were not being converted
to the '-i [n|y]' boolean syntax needed by the
dcm2nii CLI and causing an error:

ValueError: Object '<nipype.interfaces.dcm2nii.Dcm2nii
object at 0x1a01eb0>' attempting to format argument
string for attr 'None' with value 'False'.

This fix properly converts them.
@kastman ENH: Add opt for converting siemans PAR/REC files
Adds an option for the '-v' flag in dcm2nii, which
switches off the default behavior of converting
all PAR/REC files in a directory. Without this
option, dcm2nii will attempt to convert all files,
some of which may be bad runs and can cause the
entire directory to fail.

This also adds an option in the outfile parser to
search for "-->" which is the syntax returned when
dcm2nii converts PAR/REC files instead of "Saving"
or "Cropping".
@kastman BUG: Explicitly declare arg to fix position
When 'arg' is inherited from CommandLineInputSpec, it is placed last in position, which dcm2nii ignores. By defining it explicitly in the dcm2nii input spec, it can be placed before the list of image files and will be respected.
Commits on May 28, 2012
@chrisfilo chrisfilo Merge pull request #399 from kastman/add_par_option_to_dcm2nii
Add Siemans PAR options to dcm2nii + small bug fixes
@satra satra doc: added intro slides 83c33ea
Commits on May 29, 2012
@jsalva jsalva doctest files e53d2d3
@jsalva jsalva fixed doctest error with comma after -i in WIMT 299f509
@satra satra Merge pull request #400 from jsalva/master
fixed doctests for ants
4 doc/quickstart.rst
@@ -15,8 +15,10 @@ Downloading and installing
Beginner's guide
-By Michael Notter. `Available here`__
+Introductory slides. `Available here`__
+Michael Notter's guide. `Available here`__
User guides
2  nipype/interfaces/ants/
@@ -162,7 +162,7 @@ def _format_arg(self, opt, spec, val):
affine_counter += 1
if affine_counter in self.inputs.invert_affine:
- series += '-i'
+ series += '-i',
series += [transformation]
return ' '.join(series)
return super(WarpImageMultiTransform, self)._format_arg(opt, spec, val)
10 nipype/interfaces/
@@ -5,9 +5,10 @@
import os
from copy import deepcopy
from nipype.utils.filemanip import split_filename
+import re
class Dcm2niiInputSpec(CommandLineInputSpec):
- source_names = InputMultiPath(File(exists=True), argstr="%s", position=8, mandatory=True)
+ source_names = InputMultiPath(File(exists=True), argstr="%s", position=10, mandatory=True)
gzip_output = traits.Bool(False, argstr='-g', position=0, usedefault=True)
nii_output = traits.Bool(True, argstr='-n', position=1, usedefault=True)
anonymize = traits.Bool(argstr='-a', position=2)
@@ -16,6 +17,8 @@ class Dcm2niiInputSpec(CommandLineInputSpec):
reorient_and_crop = traits.Bool(argstr='-x', position=5)
output_dir = Directory(exists=True, argstr='-o %s', genfile=True, position=6)
config_file = File(exists=True, argstr="-b %s", genfile=True, position=7)
+ convert_all_pars = traits.Bool(argstr='-v', position=8)
+ args = traits.Str(argstr='%s', desc='Additional parameters to the command', position=9)
class Dcm2niiOutputSpec(TraitedSpec):
converted_files = OutputMultiPath(File(exists=True))
@@ -31,7 +34,7 @@ class Dcm2nii(CommandLine):
_cmd = 'dcm2nii'
def _format_arg(self, opt, spec, val):
- if opt in ['gzip_output', 'nii_output', 'anonymize', 'id_in_filename']:
+ if opt in ['gzip_output', 'nii_output', 'anonymize', 'id_in_filename', 'reorient', 'reorient_and_crop', 'convert_all_pars']:
spec = deepcopy(spec)
if val:
spec.argstr += ' y'
@@ -75,6 +78,9 @@ def _parse_stdout(self, stdout):
base, filename, ext = split_filename(last_added_file)
bvecs.append(os.path.join(base,filename + ".bvec"))
bvals.append(os.path.join(base,filename + ".bval"))
+ elif'-->(.*)', line):
+ search ='.*--> (.*)', line)
+ file = search.groups()[0]
if file:
0  nipype/testing/data/diffusion_weighted.nii
No changes.
0  nipype/testing/data/dwi2anat_InverseWarp.nii.gz
No changes.
0  nipype/testing/data/dwi2anat_Warp.nii.gz
No changes.
0  nipype/testing/data/dwi2anat_coreg_Affine.txt
No changes.
0  nipype/testing/data/func2anat_InverseWarp.nii.gz
No changes.
0  nipype/testing/data/func2anat_coreg_Affine.txt
No changes.
0  nipype/testing/data/resting.nii
No changes.
0  nipype/testing/data/resting2anat_Warp.nii.gz
No changes.
0  nipype/testing/data/resting2anat_coreg_Affine.txt
No changes.

No commit comments for this range

Something went wrong with that request. Please try again.