X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=itk%2FclitkExtractSliceFilter.h;h=2cdabcf4d4bbec191c9b0929330ed8d9ae1ff47e;hb=595624eb4297e747630105d45017de69733caef2;hp=93d3cd0426fa91107945308ae35cf08e2dc7f177;hpb=9cdfabc67eb004e921e7adbe98a56f30e3a3326d;p=clitk.git diff --git a/itk/clitkExtractSliceFilter.h b/itk/clitkExtractSliceFilter.h index 93d3cd0..2cdabcf 100644 --- a/itk/clitkExtractSliceFilter.h +++ b/itk/clitkExtractSliceFilter.h @@ -3,7 +3,7 @@ Authors belong to: - University of LYON http://www.universite-lyon.fr/ - - Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr + - Léon Bérard cancer center http://www.centreleonberard.fr - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr This software is distributed WITHOUT ANY WARRANTY; without even @@ -14,7 +14,7 @@ - BSD See included LICENSE.txt file - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html - ======================================================================-====*/ + ===========================================================================**/ #ifndef CLITKEXTRACTSLICEFILTER_H #define CLITKEXTRACTSLICEFILTER_H @@ -47,24 +47,10 @@ namespace clitk { class ITK_EXPORT ExtractSliceFilter: public clitk::FilterBase, public itk::ImageToImageFilter::Pointer> > + typename itk::Image > { public: - /** Standard class typedefs. */ - typedef itk::ImageToImageFilter Superclass; - typedef ExtractSliceFilter Self; - 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(ExtractSliceFilter, ImageToImageFilter); - FILTERBASE_INIT; - /** Some convenient typedefs. */ typedef typename ImageType::ConstPointer ImageConstPointer; typedef typename ImageType::Pointer ImagePointer; @@ -72,6 +58,7 @@ namespace clitk { typedef typename ImageType::PixelType PixelType; typedef typename ImageType::SpacingType SpacingType; typedef typename ImageType::SizeType SizeType; + typedef typename ImageType::IndexType IndexType; /** ImageDimension constants */ itkStaticConstMacro(ImageDimension, unsigned int, ImageType::ImageDimension); @@ -80,12 +67,28 @@ namespace clitk { typedef itk::Image SliceType; typedef typename SliceType::Pointer SliceTypePointer; + /** Standard class typedefs. */ + typedef itk::ImageToImageFilter Superclass; + typedef ExtractSliceFilter Self; + 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(ExtractSliceFilter, ImageToImageFilter); + FILTERBASE_INIT; + /** Input : initial image and object */ void SetInput(const ImageType * image); // Options itkGetConstMacro(Direction, int); itkSetMacro(Direction, int); + + // Get results + void GetOutputSlices(std::vector & o); protected: ExtractSliceFilter(); @@ -97,9 +100,14 @@ namespace clitk { virtual void GenerateInputRequestedRegion(); virtual void GenerateData(); + int m_NumberOfSlices; ImagePointer input; ImagePointer object; - std::vector output; + SliceType * output; + + RegionType m_region; + SizeType m_size; + IndexType m_index; private: ExtractSliceFilter(const Self&); //purposely not implemented