]> Creatis software - clitk.git/blob - tools/clitkPadImageGenericFilter.h
Debug RTStruct conversion with empty struc
[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 namespace clitk
29 {
30
31   class ITK_EXPORT PadImageGenericFilter:
32     public ImageToImageGenericFilter<PadImageGenericFilter>
33   {
34   public:
35     enum
36     {
37       PAD_ERR_SUCCESS = 0,
38       PAD_ERR_NOT_SAME_SPACING = -1,
39       PAD_ERR_NOT_LIKE_LARGER = -2
40     };
41
42     //--------------------------------------------------------------------
43     PadImageGenericFilter();
44
45     //--------------------------------------------------------------------
46     typedef PadImageGenericFilter   Self;
47     typedef ImageToImageGenericFilter<PadImageGenericFilter> Superclass;
48     typedef itk::SmartPointer<Self>       Pointer;
49     typedef itk::SmartPointer<const Self> ConstPointer;
50     typedef args_info_clitkPadImage       args_info_type;
51
52     //--------------------------------------------------------------------
53     itkNewMacro(Self);
54     itkTypeMacro( PadImageGenericFilter, LightObject );
55
56     //--------------------------------------------------------------------
57     void SetArgsInfo(const args_info_type& a);
58
59     //--------------------------------------------------------------------
60     // Main function called each time the filter is updated
61     template<class ImageType>
62     void UpdateWithInputImageType();
63
64   protected:
65     template<unsigned int Dim> void InitializeImageType();
66
67     template <class ImageType, class PadBoundType, unsigned int dim>
68     int PadLike(typename ImageType::Pointer input, PadBoundType* padLower, PadBoundType* padUpper);
69     
70     args_info_type mArgsInfo;
71
72   };// end class
73   //--------------------------------------------------------------------
74 } // end namespace clitk
75
76 #endif // #define CLITKPADIMAGEGENERICFILTER_H