ITK  4.6.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 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;
123 
125  void BeforeThreadedGenerateData();
126 
128  void AfterThreadedGenerateData();
129 
131  void ThreadedGenerateData(const OutputImageRegionType &
132  outputRegionForThread,
133  ThreadIdType threadId);
134 
135 private:
136  ShiftScaleInPlaceImageFilter(const Self &); //purposely not implemented
137  void operator=(const Self &); //purposely not implemented
138 
139  RealType m_Shift;
140  RealType m_Scale;
141 
142  long m_UnderflowCount;
143  long m_OverflowCount;
144 
145  Array< long > m_ThreadUnderflow;
146  Array< long > m_ThreadOverflow;
147 };
148 } // end namespace itk
149 
150 #ifndef ITK_MANUAL_INSTANTIATION
151 #include "itkShiftScaleInPlaceImageFilter.hxx"
152 #endif
153 
154 #endif //#if !defined( ITK_LEGACY_REMOVE )
155 #endif
#define itkConceptMacro(name, concept)
unsigned int ThreadIdType
Definition: itkIntTypes.h:159