convert .mha data to .mnc data

Using diffeomorphic demons registration I need to do registration for brain images. This is the code which I am working on https://github.com/BIC-MNI/EZminc. I need to give input in .mnc format. Can someone suggest me how to convert my data which is in dicom format, mha and .mhd to .mnc??

For DICOM, you can use this example. For the other formats, changing dimension from 2 to 3 in this example should be enough. Then invoke as ImageReadWrite.exe something.mha something.mnc

1 Like

Is there any software like ITK-snap to visualize .mnc files?
Also how to know the data type of that image?
I converted my image in .mha to .mnc by using imagereadcastwrite.cxx giving dim=3 and datatype short to float.
I used this images as input to the above mentioned code, it says it couldn.t read image information. Please help me with this

3D Slicer can read/write, segment, register, analyze .mnc files.

Another option is itk-vtk-viewer. Just click on the the application, and select your .mnc file.

A command line interface is also available, so you can run

$ itk-vtk-viewer ./image.mnc

if you prefer the terminal.

Here is an example mnc file from the MNI Average Brain (305):

Only MINC version 2 is supported (this version is what the example @dzenanz referenced will produce).