MHD to JPG Converter (via single-file MHA) | MiConvert

MHD to JPG Converter

A standard MetaImage .mhd file is only a header pointing to a separate .raw data file, and this tool accepts one file at a time, so uploading the .mhd alone fails today. Save the volume as a single-file .mha or .nrrd, load that, choose a slice and download it as a JPG.

🔒 Zero-Upload — Your files never leave your device
🏥

Drop your file here

DICOM (.dcm, single files or a whole series), NIfTI (.nii, .nii.gz), NRRD (.nrrd), MHA (.mha), MHD (.mhd + .raw)

Select File

Up to 1 GB per file • Processed locally

Zero Upload 100% Browser Processing No Sign Up 100% Free
MHD → JPG

Why a .mhd file won't convert on its own

MetaImage is the native format of the ITK toolkit, and it turns up throughout research pipelines, public lung CT datasets and tools such as 3D Slicer. In the .mhd flavor, the small text file you see holds only the dimensions, spacing and data type. The voxels live in a companion .raw or .zraw file named on its ElementDataFile line. Ordinary image viewers can't open either half, and producing a JPG requires both.

Our medical tool reads files inside your browser and takes a single file per conversion. When it gets a .mhd that refers to an external .raw, it has no way to reach the voxel data and stops with "Invalid MHA file: could not find data section". Because that split layout is the normal case, the honest answer is that plain .mhd conversion does not work today. The exception is a .mhd whose header says ElementDataFile = LOCAL, with the data stored in the same file, which the parser can read.

Repacking is the route that does work. A .mha file is the same MetaImage format with header and voxels combined, and .nrrd is a close equivalent. Both open here on the middle slice, with a slider to step through the volume. The tool maps the chosen slice to 8-bit grayscale using an automatic window from the 1st to 99th percentile, which you can adjust, then saves it as a JPEG with a quality setting of 0.92.

JPG makes sense when the slice is headed for an email, a slide deck or a chat thread and a small file matters more than exact pixels. Expect faint compression artifacts around sharp edges, and expect the file to carry none of the other slices, the voxel spacing, the orientation or the original intensity values. For figures where boundaries must stay exact, the PNG option avoids the compression.

How to get a JPG from MHD data

  1. Keep the .mhd and its .raw or .zraw file side by side in one folder, because the header expects to find its data next to it.
  2. Open the .mhd in 3D Slicer, or read it with SimpleITK or ITK, and save it as .nrrd or .mha. When saving .mha from 3D Slicer, untick the Compress option, since compressed MHA data isn't decoded here. Gzip-encoded NRRD is fine.
  3. Load the new .mha or .nrrd into the tool. One file at a time, up to 200 MB.
  4. Drag the slice slider to the image you want, then adjust window and level if the tissue looks flat or clipped.
  5. Select JPG and download. To capture another slice, move the slider and export again.

What you can do with the repacked volume

  • Reads single-file MetaImage (.mha) with uncompressed data, and NRRD files in raw or gzip encoding
  • Opens on the middle slice of the volume, with a slider to reach any other slice along the third axis
  • Automatic contrast from the 1st-99th percentile of the slice, plus manual window and level sliders
  • JPEG output at quality 0.92 and the slice's native pixel size, with no scaling
  • The same slice can be saved as PNG or as a one-page A4 PDF instead
  • Voxel data is processed in the browser tab and not uploaded to our servers

Video Tutorial

Are you struggling with how to convert your MHD file to JPG format? Don't worry, in this video I will reveal a super convenient tool to help you change your file extension completely for free without

MHD to JPG questions

Why do I get "Invalid MHA file: could not find data section"?

Your .mhd points to a separate .raw or .zraw file, and the tool receives only the file you selected, so the voxel data is missing. Selecting the .raw by itself won't work either, since the tool doesn't accept that extension. Combine the pair into a single .mha or .nrrd first, then load that file.

What's the quickest way to turn MHD + RAW into one file?

With SimpleITK installed in Python, two lines do it: image = sitk.ReadImage("scan.mhd") followed by sitk.WriteImage(image, "scan.mha"). Compression is off by default in that call, which is what this tool needs. Without code, load the .mhd into 3D Slicer and save the volume as .nrrd.

Is this page about the MHD tuning app?

No. MHD here means the MetaImage header format used for medical and scientific images. Questions about MHD car-tuning licenses, maps, passwords or connection problems belong with that app's own support. This page can't help with them.

Will the JPG keep the original intensity values or voxel spacing?

No. The slice is windowed down to 8-bit grayscale and then compressed, and a JPG has no place to record spacing, origin or orientation. Use it to show what the scan looks like, not to take measurements from it.

Can I export every slice as a JPG at once?

No. Each download is the slice currently on screen, and there is no batch mode. For a full stack of JPGs, a short Python loop with SimpleITK that extracts each slice, rescales it to 8-bit and writes it out will be much faster.

My slice looks like noise or stripes. What went wrong?

The data is probably stored in a byte order or encoding the reader doesn't interpret. Big-endian data, marked ElementByteOrderMSB = True in MetaImage or endian: big in NRRD, is read in the wrong order. NRRD files with ascii, hex or bzip2 encoding are also misread. Re-save the volume as little-endian with raw or gzip encoding and try again.

Does my volume get uploaded to MiConvert?

No. The file is parsed in your browser and its voxel data never reaches our servers, so nothing is kept on our side afterward. A few details do leave your machine. The page's libraries load from cdn.jsdelivr.net. Google Analytics, when active, receives the file name, size and format. A file rejected for exceeding 200 MB is logged on our server with that same information.