[ VIGRA Homepage | Function Index | Class Index | Namespaces | File List | Main Page ]

| VolumeImportInfo Class Reference Import/export of volume data. |

Argument object for the function importVolume(). More...

`#include <vigra/multi_impex.hxx>`

## Public Types
typedef TinyVector< float, 3 > | Resolution
| 3D resolution type returned by resolution()
typedef MultiArrayShape< 3 >::type | ShapeType
| type of volume size returned by shape()
typedef ShapeType | size_type
| type of volume size returned by shape()

## Public Member Functions
MultiArrayIndex | depth () const
const char * | getFileType () const
const char * | getPixelType () const
MultiArrayIndex | height () const
PixelType | pixelType () const
Resolution | resolution () const
ShapeType | shape () const
| VolumeImportInfo (const std::string &filename)
| VolumeImportInfo (const std::string &base_name, const std::string &name_extension)
MultiArrayIndex | width () const

## Detailed Description

Argument object for the function importVolume().

This object can be used to define the properties of a volume data set to be read from disk. It works like vigra::ImageImportInfo, but for 3-dimensional data. See importVolume() for usage example.

#include <vigra/multi_impex.hxx>
Namespace: vigra

## Constructor & Destructor Documentation

VolumeImportInfo | ( | const std::string & | filename | ) |

Construct VolumeImportInfo from a single filename.

The filename (which may contain a path) can be interpreted in three different ways:

- If the name refers to a file that contains volume data, the header information of this file is read. Two file formats are currently supported: Andor .SIF and multi-page TIFF.
- If the name refers to a textfile, the constructor will attempt to interpret the file in the ".info" format to obtain the header information. The volume data are then expected to be located in an accompanying RAW file. The ".info" file must contain the following key-value pairs:
  - name = [short descriptive name of the volume] (optional)
  - filename = [absolute or relative path to raw voxel data file] (required)
  - description = [arbitrary description of the data set] (optional)
  - width = [positive integer] (required)
  - height = [positive integer] (required)
  - depth = [positive integer] (required)
  - datatype = [ UINT8 | INT16 | UINT16 | INT32 | UINT32 | FLOAT | DOUBLE ] (required)
  Lines starting with "#" are ignored. To read the data correctly, the value_type of the target MultiArray must match the datatype stored in the file. Only single-band files are currently supported.
- If the name refers to a 2D image file, the constructor will attempt to decompose the filename into the format `base_name + slice_number + name_extension`. If this decomposition succeeds, all images with the same base_name and name_extension will be considered as the slices of an image stack. Slice numbers need not be consecutive (i.e. gaps are allowed) and will be interpreted according to their numerical order (i.e. "009", "010", "011" are read in the same order as "9", "10", "11"). The number of images found determines the depth of the volume, the remaining header data are read from the given image.

VolumeImportInfo | ( | const std::string & | base_name,
|  | const std::string & | name_extension
| ) |  |

Construct VolumeImportInfo for a stack of images.

The constructor will look for filenames of the form `base_name + slice_number + name_extension`. All images conforming to this pattern will be considered as the slices of an image stack. Slice numbers need not be consecutive (i.e. gaps are allowed) and will be interpreted according to their numerical order (i.e. "009", "010", "011" are read in the same order as "9", "10", "11"). The number of images found determines the depth of the volume, the remaining header data are read from the given image. name_base may contain a path.

## Member Function Documentation

ShapeType shape | ( |  | ) | const

Get the shape of the volume.

MultiArrayIndex width | ( |  | ) | const

Get width of the volume.

MultiArrayIndex height | ( |  | ) | const

Get height of the volume.

MultiArrayIndex depth | ( |  | ) | const

Get depth of the volume.

Resolution resolution | ( |  | ) | const

resolution() contains the alignment and resolution of the volume. resolution()[0] is the x increment in a left-handed world coordinate system of one unstrided step in the volume memory. The [1] and [2] elements contain the y resp. z increments of the strided row resp. slice steps in the volume.

EXAMPLES: (1.f, 1.f, 4.f) means that the slices are four times thicker than the x/y resolution. (1.f, -1.f, 1.f) means that the volume coordinate system is right-handed.

const char* getFileType | ( |  | ) | const

Query the file type.

Possible values are:

"MULTIPAGE"
  Multiple 2D images in a single file (currently only supported by TIFF).
"SIF"
  Andor Technology's .sif format.
"RAW"
  Raw data file, accompanied by a .info file
"STACK"
  A numbered set of 2D image files, one per slice of the volume.

const char* getPixelType | ( |  | ) | const

Query the pixel type of the volume data.

Possible values are:

"INT8"
  8-bit signed integer (signed char)
"UINT8"
  8-bit unsigned integer (unsigned char)
"INT16"
  16-bit signed integer (short)
"UINT16"
  16-bit unsigned integer (unsigned short)
"INT32"
  32-bit signed integer (long)
"UINT32"
  32-bit unsigned integer (unsigned long)
"INT64"
  64-bit signed integer (long long)
"UINT64"
  64-bit unsigned integer (unsigned long long)
"FLOAT"
  32-bit floating point (float)
"DOUBLE"
  64-bit floating point (double)
"UNKNOWN"
  any other type

PixelType pixelType | ( |  | ) | const

Query the pixel type of the volume data.

Same as getPixelType(), but the result is returned as a ImageImportInfo::PixelType enum. This is useful to implement a switch() on the pixel type.

Possible values are:

UINT8
  8-bit unsigned integer (unsigned char)
INT16
  16-bit signed integer (short)
UINT16
  16-bit unsigned integer (unsigned short)
INT32
  32-bit signed integer (long)
UINT32
  32-bit unsigned integer (unsigned long)
FLOAT
  32-bit floating point (float)
DOUBLE
  64-bit floating point (double)

The documentation for this class was generated from the following file:

- vigra/multi_impex.hxx

© Ullrich Köthe (ullrich.koethe@iwr.uni-heidelberg.de) Heidelberg Collaboratory for Image Processing, University of Heidelberg, Germany | html generated using doxygen and Python vigra 1.11.1 (Fri May 19 2017)