I’m in the process of writing a script to sort & rename lots of dicom files based on information in the dicom header. Ideally I wanted to include the series description (dicom field “0008,103e”) as part of the output directory name (with spaces replaced with underscores, using sed). However, dicom_hinfo only returns the first word of the series description. I could use dcmdump from DCMTK, but dicom_hinfo is a lot faster. I could use dicom_hdr & grep, but I’m not sure how I’d grep for multiple elements (instance number, series description, etc.) without reading in the header multiple times. I need to read through tens of thousands of dicom files, so speed is an issue.
Is there a way for dicom_hinfo to output the entire field for series description, rather than just the first word?
On my system, dicom_hinfo was a bit faster than dcmdump when run in a “foreach” loop in c-shell. However, I just discovered that dcmdump can read multiple dicom files at once, so that will speed things up a bit.
Following up on Rasmus’ request.
Would it be possible to add a -separator option to dicom_hinfo so that one could reliably split multi tag output into columns? Using space as a separator would not work when fields have spaces in them. Alternately, or additionally, one could request that space characters within a field value be replaced with ‘_’, say. That would make parsing columns with space as delimiter work fine.
My version check tells me I am at AFNI_18.1.18 and that the latest is AFNI_19.0.01. However when I run @update.afni.binaries -d, I get a ++ no update needed message.
It seems likely you are running a 10.7 package, which we no longer have a build system for. Try the macos_10.12_local (which is currently the ONLY mac package we have, but which seems to work on even earlier mac systems, if you have one).
Maybe I will stick a warning for out of date packages, that would probably be more polite…
The
National Institute of Mental Health (NIMH) is part of the National Institutes of
Health (NIH), a component of the U.S. Department of Health and Human
Services.