heudiconv icon indicating copy to clipboard operation
heudiconv copied to clipboard

Make renaming a subject easier and/or more flexible?

Open hacevedo opened this issue 6 years ago • 3 comments

Summary

I was wondering what the rationale is for the subject placeholder requirement when using the dcm_template argument? Since changing a subject identifier is allowed via the --anon-cmd flag, I don't see why have using a different identifier in the dicom template versus the subject name shouldn't be allowed.

For example, if I already have a generic wrapper script that calls heudiconv where I already have the dicom path and desired subject identifier available from a lookup table, it seems kind of unnecessary to write a separate script to call from heudiconv to do the renaming. While it's not hard to move the renaming logic from one script to another, the lack of support for multi word commands (i.e. allowing additional arguments other than the subject id) limits the ability to have a generic conversion script for different studies in some cases.

Would a change either to remove the value error on the missing place holder or to allow multi argument commands in anon_cmd be considered?

Platform details:

Choose one:

  • [ ] Local environment
  • [x] Container

nipy/heudiconv:unstable

  • Heudiconv version:

0.5.4.dev1

hacevedo avatar Mar 25 '19 16:03 hacevedo

hi @hacevedo - the -d, --dicom_dir_template argument was preserved to allow for backwards compatibility, but I would recommend using the --files arg instead - it may make life much easier.

For example, if you wanted to convert SUB001 to NEWSUB using dicom_dir_template, it would look something like this:

heudiconv -d /path/to/{subject}/dicoms -s SUB001 --anon_cmd renaming-script.sh ...

This could be reworked as

heudiconv --files /path/to/SUB001/dicoms -s NEWSUB ...

mgxd avatar Mar 25 '19 17:03 mgxd

The usage info says for --files says it cannot be used with --subjects. When used together, it seems to ignore the subject for file naming (although it does use the passed value for participants.tsv) and instead relies on the Patient Name tag in the DICOM headers.

hacevedo avatar Mar 25 '19 18:03 hacevedo

ah - that needs to be updated after #293..

And if you are using a heuristic with a defined infotoids() method (i.e. reproin), that may explain why. perhaps we can allow the -s, --subject argument to overwrite even if there is an infotoids? (cc @yarikoptic @mvdoc)

mgxd avatar Mar 25 '19 19:03 mgxd