ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkShiftScaleImageFilter.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 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:
40  public ImageToImageFilter< TInputImage, TOutputImage >
41 {
42 public:
43  ITK_DISALLOW_COPY_AND_ASSIGN(ShiftScaleImageFilter);
44 
50 
52  itkNewMacro(Self);
53 
57 
59  using InputImagePointer = typename TInputImage::Pointer;
60  using OutputImagePointer = typename TOutputImage::Pointer;
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 
82 
85  itkSetMacro(Shift, RealType);
86  itkGetConstMacro(Shift, RealType);
88 
91  itkSetMacro(Scale, RealType);
92  itkGetConstMacro(Scale, RealType);
94 
96  itkGetConstMacro(UnderflowCount, long);
97  itkGetConstMacro(OverflowCount, long);
99 
100 #ifdef ITK_USE_CONCEPT_CHECKING
101  // Begin concept checking
102  itkConceptMacro( OutputHasNumericTraitsCheck,
104  itkConceptMacro( InputPlusRealTypeCheck,
106  itkConceptMacro( RealTypeMultiplyOperatorCheck,
108  // End concept checking
109 #endif
110 
111 protected:
113  ~ShiftScaleImageFilter() override = default;
114  void PrintSelf(std::ostream & os, Indent indent) const override;
115 
117  void BeforeThreadedGenerateData() override;
118 
120  void AfterThreadedGenerateData() override;
121 
123  void ThreadedGenerateData(const OutputImageRegionType &
124  outputRegionForThread,
125  ThreadIdType threadId) override;
126 
128  {
129  itkExceptionMacro("This class requires threadId so it must use classic multi-threading model");
130  }
131 
132 private:
135 
138 
141 
142  const TInputImage *m_InputImage;
143  TOutputImage *m_OutputImage;
144 };
145 } // end namespace itk
146 
147 #ifndef ITK_MANUAL_INSTANTIATION
148 #include "itkShiftScaleImageFilter.hxx"
149 #endif
150 
151 #endif
typename TInputImage::OffsetType InputImageOffsetType
void DynamicThreadedGenerateData(const OutputImageRegionType &) override
typename OutputImageType::Pointer OutputImagePointer
typename TInputImage::SizeType InputImageSizeType
Define numeric traits for std::vector.
Shift and scale the pixels in an image.
typename TInputImage::IndexType InputImageIndexType
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Base class for all process objects that output image data.
typename OutputImageType::PixelType OutputImagePixelType
typename InputImageType::PixelType InputImagePixelType
typename NumericTraits< OutputImagePixelType >::RealType RealType
typename InputImageType::Pointer InputImagePointer
typename OutputImageType::RegionType OutputImageRegionType
unsigned int ThreadIdType
Definition: itkIntTypes.h:99
typename InputImageType::RegionType InputImageRegionType
Base class for filters that take an image as input and produce an image as output.
Control indentation during Print() invocation.
Definition: itkIndent.h:49
typename TOutputImage::IndexType OutputImageIndexType
#define itkConceptMacro(name, concept)
typename TOutputImage::SizeType OutputImageSizeType
typename TOutputImage::OffsetType OutputImageOffsetType