With the Spine Localization and Segmentation algorithm is there a way you can export the sacrum segmentation as a labelmap? It seems to only export the vertebrae.
To convert all anatomical structures including sacrum to a label map from the Suite, select the source image and the Spine Data and run the “Anatomy;Convert Anatomical Structure to Label Map” algorithm. In the SDK, you can use AnatomicalStructureProcessing::ConvertToMultiLabelMap
. The label map indices are in order of the anatomical structures and the label map grid is defined by the image.
Alternatively, you can also use MeshToLabelMapAlgorithm
directly on the mesh:
SharedImageSet* originalSourceImage = ...
const auto& sacrum = spineBaseAlgorithm.spineData().sacrum();
if (sacrum.meshes().has(Keys::Spine::Sacrum::key))
{
const auto& mesh = sacrum.meshes().get(Keys::Spine::Sacrum::key);
MeshToLabelMapAlgorithm toLabel(&mesh, originalSourceImage);
toLabel.compute();
auto label = toLabel.takeOutput().extractFirstImage();
...
}
1 Like