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
- 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
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;
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);
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);
+ void SetInput(const ImageType * image) ITK_OVERRIDE;
// Options
itkGetConstMacro(Direction, int);
itkSetMacro(Direction, int);
+
+ // Get results
+ void GetOutputSlices(std::vector<typename SliceType::Pointer> & o);
protected:
ExtractSliceFilter();
int m_Direction;
- virtual void GenerateOutputInformation();
- virtual void GenerateInputRequestedRegion();
- virtual void GenerateData();
+ virtual void GenerateOutputInformation() ITK_OVERRIDE;
+ virtual void GenerateInputRequestedRegion() ITK_OVERRIDE;
+ virtual void GenerateData() ITK_OVERRIDE;
+ 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