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