1 #ifndef itkGrowCutSegmentationImageFilter_h 2 #define itkGrowCutSegmentationImageFilter_h 5 #include "itkImageToImageFilter.h" 6 #include "itkSimpleDataObjectDecorator.h" 7 #include "itkVectorContainer.h" 12 #include <vcl_compiler.h> 57 template<
class TInputImage,
59 class TWeightPixelType =
float>
66 typedef ImageToImageFilter<TInputImage,TOutputImage>
Superclass;
79 TInputImage::ImageDimension );
87 typedef typename InputImageType::SizeType
SizeType;
103 TInputImage::ImageDimension);
105 TOutputImage::ImageDimension);
108 typedef Index<itkGetStaticConstMacro(InputImageDimension)>
IndexType;
128 typedef Image<TWeightPixelType, itkGetStaticConstMacro(InputImageDimension) >
WeightImageType;
138 this->ProcessObject::SetNthInput(0, const_cast< InputImageType *>(in) );
146 this->ProcessObject::SetNthInput(1, const_cast< OutputImageType *>(f) );
147 m_LabelImage =
static_cast< OutputImageType *
>(this->ProcessObject::GetInput(1));
158 this->ProcessObject::SetNthInput(2,const_cast< WeightImageType *>(w));
279 ThreadIdType threadId ) ITK_OVERRIDE;
285 void PrintSelf ( std::ostream& os, Indent indent )
const ITK_OVERRIDE;
293 void operator=(
const Self&);
295 bool InitializeStateImage( OutputImageType *state );
297 void InitializeDistancesImage(TInputImage *input,WeightImageType *distance);
299 void GetRegionOfInterest();
301 void ComputeLabelVolumes(TOutputImage *outputImage, std::vector< unsigned > &volumes, std::vector< unsigned > &phyVolumes);
303 void MaskSegmentedImageByWeight(
float upperThresh);
306 WeightPixelType m_ConfThresh;
307 InputSizeType m_Radius;
308 OutputImagePointer m_LabelImage;
309 WeightImagePointer m_WeightImage;
310 unsigned int m_Labeled;
311 unsigned int m_LocallySaturated;
312 unsigned int m_Saturated;
314 double m_SeedStrength;
315 bool m_RunOneIteration;
316 bool m_SetStateImage;
317 bool m_SetDistancesImage;
318 bool m_SetMaxSaturationImage;
320 unsigned int m_MaxIterations;
321 unsigned int m_ObjectRadius;
323 OutputPixelType m_ObjectLabel;
324 OutputPixelType m_BackgroundLabel;
325 OutputPixelType m_UnknownLabel;
327 OutputIndexType m_RoiStart;
328 OutputIndexType m_RoiEnd;
335 #ifndef ITK_MANUAL_INSTANTIATION 336 #include "itkGrowCutSegmentationImageFilter.txx" ~GrowCutSegmentationImageFilter()
void ThreadedGenerateData(const OutputImageRegionType &outputRegionForThread, ThreadIdType threadId) ITK_OVERRIDE
void GenerateInputRequestedRegion() ITK_OVERRIDE
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
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 AfterThreadedGenerateData() ITK_OVERRIDE
Index< itkGetStaticConstMacro(InputImageDimension)> IndexType
void SetInputImage(const InputImageType *in)
const OutputImagePointer GetStateImage()
InputImageType::ConstPointer InputImageConstPointer
TInputImage InputImageType
InputImageType::Pointer InputImagePointer
void PrintSelf(std::ostream &os, Indent indent) const ITK_OVERRIDE
TOutputImage OutputImageType
InputImageType::SizeType InputSizeType
OutputImageType::Pointer OutputImagePointer
const WeightImagePointer GetDistancesImage()
void GenerateData() ITK_OVERRIDE
VectorContainer< unsigned int, IndexType > NodeContainer
void EnlargeOutputRequestedRegion(DataObject *output) ITK_OVERRIDE
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 Initialize(OutputImageType *output)
itkSetMacro(SeedStrength, double)