13 #ifndef itkLabelSampler_h
14 #define itkLabelSampler_h
16 #include <itkImageToImageFilter.h>
29 template<
class TImage>
42 itkTypeMacro(
Self, ImageToImageFilter);
43 itkSetMacro(AcceptRate,
double);
44 itkSetMacro(Label,
int);
45 itkGetMacro(LabelVoxelCountMap,
outmap);
46 itkGetMacro(NumberOfSampledVoxels,
int);
55 if(m_LabelVoxelCountMap.empty())
57 return m_LabelVoxelCountMap[label];
64 ,m_UseLabelVoxelCount(false)
66 this->SetNumberOfRequiredInputs(1);
67 this->SetNumberOfRequiredOutputs(1);
77 void operator=(
const Self &);
80 int m_NumberOfSampledVoxels;
82 bool m_UseLabelVoxelCount;
83 std::map<int,int> m_LabelVoxelCountMap;
88 #ifndef ITK_MANUAL_INSTANTIATION
89 #include "../src/Algorithms/itkLabelSampler.cpp"
Randomly sub-samples voxels from a label image based on an acceptance rate.
std::map< int, int > outmap
SmartPointer< Self > Pointer
virtual void GenerateData()
ImageToImageFilter< TImage, TImage > Superclass
int GetLabelVoxelCount(int label)
Get the voxel count for a specific label value.