ITK  5.2.0
Insight Toolkit
itkCustomColormapFunction.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright NumFOCUS
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 itkCustomColormapFunction_h
19 #define itkCustomColormapFunction_h
20 
21 #include "itkColormapFunction.h"
22 
23 #include <vector>
24 
25 namespace itk
26 {
27 namespace Function
28 {
49 template <typename TScalar, typename TRGBPixel>
50 class ITK_TEMPLATE_EXPORT CustomColormapFunction : public ColormapFunction<TScalar, TRGBPixel>
51 {
52 public:
53  ITK_DISALLOW_COPY_AND_ASSIGN(CustomColormapFunction);
54 
59 
61  itkNewMacro(Self);
62 
63  using RGBPixelType = typename Superclass::RGBPixelType;
64  using ScalarType = typename Superclass::ScalarType;
65  using RealType = typename Superclass::RealType;
66 
67  using ChannelType = std::vector<RealType>;
68 
70  operator()(const TScalar &) const override;
71 
72  void
74  {
75  m_RedChannel = red;
76  }
77 
78  ChannelType
79  GetRedChannel() const
80  {
81  return m_RedChannel;
82  }
83 
84  void
86  {
87  m_GreenChannel = green;
88  }
89 
90  ChannelType
92  {
93  return m_GreenChannel;
94  }
95 
96  void
98  {
99  m_BlueChannel = blue;
100  }
101 
102  ChannelType
104  {
105  return m_BlueChannel;
106  }
107 
108 protected:
109  CustomColormapFunction() = default;
110  ~CustomColormapFunction() override = default;
111 
112 private:
116 };
117 } // end namespace Function
118 } // end namespace itk
119 
120 #ifndef ITK_MANUAL_INSTANTIATION
121 # include "itkCustomColormapFunction.hxx"
122 #endif
123 
124 #endif
itk::Function::CustomColormapFunction::m_RedChannel
ChannelType m_RedChannel
Definition: itkCustomColormapFunction.h:113
itk::Function::ColormapFunction::ScalarType
TScalar ScalarType
Definition: itkColormapFunction.h:61
itk::Function::CustomColormapFunction::GetGreenChannel
ChannelType GetGreenChannel() const
Definition: itkCustomColormapFunction.h:91
itk::Function::CustomColormapFunction::SetGreenChannel
void SetGreenChannel(ChannelType green)
Definition: itkCustomColormapFunction.h:85
itk::SmartPointer< Self >
itk::Function::CustomColormapFunction::m_BlueChannel
ChannelType m_BlueChannel
Definition: itkCustomColormapFunction.h:115
itk::Function::ColormapFunction
Function object which maps a scalar value into an RGB colormap value.
Definition: itkColormapFunction.h:46
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itk::Function::CustomColormapFunction::GetRedChannel
ChannelType GetRedChannel() const
Definition: itkCustomColormapFunction.h:79
itk::Function::ColormapFunction::RGBPixelType
TRGBPixel RGBPixelType
Definition: itkColormapFunction.h:59
itk::Function::CustomColormapFunction::m_GreenChannel
ChannelType m_GreenChannel
Definition: itkCustomColormapFunction.h:114
itk::Function::CustomColormapFunction::SetRedChannel
void SetRedChannel(ChannelType red)
Definition: itkCustomColormapFunction.h:73
itk::Function::CustomColormapFunction::SetBlueChannel
void SetBlueChannel(ChannelType blue)
Definition: itkCustomColormapFunction.h:97
itk::Function::CustomColormapFunction::RealType
typename Superclass::RealType RealType
Definition: itkCustomColormapFunction.h:65
itk::Function::CustomColormapFunction::ChannelType
std::vector< RealType > ChannelType
Definition: itkCustomColormapFunction.h:67
itkColormapFunction.h
itk::Function::CustomColormapFunction::GetBlueChannel
ChannelType GetBlueChannel() const
Definition: itkCustomColormapFunction.h:103
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::Function::CustomColormapFunction
Function object which maps a scalar value into an RGB colormap value.
Definition: itkCustomColormapFunction.h:50