ITK  4.13.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:
48 
50  itkNewMacro(Self);
51 
53  typedef typename TInputImage::RegionType InputImageRegionType;
54  typedef typename TOutputImage::RegionType OutputImageRegionType;
55 
57  typedef typename TInputImage::Pointer InputImagePointer;
58  typedef typename TOutputImage::Pointer OutputImagePointer;
59 
61  typedef typename TInputImage::PixelType InputImagePixelType;
62  typedef typename TOutputImage::PixelType OutputImagePixelType;
63 
67  typedef typename TInputImage::OffsetType InputImageOffsetType;
70  typedef typename TOutputImage::OffsetType OutputImageOffsetType;
71 
74 
76  itkStaticConstMacro(ImageDimension, unsigned int,
77  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
101  itkConceptMacro( OutputHasNumericTraitsCheck,
103  itkConceptMacro( InputPlusRealTypeCheck,
105  itkConceptMacro( RealTypeMultiplyOperatorCheck,
107  // End concept checking
108 #endif
109 
110 protected:
112  ~ShiftScaleImageFilter() ITK_OVERRIDE;
113  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
114 
116  void BeforeThreadedGenerateData() ITK_OVERRIDE;
117 
119  void AfterThreadedGenerateData() ITK_OVERRIDE;
120 
122  void ThreadedGenerateData(const OutputImageRegionType &
123  outputRegionForThread,
124  ThreadIdType threadId) ITK_OVERRIDE;
125 
126 private:
127  ITK_DISALLOW_COPY_AND_ASSIGN(ShiftScaleImageFilter);
128 
129  RealType m_Shift;
130  RealType m_Scale;
131 
132  long m_UnderflowCount;
133  long m_OverflowCount;
134 
135  Array< long > m_ThreadUnderflow;
136  Array< long > m_ThreadOverflow;
137 
138  const TInputImage *m_InputImage;
139  TOutputImage *m_OutputImage;
140 };
141 } // end namespace itk
142 
143 #ifndef ITK_MANUAL_INSTANTIATION
144 #include "itkShiftScaleImageFilter.hxx"
145 #endif
146 
147 #endif
Array class with size defined at construction time.
Definition: itkArray.h:50
TInputImage::RegionType InputImageRegionType
TInputImage::PixelType InputImagePixelType
TInputImage::Pointer InputImagePointer
Shift and scale the pixels in an image.
TInputImage::OffsetType InputImageOffsetType
TOutputImage::IndexType OutputImageIndexType
TOutputImage::PixelType OutputImagePixelType
TInputImage::SizeType InputImageSizeType
Base class for all process objects that output image data.
SmartPointer< const Self > ConstPointer
TOutputImage::RegionType OutputImageRegionType
TOutputImage::SizeType OutputImageSizeType
TOutputImage::OffsetType OutputImageOffsetType
ImageToImageFilter< TInputImage, TOutputImage > Superclass
unsigned int ThreadIdType
Definition: itkIntTypes.h:159
TInputImage::IndexType InputImageIndexType
NumericTraits< OutputImagePixelType >::RealType RealType
Base class for filters that take an image as input and produce an image as output.
OutputImageType::RegionType OutputImageRegionType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Define additional traits for native types such as int or float.
TOutputImage::Pointer OutputImagePointer
#define itkConceptMacro(name, concept)