Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itkMaskNeighborhoodOperatorImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkMaskNeighborhoodOperatorImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2006/03/29 14:53:40 $
00007   Version:   $Revision: 1.5 $
00008 
00009   Copyright (c) Insight Software Consortium. All rights reserved.
00010   See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
00011 
00012      This software is distributed WITHOUT ANY WARRANTY; without even 
00013      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00014      PURPOSE.  See the above copyright notices for more information.
00015 
00016 =========================================================================*/
00017 #ifndef __itkMaskNeighborhoodOperatorImageFilter_h
00018 #define __itkMaskNeighborhoodOperatorImageFilter_h
00019 
00020 #include "itkNeighborhoodOperatorImageFilter.h"
00021 
00022 namespace itk
00023 {
00043 template <class TInputImage, class TMaskImage, class TOutputImage, class TOperatorValueType=ITK_TYPENAME TOutputImage::PixelType>
00044 class ITK_EXPORT MaskNeighborhoodOperatorImageFilter :
00045     public NeighborhoodOperatorImageFilter< TInputImage, TOutputImage, TOperatorValueType > 
00046 {
00047 public:
00049   typedef MaskNeighborhoodOperatorImageFilter Self;
00050   typedef NeighborhoodOperatorImageFilter< TInputImage, TOutputImage, TOperatorValueType > Superclass;
00051   typedef SmartPointer<Self> Pointer;
00052   typedef SmartPointer<const Self> ConstPointer;
00053 
00055   itkNewMacro(Self);
00056 
00058   itkTypeMacro(MaskNeighborhoodOperatorImageFilter, NeighborhoodOperatorImageFilter);
00059 
00062   typedef typename TOutputImage::PixelType         OutputPixelType;
00063   typedef typename TOutputImage::InternalPixelType OutputInternalPixelType;
00064   typedef typename  TInputImage::PixelType         InputPixelType;
00065   typedef typename  TInputImage::InternalPixelType InputInternalPixelType;
00066   typedef typename   TMaskImage::PixelType         MaskPixelType;
00067   typedef typename   TMaskImage::InternalPixelType MaskInternalPixelType;
00068 
00071   itkStaticConstMacro(ImageDimension, unsigned int,
00072                       TOutputImage::ImageDimension);
00073   itkStaticConstMacro(InputImageDimension, unsigned int,
00074                       TInputImage::ImageDimension);
00075   itkStaticConstMacro(MaskImageDimension, unsigned int,
00076                       TMaskImage::ImageDimension);
00078 
00080   typedef TInputImage  InputImageType;
00081   typedef TMaskImage   MaskImageType;
00082   typedef TOutputImage OutputImageType;
00083   typedef typename InputImageType::Pointer InputImagePointer;
00084   typedef typename MaskImageType::Pointer MaskImagePointer;
00085 
00087   typedef ImageBoundaryCondition<OutputImageType> *
00088   ImageBoundaryConditionPointerType;
00089 
00091   typedef typename Superclass::OutputImageRegionType OutputImageRegionType;
00092   typedef typename Superclass::OperatorValueType         OperatorValueType;
00093 
00095   typedef typename Superclass::OutputNeighborhoodType OutputNeighborhoodType;
00096 
00100   void SetMaskImage( const TMaskImage* mask);
00101 
00105   const TMaskImage* GetMaskImage() const;
00106 
00110   itkSetMacro( DefaultValue, OutputPixelType );
00111 
00114   itkGetMacro( DefaultValue, OutputPixelType );
00115 
00119   itkSetMacro(UseDefaultValue,bool);
00120 
00122   itkGetConstReferenceMacro(UseDefaultValue,bool);
00123 
00125   itkBooleanMacro(UseDefaultValue); 
00126 
00127 #ifdef ITK_USE_CONCEPT_CHECKING
00128 
00129   itkConceptMacro(OutputEqualityComparableCheck,
00130     (Concept::EqualityComparable<OutputPixelType>));
00131   itkConceptMacro(SameDimensionCheck1,
00132     (Concept::SameDimension<InputImageDimension, ImageDimension>));
00133   itkConceptMacro(SameDimensionCheck2,
00134     (Concept::SameDimension<InputImageDimension, MaskImageDimension>));
00135   itkConceptMacro(InputConvertibleToOutputCheck,
00136     (Concept::Convertible<InputPixelType, OutputPixelType>));
00137   itkConceptMacro(OperatorConvertibleToOutputCheck,
00138     (Concept::Convertible<OperatorValueType, OutputPixelType>));
00139   itkConceptMacro(OutputOStreamWritable,
00140     (Concept::OStreamWritable<OutputPixelType>));
00141 
00143 #endif
00144 
00145 protected:
00146   MaskNeighborhoodOperatorImageFilter() : m_DefaultValue( NumericTraits<OutputPixelType>::Zero), m_UseDefaultValue(true) {}
00147   virtual ~MaskNeighborhoodOperatorImageFilter() {}
00148   void PrintSelf(std::ostream& os, Indent indent) const;
00149     
00155   void GenerateInputRequestedRegion() throw (InvalidRequestedRegionError);
00156 
00168   void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread,
00169                             int threadId );
00170 
00171 private:
00172   MaskNeighborhoodOperatorImageFilter(const Self&); //purposely not implemented
00173   void operator=(const Self&); //purposely not implemented
00174 
00175   OutputPixelType m_DefaultValue;
00176   bool m_UseDefaultValue;
00177 };
00178   
00179 } // end namespace itk
00180 
00181 #ifndef ITK_MANUAL_INSTANTIATION
00182 #include "itkMaskNeighborhoodOperatorImageFilter.txx"
00183 #endif
00184 
00185 #endif
00186 
00187 

Generated at Tue Jul 29 21:09:03 2008 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000