FreeMat

- Main Page
- Related Pages

vtkImageExport

Section: Visualization Toolkit Imaging Classes

# Usage

vtkImageExport provides a way of exporting image data at the end of a pipeline to a third-party system or to a simple C array. Applications can use this to get direct access to the image data in memory. A callback interface is provided to allow connection of the VTK pipeline to a third-party pipeline. This interface conforms to the interface of vtkImageImport. In Python it is possible to use this class to write the image data into a python string that has been pre-allocated to be the correct size.

To create an instance of class vtkImageExport, simply invoke its constructor as follows

      obj = vtkImageExport

# Methods

The class vtkImageExport has several methods that can be used. They are listed below. Note that the documentation is translated automatically from the VTK sources, and may not be completely intelligible. When in doubt, consult the VTK website. In the methods listed below, `obj` is an instance of the vtkImageExport class.

- `string = obj.GetClassName ()`
- `int = obj.IsA (string name)`
- `vtkImageExport = obj.NewInstance ()`
- `vtkImageExport = obj.SafeDownCast (vtkObject o)`
- `int = obj.GetDataMemorySize ()` - Get the number of bytes required for the output C array.
- `obj.GetDataDimensions (int ptr)` - Get the (x,y,z) index dimensions of the data. Please note that C arrays are indexed in decreasing order, i.e. array[z][y][x].
- `int = obj.GetDataDimensions ()` - Get the number of scalar components of the data. Please note that when you index into a C array, the scalar component index comes last, i.e. array[z][y][x][c].
- `int = obj.GetDataNumberOfScalarComponents ()` - Get the number of scalar components of the data. Please note that when you index into a C array, the scalar component index comes last, i.e. array[z][y][x][c].
- `int = obj.GetDataScalarType ()` - Get the scalar type of the data. The scalar type of the C array must match the scalar type of the data.
- `string = obj.GetDataScalarTypeAsString ()` - Get miscellaneous additional information about the data.
- `int = obj.GetDataExtent ()` - Get miscellaneous additional information about the data.
- `obj.GetDataExtent (int ptr)` - Get miscellaneous additional information about the data.
- `double = obj.GetDataSpacing ()` - Get miscellaneous additional information about the data.
- `obj.GetDataSpacing (double ptr)` - Get miscellaneous additional information about the data.
- `double = obj.GetDataOrigin ()` - Get miscellaneous additional information about the data.
- `obj.GetDataOrigin (double ptr)` - Get miscellaneous additional information about the data.
- `obj.ImageLowerLeftOn ()` - Set/Get whether the data goes to the exported memory starting in the lower left corner or upper left corner. Default: On. When this flag is Off, the image will be flipped vertically before it is exported. WARNING: this flag is used only with the Export() method, it is ignored by GetPointerToData().
- `obj.ImageLowerLeftOff ()` - Set/Get whether the data goes to the exported memory starting in the lower left corner or upper left corner. Default: On. When this flag is Off, the image will be flipped vertically before it is exported. WARNING: this flag is used only with the Export() method, it is ignored by GetPointerToData().
- `int = obj.GetImageLowerLeft ()` - Set/Get whether the data goes to the exported memory starting in the lower left corner or upper left corner. Default: On. When this flag is Off, the image will be flipped vertically before it is exported. WARNING: this flag is used only with the Export() method, it is ignored by GetPointerToData().
- `obj.SetImageLowerLeft (int )` - Set/Get whether the data goes to the exported memory starting in the lower left corner or upper left corner. Default: On. When this flag is Off, the image will be flipped vertically before it is exported. WARNING: this flag is used only with the Export() method, it is ignored by GetPointerToData().
- `obj.Export ()` - The main interface: update the pipeline and export the image to the memory pointed to by SetExportVoidPointer(). You can also specify a void pointer when you call Export().