ITK  5.4.0
Insight Toolkit
itkTestingStretchIntensityImageFilter.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  * https://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 itkTestingStretchIntensityImageFilter_h
19 #define itkTestingStretchIntensityImageFilter_h
20 
22 
23 namespace itk
24 {
25 namespace Testing
26 {
27 
41 template <typename TInputImage, typename TOutputImage = TInputImage>
42 class ITK_TEMPLATE_EXPORT StretchIntensityImageFilter : public ImageSource<TOutputImage>
43 {
44 public:
45  ITK_DISALLOW_COPY_AND_MOVE(StretchIntensityImageFilter);
46 
52 
53  using OutputPixelType = typename TOutputImage::PixelType;
54  using InputPixelType = typename TInputImage::PixelType;
56 
58  itkNewMacro(Self);
59 
61  itkOverrideGetNameOfClassMacro(StretchIntensityImageFilter);
62 
63  itkSetMacro(OutputMinimum, OutputPixelType);
64  itkSetMacro(OutputMaximum, OutputPixelType);
65  itkGetConstReferenceMacro(OutputMinimum, OutputPixelType);
66  itkGetConstReferenceMacro(OutputMaximum, OutputPixelType);
67 
71  itkGetConstReferenceMacro(Scale, RealType);
72  itkGetConstReferenceMacro(Shift, RealType);
77  itkGetConstReferenceMacro(InputMinimum, InputPixelType);
78  itkGetConstReferenceMacro(InputMaximum, InputPixelType);
82  using Superclass::SetInput;
83  virtual void
84  SetInput(const TInputImage * input);
85  const TInputImage *
86  GetInput() const;
89 #ifdef ITK_USE_CONCEPT_CHECKING
90  // Begin concept checking
91  itkConceptMacro(InputHasNumericTraitsCheck, (Concept::HasNumericTraits<InputPixelType>));
92  itkConceptMacro(OutputHasNumericTraitsCheck, (Concept::HasNumericTraits<OutputPixelType>));
93  itkConceptMacro(RealTypeMultiplyOperatorCheck, (Concept::MultiplyOperator<RealType>));
94  itkConceptMacro(RealTypeAdditiveOperatorsCheck, (Concept::AdditiveOperators<RealType>));
95  // End concept checking
96 #endif
97 
98 protected:
100  ~StretchIntensityImageFilter() override = default;
101 
103  void
104  BeforeThreadedGenerateData() override;
105 
107  void
108  PrintSelf(std::ostream & os, Indent indent) const override;
109 
110  using typename Superclass::OutputImageRegionType;
112 
121  void
122  DynamicThreadedGenerateData(const OutputImageRegionType & outputRegionForThread) override;
123 
124 private:
125  RealType m_Scale{};
126  RealType m_Shift{};
127 
128  InputPixelType m_InputMinimum{};
129  InputPixelType m_InputMaximum{};
130 
131  OutputPixelType m_OutputMinimum{};
132  OutputPixelType m_OutputMaximum{};
133 };
134 } // end namespace Testing
135 } // end namespace itk
136 
137 #ifndef ITK_MANUAL_INSTANTIATION
138 # include "itkTestingStretchIntensityImageFilter.hxx"
139 #endif
140 
141 #endif
itk::Testing::StretchIntensityImageFilter::InputImageRegionType
typename TInputImage::RegionType InputImageRegionType
Definition: itkTestingStretchIntensityImageFilter.h:111
itkUnaryFunctorImageFilter.h
itk::Concept::HasNumericTraits
Definition: itkConceptChecking.h:714
itk::Testing::StretchIntensityImageFilter::InputPixelType
typename TInputImage::PixelType InputPixelType
Definition: itkTestingStretchIntensityImageFilter.h:54
itk::Testing::StretchIntensityImageFilter
Applies a linear transformation to the intensity levels of the input Image.
Definition: itkTestingStretchIntensityImageFilter.h:42
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::ImageSource
Base class for all process objects that output image data.
Definition: itkImageSource.h:67
itk::GTest::TypedefsAndConstructors::Dimension2::RegionType
ImageBaseType::RegionType RegionType
Definition: itkGTestTypedefsAndConstructors.h:54
itk::Testing::StretchIntensityImageFilter::RealType
typename NumericTraits< InputPixelType >::RealType RealType
Definition: itkTestingStretchIntensityImageFilter.h:55
itk::Concept::MultiplyOperator
Definition: itkConceptChecking.h:419
itk::NumericTraits
Define additional traits for native types such as int or float.
Definition: itkNumericTraits.h:59
itk::ImageSource::OutputImageRegionType
typename OutputImageType::RegionType OutputImageRegionType
Definition: itkImageSource.h:92
itk::Concept::AdditiveOperators
Definition: itkConceptChecking.h:358
itkConceptMacro
#define itkConceptMacro(name, concept)
Definition: itkConceptChecking.h:65
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::ProcessObject
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Definition: itkProcessObject.h:139
itk::Testing::StretchIntensityImageFilter::OutputPixelType
typename TOutputImage::PixelType OutputPixelType
Definition: itkTestingStretchIntensityImageFilter.h:53