RTK  1.4.0
Reconstruction Toolkit
rtkMultiplyByVectorImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright RTK 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 rtkMultiplyByVectorImageFilter_h
19 #define rtkMultiplyByVectorImageFilter_h
20 
21 #include <itkImageToImageFilter.h>
22 
23 namespace rtk
24 {
39 template< class TInputImage>
40 class MultiplyByVectorImageFilter : public itk::ImageToImageFilter<TInputImage, TInputImage>
41 {
42 public:
47 
49  itkNewMacro(Self);
50 
53 
55  void SetVector(std::vector<float> vect);
56 
57 protected:
59  virtual ~MultiplyByVectorImageFilter() ITK_OVERRIDE {}
60 
62 #if ITK_VERSION_MAJOR<5
63  void ThreadedGenerateData(const typename TInputImage::RegionType& outputRegionForThread, itk::ThreadIdType itkNotUsed(threadId)) ITK_OVERRIDE;
64 #else
65  void DynamicThreadedGenerateData(const typename TInputImage::RegionType& outputRegionForThread) ITK_OVERRIDE;
66 #endif
67 
68 
69 private:
70  MultiplyByVectorImageFilter(const Self &); //purposely not implemented
71  void operator=(const Self &); //purposely not implemented
72 
73  std::vector<float> m_Vector;
74 
75 };
76 } //namespace RTK
77 
78 
79 #ifndef ITK_MANUAL_INSTANTIATION
80 #include "rtkMultiplyByVectorImageFilter.hxx"
81 #endif
82 
83 #endif
void ThreadedGenerateData(const typename TInputImage::RegionType &outputRegionForThread, itk::ThreadIdType) override
Multiplies each (n-1) dimension image by the corresponding element in a vector.
itk::ImageToImageFilter< TInputImage, TInputImage > Superclass
unsigned int ThreadIdType
void SetVector(std::vector< float > vect)