This repository contains a Jupyter Notebook for Medical Imaging. It demonstrates basic image processing techniques for medical images using Python and key libraries such as pydicom, skimage, and matplotlib. It includes functions to:
- Load and inspect DICOM metadata
- Map pixel values to meaningful units
- Apply windowing for tissue visualisation
- Enhance contrast and adjust intensity
- Identify and measure regions of interest
- Convert DICOM images for analysis
- Visualise and export processed images
Before running the notebook, ensure the following packages are installed:
-
numpy==1.26.3
-
pandas==2.2.0
-
matplotlib==3.8.2
-
pydicom==3.0.1
-
scikit-image==0.22.0
You can install missing dependencies using:
pip install -q numpy==1.26.3 pandas==2.2.0 matplotlib==3.8.2 pydicom==3.0.1 scikit-image==0.22.0
This outlines the methods and findings from the analysis of CT scans, focusing on techniques essential for enhancing medical images and assisting in the diagnosis of COVID-19-related changes in lung tissues. Contrast enhancement was applied to the scans, improving the clarity and visibility of lung structures. This adjustment is crucial for detailed examination and accurate diagnosis. Statistical data was used to identify variations in pixel distributions, and histograms aided in quantifying and visualising tissue density. Additionally, the use of coronal reconstructions and maximum intensity projections provided di[erent perspectives on the lung structures, o[ering a more comprehensive view that is beneficial for clinical assessments. These analyses can help to understand the extent and nature of lung damage and track lung changes associated with COVID-19 if the data is compared over time.
Axial CT image for patient A, taken from the middle of the body, original [1], transformed into Hounsfield
Units [2] and enhanced and windowed with a focus on lung tissue [3].
Histograms for the pixel distribution for an example scan for patient A [1], all scans for patient A [2], all scans
for patient B [3], and all the scans of patients A and B [4].
Coronal slices from the middle for patients A [1] and B [2], enhanced to better visualise the anatomical
details.
Windowed coronal MIP for patients A [1] and B [2] stacked from 40 slices.
Axial MIP for patients A [1] and B [2] stacked from 50 slices.
However, for practical application in clinical settings with multiple patient datasets, improvements in the code structure are necessary. The current method uses numerous individual variables for each patient, which reduces the code's readability and scalability. A consistent modular approach, where each process is encapsulated in functions, would improve reproducibility and maintainability. Additionally, issues with lung segmentation need addressing to prevent errors in calculating lung tissue in the scans, particularly in the peripheral and central slices.