ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
rtkLagCorrectionImageFilter.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 * https://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
19#ifndef rtkLagCorrectionImageFilter_h
20#define rtkLagCorrectionImageFilter_h
21
23#include <itkVector.h>
24#include <vector>
25
26#include "rtkConfiguration.h"
27#include "rtkMacro.h"
28
29namespace rtk
30{
31
53
54template <typename TImage, unsigned VModelOrder>
55class ITK_TEMPLATE_EXPORT LagCorrectionImageFilter : public itk::InPlaceImageFilter<TImage, TImage>
56{
57public:
58 ITK_DISALLOW_COPY_AND_MOVE(LagCorrectionImageFilter);
59
65
67 itkNewMacro(Self);
68
70 itkOverrideGetNameOfClassMacro(LagCorrectionImageFilter);
71
72 using ImageRegionType = typename TImage::RegionType;
73 using ImageSizeType = typename TImage::SizeType;
74 using PixelType = typename TImage::PixelType;
75 using IndexType = typename TImage::IndexType;
77 using FloatVectorType = typename std::vector<float>;
78 using OutputImageRegionType = typename TImage::RegionType;
79
81 itkGetMacro(A, VectorType);
82 itkGetMacro(B, VectorType);
83 virtual void
85 {
86 if ((this->m_A != A) && (this->m_B != B))
87 {
88 if ((A.Size() == VModelOrder) && (B.Size() == VModelOrder))
89 {
90 }
91 this->m_A = A;
92 this->m_B = B;
93 this->Modified();
95 }
96 }
97
98protected:
100 ~LagCorrectionImageFilter() override = default;
101
102 void
104
105 void
107
108 void
109 ThreadedGenerateData(const ImageRegionType & thRegion, itk::ThreadIdType threadId) override;
110
114 unsigned int
115 SplitRequestedRegion(unsigned int i, unsigned int num, OutputImageRegionType & splitRegion) override;
116 virtual int
117 SplitRequestedRegion(int i, int num, OutputImageRegionType & splitRegion);
118
119 VectorType m_A; // a_n coefficients (lag rates)
120 VectorType m_B; // b coefficients (lag coefficients)
121 VectorType m_ExpmA; // exp(-a)
122 float m_SumB; // normalization factor
123
124
125 FloatVectorType m_S; // State variable
126 IndexType m_StartIdx; // To account for cropping
127
128private:
129 bool m_NewParamJustReceived; // For state/correction initialization
130};
131
132} // namespace rtk
133
134#ifndef ITK_MANUAL_INSTANTIATION
135# include "rtkLagCorrectionImageFilter.hxx"
136#endif
137
138#endif
Base class for filters that take an image as input and overwrite that image as the output.
virtual void Modified() const
Implements transparent reference counting.
A templated class holding a n-Dimensional vector.
Definition itkVector.h:63
void GenerateOutputInformation() override
~LagCorrectionImageFilter() override=default
void GenerateInputRequestedRegion() override
typename TImage::RegionType OutputImageRegionType
itk::SmartPointer< const Self > ConstPointer
unsigned int SplitRequestedRegion(unsigned int i, unsigned int num, OutputImageRegionType &splitRegion) override
virtual void SetCoefficients(const VectorType A, const VectorType B)
typename TImage::RegionType ImageRegionType
typename std::vector< float > FloatVectorType
void ThreadedGenerateData(const ImageRegionType &thRegion, itk::ThreadIdType threadId) override
itk::InPlaceImageFilter< TImage, TImage > Superclass
typename itk::Vector< float, VModelOrder > VectorType
virtual int SplitRequestedRegion(int i, int num, OutputImageRegionType &splitRegion)
unsigned int ThreadIdType
Definition itkIntTypes.h:98