1 #ifndef itkGrowCutSegmentationImageFilter_h 2 #define itkGrowCutSegmentationImageFilter_h 5 #include "itkImageToImageFilter.h" 6 #include "itkSimpleDataObjectDecorator.h" 7 #include "itkVectorContainer.h" 55 template<
class TInputImage,
57 class TWeightPixelType =
float>
64 typedef ImageToImageFilter<TInputImage,TOutputImage>
Superclass;
77 TInputImage::ImageDimension );
85 typedef typename InputImageType::SizeType
SizeType;
101 TInputImage::ImageDimension);
103 TOutputImage::ImageDimension);
106 typedef Index<itkGetStaticConstMacro(InputImageDimension)>
IndexType;
126 typedef Image<TWeightPixelType, itkGetStaticConstMacro(InputImageDimension) >
WeightImageType;
136 this->ProcessObject::SetNthInput(0, const_cast< InputImageType *>(in) );
144 this->ProcessObject::SetNthInput(1, const_cast< OutputImageType *>(f) );
145 m_LabelImage =
static_cast< OutputImageType *
>(this->ProcessObject::GetInput(1));
156 this->ProcessObject::SetNthInput(2,const_cast< WeightImageType *>(w));
277 ThreadIdType threadId )
override;
283 void PrintSelf ( std::ostream& os, Indent indent )
const override;
291 void operator=(
const Self&);
295 void InitializeDistancesImage(TInputImage *input,
WeightImageType *distance);
297 void GetRegionOfInterest();
299 void ComputeLabelVolumes(TOutputImage *outputImage, std::vector< unsigned > &volumes, std::vector< unsigned > &phyVolumes);
301 void MaskSegmentedImageByWeight(
float upperThresh);
308 unsigned int m_Labeled;
309 unsigned int m_LocallySaturated;
310 unsigned int m_Saturated;
312 double m_SeedStrength;
313 bool m_RunOneIteration;
314 bool m_SetStateImage;
315 bool m_SetDistancesImage;
316 bool m_SetMaxSaturationImage;
318 unsigned int m_MaxIterations;
319 unsigned int m_ObjectRadius;
333 #ifndef ITK_MANUAL_INSTANTIATION 334 #include "itkGrowCutSegmentationImageFilter.txx" itkBooleanMacro(RunOneIteration)
const WeightImagePointer GetStrengthImage()
void SetStrengthImage(const WeightImageType *w)
DataObject::Pointer DataObjectPointer
void SetStateImage(const OutputImageType *l)
WeightImageType::Pointer WeightImagePointer
OutputIndexType GetROIEnd() const
void SetROIEnd(const OutputIndexType &end)
InputImageType::PixelType InputPixelType
GrowCutSegmentationImageFilter()
Simplified inverse ITK transforms.
const OutputImagePointer GetLabelImage()
NodeContainer::Pointer NodeContainerPointer
Image< TWeightPixelType, itkGetStaticConstMacro(InputImageDimension) > WeightImageType
const WeightImagePointer GetMaxSaturationImage()
InputImageType::IndexType InputIndexType
~GrowCutSegmentationImageFilter() override=default
void ThreadedGenerateData(const OutputImageRegionType &outputRegionForThread, ThreadIdType threadId) override
void GenerateData() override
void AfterThreadedGenerateData() override
OutputImageType::RegionType OutputImageRegionType
const InputImagePointer GetInputImage()
OutputIndexType GetROIStart() const
itkStaticConstMacro(ImageDimension, unsigned int, TInputImage::ImageDimension)
itkGetMacro(Labeled, unsigned int)
void SetLabelImage(const OutputImageType *f)
InputImageType::SizeType SizeType
InputImageType::SizeType OutputSizeType
void SetMaxSaturationImage(const WeightImageType *w)
SmartPointer< const Self > ConstPointer
void GrowCutSlowROI(TOutputImage *)
itkGetConstMacro(SeedStrength, double)
itkTypeMacro(GrowCutSegmentationImageFilter, ImageToImageFilter)
ImageToImageFilter< TInputImage, TOutputImage > Superclass
void EnlargeOutputRequestedRegion(DataObject *output) override
Index< itkGetStaticConstMacro(InputImageDimension)> IndexType
void GenerateInputRequestedRegion() override
void SetInputImage(const InputImageType *in)
const OutputImagePointer GetStateImage()
InputImageType::ConstPointer InputImageConstPointer
TInputImage InputImageType
InputImageType::Pointer InputImagePointer
TOutputImage OutputImageType
InputImageType::SizeType InputSizeType
OutputImageType::Pointer OutputImagePointer
const WeightImagePointer GetDistancesImage()
VectorContainer< unsigned int, IndexType > NodeContainer
TWeightPixelType WeightPixelType
SmartPointer< Self > Pointer
const WeightImagePointer GetUpdatedStrengthImage()
void SetROIStart(const OutputIndexType &start)
OutputImageType::IndexType OutputIndexType
OutputImageType::PixelType OutputPixelType
GrowCutSegmentationImageFilter Self
void SetDistancesImage(const WeightImageType *d)
void PrintSelf(std::ostream &os, Indent indent) const override
void Initialize(OutputImageType *output)
itkSetMacro(SeedStrength, double)