00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkVTKImageExport_h
00018 #define __itkVTKImageExport_h
00019
00020 #include "itkVTKImageExportBase.h"
00021
00022 namespace itk
00023 {
00024
00051 template <class TInputImage, typename TVTKRealType=float>
00052 class ITK_EXPORT VTKImageExport: public VTKImageExportBase
00053 {
00054 public:
00056 typedef VTKImageExport Self;
00057 typedef VTKImageExportBase Superclass;
00058 typedef SmartPointer<Self> Pointer;
00059 typedef SmartPointer<const Self> ConstPointer;
00060
00062 itkTypeMacro(VTKImageExport,VTKImageExportBase);
00063
00065 itkNewMacro(Self);
00066
00069 typedef TVTKRealType vtkRealType;
00070 typedef vtkRealType VTKSpacingType;
00071 typedef vtkRealType VTKOriginType;
00072
00074 typedef TInputImage InputImageType;
00075
00079 typedef TVTKRealType * (*SpacingCallbackType)(void*);
00080 typedef TVTKRealType * (*OriginCallbackType)(void*);
00081
00083 SpacingCallbackType GetSpacingCallback() const;
00084 OriginCallbackType GetOriginCallback() const;
00085
00087 void SetInput(const InputImageType*);
00088
00089 protected:
00090 VTKImageExport();
00091 ~VTKImageExport() {}
00092 void PrintSelf(std::ostream& os, Indent indent) const;
00093
00094 typedef typename InputImageType::Pointer InputImagePointer;
00095 typedef typename InputImageType::RegionType InputRegionType;
00096 typedef typename InputRegionType::SizeType InputSizeType;
00097 typedef typename InputRegionType::IndexType InputIndexType;
00098 itkStaticConstMacro(InputImageDimension, unsigned int,
00099 InputImageType::ImageDimension );
00100
00101 InputImageType * GetInput(void);
00102
00103 int* WholeExtentCallback();
00104 virtual VTKSpacingType * SpacingCallback();
00105 virtual VTKOriginType * OriginCallback();
00106 const char* ScalarTypeCallback();
00107 int NumberOfComponentsCallback();
00108 void PropagateUpdateExtentCallback(int*);
00109 int* DataExtentCallback();
00110 void* BufferPointerCallback();
00111
00112 private:
00113 VTKImageExport(const Self&);
00114 void operator=(const Self&);
00115
00119 static VTKSpacingType * SpacingCallbackFunction(void*);
00120 static VTKOriginType * OriginCallbackFunction(void*);
00121
00122 std::string m_ScalarTypeName;
00123 int m_WholeExtent[6];
00124 int m_DataExtent[6];
00125 VTKSpacingType m_DataSpacing[3];
00126 VTKOriginType m_DataOrigin[3];
00127 };
00128
00129 }
00130
00131 #ifndef ITK_MANUAL_INSTANTIATION
00132 #include "itkVTKImageExport.txx"
00133 #endif
00134
00135 #endif