No account yet ?
The MHD file is an ITK Meta-Image Header.
Insight Segmentation and Registration Toolkit (ITK) is an open-source, cross-platform system that provides developers with an extensive suite of software tools for image analysis.
Tested in Anaconda and Python 3.7
import SimpleITK as sitk import matplotlib.pylab as plt ct_scans = sitk.GetArrayFromImage(sitk.ReadImage("70-air-body-lungs.mhd", sitk.sitkFloat32)) for i in range(ct_scans.shape[0]): plt.imshow(ct_scans[i], 'gray') plt.axis('off') plt.show() plt.imsave('output/70-air-body-lungs_' + str(i) + '.png', ct_scans[i], cmap='gray', format='png')
mhd2png
Copyright (c) 2023 elodees
Downloading the 70-air-body-lungs.mhd and 70-air-body-lungs.raw files
Welcome, my name is Eric Soupet and I am the administrator of the site elodees.com. elodees.com is a state of the art of Artificial Intelligence and aims to be collaborative, you can now offer content such as articles, events, tutorials, ... so don't hesitate !
Platform images credit : Pixabay - Pixabay License | Pexels - Pexels License