Python Medical Image Conversion and File management
There are three main medical image formats used for projects and image datasets:
1. DICOM, industry standard format. A 3D image is usually represented as a set of 2-D images in a directory. The format is a tagged file format. The tags give information on how to order the images into a 3D array.
2. NifTi, this format is often used in image research. A 3D image is represented by a 3D file, it also always contains a 3D affine transform that may need to be managed.
3. v4 is the format used in the VisionX v4 system. A 3D or 2D image is contained in a single v4 file. It is the best format to use with the vsimba image viewer.
Image file format conversion utilities
Program |
Function |
dcmtoni |
convert DICOM to NifTi |
vnitovx |
convert NifTi to v4 |
vdcptovx |
convert DICOM to v4 |
vxtoni |
convert v4 to NifTi |
vnitodcm1 |
convert NifTi to DICOM |
dcmtoniix3 |
convert DICOM to NifTi |
dcminfo |
view all the tags in a DICOM image or directory |
vntovx -qn |
view header of NifTi file |
vls -h |
view header of a v4 file |
Notes:
1. vnitodcm fakes many of the DICOM tags, the files created may be used as input to applications, but the UID tags are not unique and some tags have arbitrary values; thus, the files should not be used in a DICOM management system.
2. To convert v4 to DICOM there is no converter for all cases yet. A simple approach is to first convert v4 to nifty (vxtoni) and convert the nifty to DICOM (vnitodcm). If the v4 file is the in the old vintage standard with dicom headers then v4todcm will create a correct DICOM set of files.
3. dcmtoniix is a standard software tool downloaded from GitHub. It uses a different command line syntax.