Skip to content
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

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

Open
gdevenyi opened this issue Feb 6, 2017 · 12 comments

Comments

@gdevenyi
Copy link

gdevenyi commented Feb 6, 2017

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.

@gdevenyi gdevenyi changed the title FEATURE REQUEST: dcm2mnc allows naming with sequence type FEATURE REQUEST: dcm2mnc allow naming with sequence type Feb 6, 2017
@andrewjanke
Copy link
Member

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
Copy link
Author

gdevenyi commented Feb 6, 2017

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
Copy link
Member

andrewjanke commented Feb 6, 2017 via email

@rdvincent
Copy link
Member

@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
Copy link
Author

gdevenyi commented Feb 6, 2017

%P is exactly what I'm looking for

Recasting request as a "update manpage"

@gdevenyi gdevenyi changed the title FEATURE REQUEST: dcm2mnc allow naming with sequence type dcm2mnc: update manpage to document %P for using protocol name in mnc file naming Feb 6, 2017
@rdvincent
Copy link
Member

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

@gdevenyi
Copy link
Author

gdevenyi commented Feb 7, 2017

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

@rdvincent
Copy link
Member

@gdevenyi
Copy link
Author

gdevenyi commented Feb 7, 2017

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

@vfonov
Copy link
Member

vfonov commented Feb 7, 2017 via email

@gdevenyi
Copy link
Author

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

@vfonov
Copy link
Member

vfonov commented Aug 28, 2017

I guess this commit came after I split up man pages: 157d053

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants