]> Creatis software - clitk.git/blob - itk/clitkInvertVFFilter.h
cleanup / better handling of errors
[clitk.git] / itk / clitkInvertVFFilter.h
1 #ifndef __clitkInvertVFFilter_h
2 #define __clitkInvertVFFilter_h
3
4 //clitk include
5 #include "clitkImageCommon.h"
6
7 #include "itkImageToImageFilter.h"
8 #include "itkImage.h"
9 #include "itkImageRegionIterator.h"
10 #include "itkImageRegionIteratorWithIndex.h"
11 #include "itkNumericTraits.h"
12
13 namespace clitk
14 {
15   
16   template <class InputImageType, class OutputImageType>  
17   class ITK_EXPORT InvertVFFilter : public itk::ImageToImageFilter<InputImageType, OutputImageType>
18   
19   {
20   public:
21     typedef InvertVFFilter     Self;
22     typedef itk::ImageToImageFilter<InputImageType, OutputImageType>     Superclass;
23     typedef itk::SmartPointer<Self>            Pointer;
24     typedef itk::SmartPointer<const Self>      ConstPointer;
25    
26     /** Method for creation through the object factory. */
27     itkNewMacro(Self);  
28
29     /** Run-time type information (and related methods) */
30     itkTypeMacro( InvertVFFilter, ImageToImageFilter );
31   
32     /** Determine the image dimension. */
33     itkStaticConstMacro(ImageDimension, unsigned int,
34                         InputImageType::ImageDimension );
35     
36     //Some other typedefs
37     typedef double CoordRepType;
38     typedef itk::Image<double, ImageDimension> WeightsImageType;
39     typedef itk::Image<itk::SimpleFastMutexLock, ImageDimension> MutexImageType;
40
41     /** Point type */
42     typedef itk::Point<CoordRepType,itkGetStaticConstMacro(ImageDimension)> PointType;
43
44     /** Inherit some types from the superclass. */
45     typedef typename OutputImageType::IndexType        IndexType;
46     typedef typename OutputImageType::SizeType         SizeType;
47     typedef typename OutputImageType::PixelType        PixelType;
48     typedef typename OutputImageType::SpacingType      SpacingType;
49
50     //Set Methods(inline)
51     itkSetMacro( Verbose, bool);
52     itkSetMacro( EdgePaddingValue, PixelType );
53     void SetNumberOfThreads(unsigned int r )
54     {
55       m_NumberOfThreadsIsGiven=true;
56       m_NumberOfThreads=r;
57     }
58     itkSetMacro(ThreadSafe, bool);
59
60   
61   protected:
62     InvertVFFilter();
63     ~InvertVFFilter() {};
64     void GenerateData( );
65    
66     bool m_Verbose;
67     bool m_NumberOfThreadsIsGiven;
68     unsigned int m_NumberOfThreads;
69     PixelType m_EdgePaddingValue;
70     bool m_ThreadSafe;
71   };
72
73
74 } // end namespace clitk
75 #ifndef ITK_MANUAL_INSTANTIATION
76 #include "clitkInvertVFFilter.txx"
77 #endif
78
79 #endif // #define __clitkInvertVFFilter_h