3 #include <itkInPlaceImageFilter.h> 4 #include <itkNumericTraits.h> 6 #include <itkVariableLengthVector.h> 10 template <
typename TInputImage,
typename TOutputImage=TInputImage>
12 public itk::InPlaceImageFilter<TInputImage,TOutputImage>
17 typedef itk::InPlaceImageFilter<TInputImage,TOutputImage>
Superclass;
52 itkSetMacro(Direction,
unsigned int)
75 itkSetMacro(NormalizeAcrossScale,
bool)
76 itkGetConstMacro(NormalizeAcrossScale,
bool)
80 itkGetConstMacro(Sigma, ScalarRealType)
81 itkSetMacro(Sigma, ScalarRealType)
85 virtual ~RecursiveLineYvvGaussianImageFilter() {}
86 void PrintSelf(std::ostream& os, itk::Indent indent)
const ITK_OVERRIDE;
123 V2 = V1;V1 = V0;V0 = out;
128 inline void ComputeCausalPart(itk::VariableLengthVector<T> &out,
const itk::VariableLengthVector<T> &data,
129 itk::VariableLengthVector<T> &V0, itk::VariableLengthVector<T> &V1,
130 itk::VariableLengthVector<T> &V2)
132 unsigned int vSize = data.GetSize();
133 if (out.GetSize() != vSize)
136 for (
unsigned int i = 0;i < vSize;++i)
138 out[i] = data[i] + V0[i] *
m_B1 + V1[i] *
m_B2 + V2[i] *
m_B3;
139 V2[i] = V1[i];V1[i] = V0[i];V0[i] = out[i];
148 V2 = V1;V1 = V0;V0 = out;
154 itk::VariableLengthVector<T> &V0, itk::VariableLengthVector<T> &V1,
155 itk::VariableLengthVector<T> &V2)
157 unsigned int vSize = data.GetSize();
158 for (
unsigned int i = 0;i < vSize;++i)
161 V2[i] = V1[i];V1[i] = V0[i];V0[i] = out[i];
172 inline void ComputeCausalBase(
const itk::VariableLengthVector<T> &data, itk::VariableLengthVector<T> &V0,
173 itk::VariableLengthVector<T> &V1, itk::VariableLengthVector<T> &V2)
175 unsigned int vSize = data.GetSize();
176 if (V0.GetSize() != vSize)
178 if (V1.GetSize() != vSize)
180 if (V2.GetSize() != vSize)
183 for (
unsigned int i = 0;i < vSize;++i)
185 V0[i] = data[i] / (1.0 -
m_B1 -
m_B2 -
m_B3);V1[i] = V0[i];V2[i] = V1[i];
200 for (
unsigned int i = 0;i < 3;++i)
202 V0 += (outs[ln - 1 - i] - u_p) *
m_MMatrix(0,i);
203 V1 += (outs[ln - 1 - i] - u_p) *
m_MMatrix(1,i);
204 V2 += (outs[ln - 1 - i] - u_p) *
m_MMatrix(2,i);
215 itk::VariableLengthVector<T> &V0, itk::VariableLengthVector<T> &V1,
216 itk::VariableLengthVector<T> &V2,
unsigned int ln)
218 unsigned int vSize = data.GetSize();
222 for (
unsigned int i = 0;i < vSize;++i)
224 V0[i] = data[i] * factor * factor;
225 V1[i] = data[i] * factor * factor;
226 V2[i] = data[i] * factor * factor;
229 for (
unsigned int i = 0;i < 3;++i)
230 for (
unsigned int j = 0;j < vSize;++j)
232 V0[j] += (outs[ln - 1 - i][j] - data[j] * factor) *
m_MMatrix(0,i);
233 V1[j] += (outs[ln - 1 - i][j] - data[j] * factor) *
m_MMatrix(1,i);
234 V2[j] += (outs[ln - 1 - i][j] - data[j] * factor) *
m_MMatrix(2,i);
238 for (
unsigned int i = 0;i < vSize;++i)
260 unsigned int m_Direction;
266 bool m_NormalizeAcrossScale;
void EnlargeOutputRequestedRegion(itk::DataObject *output) ITK_OVERRIDE
itk::InPlaceImageFilter< TInputImage, TOutputImage > Superclass
void ComputeAntiCausalPart(itk::VariableLengthVector< T > &out, itk::VariableLengthVector< T > &data, itk::VariableLengthVector< T > &V0, itk::VariableLengthVector< T > &V1, itk::VariableLengthVector< T > &V2)
const TInputImage * GetInputImage(void)
itk::SmartPointer< Self > Pointer
itk::NumericTraits< InputPixelType >::ScalarRealType ScalarRealType
vnl_matrix< ScalarRealType > m_MMatrix
void ComputeCausalPart(itk::VariableLengthVector< T > &out, const itk::VariableLengthVector< T > &data, itk::VariableLengthVector< T > &V0, itk::VariableLengthVector< T > &V1, itk::VariableLengthVector< T > &V2)
void ComputeAntiCausalPart(T &out, T &data, T &V0, T &V1, T &V2)
void GenerateData() ITK_OVERRIDE
itk::NumericTraits< InputPixelType >::RealType RealType
void ComputeAntiCausalBase(const T &data, T *outs, T &V0, T &V1, T &V2, unsigned int ln)
TInputImage InputImageType
itk::SmartPointer< const Self > ConstPointer
void FilterDataArray(RealType *outs, const RealType *data, unsigned int ln, RealType &sV0, RealType &sV1, RealType &sV2)
void PrintSelf(std::ostream &os, itk::Indent indent) const ITK_OVERRIDE
void ComputeCausalPart(T &out, const T &data, T &V0, T &V1, T &V2)
TOutputImage OutputImageType
void ComputeAntiCausalBase(const itk::VariableLengthVector< T > &data, itk::VariableLengthVector< T > *outs, itk::VariableLengthVector< T > &V0, itk::VariableLengthVector< T > &V1, itk::VariableLengthVector< T > &V2, unsigned int ln)
TInputImage::PixelType InputPixelType
TInputImage::Pointer InputImagePointer
TInputImage::ConstPointer InputImageConstPointer
void SetInputImage(const TInputImage *)
TOutputImage::RegionType OutputImageRegionType
void BeforeThreadedGenerateData() ITK_OVERRIDE
virtual void SetUp(ScalarRealType spacing)
void ComputeCausalBase(const T &data, T &V0, T &V1, T &V2)
void DynamicThreadedGenerateData(const OutputImageRegionType &outputRegionForThread) ITK_OVERRIDE
RecursiveLineYvvGaussianImageFilter Self
void ComputeCausalBase(const itk::VariableLengthVector< T > &data, itk::VariableLengthVector< T > &V0, itk::VariableLengthVector< T > &V1, itk::VariableLengthVector< T > &V2)