Skip to content

Fix/dcm2niix #2498

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Mar 23, 2018
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions nipype/interfaces/dcm2nii.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ class Dcm2niixInputSpec(CommandLineInputSpec):
argstr="-f %s",
desc="Output filename")
output_dir = Directory(
os.getcwd(),
".",
usedefault=True,
exists=True,
argstr='-o %s',
Expand Down Expand Up @@ -323,7 +323,7 @@ class Dcm2niixInputSpec(CommandLineInputSpec):
desc="Flag if text notes includes private patient details")
compression = traits.Enum(
1, 2, 3, 4, 5, 6, 7, 8, 9,
argstr='-%s',
argstr='-%d',
desc="Gz compression level (1=fastest, 9=smallest)")
comment = traits.Str(
argstr='-c %s',
Expand Down Expand Up @@ -360,11 +360,6 @@ class Dcm2niix(CommandLine):
>>> converter.inputs.output_dir = 'ds005'
>>> converter.cmdline
'dcm2niix -b y -z y -5 -x n -t n -m n -o ds005 -s n -v n dicomdir'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perhaps add:

>>> converter.run() # doctest: +SKIP

after this


>>> flags = '-'.join([val.strip() + ' ' for val in sorted(' '.join(converter.cmdline.split()[1:-1]).split('-'))])
>>> flags
' -5 -b y -m n -o ds005 -s n -t n -v n -x n -z y '
>>> converter.run() # doctest: +SKIP
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we did still want the converter.run() line, though.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😅

"""

input_spec = Dcm2niixInputSpec
Expand All @@ -387,6 +382,8 @@ def _format_arg(self, opt, spec, val):
val = True
if opt == 'source_names':
return spec.argstr % val[0]
if opt == 'series_numbers':
return ' '.join([spec.argstr % v for v in val])
return super(Dcm2niix, self)._format_arg(opt, spec, val)

def _run_interface(self, runtime):
Expand Down