Open gdevenyi opened 7 years ago
This is already possible in dcm2mnc, have a look at the -fname and -dname options. Here's python snippet showing what is possible.
cmd = ['dcm2mnc', '-usecoordinates', '-anon', '-dname', '', '-fname', '%N%D-%T' + str(SeriesNumber).zfill(2) + '' + StudyDescription + '' + SeriesDescription + '%s%e%t%p%c'] cmd.extend(flist) cmd.append(outdir) do_cmd(cmd, False)
(From here: https://github.com/NIF-au/imagetrove-python-uploader/blob/master/dicom/imgtr-uploader-dicom.py#L421)
a
Thanks @andrewjanke I was aware of -fname and -dname, but it didn't appear to me that any of the "%" formatting options actually contain the info I want inserted? It looks like you're getting that elsewhere in that snippet?
Correct,
I extract exactly what I want with dcmdump as it is dependent on the scanner.
A
On 7 Feb 2017 6:27 am, "Gabriel A. Devenyi" notifications@github.com wrote:
Thanks @andrewjanke https://github.com/andrewjanke I was aware of -fname and -dname, but it didn't appear to me that any of the "%" formatting options actually contain the info I want inserted? It looks like you're getting that elsewhere in that snippet?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/BIC-MNI/minc-tools/issues/61#issuecomment-277802965, or mute the thread https://github.com/notifications/unsubscribe-auth/AATwir8S6b67cEKiQ0sZu3bDkc9cL7ZFks5rZ4IRgaJpZM4L4jRP .
@gdevenyi There is a poorly-documented option, %P, that is available to insert the protocol name, as well as %A to insert the acquisition or series ID. Would either of these help?
%P is exactly what I'm looking for
Recasting request as a "update manpage"
@gdevenyi It is already in the man page, at least on the develop branch. Not sure the man page is getting installed however.
Ah, on develop I'm seeing a manpage without this option listed.
It should be listed as shown here:
https://github.com/BIC-MNI/minc-tools/blob/develop/conversion/dcm2mnc/dcm2mnc.man1#L214
Yup, my sources have that, but the installed version seem to be coming from somewhere else.
http://bic-mni.github.io/man-pages/man/dcm2mnc
On Feb 7, 2017 2:14 PM, "Gabriel A. Devenyi" notifications@github.com wrote:
Yup, my sources have that, but the installed version seem to be coming from somewhere else.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/BIC-MNI/minc-tools/issues/61#issuecomment-278109210, or mute the thread https://github.com/notifications/unsubscribe-auth/AAmYVsAkWA8LEtB5EIp1QCoEfK3u_Crkks5raMKIgaJpZM4L4jRP .
Thanks @vfonov but that man page also is missing "%P"
I guess this commit came after I split up man pages: https://github.com/BIC-MNI/minc-tools/commit/157d0532dd137e21147ee3de6a92e77f37463457
Something very nice about modern dcm2nii converters is the output files can be named with the sequence information from the DICOMs.
Right now dcm2mnc only offers the acquisition number as a naming option. Sadly, if the sequence was done out-of-order at the scanner this number is unreliable.
Currently I rely on parsing the mincheader output to rename the resulting files to something more useful, since I commonly encounter scanning sessions with many sequences.