Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
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&);
00141 void operator=(const Self&);
00142
00143 double m_Opacity;
00144 LabelPixelType m_BackgroundValue;
00145
00146 };
00147
00148
00149
00150 }
00151
00152 #ifndef ITK_MANUAL_INSTANTIATION
00153 #include "itkLabelOverlayImageFilter.txx"
00154 #endif
00155
00156 #endif
00157