ANIMA  4.0
animaGeneralizedFAImageFilter.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <iostream>
4 #include <itkImageToImageFilter.h>
5 #include <itkVectorImage.h>
6 #include <vector>
7 
8 namespace anima
9 {
10 
11 template <typename TInputPixelType>
13 public itk::ImageToImageFilter< itk::VectorImage<TInputPixelType, 3> , itk::Image <TInputPixelType, 3> >
14 {
15 public:
18  typedef itk::VectorImage <TInputPixelType, 3> TInputImage;
19  typedef itk::Image <TInputPixelType, 3> TOutputImage;
20  typedef itk::ImageToImageFilter< TInputImage, TOutputImage > Superclass;
21  typedef itk::SmartPointer<Self> Pointer;
22  typedef itk::SmartPointer<const Self> ConstPointer;
23 
25  itkNewMacro(Self);
26 
28  itkTypeMacro(GeneralizedFAImageFilter, ImageToImageFilter);
29 
30  typedef typename TInputImage::Pointer InputImagePointer;
31  typedef typename TInputImage::PixelType InputImagePixel;
32  typedef typename TOutputImage::Pointer OutputImagePointer;
33 
35  typedef typename Superclass::OutputImageRegionType OutputImageRegionType;
36 
37 protected:
39  {
40  }
41 
43 
44  void DynamicThreadedGenerateData(const OutputImageRegionType &outputRegionForThread) ITK_OVERRIDE;
45 
46  bool isZero(InputImagePixel &testVal)
47  {
48  bool resVal = true;
49  for (unsigned int i = 0;i < testVal.GetSize();++i)
50  {
51  if (testVal[i] != 0)
52  {
53  resVal = false;
54  break;
55  }
56  }
57 
58  return resVal;
59  }
60 
61 private:
62  ITK_DISALLOW_COPY_AND_ASSIGN(GeneralizedFAImageFilter);
63 };
64 
65 } // end of namespace anima
66 
itk::Image< TInputPixelType, 3 > TOutputImage
void DynamicThreadedGenerateData(const OutputImageRegionType &outputRegionForThread) ITK_OVERRIDE
itk::ImageToImageFilter< TInputImage, TOutputImage > Superclass
Superclass::OutputImageRegionType OutputImageRegionType
bool isZero(InputImagePixel &testVal)
itk::SmartPointer< const Self > ConstPointer
itk::VectorImage< TInputPixelType, 3 > TInputImage