ITK  4.13.0
Insight Segmentation and Registration Toolkit
itkTestingStretchIntensityImageFilter.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 itkTestingStretchIntensityImageFilter_h
19  #define itkTestingStretchIntensityImageFilter_h
20 
22 
23  namespace itk
24  {
25  namespace Testing
26  {
27 
40 template< typename TInputImage, typename TOutputImage = TInputImage >
41 class ITK_TEMPLATE_EXPORT StretchIntensityImageFilter: public ImageSource< TOutputImage >
42 {
43 public:
49 
50  typedef typename TOutputImage::PixelType OutputPixelType;
51  typedef typename TInputImage::PixelType InputPixelType;
53 
55  itkNewMacro(Self);
56 
59 
60  itkSetMacro(OutputMinimum, OutputPixelType);
61  itkSetMacro(OutputMaximum, OutputPixelType);
62  itkGetConstReferenceMacro(OutputMinimum, OutputPixelType);
63  itkGetConstReferenceMacro(OutputMaximum, OutputPixelType);
64 
68  itkGetConstReferenceMacro(Scale, RealType);
69  itkGetConstReferenceMacro(Shift, RealType);
71 
74  itkGetConstReferenceMacro(InputMinimum, InputPixelType);
75  itkGetConstReferenceMacro(InputMaximum, InputPixelType);
77 
79  using Superclass::SetInput;
80  virtual void SetInput(const TInputImage *image);
81  const TInputImage * GetInput() const;
83 
84 #ifdef ITK_USE_CONCEPT_CHECKING
85  // Begin concept checking
86  itkConceptMacro( InputHasNumericTraitsCheck,
88  itkConceptMacro( OutputHasNumericTraitsCheck,
90  itkConceptMacro( RealTypeMultiplyOperatorCheck,
92  itkConceptMacro( RealTypeAdditiveOperatorsCheck,
94  // End concept checking
95 #endif
96 
97 protected:
99  virtual ~StretchIntensityImageFilter() ITK_OVERRIDE {}
100 
102  void BeforeThreadedGenerateData(void) ITK_OVERRIDE;
103 
105  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
106 
108  typedef typename TInputImage::RegionType InputImageRegionType;
109 
118  void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread, ThreadIdType threadId) ITK_OVERRIDE;
119 
120 private:
121  ITK_DISALLOW_COPY_AND_ASSIGN(StretchIntensityImageFilter);
122 
123  RealType m_Scale;
124  RealType m_Shift;
125 
126  InputPixelType m_InputMinimum;
127  InputPixelType m_InputMaximum;
128 
129  OutputPixelType m_OutputMinimum;
130  OutputPixelType m_OutputMaximum;
131 };
132 } // end namespace Testing
133 } // end namespace itk
134 
135 #ifndef ITK_MANUAL_INSTANTIATION
136 #include "itkTestingStretchIntensityImageFilter.hxx"
137 #endif
138 
139 #endif
NumericTraits< InputPixelType >::RealType RealType
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.
Applies a linear transformation to the intensity levels of the input Image.
unsigned int ThreadIdType
Definition: itkIntTypes.h:159
OutputImageType::RegionType OutputImageRegionType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Define additional traits for native types such as int or float.
#define itkConceptMacro(name, concept)