18 #ifndef itkStatisticsLabelMapFilter_h
19 #define itkStatisticsLabelMapFilter_h
40 template <
typename TImage,
typename TFeatureImage>
42 :
public ShapeLabelMapFilter<TImage, Image<typename TImage::PixelType, TImage::ImageDimension>>
70 static constexpr
unsigned int ImageDimension = TImage::ImageDimension;
78 #ifdef ITK_USE_CONCEPT_CHECKING
94 this->SetNthInput(1, const_cast<TFeatureImage *>(input));
108 this->SetInput(input);
115 this->SetFeatureImage(input);
124 itkSetMacro(ComputeHistogram,
bool);
125 itkGetConstReferenceMacro(ComputeHistogram,
bool);
126 itkBooleanMacro(ComputeHistogram);
134 itkSetMacro(NumberOfBins,
unsigned int);
135 itkGetConstReferenceMacro(NumberOfBins,
unsigned int);
139 static constexpr
unsigned int
142 constexpr
size_t bitsShift = std::min(8 *
sizeof(
FeatureImagePixelType), 8 *
sizeof(m_NumberOfBins) - 1);
144 return std::is_integral_v<FeatureImagePixelType> &&
sizeof(
FeatureImagePixelType) <= 2 ? 1u << bitsShift : 128u;
152 ThreadedProcessLabelObject(LabelObjectType * labelObject)
override;
155 BeforeThreadedGenerateData()
override;
158 PrintSelf(std::ostream & os,
Indent indent)
const override;
163 unsigned int m_NumberOfBins{ GetDefaultNumberOfBins() };
164 bool m_ComputeHistogram{
true };
168 #ifndef ITK_MANUAL_INSTANTIATION
169 # include "itkStatisticsLabelMapFilter.hxx"