RTK  2.0.1
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:
43  ITK_DISALLOW_COPY_AND_ASSIGN(MultiplyByVectorImageFilter);
44 
49 
51  itkNewMacro(Self);
52 
55 
57  void SetVector(std::vector<float> vect);
58 
59 protected:
61  ~MultiplyByVectorImageFilter() override = default;
62 
64 #if ITK_VERSION_MAJOR<5
65  void ThreadedGenerateData(const typename TInputImage::RegionType& outputRegionForThread, itk::ThreadIdType itkNotUsed(threadId)) override;
66 #else
67  void DynamicThreadedGenerateData(const typename TInputImage::RegionType& outputRegionForThread) override;
68 #endif
69 
70 
71 private:
72  std::vector<float> m_Vector;
73 
74 };
75 } //namespace RTK
76 
77 
78 #ifndef ITK_MANUAL_INSTANTIATION
79 #include "rtkMultiplyByVectorImageFilter.hxx"
80 #endif
81 
82 #endif
void ThreadedGenerateData(const typename TInputImage::RegionType &outputRegionForThread, itk::ThreadIdType) override
Multiplies each (n-1) dimension image by the corresponding element in a vector.
~MultiplyByVectorImageFilter() override=default
unsigned int ThreadIdType
void SetVector(std::vector< float > vect)