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

Import/export of volume data. VIGRA

Functions

template<class T , class Tag >
void exportVolume (MultiArrayView< 3, T, Tag > const &volume, const std::string &name_base, const std::string &name_ext)
 Function for exporting a 3D volume.
template<class T , class Allocator >
void importVolume (VolumeImportInfo const &info, MultiArray< 3, T, Allocator > &volume)
 Function for importing a 3D volume.
template<class T , class Allocator >
void importVolume (MultiArray< 3, T, Allocator > &volume, const std::string &filename)
 Function for importing a 3D volume.
template<class T , class Allocator >
void importVolume (MultiArray< 3, T, Allocator > &volume, const std::string &name_base, const std::string &name_ext)
 Function for importing a 3D volume.


Function Documentation

void vigra::importVolume ( MultiArray< 3, T, Allocator > &  volume,
const std::string &  name_base,
const std::string &  name_ext 
)

Function for importing a 3D volume.

The data are expected to be stored in a by-slice manner, where the slices are enumerated from name_base+"[0-9]+"+name_ext. name_base may contain a path. All slice files with the same name base and extension are considered part of the same volume. Slice numbers must be non-negative, but can otherwise start anywhere and need not be successive. Slices will be read in ascending numerical (not lexicographic) order. All slices must have the same size. The volume will be reshaped to match the count and size of the slices found.

#include <vigra/multi_impex.hxx>

Namespace: vigra

void vigra::importVolume ( MultiArray< 3, T, Allocator > &  volume,
const std::string &  filename 
)

Function for importing a 3D volume.

The data can be given in two ways:

  • If the volume is stored in a by-slice manner (e.g. one image per slice), the filename can refer to an arbitrary image from the set. importVolume() then assumes that the slices are enumerated like name_base+"[0-9]+"+name_ext, where name_base, the index, and name_ext are determined automatically. All slice files with the same name base and extension are considered part of the same volume. Slice numbers must be non-negative, but can otherwise start anywhere and need not be successive. Slices will be read in ascending numerical (not lexicographic) order. All slices must have the same size.
  • Otherwise, importVolume() will try to read filename as an info text file with the following key-value pairs:
    • name = [short descriptive name of the volume] (optional)
    • filename = [absolute or relative path to raw voxel data file] (required)
    • gradfile = [absolute or relative path to gradient data file] (currently ignored)
    • description = [arbitrary description of the data set] (optional)
    • width = [positive integer] (required)
    • height = [positive integer] (required)
    • depth = [positive integer] (required)
    • datatype = [UNSIGNED_CHAR | UNSIGNED_BYTE] (default: UNSIGNED_CHAR)
    The voxel type is currently assumed to be binary compatible to the value_type T of the MuliArray. Lines starting with "#" are ignored.

In either case, the volume will be reshaped to match the count and size of the slices found.

#include <vigra/multi_impex.hxx>

Namespace: vigra

void vigra::importVolume ( VolumeImportInfo const &  info,
MultiArray< 3, T, Allocator > &  volume 
)

Function for importing a 3D volume.

Read the volume data set info refers to. Explicit construction of the info object allows to allocate a volume object type whose value_type matches the voxel type of the stored data. The volume will be reshaped to match the count and size of the slices found.

#include <vigra/multi_impex.hxx>

Namespace: vigra

void vigra::exportVolume ( MultiArrayView< 3, T, Tag > const &  volume,
const std::string &  name_base,
const std::string &  name_ext 
)

Function for exporting a 3D volume.

The volume is exported in a by-slice manner, where the number of slices equals the depth of the volume. The file names will be enumerated like name_base+"000"+name_ext, name_base+"001"+name_ext etc. (the actual number of zeros depends on the depth). If the target image type does not support the source voxel type, all slices will be mapped simultaneously to the appropriate target range.

#include <vigra/multi_impex.hxx>

Namespace: vigra

© 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.6.0 (5 Nov 2009)