X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=itk%2FclitkExtractSliceFilter.h;h=136f43112a1a67619edd669d82ee5c3d85dd39b0;hb=570f694443022e017af9d2fab9264e56a1561a61;hp=93d3cd0426fa91107945308ae35cf08e2dc7f177;hpb=9cdfabc67eb004e921e7adbe98a56f30e3a3326d;p=clitk.git diff --git a/itk/clitkExtractSliceFilter.h b/itk/clitkExtractSliceFilter.h index 93d3cd0..136f431 100644 --- a/itk/clitkExtractSliceFilter.h +++ b/itk/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