-
Notifications
You must be signed in to change notification settings - Fork 532
[ENH] added interface for dcm2niix #1435
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
Conversation
@@ -180,3 +180,127 @@ def _gen_filename(self, name): | |||
f.close() | |||
return config_file | |||
return None | |||
|
|||
## dcm2niix update |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this line
@mgxd - could you again merge with current upstream master? and also run |
Some initial comments:
|
@DimitriPapadopoulos Thanks for the comments.
Let me know if you catch anything else! |
I'm not sure it can work in case DICOM file names are not passed as absolute paths. I'm in a directory with hundreds of DICOM files:
Then:
However dcm2niix doesn't seem to be processing paths relative to the current directory:
unlike dcm2nii:
What about |
From my test directory with 2 DICOM sequences, Dcm2nii and Dcm2niix create 2 NIfTI files. With Dcm2nii default output file names used to be:
With Dcm2niix default output file names are:
I understand the default has changed between dcm2nii and dcm2niix but would it be worth changing the default output format of Dcm2niix from |
I've updated the doctest to include the single file flag.
|
def _run_interface(self, runtime): | ||
new_runtime = super(Dcm2niix, self)._run_interface(runtime) | ||
(self.output_files, | ||
self.bvecs, self.bvals, self.bids) = self._parse_stdout(new_runtime.stdout) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
have you tested this with and without the bids option?
@mgxd Indeed in single file mode dcm2niix is able to handle relative pathnames:
but it cannot convert directories identified by a relative pathname:
unlike dcm2nii:
I believe Dcm2niix should accept relative pathames outside of single file mode, perhaps by adding |
@DimitriPapadopoulos |
Perhaps 3603523 should be reverted then. What do you think? Sorry about that. |
Thanks for the constant updates @neurolabusc! |
@mgxd - the one thing i would suggest is going back to the single file example in the doctest |
|
||
class Dcm2niixInputSpec(CommandLineInputSpec): | ||
source_names = InputMultiPath(File(exists=True), argstr="%s", position=-1, | ||
copyfile=False, mandatory=True, xor=['source_dir']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
desc
missing for all inputs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i know dcm2nii didn't have any either. but that should be fixed as well.
output_dir = Directory(exists=True, argstr='-o %s', genfile=True, | ||
desc="Output directory") | ||
bids_format = traits.Bool(True, argstr='-b', usedefault=True, | ||
desc="BIDS sidecar") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perhaps change to: Create a BIDS sidecar file
support for @neurolabusc's dcm2niix converter - compatible upto 4.12.16 version