]> Creatis software - clitk.git/blobdiff - itk/clitkExtractSliceFilter.h
Moved from repository clitk to clitk.private/tests_dav
[clitk.git] / itk / clitkExtractSliceFilter.h
index 93d3cd0426fa91107945308ae35cf08e2dc7f177..2cdabcf4d4bbec191c9b0929330ed8d9ae1ff47e 100644 (file)
@@ -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<ImageType, 
-                                   std::vector<typename itk::Image<typename ImageType::PixelType, 
-                                                                   ImageType::ImageDimension-1>::Pointer> > 
+                                   typename itk::Image<typename ImageType::PixelType, ImageType::ImageDimension-1> >
   {
 
   public:
-    /** Standard class typedefs. */
-    typedef itk::ImageToImageFilter<ImageType, ImageType> Superclass;
-    typedef ExtractSliceFilter                              Self;
-    typedef itk::SmartPointer<Self>                         Pointer;
-    typedef itk::SmartPointer<const Self>                   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<PixelType, ImageDimension-1> SliceType;
     typedef typename SliceType::Pointer             SliceTypePointer;
 
+    /** Standard class typedefs. */
+    typedef itk::ImageToImageFilter<ImageType, SliceType>   Superclass;
+    typedef ExtractSliceFilter                              Self;
+    typedef itk::SmartPointer<Self>                         Pointer;
+    typedef itk::SmartPointer<const Self>                   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<typename SliceType::Pointer> & o);
 
   protected:
     ExtractSliceFilter();
@@ -97,9 +100,14 @@ namespace clitk {
     virtual void GenerateInputRequestedRegion();
     virtual void GenerateData();
 
+    int m_NumberOfSlices;
     ImagePointer input;
     ImagePointer object;
-    std::vector<SliceTypePointer> output;
+    SliceType *  output;
+    
+    RegionType m_region;
+    SizeType   m_size;
+    IndexType  m_index;
 
   private:
     ExtractSliceFilter(const Self&); //purposely not implemented