18 #ifndef itkShapePositionLabelMapFilter_h
19 #define itkShapePositionLabelMapFilter_h
39 template <
typename TImage>
62 static constexpr
unsigned int ImageDimension = TImage::ImageDimension;
70 #ifdef ITK_USE_CONCEPT_CHECKING
90 this->SetAttribute(LabelObjectType::GetAttributeFromName(s));
99 ThreadedProcessLabelObject(LabelObjectType * labelObject)
override;
101 template <
typename TAttributeAccessor>
105 using AttributeValueType =
typename TAttributeAccessor::AttributeValueType;
106 AttributeValueType position = accessor(labelObject);
111 using CoordinateType = double;
114 for (
unsigned int i = 0; i < ImageDimension; i++)
119 point[i] = static_cast<OffsetValueType>(position[i]);
122 this->GetOutput()->TransformPhysicalPointToIndex(point, idx);
127 for (
unsigned int i = 0; i < ImageDimension; i++)
129 idx[i] = static_cast<IndexValueType>(position[i]);
133 labelObject->Clear();
135 labelObject->AddIndex(idx);
139 PrintSelf(std::ostream & os,
Indent indent)
const override;
146 #ifndef ITK_MANUAL_INSTANTIATION
147 # include "itkShapePositionLabelMapFilter.hxx"