This is a Python tool to manually segment myocardial images according to the American Heart Association (AHA) 16-segment model.
Tested and confirmed to work on:
Load a numpy.array
containing your myocardial image and a numpy.array
containing the corresponding myocardial mask.
To initialize the main class, select the type of segmentation you want to perform: basal
, mid
, or apical
.
import numpy as np
from AHA_segmentation import AHA_segmentation
image = np.load(example_image.npy)
mask = np.load('example_mask.npy')
Segmentation_class = AHA_segmentation(image, mask, mode='basal')
This will create the main figure with the segmentation guidelines:
Call the segment()
method and adjust the sliders until the guidelines are positioned correctly. The right ventricle should be positioned in the area defined by the rlines marked with a circle and a square.
Segmentation_class.segment()
Call the save_segment()
method to save. This will return a numpy.array
mask whose values correspond to the AHA segment in each area.
mask = Segmentation_class.save_segments()