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<FeatureImagePixelType>::value &&
sizeof(
FeatureImagePixelType) <= 2 ? 1u << bitsShift
153 ThreadedProcessLabelObject(LabelObjectType * labelObject)
override;
156 BeforeThreadedGenerateData()
override;
159 PrintSelf(std::ostream & os,
Indent indent)
const override;
164 unsigned int m_NumberOfBins{ GetDefaultNumberOfBins() };
165 bool m_ComputeHistogram{
true };
169 #ifndef ITK_MANUAL_INSTANTIATION
170 # include "itkStatisticsLabelMapFilter.hxx"