]> Creatis software - clitk.git/blob - tools/clitkPadImageGenericFilter.h
Bug/issue 704
[clitk.git] / tools / clitkPadImageGenericFilter.h
1 /*=========================================================================
2   Program:   vv                     http://www.creatis.insa-lyon.fr/rio/vv
3
4   Authors belong to:
5   - University of LYON              http://www.universite-lyon.fr/
6   - Léon Bérard cancer center       http://www.centreleonberard.fr
7   - CREATIS CNRS laboratory         http://www.creatis.insa-lyon.fr
8
9   This software is distributed WITHOUT ANY WARRANTY; without even
10   the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11   PURPOSE.  See the copyright notices for more information.
12
13   It is distributed under dual licence
14
15   - BSD        See included LICENSE.txt file
16   - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
17 ===========================================================================**/
18
19 #ifndef CLITKPADIMAGEGENERICFILTER_H
20 #define CLITKPADIMAGEGENERICFILTER_H
21
22 // clitk
23 #include "clitkIO.h"
24 #include "clitkImageToImageGenericFilter.h"
25 #include "clitkPadImage_ggo.h"
26
27
28 //--------------------------------------------------------------------
29 namespace clitk
30 {
31
32   class ITK_EXPORT PadImageGenericFilter:
33     public ImageToImageGenericFilter<PadImageGenericFilter>
34   {
35   public:
36     enum
37     {
38       ERR_SUCCESS = 0,
39       ERR_NOT_SAME_SPACING = -1,
40       ERR_NOT_LIKE_LARGER = -2
41     };
42
43     //--------------------------------------------------------------------
44     PadImageGenericFilter();
45
46     //--------------------------------------------------------------------
47     typedef PadImageGenericFilter   Self;
48     typedef ImageToImageGenericFilter<PadImageGenericFilter> Superclass;
49     typedef itk::SmartPointer<Self>       Pointer;
50     typedef itk::SmartPointer<const Self> ConstPointer;
51     typedef args_info_clitkPadImage       args_info_type;
52
53     //--------------------------------------------------------------------
54     itkNewMacro(Self);
55     itkTypeMacro( PadImageGenericFilter, LightObject );
56
57     //--------------------------------------------------------------------
58     void SetArgsInfo(const args_info_type& a);
59
60     //--------------------------------------------------------------------
61     // Main function called each time the filter is updated
62     template<class ImageType>
63     void UpdateWithInputImageType();
64
65   protected:
66     template<unsigned int Dim> void InitializeImageType();
67
68     template <class ImageType, class PadBoundType, unsigned int dim>
69     int PadLike(typename ImageType::Pointer input, PadBoundType* padLower, PadBoundType* padUpper);
70     
71     args_info_type mArgsInfo;
72
73   };// end class
74   //--------------------------------------------------------------------
75 } // end namespace clitk
76
77 #endif // #define CLITKPADIMAGEGENERICFILTER_H