ITK  4.6.0
Insight Segmentation and Registration Toolkit
itkLabelOverlayImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef __itkLabelOverlayImageFilter_h
19 #define __itkLabelOverlayImageFilter_h
20 
21 #include "itkLabelOverlayFunctor.h"
23 #include "itkConceptChecking.h"
24 
25 namespace itk
26 {
53 template< typename TInputImage, typename TLabelImage, typename TOutputImage >
55  public
56  BinaryFunctorImageFilter< TInputImage, TLabelImage, TOutputImage,
57  Functor::LabelOverlayFunctor<
58  typename TInputImage::PixelType,
59  typename TLabelImage::PixelType,
60  typename TOutputImage::PixelType > >
61 {
62 public:
65 
66  typedef BinaryFunctorImageFilter< TInputImage, TLabelImage, TOutputImage,
68  typename TInputImage::PixelType,
69  typename TLabelImage::PixelType,
70  typename TOutputImage::PixelType > > Superclass;
71 
74 
75  typedef TOutputImage OutputImageType;
76  typedef TLabelImage LabelImageType;
77  typedef TInputImage InputImageType;
78 
79  typedef typename TOutputImage::PixelType OutputPixelType;
80  typedef typename TLabelImage::PixelType LabelPixelType;
81  typedef typename TInputImage::PixelType InputPixelType;
82 
85 
87  itkNewMacro(Self);
88 
90  void SetLabelImage(const TLabelImage *input);
91 
93  const LabelImageType * GetLabelImage() const;
94 
98  itkSetMacro(Opacity, double);
99  itkGetConstReferenceMacro(Opacity, double);
101 
103  itkSetMacro(BackgroundValue, LabelPixelType);
104  itkGetConstReferenceMacro(BackgroundValue, LabelPixelType);
106 
107 #ifdef ITK_USE_CONCEPT_CHECKING
108  // Begin concept checking
109  itkConceptMacro( OutputPixelShouldHaveValueType,
111  itkConceptMacro( OutputPixelShouldHaveBracketOperator,
114  unsigned int,
115  typename OutputPixelType::ValueType > ) );
116  // End concept checking
117 #endif
118 
120  void ResetColors();
121 
123  unsigned int GetNumberOfColors() const;
124 
126  typedef typename OutputPixelType::ComponentType ComponentType;
127 
130 
131 protected:
134 
136  void BeforeThreadedGenerateData(void);
137 
139  void PrintSelf(std::ostream & os, Indent indent) const;
140 
142 
143 private:
144  LabelOverlayImageFilter(const Self &); //purposely not implemented
145  void operator=(const Self &); //purposely not implemented
146 
147  double m_Opacity;
149 };
150 } // end namespace itk
151 
152 #ifndef ITK_MANUAL_INSTANTIATION
153 #include "itkLabelOverlayImageFilter.hxx"
154 #endif
155 
156 #endif
BinaryFunctorImageFilter< TInputImage, TLabelImage, TOutputImage, Functor::LabelOverlayFunctor< typename TInputImage::PixelType, typename TLabelImage::PixelType, typename TOutputImage::PixelType > > Superclass
void operator=(const Self &)
Apply a colormap to a label image and put it on top of the input image.
OutputPixelType::ComponentType ComponentType
Base class for all process objects that output image data.
void SetLabelImage(const TLabelImage *input)
Functor for applying a colormap to a label image and combine it with a grayscale image.
SmartPointer< const Self > ConstPointer
void PrintSelf(std::ostream &os, Indent indent) const
void AddColor(ComponentType r, ComponentType g, ComponentType b)
TOutputImage::PixelType OutputPixelType
unsigned int GetNumberOfColors() const
const LabelImageType * GetLabelImage() const
Control indentation during Print() invocation.
Definition: itkIndent.h:49
#define itkConceptMacro(name, concept)
Implements pixel-wise generic operation of two images, or of an image and a constant.