diff --git a/Modules/AlgorithmsExt/include/itkIntelligentBinaryClosingFilter.h b/Modules/AlgorithmsExt/include/itkIntelligentBinaryClosingFilter.h index 846211b1f2..20423e6434 100644 --- a/Modules/AlgorithmsExt/include/itkIntelligentBinaryClosingFilter.h +++ b/Modules/AlgorithmsExt/include/itkIntelligentBinaryClosingFilter.h @@ -1,139 +1,137 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __itkIntelligentBinaryClosingFilter_h #define __itkIntelligentBinaryClosingFilter_h #if defined(_MSC_VER) #pragma warning(disable : 4786) #endif #include #include #include #include #include #include #include #include #include #include namespace itk { /** \class itkIntelligentBinaryClosingFilter * WARNING: This filtezr needs at least ITK version 3.2 * or above to run and compile!!! * */ template class ITK_EXPORT IntelligentBinaryClosingFilter : public ImageToImageFilter { public: /** Standard "Self" typedef. */ typedef IntelligentBinaryClosingFilter Self; /** The type of input image. */ typedef TInputImage InputImageType; /** Dimension of the input and output images. */ itkStaticConstMacro(ImageDimension, unsigned int, TInputImage::ImageDimension); /** The type of output image. */ typedef TOutputImage OutputImageType; /** Standard super class typedef support. */ typedef ImageToImageFilter Superclass; /** Smart pointer typedef support */ typedef SmartPointer Pointer; /** Run-time type information (and related methods) */ itkTypeMacro(IntelligentBinaryClosingFilter, ImageToImageFilter); /** Method for creation through the object factory. */ itkFactorylessNewMacro(Self) itkCloneMacro(Self) /** Standard process object method. This filter is not multithreaded. */ void GenerateData() override; /** Overloaded to link the input to this filter with the input of the mini-pipeline */ void SetInput(const InputImageType *input) override { // processObject is not const-correct so a const_cast is needed here this->ProcessObject::SetNthInput(0, const_cast(input)); m_DilateImageFilter->SetInput(input); } using Superclass::SetInput; void SetInput(unsigned int i, const TInputImage *image) override { if (i != 0) { itkExceptionMacro(<< "Filter has only one input."); } else { this->SetInput(image); } } itkGetMacro(ClosingRadius, float); itkSetMacro(ClosingRadius, float); itkGetMacro(SurfaceRatio, float); itkSetMacro(SurfaceRatio, float); protected: IntelligentBinaryClosingFilter(); ~IntelligentBinaryClosingFilter() override {} - IntelligentBinaryClosingFilter(const Self &) {} - void operator=(const Self &) {} void PrintSelf(std::ostream &os, Indent indent) const override; private: typedef typename InputImageType::PixelType InputPixelType; typedef BinaryBallStructuringElement StructuringElementType; typedef BinaryErodeImageFilter BinaryErodeImageFilterType; typedef BinaryDilateImageFilter BinaryDilateImageFilterType; typedef SubtractImageFilter SubtractImageFilterType; typedef ConnectedComponentImageFilter ConnectedComponentImageFilterType; typedef RelabelComponentImageFilter RelabelComponentImageFilterType; typedef GrayscaleDilateImageFilter DilateComponentImageFilterType; typedef ImageRegionIterator InputIteratorType; typedef ImageRegionConstIterator ConstInputIteratorType; typedef ImageRegionIterator OutputIteratorType; typename BinaryErodeImageFilterType::Pointer m_ErodeImageFilter; typename BinaryDilateImageFilterType::Pointer m_DilateImageFilter; typename SubtractImageFilterType::Pointer m_SubtractImageFilter; typename ConnectedComponentImageFilterType::Pointer m_ConnectedComponentImageFilter; typename RelabelComponentImageFilterType::Pointer m_RelabelComponentImageFilter; typename DilateComponentImageFilterType::Pointer m_BorderDetectionDilateFilter; // typename BinaryDilateImageFilterType::Pointer m_BorderAdjacencyDilateFilter; float m_ClosingRadius; float m_SurfaceRatio; }; } // end namespace itk #ifndef ITK_MANUAL_INSTANTIATION #include "itkIntelligentBinaryClosingFilter.txx" #endif #endif // IntelligentBinaryClosingFilter_h