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

itkLabelOverlayImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkLabelOverlayImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2009-07-07 12:27:33 $
00007   Version:   $Revision: 1.16 $
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 __itkLabelOverlayImageFilter_h
00018 #define __itkLabelOverlayImageFilter_h
00019 
00020 #include "itkLabelOverlayFunctor.h"
00021 #include "itkBinaryFunctorImageFilter.h"
00022 #include "itkConceptChecking.h"
00023 
00024 namespace itk
00025 {
00048 template <typename  TInputImage, class TLabelImage, typename  TOutputImage>
00049 class ITK_EXPORT LabelOverlayImageFilter :
00050     public
00051      BinaryFunctorImageFilter<TInputImage, TLabelImage, TOutputImage, 
00052        Functor::LabelOverlayFunctor< 
00053           typename TInputImage::PixelType, 
00054           typename TLabelImage::PixelType, 
00055           typename TOutputImage::PixelType>   >
00056 {
00057 public:
00059   typedef LabelOverlayImageFilter  Self;
00060 
00061   typedef BinaryFunctorImageFilter<TInputImage, TLabelImage, TOutputImage, 
00062                         Functor::LabelOverlayFunctor< 
00063                             typename TInputImage::PixelType, 
00064                             typename TLabelImage::PixelType, 
00065                             typename TOutputImage::PixelType>   >  Superclass;
00066 
00067   typedef SmartPointer<Self>        Pointer;
00068   typedef SmartPointer<const Self>  ConstPointer;
00069 
00070   typedef TOutputImage OutputImageType;
00071   typedef TLabelImage  LabelImageType;
00072   typedef TInputImage  InputImageType;
00073 
00074   typedef typename TOutputImage::PixelType OutputPixelType;
00075   typedef typename TLabelImage::PixelType  LabelPixelType;
00076   typedef typename TInputImage::PixelType  InputPixelType;
00077 
00079   itkTypeMacro(LabelOverlayImageFilter, BinaryFunctorImageFilter);
00080 
00082   itkNewMacro(Self);
00083 
00085   void SetLabelImage( const TLabelImage *input);
00086 
00088   const LabelImageType * GetLabelImage() const;
00089 
00093   itkSetMacro( Opacity, double );
00094   itkGetConstReferenceMacro( Opacity, double );
00096 
00098   itkSetMacro( BackgroundValue, LabelPixelType );
00099   itkGetConstReferenceMacro( BackgroundValue, LabelPixelType );
00101 
00102 #ifdef ITK_USE_CONCEPT_CHECKING
00103 
00104   itkConceptMacro(OutputHasPixelTraitsCheck,
00105     (Concept::HasPixelTraits<OutputPixelType>));
00106   itkConceptMacro(OutputPixelShouldHaveValueType,
00107     (Concept::HasValueType<OutputPixelType>));
00108   itkConceptMacro(OutputPixelShouldHaveBracketOperator,
00109     (Concept::BracketOperator<
00110         OutputPixelType, 
00111         unsigned int,
00112         typename OutputPixelType::ValueType>));
00113 
00115 #endif
00116 
00118   void ResetColors();
00119 
00121   unsigned int GetNumberOfColors() const;
00122 
00124   typedef typename OutputPixelType::ComponentType ComponentType;
00125 
00127   void AddColor( ComponentType r, ComponentType g, ComponentType b );
00128 
00129 protected:
00130   LabelOverlayImageFilter();
00131   virtual ~LabelOverlayImageFilter() {};
00132 
00134   void BeforeThreadedGenerateData(void);
00135 
00137   void PrintSelf(std::ostream& os, Indent indent) const;
00138 
00139 private:
00140   LabelOverlayImageFilter(const Self&); //purposely not implemented
00141   void operator=(const Self&); //purposely not implemented
00142 
00143   double                        m_Opacity;
00144   LabelPixelType                m_BackgroundValue;
00145 
00146 };
00147 
00148 
00149   
00150 } // end namespace itk
00151   
00152 #ifndef ITK_MANUAL_INSTANTIATION
00153 #include "itkLabelOverlayImageFilter.txx"
00154 #endif
00155 
00156 #endif
00157 

Generated at Tue Sep 15 03:46:20 2009 for ITK by doxygen 1.5.8 written by Dimitri van Heesch, © 1997-2000