AortaGeomReconDisplayModuleLib package¶
Submodules¶
AortaGeomReconEnums module¶
AortaSegmenter module¶
- class AortaSegmenter.AortaSegmenter(cropped_image, des_seed, asc_seed, stop_limit=10, threshold_coef=3, kernel_size=6, rms_error=0.02, no_ite=600, curvature_scaling=2, propagation_scaling=0.5, debug=False)¶
Bases:
object
This class contains the data structure and the algorithm to perfrom aorta segmentation.
- cropped_image¶
The original image that the user has only perform cropping.
- Type:
SITK::image
- des_seed¶
A tuple of 3 integers indicates the centre of Descending aorta on an axial slice.
- Type:
tuple
- asc_seed¶
A tuple of 3 integers indicates the centre of Ascending aorta on an axial slice.
- Type:
tuple
- num_slice_skipping¶
The number of slice allowed to consecutively skip by the algorithm.
- Type:
int
- stop_limit¶
The number to signal the stopping point in the segmentation loop.
- Type:
float
- threshold_coef¶
This coefficient controls the lower and upper pixel intensity threshold.
- Type:
float
- kernel_size¶
The size used to generate circle like shape for the label map. Large kernel size implies larger initial circle size.
- Type:
int
- rms_error¶
The rms error for ThresholdSegmentationLevelSetImageFilter.
- Type:
float
- no_ite¶
The maximum iterations for ThresholdSegmentationLevelSetImageFilter.
- Type:
int
- curvature_scaling¶
The weight of curvature on calculating the speed term for ThresholdSegmentationLevelSetImageFilter.
- Type:
float
- propagation_scaling¶
The weight of propagation on calculating the speed term for ThresholdSegmentationLevelSetImageFilter.
- Type:
float
- __calculate_centroids(points, asc_c, des_c)¶
Calculate new descending aorta and ascending aorta centroid.
- Parameters:
points (list) – A list of points coordinate
asc_c (tuple) – The previous ascending aorta centroid coordinate
des_c (tuple) – The previous descending aorta centroid coordinate
- Returns:
list containing:
(tuple): The new descending aorta centroid coordinate
(tuple): The new ascending aorta centroid coordinate
- Return type:
(list)
- __get_dist(p1, p2)¶
Calculate the Euclidean distance between any two points.
- Parameters:
p1 (tuple) – a point’s coordinate
p2 (tuple) – a point’s coordinate
- Returns:
The Euclidean distance between p1 and p2.
- Return type:
float
- __get_image_segment()¶
1. Use SITK::BinaryDilate to create a label image of the processing slice. Use the previous centroid(s) coordinate and dilate with the given kernel_size in a ball shape.
2. Use SITK::LabelStatisticsImageFilter to get the mean and the standard deviation of the intensity values of white pixel (label of 1). Use the mean and the std to calculate the threshold for segmentation image filter.
Use SITK::SignedMaurerDistanceMap to calculate the signed squared Euclidean distance transform of the label image.
5. Finally, use the Euclidean distance transform from the previous step as seed image to perform segmentation with SITK::ThresholdSegmentationLevelSetImageFilter and
- Returns:
Segmented slice label image
- Return type:
SITK::image
- __get_new_centroids(new_slice)¶
Calculate new centroids on the segmented slice.
- Parameters:
new_slice (SITK::image) – Segmentation result label image.
- Returns:
- tuple containing:
tuple: The new derived centroid coordinate closest to the previous descending aorta centroid.
tuple: The new derived centroid coordinate closest to the previous ascending aorta centroid.
- Return type:
(tuple)
- __is_asc_reaching_heart(asc_c)¶
The stop condition of ascending aorta segmentation from Superior to Inferior direction. Once the segmentation result reaches the heart, the new centroid will locate far from the previous ascending aorta centroid.
- Parameters:
asc_c (tuple) – The new centroid closer to the ascending aorta.
- Returns:
The distance between new centroid and the previous ascending aorta centroid reaches the stop limit.
- Return type:
Boolean
- __prepare_label_map()¶
Create a label map image that has a circle-like shape around the previous descending aorta centroid and ascending aorta centroid (if any). The pixels within the circle are labeled as white pixels (value of 1), the other are labeled as black pixels (value of 0).
- Returns:
A label map image that has a circle like shape around the previous descending aorta centroid and ascending aorta centroid.
- Return type:
SITK::IMAGE
- __segmentation()¶
The main loop of the segmentation algorithm. For each axial slice, the algorithm performs segmetation with get_image_segment function. Next, the algorithm calculates new centroids based on the segmented slice. Repeat this process until the stop condition has reached. The stop conditions are:
The distance from the new ascending centroid to the previous ascending centroid reaches the stop limit.
The difference of the std of the initial label image and of the final segmented label image reaches the stop limit.
The first stop condition only removes the ascending aorta centroid from the segmentation process, the segmentation of descending aorta is unaffected.
- begin_segmentation()¶
This is the main entry point of the segmentation algorithm. This api should be called to perform aorta segmentation. (superior to inferior, then inferior to superior starting from the seed slice).
- property processing_image¶
processing image getter. The prcoessing image is the segmentation result, in form of a 3D label image.
- property stopping_slice¶
stopping slice getter. Return the last processing slice for debug purpose.