ITK  4.13.0
Insight Segmentation and Registration Toolkit
itkShiftScaleInPlaceImageFilter.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 itkShiftScaleInPlaceImageFilter_h
19 #define itkShiftScaleInPlaceImageFilter_h
20 #if !defined( ITK_LEGACY_REMOVE )
21 
22 #include "itkInPlaceImageFilter.h"
23 #include "itkArray.h"
24 
25 namespace itk
26 {
47 template< typename TInputImage >
48 class ITK_TEMPLATE_EXPORT ShiftScaleInPlaceImageFilter:
49  public InPlaceImageFilter< TInputImage >
50 {
51 public:
53  typedef ShiftScaleInPlaceImageFilter Self;
54  typedef InPlaceImageFilter< TInputImage > Superclass;
55  typedef SmartPointer< Self > Pointer;
56  typedef SmartPointer< const Self > ConstPointer;
57 
59  itkNewMacro(Self);
60 
62  typedef typename TInputImage::RegionType InputImageRegionType;
63  typedef typename TInputImage::RegionType OutputImageRegionType;
64 
66  typedef typename TInputImage::Pointer InputImagePointer;
67  typedef typename TInputImage::Pointer OutputImagePointer;
68 
70  typedef typename TInputImage::PixelType InputImagePixelType;
71  typedef typename TInputImage::PixelType OutputImagePixelType;
72 
74  typedef typename TInputImage::IndexType InputImageIndexType;
75  typedef typename TInputImage::SizeType InputImageSizeType;
76  typedef typename TInputImage::OffsetType InputImageOffsetType;
77  typedef typename TInputImage::IndexType OutputImageIndexType;
78  typedef typename TInputImage::SizeType OutputImageSizeType;
79  typedef typename TInputImage::OffsetType OutputImageOffsetType;
80 
82  typedef typename NumericTraits< OutputImagePixelType >::RealType RealType;
83 
85  itkStaticConstMacro(ImageDimension, unsigned int,
86  TInputImage::ImageDimension);
87 
89  itkTypeMacro(ShiftScaleInPlaceImageFilter, InPlaceImageFilter);
90 
93  itkSetMacro(Shift, RealType);
94  itkGetConstMacro(Shift, RealType);
96 
99  itkSetMacro(Scale, RealType);
100  itkGetConstMacro(Scale, RealType);
102 
104  itkGetConstMacro(UnderflowCount, long);
105  itkGetConstMacro(OverflowCount, long);
107 
108 #ifdef ITK_USE_CONCEPT_CHECKING
109  // Begin concept checking
110  itkConceptMacro( InputHasNumericTraitsCheck,
111  ( Concept::HasNumericTraits< InputImagePixelType > ) );
112  itkConceptMacro( InputPlusRealTypeCheck,
113  ( Concept::AdditiveOperators< InputImagePixelType, RealType, RealType > ) );
114  itkConceptMacro( RealTypeMultiplyOperatorCheck,
115  ( Concept::MultiplyOperator< RealType > ) );
116  // End concept checking
117 #endif
118 
119 protected:
120  ShiftScaleInPlaceImageFilter();
121  ~ShiftScaleInPlaceImageFilter();
122  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
123 
125  void BeforeThreadedGenerateData() ITK_OVERRIDE;
126 
128  void AfterThreadedGenerateData() ITK_OVERRIDE;
129 
131  void ThreadedGenerateData(const OutputImageRegionType &
132  outputRegionForThread,
133  ThreadIdType threadId) ITK_OVERRIDE;
134 
135 private:
136  ITK_DISALLOW_COPY_AND_ASSIGN(ShiftScaleInPlaceImageFilter);
137 
138  RealType m_Shift;
139  RealType m_Scale;
140 
141  long m_UnderflowCount;
142  long m_OverflowCount;
143 
144  Array< long > m_ThreadUnderflow;
145  Array< long > m_ThreadOverflow;
146 };
147 } // end namespace itk
148 
149 #ifndef ITK_MANUAL_INSTANTIATION
150 #include "itkShiftScaleInPlaceImageFilter.hxx"
151 #endif
152 
153 #endif //#if !defined( ITK_LEGACY_REMOVE )
154 #endif
unsigned int ThreadIdType
Definition: itkIntTypes.h:159
#define itkConceptMacro(name, concept)