lcat.loading package¶
Submodules¶
lcat.loading.annotations module¶
BMI 260: Final Project Load chest CT scan annotations from radiologist xml files.
-
class
lcat.loading.annotations.
Nodule
(nodule_id, characteristics, origin, mask)¶ Bases:
tuple
-
characteristics
¶ Alias for field number 1
-
mask
¶ Alias for field number 3
-
nodule_id
¶ Alias for field number 0
-
origin
¶ Alias for field number 2
-
-
lcat.loading.annotations.
get_mask_region
(read, dimensions, sop_instance_uids)[source]¶ Returns a full representation of the region represented by the given nodule read as a mask.
-
lcat.loading.annotations.
get_nodule_information
(read, dimensions, sop_instance_uids)[source]¶ Given an unblindedReadNodule element, create a Nodule object representing the nodule’s characteristics and vertices.
-
lcat.loading.annotations.
get_read_characteristics
(read)[source]¶ Get the characteristics from a read as recorded by the radiologist. Returns an empty dictionary if no characteristics were recorded.
-
lcat.loading.annotations.
get_read_mask
(read, dimensions, sop_instance_uids)[source]¶ Get a 3D array representing the region described by the specific read, prefaced by an origin specifying its placement in the image (in index coordinates).
-
lcat.loading.annotations.
load_radiologist_annotations
(dicom_folder, dimensions, sop_instance_uids)[source]¶ Load radiologist annotations (namely nodule characteristics and regions) from the xml files present in dicom_folder. Returns an array of Nodule objects representing all nodules found in the radiologist annotations.
lcat.loading.images module¶
Authors: Connor Brinton and Scotty Fleming Load a CT scan from a series of dicom files.
lcat.loading.scans module¶
Load data for a chest CT scan from both dicom and radiologist xml files.
-
class
lcat.loading.scans.
Scan
(patient_id, voxels, nodules, unit_cell)¶ Bases:
tuple
-
nodules
¶ Alias for field number 2
-
patient_id
¶ Alias for field number 0
-
unit_cell
¶ Alias for field number 3
-
voxels
¶ Alias for field number 1
-
-
lcat.loading.scans.
cubify_scan
(scan)[source]¶ Given a scan, interpolate the data to make the unit cell cubic. The dimension(s) with the smallest magnitude(s) in the unit cell will remain the same.
-
lcat.loading.scans.
get_scaling_factors
(scan)[source]¶ Returns the scaling factors for the given scan.
-
lcat.loading.scans.
interpolate_array
(array, new_shape, output=None, mode='nearest')[source]¶ Given an array and a target shape, perform an orthogonal transformation to the new shape using a spline interpolation.
-
lcat.loading.scans.
interpolate_array_by_axis
(array, axis_coordinates, output=None, mode='nearest')[source]¶
-
lcat.loading.scans.
load_scan
(scan_folder, cubify=False)[source]¶ Loads the CT scan as a 3d voxel array, then loads the segmentation in the given dicom_folder by reading any xml files located in the folder and referencing dicom files as necessary. Returns a 3D mask with the same dimensions as the CT scan.
TODO: Combine nodules referring to the same entity. Unfortunately there is currently no unique ID for each nodule, meaning that multiple radiologist reads result in multiple almost-identical nodules in the scan metadata.
-
lcat.loading.scans.
rescale_nodule
(nodule, scaling_factors)[source]¶ This interpolation process is trickier than the voxel interpolation process, because we’re not only rescaling the mask, we’re also moving the origin of the mask. In order to properly perform this interpolation, we perform the following steps: (1) Find the scaled origin as real numbers (not rounded) (2) Find the scaled anti-origin (opposite corner) as real numbers (not rounded) (3) Count the number of scaled cells along each dimension for mask (4) Convert rounded extents to original space (5) Perform rescaling by axis coordinates
Module contents¶
Loading package of the Lung Cancer Action Team toolkit.