Skip to content
generated from fastai/fastpages

Tutorials that take an in depth look at how to view and manipulate DICOM images and how to get them ready for machine learning

License

Notifications You must be signed in to change notification settings

asvcode/MedicalImaging

Repository files navigation

Click on the link above to go to the tutorials

Medical Imaging

These tutorials take an in depth look at how to view DICOM images and what information is contained within the head of the DICOM. These tutorials also look at what considerations should be taken when evaluating models for medical diagnosis such as Positive and Negative Predictive values, Specificity, Sensitivity, what RescaleSlope and RescaleIntercept are and how to view diffent tissues densities, Windowing and how to normalize images using bins.

These tutorials are based on the lastest release of fastai which was officially released in August 2020 and Medical Imaging using Fastai provides an in depth look at the fastai's medical.imaging.module.

Currently 3 easily accessible datasets are used for the tutorials. These can be found in the Getting to know DICOMS tutorial

What are DICOMs?

DICOM(Digital Imaging and COmmunications in Medicine) is the de-facto standard that establishes rules that allow medical images(X-Ray, MRI, CT) and associated information to be exchanged between imaging equipment from different vendors, computers, and hospitals. The DICOM format provides a suitable means that meets health infomation exchange (HIE) standards for transmission of health related data among facilities and HL7 standards which is the messaging standard that enables clinical applications to exchange data.

DICOM files typically have a .dcm extension and provides a means of storing data in seperate 'tags' such as patient information as well as image/pixel data. A DICOM file consists of a header and image data sets packed into a single file. The information within the header is organized as a constant and standardized series of tags. By extracting data from these tags one can access important information regarding the patient demographics, study parameters, etc

16 bit DICOM images have values ranging from -32768 to 32768 while 8-bit greyscale images store values from 0 to 255. The value ranges in DICOM images are useful as they correlate with the Hounsfield Scale which is a quantitative scale for describing radiodensity

Parts of a DICOM

Requirements

Requires the most recent version of fastai, installation instructions can be viewed at fastai

Also requires installing pydicom

  • pip install pydicom

and scikit-image

  • pip install scikit-image

and kornia

  • pip install kornia===0.2.0

(there is a current incompatability with the lastest version of kornia. Installing version 0.2.0 solves this issue

Using with Google Colab:

Click on the link below for an example of loading the dependancies on Colab

Open In Colab

Fastai provides an easy to access slim dicom dataset (250 DICOM files, ~30MB) from the SIIM-ACR Pneumothorax Segmentation dataset for us to experiment with dicom images. The file structure of the dataset is as follows:

Images from the notebooks

>hist_scaled(in Part1)

hist_scaled provides a way to scale a tensor of pixels evenly using freqhist_bins to values between 0 and 1. This is the histogram of image pixel values scaled from 0 to 255. As explained in this notebook

Scaled histogram now has pixel values ranging from 0 to 1

About

Tutorials that take an in depth look at how to view and manipulate DICOM images and how to get them ready for machine learning

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published