Easily convert MRI filed based on the DICOM format to a PNG image
Project description
Introduction
A simple python module to make it easy to batch convert a binary DICOM file, which is usually an output from an MRI scan to a PNG image.
The MRI scanning facilities typically hand you a CD containing your MRI scans. This CD will typically not contain any image files in traditional formats that can be opened up by your default image viewing program. The CD contains a list of DICOM files, which can only be viewed by the included viewer, which is mostly only supported on a Windows machine.
This module should help you convert all the DICOM based scans to PNG files. This tool can be used as a command line tools as well as a library in your python code
Quick Start
mritopng
will install a command line utility that can be used to convert individual DICOM files:
$ mritopng /DICOM/SCAN1 output.png
The utility can also be used to convert a whole folder recursively by using the -f
option:
$ mritopng -f /DICOM /PNG
It’s pretty easy to get up and running with mritopng
in your own project
import mritopng # Convert a since file mritopng.convert_file('/home/user/DICOM/SCAN1', '/home/user/output.png') # Convert a whole folder recursively mritopng.convert_folder('/home/user/DICOM/', '/home/user/PNG/')
Installation
mritopng
comes with a setup.py
script to use with distutils. After unpacking the distribution, cd into the
directory and execute the command:
python setup.py install
This will install two things
The
mritopng
module will be installed;import mritopng
will allow you to use itA command line utility called
mritopng
which can be used from the console
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file mritopng-2.1.tar.gz
.
File metadata
- Download URL: mritopng-2.1.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2060f9ca25fa8767a30d4aa11ea048884efd2116d039e9e4a61da259ed841879 |
|
MD5 | 10fc8bbfb3932b75a8241869ef18aa21 |
|
BLAKE2b-256 | ec280a7834ecb469dcef9dc33ec627194e36857464387252b8fae839415c047b |