/MedImageProcMath

Medical image processing with Mathematica, MATLAB, and Python

Primary LanguageMathematica

MedImageProcMath

NOTE: Mathematica handling of DICOM data changed with version 12.1. The use of the DICOM tags, RescaleIntercept RescaleSlope does not calculate correct Hounsfield units. As a result, calculation of SSDE using pixel attenuation values does not correctly calculate SSDE. The original CAMPS algorithm is not based on pixel attenuation values, so SSDE calculated with the CAMPS portion of algorithms is still correct. I have tested the Python version with 3.7, and it still works. I haven't fully check the MATLAB version, but based on inspection of array values, it should still work. The algorithm should take the stored 12bit unsigned integer (type of storage value will change based on storage format, which is delineated in DICOM tags), multiply by rescale slope, added to rescale intercept (a linear transformation to Hounsfield units). The storage format I encountered is two major public databases is compatible with this approach. The approach may not work for some common storage formats such as JPEG, compressed or "uncompressed".

Medical image processing with Mathematica repository is for Mathematica code segmenting an axial CT body image into body pixels, and non body pixels. The segmentation is useful for calculation of Size Specific Dose Estimate (SSDE). The segmentation of body axial CT images can be accomplished with well established techniques. This allows a fast calculation of SSDE. The SSDE is one of the best available parameters to optimize the tradeoff between the risk of radiation exposure, and the usefullness of the medical image for diagnosis. If actual calculation of a patient's radiation exposure is required, more computationally complex techniques of x-ray photon transport simulation are required. This program is useful only as an educational tool. Currently, a large number of medical facilities are unaware of the usefullness of SSDE. This repository contains both ".nb" format and ".pdf" format documents. ".nb" are files that can be executed with Mathematica.

There are now three programs listed that demonstrate basic morphologic image processing for application to Computed Tomography exams. The programs are provided in MATLAB, Mathematica, and Python computer languages. Please see the other repositories. The programs read the DICOM format file to obtain the metainformation and image data. The image is segmented to separate the area of interest from the background. Based on pixel dimensions included in the metainformation, the equivalent disk diameter is calculated. The equivalent water disk diameter is then calculated using the pixel attenuation values contained within the body pixels.

The programs were used to calculate the equivalent disk diameter of a CT phantom. The CT phantom has a known diameter. Therefore the results can be compared to a known true value. In this case, the Mathematica parameters used for a morphologic algorithm were based on measurements from the phantom. Both the MATLAB program, and the Python program rely on the Otsu method of determining thresholds for morphologic segmentation.

The programs are intended as examples Medical Physicists can use to program a tool for calculating SSDE from CTDIvol. The SSDE tool can demonstrate how the calculation of Size Specific Dose Estimate is a better measure of radiation exposure for optimizing the tradeoff between radiation exposure and image quality. The majority of CT facilities use older measures of CT radiation exposure. By demonstrating the calculation of SSDE (which can be automated), CT facilities may be convinced to adopt the better method of optimizing radiation exposure. The SSDE provides a better parameter for predicting image noise and radiation exposure.

If users plan to use these programs, some modifications will be necessary. The programs would have to be modified to reflect the folder where axial CT images are found (often provided on an optical disk). Programs may also have to be modified to reflect different values in the metainformation included in the DICOM image header. The metainformation in the DICOM headers of different CT manufactures vary. The DICOM header metainformation should include information about the dimensions of individual pixels. The Mathematica program does contain the formula for calculating SSDE from CTDIvol (SSDE conversion factor) based on the equivalent disk diameter. This should provide enough information for users to modify the program for their own use. NOTE: The pixel attenuation approach for calculation of SSDE does not work in the latest version of Mathematica. The DICOM metadata includes information on the storage format of pixel values. In the case of JPEG, JPEG2000, and RLE, the results of calculation based on pixel attenuation method of calculation of SSDE may be incorrect depending on how the language libraries decode the stored data into an array of pixels. The CAMPS algorithm does not depend on the correct calculation of Hounsfield units. It is based on the area of the body pixels. The CAMPS algorithm can still be used if incorrect Hounsfield units are stored. The CAMPS algorithm would also be applicable if the image data array is normalized, as is commonly performed in neural network processing.