BIC-MNI / minc-tools

Basic minc-tools from former minc repository
Other
30 stars 25 forks source link

dcm2mnc: update manpage to document %P for using protocol name in mnc file naming #61

Open gdevenyi opened 7 years ago

gdevenyi commented 7 years ago

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.

andrewjanke commented 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

gdevenyi commented 7 years ago

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?

andrewjanke commented 7 years ago

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 .

rdvincent commented 7 years ago

@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?

gdevenyi commented 7 years ago

%P is exactly what I'm looking for

Recasting request as a "update manpage"

rdvincent commented 7 years ago

@gdevenyi It is already in the man page, at least on the develop branch. Not sure the man page is getting installed however.

gdevenyi commented 7 years ago

Ah, on develop I'm seeing a manpage without this option listed.

rdvincent commented 7 years ago

It should be listed as shown here:

https://github.com/BIC-MNI/minc-tools/blob/develop/conversion/dcm2mnc/dcm2mnc.man1#L214

gdevenyi commented 7 years ago

Yup, my sources have that, but the installed version seem to be coming from somewhere else.

vfonov commented 7 years ago

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 .

gdevenyi commented 7 years ago

Thanks @vfonov but that man page also is missing "%P"

vfonov commented 7 years ago

I guess this commit came after I split up man pages: https://github.com/BIC-MNI/minc-tools/commit/157d0532dd137e21147ee3de6a92e77f37463457