ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkGrayscaleGeodesicErodeImageFilter.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 __itkGrayscaleGeodesicErodeImageFilter_h
00019 #define __itkGrayscaleGeodesicErodeImageFilter_h
00020 
00021 #include "itkImageToImageFilter.h"
00022 
00023 namespace itk
00024 {
00064 template< class TInputImage, class TOutputImage >
00065 class ITK_EXPORT GrayscaleGeodesicErodeImageFilter:
00066   public ImageToImageFilter< TInputImage, TOutputImage >
00067 {
00068 public:
00070   typedef GrayscaleGeodesicErodeImageFilter               Self;
00071   typedef ImageToImageFilter< TInputImage, TOutputImage > Superclass;
00072   typedef SmartPointer< Self >                            Pointer;
00073   typedef SmartPointer< const Self >                      ConstPointer;
00074 
00076   typedef TInputImage                            MarkerImageType;
00077   typedef typename MarkerImageType::Pointer      MarkerImagePointer;
00078   typedef typename MarkerImageType::ConstPointer MarkerImageConstPointer;
00079   typedef typename MarkerImageType::RegionType   MarkerImageRegionType;
00080   typedef typename MarkerImageType::PixelType    MarkerImagePixelType;
00081   typedef TInputImage                            MaskImageType;
00082   typedef typename MaskImageType::Pointer        MaskImagePointer;
00083   typedef typename MaskImageType::ConstPointer   MaskImageConstPointer;
00084   typedef typename MaskImageType::RegionType     MaskImageRegionType;
00085   typedef typename MaskImageType::PixelType      MaskImagePixelType;
00086   typedef TOutputImage                           OutputImageType;
00087   typedef typename OutputImageType::Pointer      OutputImagePointer;
00088   typedef typename OutputImageType::ConstPointer OutputImageConstPointer;
00089   typedef typename OutputImageType::RegionType   OutputImageRegionType;
00090   typedef typename OutputImageType::PixelType    OutputImagePixelType;
00091 
00093   itkStaticConstMacro(MarkerImageDimension, unsigned int,
00094                       TInputImage::ImageDimension);
00095   itkStaticConstMacro(MaskImageDimension, unsigned int,
00096                       TInputImage::ImageDimension);
00097   itkStaticConstMacro(OutputImageDimension, unsigned int,
00098                       TOutputImage::ImageDimension);
00100 
00102   itkNewMacro(Self);
00103 
00105   itkTypeMacro(GrayscaleGeodesicErodeImageFilter,
00106                ImageToImageFilter);
00107 
00111   void SetMarkerImage(const MarkerImageType *);
00112 
00113   const MarkerImageType * GetMarkerImage();
00114 
00118   void SetMaskImage(const MaskImageType *);
00119 
00120   const MaskImageType * GetMaskImage();
00121 
00125   itkSetMacro(RunOneIteration, bool);
00126   itkGetConstMacro(RunOneIteration, bool);
00127   itkBooleanMacro(RunOneIteration);
00129 
00132   itkGetConstMacro(NumberOfIterationsUsed, unsigned long);
00133 
00140   itkSetMacro(FullyConnected, bool);
00141   itkGetConstReferenceMacro(FullyConnected, bool);
00142   itkBooleanMacro(FullyConnected);
00144 
00145 #ifdef ITK_USE_CONCEPT_CHECKING
00146 
00147   itkConceptMacro( SameDimensionCheck,
00148                    ( Concept::SameDimension< MarkerImageDimension, OutputImageDimension > ) );
00149   itkConceptMacro( InputComparableCheck,
00150                    ( Concept::Comparable< MarkerImagePixelType > ) );
00151   itkConceptMacro( InputConvertibleToOutputCheck,
00152                    ( Concept::Convertible< MarkerImagePixelType, OutputImagePixelType > ) );
00153 
00155 #endif
00156 protected:
00157   GrayscaleGeodesicErodeImageFilter();
00158   ~GrayscaleGeodesicErodeImageFilter() {}
00159   void PrintSelf(std::ostream & os, Indent indent) const;
00161 
00168   void GenerateInputRequestedRegion();
00169 
00174   void EnlargeOutputRequestedRegion( DataObject *itkNotUsed(output) );
00175 
00182   void GenerateData();
00183 
00188   void ThreadedGenerateData(const OutputImageRegionType &
00189                             outputRegionForThread,
00190                             ThreadIdType threadId);
00191 
00192 private:
00193   GrayscaleGeodesicErodeImageFilter(const Self &); //purposely not implemented
00194   void operator=(const Self &);                    //purposely not implemented
00195 
00196   bool          m_RunOneIteration;
00197   unsigned long m_NumberOfIterationsUsed;
00198   bool          m_FullyConnected;
00199 }; // end of class
00200 } // end namespace itk
00201 
00202 #ifndef ITK_MANUAL_INSTANTIATION
00203 #include "itkGrayscaleGeodesicErodeImageFilter.hxx"
00204 #endif
00205 
00206 #endif
00207