00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00064 #ifndef __vtkImageExport_h
00065 #define __vtkImageExport_h
00066
00067 #include "vtkProcessObject.h"
00068 #include "vtkImageData.h"
00069
00070 class VTK_IMAGING_EXPORT vtkImageExport : public vtkProcessObject
00071 {
00072 public:
00073 static vtkImageExport *New();
00074 vtkTypeMacro(vtkImageExport,vtkProcessObject);
00075 void PrintSelf(ostream& os, vtkIndent indent);
00076
00078 int GetDataMemorySize();
00079
00081
00083 void GetDataDimensions(int *ptr);
00084 int *GetDataDimensions() {
00085 this->GetDataDimensions(this->DataDimensions);
00086 return this->DataDimensions; }
00088
00090
00093 int GetDataNumberOfScalarComponents() {
00094 if (this->GetInput() == NULL) { return 1; }
00095 this->GetInput()->UpdateInformation();
00096 return this->GetInput()->GetNumberOfScalarComponents(); };
00098
00100
00102 int GetDataScalarType() {
00103 if (this->GetInput() == NULL) { return VTK_UNSIGNED_CHAR; }
00104 this->GetInput()->UpdateInformation();
00105 return this->GetInput()->GetScalarType(); };
00106 const char *GetDataScalarTypeAsString() {
00107 return vtkImageScalarTypeNameMacro(this->GetDataScalarType()); }
00109
00111
00112 int *GetDataExtent() {
00113 static int defaultextent[6] = {0, 0, 0, 0, 0, 0};
00114 if (this->GetInput() == NULL) { return defaultextent; }
00115 this->GetInput()->UpdateInformation();
00116 return this->GetInput()->GetWholeExtent(); };
00117 void GetDataExtent(int *ptr) {
00118 if (this->GetInput() == NULL) {
00119 ptr[0] = ptr[1] = ptr[2] = ptr[3] = ptr[4] = ptr[5] = 0; return; }
00120 this->GetInput()->UpdateInformation();
00121 this->GetInput()->GetWholeExtent(ptr); };
00122 float *GetDataSpacing() {
00123 static float defaultspacing[3] = {1, 1, 1};
00124 if (this->GetInput() == NULL) { return defaultspacing; }
00125 this->GetInput()->UpdateInformation();
00126 return this->GetInput()->GetSpacing(); };
00127 void GetDataSpacing(float *ptr) {
00128 if (this->GetInput() == NULL) { ptr[0] = ptr[1] = ptr[2] = 0.0; return; }
00129 this->GetInput()->UpdateInformation();
00130 this->GetInput()->GetSpacing(ptr); };
00131 float *GetDataOrigin() {
00132 static float defaultorigin[3] = {0, 0, 0};
00133 if (this->GetInput() == NULL) { return defaultorigin; }
00134 this->GetInput()->UpdateInformation();
00135 return this->GetInput()->GetOrigin(); };
00136 void GetDataOrigin(float *ptr) {
00137 if (this->GetInput() == NULL) { ptr[0] = ptr[1] = ptr[2] = 0.0; return; }
00138 this->GetInput()->UpdateInformation();
00139 this->GetInput()->GetOrigin(ptr); };
00141
00143
00144 void SetInput(vtkImageData *input);
00145 vtkImageData *GetInput();
00147
00149
00154 vtkBooleanMacro(ImageLowerLeft, int);
00155 vtkGetMacro(ImageLowerLeft, int);
00156 vtkSetMacro(ImageLowerLeft, int);
00158
00160
00163 void SetExportVoidPointer(void *);
00164 void *GetExportVoidPointer() { return this->ExportVoidPointer; };
00166
00168
00171 void Export() { this->Export(this->ExportVoidPointer); };
00172 virtual void Export(void *);
00174
00179 void *GetPointerToData();
00180
00182 void* GetCallbackUserData();
00183
00184
00186
00187 callbacks. See furhter documentation in vtkImageImport.h. */
00188 typedef void (*UpdateInformationCallbackType)(void*);
00189 typedef int (*PipelineModifiedCallbackType)(void*);
00190 typedef int* (*WholeExtentCallbackType)(void*);
00191 typedef float* (*SpacingCallbackType)(void*);
00192 typedef float* (*OriginCallbackType)(void*);
00193 typedef const char* (*ScalarTypeCallbackType)(void*);
00194 typedef int (*NumberOfComponentsCallbackType)(void*);
00195 typedef void (*PropagateUpdateExtentCallbackType)(void*, int*);
00196 typedef void (*UpdateDataCallbackType)(void*);
00197 typedef int* (*DataExtentCallbackType)(void*);
00198 typedef void* (*BufferPointerCallbackType)(void*);
00200
00202
00203 UpdateInformationCallbackType GetUpdateInformationCallback() const;
00204 PipelineModifiedCallbackType GetPipelineModifiedCallback() const;
00205 WholeExtentCallbackType GetWholeExtentCallback() const;
00206 SpacingCallbackType GetSpacingCallback() const;
00207 OriginCallbackType GetOriginCallback() const;
00208 ScalarTypeCallbackType GetScalarTypeCallback() const;
00209 NumberOfComponentsCallbackType GetNumberOfComponentsCallback() const;
00210 PropagateUpdateExtentCallbackType GetPropagateUpdateExtentCallback() const;
00211 UpdateDataCallbackType GetUpdateDataCallback() const;
00212 DataExtentCallbackType GetDataExtentCallback() const;
00213 BufferPointerCallbackType GetBufferPointerCallback() const;
00214
00216
00217 protected:
00218 vtkImageExport();
00219 ~vtkImageExport();
00220
00221 virtual void UpdateInformationCallback();
00222 virtual int PipelineModifiedCallback();
00223 virtual void UpdateDataCallback();
00224 virtual int* WholeExtentCallback();
00225 virtual float* SpacingCallback();
00226 virtual float* OriginCallback();
00227 virtual const char* ScalarTypeCallback();
00228 virtual int NumberOfComponentsCallback();
00229 virtual void PropagateUpdateExtentCallback(int*);
00230 virtual int* DataExtentCallback();
00231 virtual void* BufferPointerCallback();
00232
00233 int ImageLowerLeft;
00234 int DataDimensions[3];
00235 void *ExportVoidPointer;
00236
00237 unsigned long LastPipelineMTime;
00238
00239 private:
00240 vtkImageExport(const vtkImageExport&);
00241 void operator=(const vtkImageExport&);
00242
00243 static void UpdateInformationCallbackFunction(void*);
00244 static int PipelineModifiedCallbackFunction(void*);
00245 static int* WholeExtentCallbackFunction(void*);
00246 static float* SpacingCallbackFunction(void*);
00247 static float* OriginCallbackFunction(void*);
00248 static const char* ScalarTypeCallbackFunction(void*);
00249 static int NumberOfComponentsCallbackFunction(void*);
00250 static void PropagateUpdateExtentCallbackFunction(void*, int*);
00251 static void UpdateDataCallbackFunction(void*);
00252 static int* DataExtentCallbackFunction(void*);
00253 static void* BufferPointerCallbackFunction(void*);
00254 };
00255
00256 #endif
00257
00258