X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcpExtensions%2FAlgorithms%2FIsoImageSlicer.h;fp=lib%2FcpExtensions%2FAlgorithms%2FIsoImageSlicer.h;h=0000000000000000000000000000000000000000;hb=2e142df11d6f312a2a2b5097b8da73571ed523e8;hp=919043022b208d86348d5795d69ce8a5be8319ef;hpb=61b3659afe961ed248f30e26f9ca8f28fcfafddc;p=cpPlugins.git diff --git a/lib/cpExtensions/Algorithms/IsoImageSlicer.h b/lib/cpExtensions/Algorithms/IsoImageSlicer.h deleted file mode 100644 index 9190430..0000000 --- a/lib/cpExtensions/Algorithms/IsoImageSlicer.h +++ /dev/null @@ -1,185 +0,0 @@ -// ------------------------------------------------------------------------- -// @author Leonardo Florez-Valencia (florez-l@javeriana.edu.co) -// ------------------------------------------------------------------------- - -#ifndef __CPEXTENSIONS__ALGORITHMS__ISOIMAGESLICER__H__ -#define __CPEXTENSIONS__ALGORITHMS__ISOIMAGESLICER__H__ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace cpExtensions -{ - namespace Algorithms - { - /** - */ - template< class R, class I > - class BaseImageSlicer - : public itk::ImageToImageFilter< typename R::InputImageType, itk::Image< typename R::InputImageType::PixelType, R::ImageDimension - 1 > > - { - public: - // Basic types - typedef BaseImageSlicer Self; - typedef R TSlicer; - typedef I TInterpolateFunction; - typedef typename R::InputImageType TImage; - typedef typename I::CoordRepType TScalar; - typedef typename TImage::PixelType TPixel; - enum - { - Dim = TImage::ImageDimension, - SliceDim = TImage::ImageDimension - 1 - }; - typedef itk::Image< TPixel, Self::SliceDim > TSliceImage; - - // itk types - typedef itk::ImageToImageFilter< TImage, TSliceImage > Superclass; - typedef itk::SmartPointer< Self > Pointer; - typedef itk::SmartPointer< const Self > ConstPointer; - - // Internal filters - typedef itk::ExtractImageFilter< TImage, TSliceImage > TCollapsor; - - // Various types - typedef typename TImage::IndexType TIndex; - typedef typename TImage::RegionType TRegion; - typedef typename TImage::SizeType TSize; - typedef typename TImage::SpacingType TSpacing; - typedef typename TSpacing::ValueType TSpacingValue; - - typedef itk::AffineTransform< TScalar, Self::Dim > TTransform; - typedef typename TTransform::MatrixType TMatrix; - typedef typename TTransform::OffsetType TVector; - - public: - itkNewMacro( Self ); - itkTypeMacro( BaseImageSlicer, itkImageToImageFilter ); - - itkBooleanMacro( SizeFromMaximum ); - itkBooleanMacro( SizeFromMinimum ); - itkBooleanMacro( SpacingFromMaximum ); - itkBooleanMacro( SpacingFromMinimum ); - - itkGetConstObjectMacro( Transform, TTransform ); - itkGetConstMacro( DefaultValue, TPixel ); - itkGetConstMacro( Size, TVector ); - itkGetConstMacro( SizeFromMaximum, bool ); - itkGetConstMacro( SizeFromMinimum, bool ); - itkGetConstMacro( Spacing, TSpacingValue ); - itkGetConstMacro( SpacingFromMaximum, bool ); - itkGetConstMacro( SpacingFromMinimum, bool ); - - itkSetObjectMacro( Transform, TTransform ); - itkSetMacro( Size, TVector ); - itkSetMacro( DefaultValue, TPixel ); - itkSetMacro( SizeFromMaximum, bool ); - itkSetMacro( SizeFromMinimum, bool ); - itkSetMacro( Spacing, TSpacingValue ); - itkSetMacro( SpacingFromMaximum, bool ); - itkSetMacro( SpacingFromMinimum, bool ); - - public: - virtual unsigned long GetMTime( ) const cpExtensions_OVERRIDE; - - const TInterpolateFunction* GetInterpolator( ) const; - const TMatrix& GetRotation( ) const; - const TVector& GetTranslation( ) const; - - void SetInterpolator( TInterpolateFunction* f ); - - template< class M > - void SetRotation( const M& r ); - - template< class V > - void SetTranslation( const V& t ); - void SetSize( TScalar s ); - - protected: - BaseImageSlicer( ); - virtual ~BaseImageSlicer( ); - - virtual void GenerateOutputInformation( ) cpExtensions_OVERRIDE; // TODO { } - virtual void GenerateInputRequestedRegion( ) cpExtensions_OVERRIDE; - virtual void GenerateData( ) cpExtensions_OVERRIDE; - - private: - // Purposely not implemented - BaseImageSlicer( const Self& ); - void operator=( const Self& ); - - protected: - typename TSlicer::Pointer m_Slicer; - typename TCollapsor::Pointer m_Collapsor; - typename TTransform::Pointer m_Transform; - - TPixel m_DefaultValue; - - TVector m_Size; - bool m_SizeFromMaximum; - bool m_SizeFromMinimum; - - TSpacingValue m_Spacing; - bool m_SpacingFromMaximum; - bool m_SpacingFromMinimum; - }; - - } // ecapseman - -} // ecapseman - -// ------------------------------------------------------------------------- -#define CPPLUGINS_DEFINE_ISOIMAGESLICER( name, R, F ) \ - template< class I, class S = double > \ - class name \ - : public BaseImageSlicer< R< I, I, S >, F< I, S > > \ - { \ - public: \ - typedef BaseImageSlicer< R< I, I, S >, F< I, S > > Superclass; \ - typedef name Self; \ - typedef itk::SmartPointer< Self > Pointer; \ - typedef itk::SmartPointer< const Self > ConstPointer; \ - public: \ - itkNewMacro( Self ); \ - itkTypeMacro( name, BaseSlicer ); \ - protected: \ - name( ) : Superclass( ) { } \ - virtual ~name( ) { } \ - private: \ - name( const Self& ); \ - void operator=( const Self& ); \ - }; - -namespace cpExtensions -{ - namespace Algorithms - { - CPPLUGINS_DEFINE_ISOIMAGESLICER( - IsoImageSlicer, - itk::ResampleImageFilter, - itk::InterpolateImageFunction - ); - CPPLUGINS_DEFINE_ISOIMAGESLICER( - VectorIsoImageSlicer, - itk::VectorResampleImageFilter, - itk::VectorInterpolateImageFunction - ); - - } // ecapseman - -} // ecapseman - -#ifndef ITK_MANUAL_INSTANTIATION -# include -#endif // ITK_MANUAL_INSTANTIATION - -#endif // __CPEXTENSIONS__ALGORITHMS__ISOIMAGESLICER__H__ - -// eof - $RCSfile$