]> Creatis software - clitk.git/blob - tools/clitkCropImageGenericFilter.h
new CropImage with AutoCrop and CropLike
[clitk.git] / tools / clitkCropImageGenericFilter.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://oncora1.lyon.fnclcc.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 CLITKCROPIMAGEGENERICFILTER_H
20 #define CLITKCROPIMAGEGENERICFILTER_H
21
22 // clitk 
23 #include "clitkIO.h"
24 #include "clitkImageToImageGenericFilter.h"
25 #include "clitkCropLikeImageFilter.h"
26 #include "clitkAutoCropFilter.h"
27
28 // itk
29 #include <itkCropImageFilter.h>
30
31 //--------------------------------------------------------------------
32 namespace clitk 
33 {
34
35   template<class ArgsInfoType>
36   class ITK_EXPORT CropImageGenericFilter:
37     public ImageToImageGenericFilter<CropImageGenericFilter<ArgsInfoType> >
38   {
39   public:
40     //--------------------------------------------------------------------
41     CropImageGenericFilter();
42   
43     //--------------------------------------------------------------------
44     typedef CropImageGenericFilter   Self;
45     typedef ImageToImageGenericFilter<CropImageGenericFilter<ArgsInfoType> > Superclass;
46     typedef itk::SmartPointer<Self>       Pointer;
47     typedef itk::SmartPointer<const Self> ConstPointer;
48    
49     //--------------------------------------------------------------------
50     itkNewMacro(Self);  
51     itkTypeMacro( CropImageGenericFilter, LightObject );
52
53     //--------------------------------------------------------------------
54     void SetArgsInfo(const ArgsInfoType & a);
55
56     //--------------------------------------------------------------------
57     // Main function called each time the filter is updated
58     template<class ImageType>  
59     void UpdateWithInputImageType();
60
61   protected:
62     template<unsigned int Dim> void InitializeImageType();
63     ArgsInfoType mArgsInfo;
64
65   };// end class
66   //--------------------------------------------------------------------
67 } // end namespace clitk
68
69 #ifndef ITK_MANUAL_INSTANTIATION
70 #include "clitkCropImageGenericFilter.txx"
71 #endif
72
73 #endif // #define CLITKCROPIMAGEGENERICFILTER_H