
However, by passing a -reslice to the script, all dimensions are converted.

-inputFileSubStr : A short hand trick to specify the inputFile.Typically a DICOM file or a NifTI volume. -i | -inputFile : Input file to convert.Med2image needs at a minimum (some of) the following required command line arguments: The containerized version exposes a similar CLI and functionality as this module. We also offer a docker container of med2image as a ChRIS-conformant platform plugin here (see also the closely related that performs conversions down a directory tree recursively) - please that reference for information on running the dockerized container.
CONVERT DICOM TO JPG PYTHON INSTALL
Sudo apt-get install -y python3-tk Docker container One method of installing this script and all of its dependencies is by fetching it from PyPI. The script should work fine under Windows, but we have not actively tested on that platform - our dev envs are Linux Ubuntu and macOS.

This document assumes UNIX conventions and a bash shell. matplotlib : (to save data in various image formats).pfmisc : (a general miscellaneous module for color support, etc).Make sure that the following dependencies are installed on your host system (or even better, a python3 virtual env): Med2image is a simple Python3 utility that converts medical image formatted files (such as DICOM and NifTI) to more web friendly ones, such as png and jpg.Ĭurrently, NIfTI and DICOM input formats are understood, while any graphical output type that is supported by matplotlib can be generated.Īt present med2image does not convert DICOM to NifTI, but this is planned for a future release. Convert DICOM or NIfTI inputs to jpg or png outputs.

CONVERT DICOM TO JPG PYTHON FULL
And while I could add an additional conversion from PBM to PNG, I'd rather call convert only once and do the full conversion in a single command.Īnyone know what parameters I might be missing in the calls to dcm2pnm or ImageMagick's convert to get the images looking as expected?Įdit: including a sample. The problem is I need these to be in PNG, not PBM. png conversions look like this, which is a very washed out image, perhaps due to problems with an alpha channel, gamma, or.? pnm looks like this, which is not quite an inverse image, but somehow looks wrong:Īnd both of the. pbm is the only one that seems to give great results.

I can convert them from DICOM to several other formats, but as you'll see the conversion isn't working as expected in most cases. I have some DICOM medical imaging files downloaded from Cancer Imaging Archive.
