ITK  5.2.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  * 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 itkShiftScaleImageFilter_h
19 #define itkShiftScaleImageFilter_h
20 
21 #include "itkImageToImageFilter.h"
22 #include "itkArray.h"
23 
24 namespace itk
25 {
38 template <typename TInputImage, typename TOutputImage>
39 class ITK_TEMPLATE_EXPORT ShiftScaleImageFilter : public ImageToImageFilter<TInputImage, TOutputImage>
40 {
41 public:
42  ITK_DISALLOW_COPY_AND_ASSIGN(ShiftScaleImageFilter);
43 
49 
51  itkNewMacro(Self);
52 
56 
58  using InputImagePointer = typename TInputImage::Pointer;
59  using OutputImagePointer = typename TOutputImage::Pointer;
60 
62  using InputImagePixelType = typename TInputImage::PixelType;
63  using OutputImagePixelType = typename TOutputImage::PixelType;
64 
68  using InputImageOffsetType = typename TInputImage::OffsetType;
71  using OutputImageOffsetType = typename TOutputImage::OffsetType;
72 
75 
77  static constexpr unsigned int ImageDimension = TInputImage::ImageDimension;
78 
81 
84  itkSetMacro(Shift, RealType);
85  itkGetConstMacro(Shift, RealType);
87 
90  itkSetMacro(Scale, RealType);
91  itkGetConstMacro(Scale, RealType);
93 
95  itkGetConstMacro(UnderflowCount, long);
96  itkGetConstMacro(OverflowCount, long);
98 
99 #ifdef ITK_USE_CONCEPT_CHECKING
100  // Begin concept checking
103  itkConceptMacro(RealTypeMultiplyOperatorCheck, (Concept::MultiplyOperator<RealType>));
104  // End concept checking
105 #endif
106 
107 protected:
109  ~ShiftScaleImageFilter() override = default;
110  void
111  PrintSelf(std::ostream & os, Indent indent) const override;
112 
114  void
115  BeforeThreadedGenerateData() override;
116 
118  void
119  AfterThreadedGenerateData() override;
120 
122  void
123  ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread, ThreadIdType threadId) override;
124 
125  void
127  {
128  itkExceptionMacro("This class requires threadId so it must use classic multi-threading model");
129  }
130 
131 private:
134 
137 
140 
141  const TInputImage * m_InputImage;
142  TOutputImage * m_OutputImage;
143 };
144 } // end namespace itk
145 
146 #ifndef ITK_MANUAL_INSTANTIATION
147 # include "itkShiftScaleImageFilter.hxx"
148 #endif
149 
150 #endif
itk::ShiftScaleImageFilter::m_ThreadUnderflow
Array< long > m_ThreadUnderflow
Definition: itkShiftScaleImageFilter.h:138
itk::Concept::HasNumericTraits
Definition: itkConceptChecking.h:712
itk::ImageSource::OutputImagePointer
typename OutputImageType::Pointer OutputImagePointer
Definition: itkImageSource.h:91
itk::ShiftScaleImageFilter::m_OutputImage
TOutputImage * m_OutputImage
Definition: itkShiftScaleImageFilter.h:142
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:70
itk::ImageToImageFilter::InputImagePixelType
typename InputImageType::PixelType InputImagePixelType
Definition: itkImageToImageFilter.h:133
itk::ThreadIdType
unsigned int ThreadIdType
Definition: itkIntTypes.h:99
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:69
itk::ImageToImageFilter::InputImagePointer
typename InputImageType::Pointer InputImagePointer
Definition: itkImageToImageFilter.h:130
itk::ShiftScaleImageFilter::m_Shift
RealType m_Shift
Definition: itkShiftScaleImageFilter.h:132
itk::ShiftScaleImageFilter::InputImageOffsetType
typename TInputImage::OffsetType InputImageOffsetType
Definition: itkShiftScaleImageFilter.h:68
itk::GTest::TypedefsAndConstructors::Dimension2::RegionType
ImageBaseType::RegionType RegionType
Definition: itkGTestTypedefsAndConstructors.h:54
itk::ShiftScaleImageFilter::DynamicThreadedGenerateData
void DynamicThreadedGenerateData(const OutputImageRegionType &) override
Definition: itkShiftScaleImageFilter.h:126
itk::ShiftScaleImageFilter::OutputImageOffsetType
typename TOutputImage::OffsetType OutputImageOffsetType
Definition: itkShiftScaleImageFilter.h:71
itk::ShiftScaleImageFilter::RealType
typename NumericTraits< OutputImagePixelType >::RealType RealType
Definition: itkShiftScaleImageFilter.h:74
itk::ShiftScaleImageFilter::m_UnderflowCount
long m_UnderflowCount
Definition: itkShiftScaleImageFilter.h:135
itkImageToImageFilter.h
itk::ShiftScaleImageFilter::InputImageSizeType
typename TInputImage::SizeType InputImageSizeType
Definition: itkShiftScaleImageFilter.h:67
itk::Concept::MultiplyOperator
Definition: itkConceptChecking.h:417
itk::ShiftScaleImageFilter::m_OverflowCount
long m_OverflowCount
Definition: itkShiftScaleImageFilter.h:136
itk::NumericTraits
Define additional traits for native types such as int or float.
Definition: itkNumericTraits.h:58
itkArray.h
itk::ShiftScaleImageFilter::InputImageIndexType
typename TInputImage::IndexType InputImageIndexType
Definition: itkShiftScaleImageFilter.h:66
itk::ImageSource::OutputImageRegionType
typename OutputImageType::RegionType OutputImageRegionType
Definition: itkImageSource.h:92
itk::ShiftScaleImageFilter
Shift and scale the pixels in an image.
Definition: itkShiftScaleImageFilter.h:39
itk::Concept::AdditiveOperators
Definition: itkConceptChecking.h:356
itkConceptMacro
#define itkConceptMacro(name, concept)
Definition: itkConceptChecking.h:64
itk::ShiftScaleImageFilter::m_ThreadOverflow
Array< long > m_ThreadOverflow
Definition: itkShiftScaleImageFilter.h:139
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:138
itk::ShiftScaleImageFilter::m_InputImage
const TInputImage * m_InputImage
Definition: itkShiftScaleImageFilter.h:141
itk::ImageSource::OutputImagePixelType
typename OutputImageType::PixelType OutputImagePixelType
Definition: itkImageSource.h:93
itk::Array< long >
itk::ImageToImageFilter::InputImageRegionType
typename InputImageType::RegionType InputImageRegionType
Definition: itkImageToImageFilter.h:132
itk::ShiftScaleImageFilter::m_Scale
RealType m_Scale
Definition: itkShiftScaleImageFilter.h:133