ITK  4.2.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, class TLabelImage, typename TOutputImage >
54 class ITK_EXPORT LabelOverlayImageFilter:
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 
109  itkConceptMacro( OutputPixelShouldHaveValueType,
111  itkConceptMacro( OutputPixelShouldHaveBracketOperator,
114  unsigned int,
115  typename OutputPixelType::ValueType > ) );
116 
118 #endif
119 
121  void ResetColors();
122 
124  unsigned int GetNumberOfColors() const;
125 
127  typedef typename OutputPixelType::ComponentType ComponentType;
128 
130  void AddColor(ComponentType r, ComponentType g, ComponentType b);
131 
132 protected:
135 
137  void BeforeThreadedGenerateData(void);
138 
140  void PrintSelf(std::ostream & os, Indent indent) const;
141 
142  void GenerateOutputInformation();
143 
144 private:
145  LabelOverlayImageFilter(const Self &); //purposely not implemented
146  void operator=(const Self &); //purposely not implemented
147 
148  double m_Opacity;
150 };
151 } // end namespace itk
152 
153 #ifndef ITK_MANUAL_INSTANTIATION
154 #include "itkLabelOverlayImageFilter.hxx"
155 #endif
156 
157 #endif
158