X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=tools%2FclitkCropImageGenericFilter.h;h=2a16b9dcf0447197821507fbf9f341b552c7ebd9;hb=109fbd68b9c171a4fa18d6c58b311718b418d181;hp=5347b0bab499b11886bfdb1a78fb9604fd706211;hpb=a26cd8a19e1b9ad8344ab501436045f171a73713;p=clitk.git diff --git a/tools/clitkCropImageGenericFilter.h b/tools/clitkCropImageGenericFilter.h index 5347b0b..2a16b9d 100755 --- a/tools/clitkCropImageGenericFilter.h +++ b/tools/clitkCropImageGenericFilter.h @@ -15,102 +15,59 @@ - BSD See included LICENSE.txt file - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html ======================================================================-====*/ -#ifndef clitkCropImageGenericFilter_h -#define clitkCropImageGenericFilter_h -/* ================================================= - * @file clitkCropImageGenericFilter.h - * @author - * @date - * - * @brief - * - ===================================================*/ +#ifndef CLITKCROPIMAGEGENERICFILTER_H +#define CLITKCROPIMAGEGENERICFILTER_H - -// clitk include +// clitk #include "clitkIO.h" -#include "clitkCommon.h" -#include "clitkImageCommon.h" -#include "clitkCropImage_ggo.h" +#include "clitkImageToImageGenericFilter.h" +#include "clitkCropLikeImageFilter.h" +#include "clitkAutoCropFilter.h" -//itk include -#include "itkLightObject.h" -#include "itkCropImageFilter.h" +// itk +#include +//-------------------------------------------------------------------- namespace clitk { - - class ITK_EXPORT CropImageGenericFilter : public itk::LightObject + template + class ITK_EXPORT CropImageGenericFilter: + public ImageToImageGenericFilter > { public: - //---------------------------------------- - // ITK - //---------------------------------------- - typedef CropImageGenericFilter Self; - typedef itk::LightObject Superclass; - typedef itk::SmartPointer Pointer; - typedef itk::SmartPointer ConstPointer; + //-------------------------------------------------------------------- + CropImageGenericFilter(); + + //-------------------------------------------------------------------- + typedef CropImageGenericFilter Self; + typedef ImageToImageGenericFilter > Superclass; + typedef itk::SmartPointer Pointer; + typedef itk::SmartPointer ConstPointer; - // Method for creation through the object factory + //-------------------------------------------------------------------- itkNewMacro(Self); - - // Run-time type information (and related methods) itkTypeMacro( CropImageGenericFilter, LightObject ); + //-------------------------------------------------------------------- + void SetArgsInfo(const ArgsInfoType & a); - //---------------------------------------- - // Typedefs - //---------------------------------------- - - - //---------------------------------------- - // Set & Get - //---------------------------------------- - void SetArgsInfo(const args_info_clitkCropImage & a) - { - m_ArgsInfo=a; - m_Verbose=m_ArgsInfo.verbose_flag; - m_InputFileName=m_ArgsInfo.input_arg; - } - - - //---------------------------------------- - // Update - //---------------------------------------- - void Update(); + //-------------------------------------------------------------------- + // Main function called each time the filter is updated + template + void UpdateWithInputImageType(); protected: + template void InitializeImageType(); + ArgsInfoType mArgsInfo; - //---------------------------------------- - // Constructor & Destructor - //---------------------------------------- - CropImageGenericFilter(); - ~CropImageGenericFilter() {}; - - - //---------------------------------------- - // Templated members - //---------------------------------------- - template void UpdateWithDim(std::string PixelType, unsigned int Components); - template void UpdateWithDimAndPixelType(); - - - //---------------------------------------- - // Data members - //---------------------------------------- - args_info_clitkCropImage m_ArgsInfo; - bool m_Verbose; - std::string m_InputFileName; - - }; - - + };// end class + //-------------------------------------------------------------------- } // end namespace clitk #ifndef ITK_MANUAL_INSTANTIATION #include "clitkCropImageGenericFilter.txx" #endif -#endif // #define clitkCropImageGenericFilter_h +#endif // #define CLITKCROPIMAGEGENERICFILTER_H