ITK  6.0.0
Insight Toolkit
itkShiftScaleImageFilter.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 itkShiftScaleImageFilter_h
19 #define itkShiftScaleImageFilter_h
20 
21 #include "itkImageToImageFilter.h"
22 #include "itkArray.h"
23 #include <mutex>
24 
25 namespace itk
26 {
39 template <typename TInputImage, typename TOutputImage>
40 class ITK_TEMPLATE_EXPORT ShiftScaleImageFilter : public ImageToImageFilter<TInputImage, TOutputImage>
41 {
42 public:
43  ITK_DISALLOW_COPY_AND_MOVE(ShiftScaleImageFilter);
44 
50 
52  itkNewMacro(Self);
53 
57 
61 
63  using InputImagePixelType = typename TInputImage::PixelType;
64  using OutputImagePixelType = typename TOutputImage::PixelType;
65 
69  using InputImageOffsetType = typename TInputImage::OffsetType;
72  using OutputImageOffsetType = typename TOutputImage::OffsetType;
73 
76 
78  static constexpr unsigned int ImageDimension = TInputImage::ImageDimension;
79 
81  itkOverrideGetNameOfClassMacro(ShiftScaleImageFilter);
82 
85  itkSetMacro(Shift, RealType);
86  itkGetConstMacro(Shift, RealType);
91  itkSetMacro(Scale, RealType);
92  itkGetConstMacro(Scale, RealType);
96  itkGetConstMacro(UnderflowCount, SizeValueType);
97  itkGetConstMacro(OverflowCount, SizeValueType);
100 #ifdef ITK_USE_CONCEPT_CHECKING
101  // Begin concept checking
104  itkConceptMacro(RealTypeMultiplyOperatorCheck, (Concept::MultiplyOperator<RealType>));
105  // End concept checking
106 #endif
107 
108 protected:
109  ShiftScaleImageFilter() = default;
110  ~ShiftScaleImageFilter() override = default;
111 
112  void
113  PrintSelf(std::ostream & os, Indent indent) const override;
114 
116  void
117  BeforeThreadedGenerateData() override;
118 
119  void
120  DynamicThreadedGenerateData(const OutputImageRegionType &) override;
121 
122 private:
123  RealType m_Shift{};
125 
126  SizeValueType m_UnderflowCount{ 0 };
127  SizeValueType m_OverflowCount{ 0 };
128 
129  std::mutex m_Mutex{};
130 };
131 } // end namespace itk
132 
133 #ifndef ITK_MANUAL_INSTANTIATION
134 # include "itkShiftScaleImageFilter.hxx"
135 #endif
136 
137 #endif
Pointer
SmartPointer< Self > Pointer
Definition: itkAddImageFilter.h:93
itk::Concept::HasNumericTraits
Definition: itkConceptChecking.h:716
itk::ImageSource::OutputImagePointer
typename OutputImageType::Pointer OutputImagePointer
Definition: itkImageSource.h:91
itk::GTest::TypedefsAndConstructors::Dimension2::SizeType
ImageBaseType::SizeType SizeType
Definition: itkGTestTypedefsAndConstructors.h:49
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::ShiftScaleImageFilter::OutputImageSizeType
typename TOutputImage::SizeType OutputImageSizeType
Definition: itkShiftScaleImageFilter.h:71
itk::ImageToImageFilter::InputImagePixelType
typename InputImageType::PixelType InputImagePixelType
Definition: itkImageToImageFilter.h:133
itk::GTest::TypedefsAndConstructors::Dimension2::IndexType
ImageBaseType::IndexType IndexType
Definition: itkGTestTypedefsAndConstructors.h:50
itk::ImageToImageFilter
Base class for filters that take an image as input and produce an image as output.
Definition: itkImageToImageFilter.h:108
itk::ImageSource
Base class for all process objects that output image data.
Definition: itkImageSource.h:67
itk::ShiftScaleImageFilter::OutputImageIndexType
typename TOutputImage::IndexType OutputImageIndexType
Definition: itkShiftScaleImageFilter.h:70
itk::ImageToImageFilter::InputImagePointer
typename InputImageType::Pointer InputImagePointer
Definition: itkImageToImageFilter.h:130
itk::NumericTraits::OneValue
static T OneValue()
Definition: itkNumericTraits.h:158
itk::ShiftScaleImageFilter::InputImageOffsetType
typename TInputImage::OffsetType InputImageOffsetType
Definition: itkShiftScaleImageFilter.h:69
itk::GTest::TypedefsAndConstructors::Dimension2::RegionType
ImageBaseType::RegionType RegionType
Definition: itkGTestTypedefsAndConstructors.h:54
itk::ShiftScaleImageFilter::OutputImageOffsetType
typename TOutputImage::OffsetType OutputImageOffsetType
Definition: itkShiftScaleImageFilter.h:72
itk::ShiftScaleImageFilter::RealType
typename NumericTraits< OutputImagePixelType >::RealType RealType
Definition: itkShiftScaleImageFilter.h:75
itkImageToImageFilter.h
itk::ShiftScaleImageFilter::InputImageSizeType
typename TInputImage::SizeType InputImageSizeType
Definition: itkShiftScaleImageFilter.h:68
itk::Concept::MultiplyOperator
Definition: itkConceptChecking.h:421
itk::NumericTraits
Define additional traits for native types such as int or float.
Definition: itkNumericTraits.h:60
itkArray.h
itk::ShiftScaleImageFilter::InputImageIndexType
typename TInputImage::IndexType InputImageIndexType
Definition: itkShiftScaleImageFilter.h:67
itk::ImageSource::OutputImageRegionType
typename OutputImageType::RegionType OutputImageRegionType
Definition: itkImageSource.h:92
itk::ShiftScaleImageFilter
Shift and scale the pixels in an image.
Definition: itkShiftScaleImageFilter.h:40
itk::Concept::AdditiveOperators
Definition: itkConceptChecking.h:360
itkConceptMacro
#define itkConceptMacro(name, concept)
Definition: itkConceptChecking.h:65
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnatomicalOrientation.h:29
itk::ProcessObject
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Definition: itkProcessObject.h:139
itk::ImageSource::OutputImagePixelType
typename OutputImageType::PixelType OutputImagePixelType
Definition: itkImageSource.h:93
itk::ImageToImageFilter::InputImageRegionType
typename InputImageType::RegionType InputImageRegionType
Definition: itkImageToImageFilter.h:132
itk::SizeValueType
unsigned long SizeValueType
Definition: itkIntTypes.h:86