18 #ifndef itkShapePositionLabelMapFilter_h
19 #define itkShapePositionLabelMapFilter_h
38 template <
typename TImage>
61 static constexpr
unsigned int ImageDimension = TImage::ImageDimension;
69 #ifdef ITK_USE_CONCEPT_CHECKING
89 this->SetAttribute(LabelObjectType::GetAttributeFromName(s));
98 ThreadedProcessLabelObject(LabelObjectType * labelObject)
override;
100 template <
typename TAttributeAccessor>
104 using AttributeValueType =
typename TAttributeAccessor::AttributeValueType;
105 AttributeValueType position = accessor(labelObject);
110 using CoordinateType = double;
113 for (
unsigned int i = 0; i < ImageDimension; ++i)
118 point[i] = static_cast<OffsetValueType>(position[i]);
121 idx = this->GetOutput()->TransformPhysicalPointToIndex(
point);
126 for (
unsigned int i = 0; i < ImageDimension; ++i)
128 idx[i] = static_cast<IndexValueType>(position[i]);
132 labelObject->Clear();
134 labelObject->AddIndex(idx);
138 PrintSelf(std::ostream & os,
Indent indent)
const override;
145 #ifndef ITK_MANUAL_INSTANTIATION
146 # include "itkShapePositionLabelMapFilter.hxx"