ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkGrayscaleConnectedOpeningImageFilter.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 __itkGrayscaleConnectedOpeningImageFilter_h
00019 #define __itkGrayscaleConnectedOpeningImageFilter_h
00020 
00021 #include "itkImageToImageFilter.h"
00022 
00023 namespace itk
00024 {
00045 template< class TInputImage, class TOutputImage >
00046 class ITK_EXPORT GrayscaleConnectedOpeningImageFilter:
00047   public ImageToImageFilter< TInputImage, TOutputImage >
00048 {
00049 public:
00051   typedef GrayscaleConnectedOpeningImageFilter            Self;
00052   typedef ImageToImageFilter< TInputImage, TOutputImage > Superclass;
00053   typedef SmartPointer< Self >                            Pointer;
00054   typedef SmartPointer< const Self >                      ConstPointer;
00055 
00057   typedef TInputImage                              InputImageType;
00058   typedef typename InputImageType::Pointer         InputImagePointer;
00059   typedef typename InputImageType::ConstPointer    InputImageConstPointer;
00060   typedef typename InputImageType::RegionType      InputImageRegionType;
00061   typedef typename InputImageType::PixelType       InputImagePixelType;
00062   typedef typename InputImageRegionType::IndexType InputImageIndexType;
00063   typedef TOutputImage                             OutputImageType;
00064   typedef typename OutputImageType::Pointer        OutputImagePointer;
00065   typedef typename OutputImageType::ConstPointer   OutputImageConstPointer;
00066   typedef typename OutputImageType::RegionType     OutputImageRegionType;
00067   typedef typename OutputImageType::PixelType      OutputImagePixelType;
00068 
00070   itkStaticConstMacro(InputImageDimension, unsigned int,
00071                       TInputImage::ImageDimension);
00072   itkStaticConstMacro(OutputImageDimension, unsigned int,
00073                       TOutputImage::ImageDimension);
00075 
00077   itkNewMacro(Self);
00078 
00080   itkTypeMacro(GrayscaleConnectedOpeningImageFilter,
00081                ImageToImageFilter);
00082 
00084   itkSetMacro(Seed, InputImageIndexType);
00085   itkGetConstMacro(Seed, InputImageIndexType);
00087 
00094   itkSetMacro(FullyConnected, bool);
00095   itkGetConstReferenceMacro(FullyConnected, bool);
00096   itkBooleanMacro(FullyConnected);
00098 
00099 #ifdef ITK_USE_CONCEPT_CHECKING
00100 
00101   itkConceptMacro( InputEqualityComparableCheck,
00102                    ( Concept::EqualityComparable< InputImagePixelType > ) );
00103   itkConceptMacro( InputConvertibleToOutputCheck,
00104                    ( Concept::Convertible< InputImagePixelType, OutputImagePixelType > ) );
00105   itkConceptMacro( InputOStreamWritableCheck,
00106                    ( Concept::OStreamWritable< InputImagePixelType > ) );
00107 
00109 #endif
00110 protected:
00111   GrayscaleConnectedOpeningImageFilter();
00112   ~GrayscaleConnectedOpeningImageFilter() {}
00113   void PrintSelf(std::ostream & os, Indent indent) const;
00115 
00119   void GenerateInputRequestedRegion();
00120 
00122   void EnlargeOutputRequestedRegion( DataObject *itkNotUsed(output) );
00123 
00126   void GenerateData();
00127 
00128 private:
00129   GrayscaleConnectedOpeningImageFilter(const Self &); //purposely not
00130                                                       // implemented
00131   void operator=(const Self &);                       //purposely not
00132 
00133   // implemented
00134 
00135   unsigned long       m_NumberOfIterationsUsed;
00136   InputImageIndexType m_Seed;
00137 
00138   bool m_FullyConnected;
00139 }; // end of class
00140 } // end namespace itk
00141 
00142 #ifndef ITK_MANUAL_INSTANTIATION
00143 #include "itkGrayscaleConnectedOpeningImageFilter.hxx"
00144 #endif
00145 
00146 #endif
00147