]> Creatis software - FrontAlgorithms.git/blob - lib/fpa/Common/SliceBySliceRandomWalker.h
48f2bedf8e2375b3e86a4131b5e36dea8f644c22
[FrontAlgorithms.git] / lib / fpa / Common / SliceBySliceRandomWalker.h
1 // =========================================================================
2 // @author Leonardo Florez Valencia
3 // @email florez-l@javeriana.edu.co
4 // =========================================================================
5 #ifndef __fpa__Common__SliceBySliceRandomWalker__h__
6 #define __fpa__Common__SliceBySliceRandomWalker__h__
7
8 #include <fpa/Config.h>
9 #include <itkImageToImageFilter.h>
10
11 namespace fpa
12 {
13   namespace Common
14   {
15     /**
16      */
17     template< class _TImage, class _TLabels, class _TScalarImage >
18     class SliceBySliceRandomWalker
19       : public itk::ImageToImageFilter< _TImage, _TLabels >
20     {
21     public:
22       typedef _TImage       TImage;
23       typedef _TLabels      TLabels;
24       typedef _TScalarImage TScalarImage;
25
26       typedef SliceBySliceRandomWalker                   Self;
27       typedef itk::ImageToImageFilter< TImage, TLabels > Superclass;
28       typedef itk::SmartPointer< Self >                  Pointer;
29       typedef itk::SmartPointer< const Self >            ConstPointer;
30
31       typedef typename TImage::PixelType       TPixel;
32       typedef typename TLabels::PixelType      TLabel;
33       typedef typename TScalarImage::PixelType TScalar;
34
35     public:
36       itkNewMacro( Self );
37       itkTypeMacro(
38         fpa::Common::SliceBySliceRandomWalker, itk::ImageToImageFilter
39         );
40
41       ivqITKInputMacro( InputLabels, TLabels );
42       ivqITKInputMacro( InputVesselness, TScalarImage );
43
44     protected:
45       SliceBySliceRandomWalker( );
46       virtual ~SliceBySliceRandomWalker( );
47
48       virtual void GenerateData( ) override;
49
50       void _Composite(
51         typename TScalarImage::Pointer& composite,
52         const TLabels* labels,
53         const TScalarImage* vesselness
54         );
55
56       template< class _TSlicePtr, class _TInput >
57       void _Slice(
58         _TSlicePtr& slice,
59         const _TInput* input,
60         typename _TInput::RegionType region
61         );
62
63       template< class _TBinaryTree, class _TData3D, class _TFusion >
64       void _GoDown(
65         _TBinaryTree& binaryTree,
66         const _TData3D& data3D,
67         const _TFusion& fusion,
68         int numSlices
69         );
70
71       template< class _TBinaryTree, class _TData3D, class _TFusion >
72       void _GoUp(
73         _TBinaryTree& binaryTree,
74         const _TData3D& data3D,
75         const _TFusion& fusion,
76         int numSlices
77         );
78
79     private:
80       // Purposely not implemented
81       SliceBySliceRandomWalker( const Self& other );
82       Self& operator=( const Self& other );
83     };
84
85   } // ecapseman
86
87 } // ecapseman
88
89 #ifndef ITK_MANUAL_INSTANTIATION
90 #  include <fpa/Common/SliceBySliceRandomWalker.hxx>
91 #endif // ITK_MANUAL_INSTANTIATION
92 #endif // __fpa__Common__SliceBySliceRandomWalker__h__
93 // eof - $RCSfile$