dicom_to_minc (was Re: [MINC-users] Shapoor from Dr. Bushnell's lab)

Jonathan Harlap minc-users@bic.mni.mcgill.ca
Thu, 02 Oct 2003 07:22:13 -0400


actually, dicom_to_minc will handle being told to convert more than one
series-worth of data at a time, the caveat being that it may split the
single series into a number of mincs (which can then be concatenated
with mincconcat (or concat_mri, which is just a wrapper to simplify
mincconcat usage).

alternately, you can make sure to pass dicom_to_minc the files in the
order they belong - this significantly helps it generate the proper set
of files...

i have a tool `get_dicom_info` which currently lives (at the bic) at
~jharlap/bin/get_dicom_info which is basically the dicom version of
Mincinfo (capital M - deals with multiple mincs).  in conjuction with my
modified dicom_to_minc (changed only to add the -stdin option such that
it can accept a list of dicom filenames via STDIN rather than on the
command line), you can have much better control over what files are
passed to get_dicom_info and in what order.

for example, given a tree full of dicom files /path/to/dicom (which may
contain subdirs full of dicom, and so on):

  `find /path/to/dicom -type f -name \*.dcm \
   | ~jharlap/bin/get_dicom_info -stdin -studyuid -series -echo -image
-file \
   | sort -n -k1 -k2 -k3 -k4 | cut -f 5 \
   | ~jharlap/bin/my_dicom_to_minc /path/to/put/mincs -stdin -notape`

what all that does is, simply, find all the dicom files, get the study
instance uid, series number, echo number, and image number (and
filename) for each of those files, sort the list on studyuid & series &
echo & image, and then pass the filenames in that new order to
my_dicom_to_minc, which should generate mincs in /path/to/put/mincs.

i haven't tried this on fMRI data, although i don't see any reason why
it wouldn't work...  i would love to hear if/how it works for fMRI - or
if people at the bic want these two tools in /usr/local/mni/bin rather
than in my space ;)

jon


On Wed, 2003-10-01 at 19:55, Jon Erik Ween wrote:
> This will work if you have *.dcm files for asingle series in a folder
> and the *.dcm filesare named in the appropriate sequential order. Many
> indexing databases(such as the Oldenburg CTN) assigns random names to
> files, so they areconcatenated correctly by dicom_to_minc. Using the
> mklinks2 utilitycan help with the filename problem (as outlined on the
> (x)medconwebsite) but then, if you have a "smart" PACS that saves
> space byconcatenating different sequences into a single DICOM
> series,dicom_to_minc will not parse these correctly.
> 
> Jon
> 
> On Wednesday, October 1, 2003, at 04:20 PM, Jason Lerch wrote:
> 
>         Hello Shapoor,
>         
>         try:
>         
>         dicom_to_minc
>         
>         Cheers,
>         
>         Jason
>         
>         On Monday, September 29, 2003, at 11:01 AM, Shapoor wrote:
>         
>                 Hi,
>                 
>                  
>                 
>                 I have files that are in dicom format, I was wondering
>                 how can Itransfer them into minc format?
>                 
>                  
>                 
>                 Thank you
>                 
>                 Shapoor
>                 
>         
>         
>         _______________________________________________
>         MINC-users@bic.mni.mcgill.ca
>         http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users
>         
>         
> Jon Erik Ween, MD, MS
> Assistant Professor
> Cognitive and Cerebrovascular Neurology
> Director, Stroke Program
> Loma Linda University