#ifndef _vtkMetaImageData_h_ #define _vtkMetaImageData_h_ #include #ifdef vtkDataManagement_USE_ITK // ITK includes for I/O only #include #include #include #include #include #endif class vtkImageData; class vtkVolumeProperty; /** \class vtkMetaImageData vtkMetaImageData.h "vtkMetaImageData.h" \brief Concrete implementation of vtkMetaDataSet for Image handling \author Nicolas Toussaint This class is a powerfull vtk Addon class that helps handling a vtkDataSet. You can use it as a tool for handling an image, modify it, convert it into itkImage, etc Use the Read function to read any type of itk and vtk image file formats. Use the Write function to write it into a previous formats file. And you can associate to the metaimage a specific vtkVolumeProperty Note : This class will be able to read and write files only if ITK is used \see vtkMetaDataSet vtkMetaSurfaceMesh vtkMetaVolumeMesh vtkMetaDataSetSequence vtkDataManager */ class VTK_EXPORT vtkMetaImageData: public vtkMetaDataSet { public: static vtkMetaImageData* New(); vtkTypeRevisionMacro(vtkMetaImageData,vtkMetaDataSet); #ifdef vtkDataManagement_USE_ITK //BTX typedef itk::Image FloatImageType; typedef itk::VTKImageToImageFilter ItkConverterType; FloatImageType::Pointer GetItkImage (void); void SetDataSetAsItkImage(FloatImageType::Pointer image); //ETX #endif /** Overwridden methods for read and write images These methods could only be used if ITK is set to ON */ virtual void Read (const char* filename); virtual void Write (const char* filename); /** Get mehtod to get the vtkDataSet as an vtkImageData */ vtkImageData* GetImageData (void) const; /** Get the type of the metadataset as string */ virtual const char* GetDataSetType (void) const { return "ImageData"; } static unsigned int CanReadFile (const char* filename); vtkGetMacro (ComponentType, unsigned long); vtkSetMacro (ComponentType, unsigned long); protected: vtkMetaImageData(); ~vtkMetaImageData(); /** Method called everytime the dataset changes for connexion updates */ virtual void LinkFilters (void); /** Method called everytime the dataset changes for initialization */ virtual void Initialize (void); vtkVolumeProperty* VolumeProperty; private: vtkMetaImageData(const vtkMetaImageData&); // Not implemented. void operator=(const vtkMetaImageData&); // Not implemented. unsigned long ComponentType; #ifdef vtkDataManagement_USE_ITK //BTX FloatImageType::Pointer m_ItkImage; ItkConverterType::Pointer m_ItkConverter; //ETX #endif }; #endif