ANIMA  4.0
animaLocalPatchCovarianceDistanceImageFilter.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <iostream>
5 #include <itkVectorImage.h>
6 #include <itkImage.h>
7 
8 #include <vector>
9 
10 namespace anima
11 {
12 
13 template <class PixelScalarType>
15 public anima::MaskedImageToImageFilter< itk::VectorImage <PixelScalarType, 3> , itk::Image <PixelScalarType, 3> >
16 {
17 public:
20  typedef itk::SmartPointer<Self> Pointer;
21  typedef itk::SmartPointer<const Self> ConstPointer;
22 
24  itkNewMacro(Self)
25 
26 
28 
29 
30  typedef itk::VectorImage <PixelScalarType, 3> InputImageType;
31  typedef itk::Image <PixelScalarType, 3> OutputImageType;
32 
33  typedef typename InputImageType::PixelType VectorType;
34 
35  typedef vnl_matrix <double> CovarianceType;
36 
37  typedef anima::MaskedImageToImageFilter< InputImageType, OutputImageType > Superclass;
38  typedef typename Superclass::MaskImageType MaskImageType;
39  typedef typename InputImageType::Pointer InputImagePointer;
40  typedef typename InputImageType::IndexType InputImageIndexType;
41  typedef typename OutputImageType::Pointer OutputImagePointer;
42 
44  typedef typename Superclass::OutputImageRegionType OutputImageRegionType;
45  itkSetMacro(PatchHalfSize, unsigned int)
46 
47 protected:
49  : Superclass()
50  {
51  this->SetNumberOfRequiredOutputs(2);
52  this->SetNthOutput(0,this->MakeOutput(0));
53  this->SetNthOutput(1,this->MakeOutput(1));
54 
55  m_PatchHalfSize = 1;
56  }
57 
59 
60  void BeforeThreadedGenerateData() ITK_OVERRIDE;
61  void DynamicThreadedGenerateData(const OutputImageRegionType &outputRegionForThread) ITK_OVERRIDE;
62 
63 private:
64  ITK_DISALLOW_COPY_AND_ASSIGN(LocalPatchCovarianceDistanceImageFilter);
65 
66  unsigned int m_PatchHalfSize;
67 };
68 
69 } // end namespace anima
70 
LocalPatchCovarianceDistanceImageFilter< PixelScalarType > Self
void DynamicThreadedGenerateData(const OutputImageRegionType &outputRegionForThread) ITK_OVERRIDE