[MINC-users] MINC to DICOM

Andrew Janke a.janke at gmail.com
Fri Oct 3 01:11:21 EDT 2008


> :) well my subjective truth is more of a half-full nature: the vast
> majority of users that ask me about a minc-to-dicom conversion, simply
> want to be able to load a minc volume in their favorite dicom viewer

Certainly not in my world.  The tend to come from the "I want to do
some processing and put it back in our PACS" type people or more scary
"I want to do motion correction pre-processing on DTI mosaic images in
MINC put it back in DICOM, read it into FSL and run TBSS" types.

> (and don't want to bother with building and learning Display - who
> could blame them?). As such, 90% of these would be perfectly happy
> with having a way to turn a minc volume into valid dicom.

define "valid dicom". It is a very very loose spec. For example to be
a tad facetious you could do this (on most ubuntu machines).

   mincpik fred.mnc out.pdf
   pdf2dcm out.pdf out.dcm

and it is "valid" dicom

You can also do the same for a JPEG2000 DICOM file (just an
encapsulated JPEG as per the above) using jpg2dcm. They will both load
into most dicom viewers and are certainly valid and would allow users
to view data.


> is simply not realistic. However, I suspect that a mnc2dcm that would attain
>
>  <minc> == dcm2mnc( mnc2dcm( <minc> ) )

I doubt it.  Header info will certainly be lost unless we add our own
custom dicom tags for history patient name, acquisition, etc. This
might be true for image orientation/cosines _if_ you guarantee me that
nothing is going to be done with the dicom file once converted. ie:
none of this:

   $ mnc2dcm out.mnc out.dcm
   $ dcmtk -strip out.dcm new.dcm

   ...

Why? Different manufacturers define origin/start/etc differently, then
there is the thorn issue of "mosaics".

> I don't believe that you can do the
> back-and-forth conversion with nii2mnc/mnc2nii and expect to get the
> same result either - but I could be wrong).

Wrong.  (Well at least for Nifti-1 if you use it correctly and the
programs you use on the Nifti-1 file conform to the Nifti-1 spec).

> But if nobody is interested or has done it already; I hope to find
> time or $$ to take care of this, because in my mind it is one of the
> largest 'holes' in minc.

How many $$?  :)

For the meantime if you really really really really promise with sugar
on top to only, only ever ever want to view images in dicom viewers
and not do anything more with them, just view them and only view them
and promise to not try to use this for other things that "we could
just extend this a bit for" here is "mnc2dcm" :)

pnmtodc is part of dicom2tools from david clunies (an Ozzie!) site,
the package is very easy to compile.

   http://www.dclunie.com/dicom3tools.html

---
#! /bin/sh


infile=$1
outfile=$2

slices=`mincinfo -dimlength zspace $infile`

for i in `seq 0 $slices`;
do
   echo "Doing slice $i"
   mincpik -clobber $infile /tmp/tmp-mnc2dcm-$i.pnm
   pnmtodc /tmp/tmp-mnc2dcm-$i.pnm ${outfile}-$i.dcm
done

---


a


More information about the MINC-users mailing list