itk-labelpointset 0.1.0

Creator: bigcodingguy24

Last updated:

Add to Cart

Description:

itklabelpointset 0.1.0

ITKLabelPointSet





Overview
This is a module for the Insight Toolkit (ITK). The module includes a filter to extract a PointSet from a labeled image.
Additional filters and IO classes may be added in future versions to support pointset registration workflows.
import itk

labels = itk.imread('path/to/labelmap.mha').astype(itk.US)
D = labels.ndim

ImageType = type(labels)
PointSetType = itk.PointSet[itk.US, D]

extractor = itk.LabelToPointSetFilter[ImageType, PointSetType].New()
extractor.SetInput(labels)
extractor.Update()
point_set = extractor.GetOutput()

data = point_set.GetPointData()
for i in range(point_set.GetNumberOfPoints()):
print(f"{i}: {point_set.GetPoint(i)}, {data.GetElement(i)}")

Installation
To install the binary Python packages:
python -m pip install itk-labelpointset

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Customer Reviews

There are no reviews.