Skip to content

Mouse DICOM to MINC Conversion

Gabriel A. Devenyi edited this page Apr 15, 2020 · 2 revisions

So you've got some scans from the Bruker 7T magnet here at the CIC and want to use our animal imaging tools on them. Unfortunately, most of our tools work with mnc format; a format that the Bruker computer cannot generate itself. Ideally, your operator has exported the raw scans at least as DICOM format, which can now be converted into mnc. This wiki explains how to do that conversion.

It is good practice to make separate copies of your raw data in a different conversion/preprocessing directory before beginning. Don’t work with the only copies of scans you have as you may lose/alter them irreversibly.

Conversion to minc and the rest of the preprocessing are now separate tools. This page is only for conversion to DICOM, see "Mouse Scan Preprocessing" for the rest of the preprocessing steps.

DICOMs can be converted easily into mincs by using the dcm2mnc command. It requires the modules minc-toolkit and minc-toolkit-extras pre-loaded into your terminal. Here's the command general format

dcm2mnc -[options] [location to look for DICOMs to convert] [location to dump resulting mncs]

For example:

dcm2mnc -usecoordinates -dname '' -fname '%N' ./* .

  • usecoordinates option should always be on for us, something to do with DICOM format having wrong spatial information in our setup
  • ./* looks for any folders that look like DICOMs at the current location
  • . says dump the mnc files here
  • -dname '' gets rid of the default output of putting each minc file in it’s own directory (super annoying)
  • -fname '%N' makes the converter name each output mnc file with just the patient name, instead of super long default naming pattern. I give a different patient name for each time point, so I can afford to cut down the info this much.

Notes:

  • dcm2mnc can also take full/absolute directory paths
  • fairly fast step, a few seconds per scan

Example script with module loading and cleanup features:

/data/chamal/projects/dan/bin/dcm2mnc_v2

#!/bin/bash
#For converting DICOMs to mnc format
#Run with /data/chamal/projects/dan/bin/dcm2mnc_v2.sh in folder where you want the conversion to happen

module load minc-toolkit
module load minc-toolkit-extras
#loads minc toolkit and necessary commands

dcm2mnc -usecoordinates -dname '' -fname '%N' ./* .
#locate all DICOM folders here, convert them to minc files, and dump them here
#-dname '' makes the mnc output not stick every minc in it's own directory, much cleaner
#-fname '%N' reduces the name of the output file to only the name of the scan (much better than crazy long default naming scheme

mkdir originaldicoms
#makes a directory to stuff all the original dicoms you started to convert

mv *MCH*MCH*/ ./originaldicoms
#move original dicoms into a separate` folder for clean-up's sake
Clone this wiki locally