This code describes different ways of reading DICOM images.
-
Function
get_dcm
reads dicom files from a directory -
It first checks if the DICOM images have
ImagePositionPatient
attribute. If it has, it stores slices according to theImagePositionPatient
. Otherwise, it sorts by name. -
Input parameter:
dcm_path
: location of dcm data -
Output: Returns -
dcm_data
: dicom data in a single array
pix_spacing
: spacing of pixel/voxel
intensity
: min and max intensity
-
Function
get_dcm
reads dicom files from a directory -
It first checks if the DICOM images have
SliceLocation
attribute. If it has, it stores slices according to theSliceLocation
. Otherwise, it sorts by name. -
Input parameter:
dcm_path
: location of dcm data -
Output: Returns -
dcm_data
: dicom data in a single array
pix_spacing
: spacing of pixel/voxel
intensity
: min and max intensity
Author @ Mrinal Kanti Dhar
numpy
pydicom