ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkGrayscaleConnectedClosingImageFilter.h
Go to the documentation of this file.
00001 /*=========================================================================
00002  *
00003  *  Copyright Insight Software Consortium
00004  *
00005  *  Licensed under the Apache License, Version 2.0 (the "License");
00006  *  you may not use this file except in compliance with the License.
00007  *  You may obtain a copy of the License at
00008  *
00009  *         http://www.apache.org/licenses/LICENSE-2.0.txt
00010  *
00011  *  Unless required by applicable law or agreed to in writing, software
00012  *  distributed under the License is distributed on an "AS IS" BASIS,
00013  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  *  See the License for the specific language governing permissions and
00015  *  limitations under the License.
00016  *
00017  *=========================================================================*/
00018 #ifndef __itkGrayscaleConnectedClosingImageFilter_h
00019 #define __itkGrayscaleConnectedClosingImageFilter_h
00020 
00021 #include "itkImageToImageFilter.h"
00022 
00023 namespace itk
00024 {
00044 template< class TInputImage, class TOutputImage >
00045 class ITK_EXPORT GrayscaleConnectedClosingImageFilter:
00046   public ImageToImageFilter< TInputImage, TOutputImage >
00047 {
00048 public:
00050   typedef GrayscaleConnectedClosingImageFilter            Self;
00051   typedef ImageToImageFilter< TInputImage, TOutputImage > Superclass;
00052   typedef SmartPointer< Self >                            Pointer;
00053   typedef SmartPointer< const Self >                      ConstPointer;
00054 
00056   typedef TInputImage                              InputImageType;
00057   typedef typename InputImageType::Pointer         InputImagePointer;
00058   typedef typename InputImageType::ConstPointer    InputImageConstPointer;
00059   typedef typename InputImageType::RegionType      InputImageRegionType;
00060   typedef typename InputImageType::PixelType       InputImagePixelType;
00061   typedef typename InputImageRegionType::IndexType InputImageIndexType;
00062   typedef TOutputImage                             OutputImageType;
00063   typedef typename OutputImageType::Pointer        OutputImagePointer;
00064   typedef typename OutputImageType::ConstPointer   OutputImageConstPointer;
00065   typedef typename OutputImageType::RegionType     OutputImageRegionType;
00066   typedef typename OutputImageType::PixelType      OutputImagePixelType;
00067 
00069   itkStaticConstMacro(InputImageDimension, unsigned int,
00070                       TInputImage::ImageDimension);
00071   itkStaticConstMacro(OutputImageDimension, unsigned int,
00072                       TOutputImage::ImageDimension);
00074 
00076   itkNewMacro(Self);
00077 
00079   itkTypeMacro(GrayscaleConnectedClosingImageFilter,
00080                ImageToImageFilter);
00081 
00083   itkSetMacro(Seed, InputImageIndexType);
00084   itkGetConstMacro(Seed, InputImageIndexType);
00086 
00093   itkSetMacro(FullyConnected, bool);
00094   itkGetConstReferenceMacro(FullyConnected, bool);
00095   itkBooleanMacro(FullyConnected);
00097 
00098 #ifdef ITK_USE_CONCEPT_CHECKING
00099 
00100   itkConceptMacro( InputEqualityComparableCheck,
00101                    ( Concept::EqualityComparable< InputImagePixelType > ) );
00102   itkConceptMacro( InputConvertibleToOutputCheck,
00103                    ( Concept::Convertible< InputImagePixelType, OutputImagePixelType > ) );
00104   itkConceptMacro( InputOStreamWritableCheck,
00105                    ( Concept::OStreamWritable< InputImagePixelType > ) );
00106 
00108 #endif
00109 protected:
00110   GrayscaleConnectedClosingImageFilter();
00111   ~GrayscaleConnectedClosingImageFilter() {}
00112   void PrintSelf(std::ostream & os, Indent indent) const;
00114 
00118   void GenerateInputRequestedRegion();
00119 
00121   void EnlargeOutputRequestedRegion( DataObject *itkNotUsed(output) );
00122 
00125   void GenerateData();
00126 
00127 private:
00128   GrayscaleConnectedClosingImageFilter(const Self &); //purposely not
00129                                                       // implemented
00130   void operator=(const Self &);                       //purposely not
00131 
00132   // implemented
00133 
00134   unsigned long       m_NumberOfIterationsUsed;
00135   InputImageIndexType m_Seed;
00136 
00137   bool m_FullyConnected;
00138 }; // end of class
00139 } // end namespace itk
00140 
00141 #ifndef ITK_MANUAL_INSTANTIATION
00142 #include "itkGrayscaleConnectedClosingImageFilter.hxx"
00143 #endif
00144 
00145 #endif
00146