f3d

A simple yet efficient format for and storage of volumetric data

basic C library for manipulation with f3d files
Extended C++ class library for manipulation with f3d files
Tools for manipulation with f3d files
f3d: a Format for Storage of Volumetric Data

The f3d (Format 3 Dimensional) is aimed at storage and manipulation of volumetric grids. It was designed with the following aims on mind:

Support of different kinds of voxels
  • Scalar and color voxels
  • 8, 16, 32 bit integers, signed and unsigned, floats
Different kinds of grids
Cartesian, regular and rectilinear grids
Self descriptive
An f3d file contains all information necessary for its processing. This information is to be accessible with basic tools as, for example UNIX head command or a general image or text file viewers (xv, vi).
Application specific comments
provide a means to transfer information between different applications (for example, from voxelization to visualization).
Data compression
Volumetric data are usually huge, but they often compress very well (especially segmented masks or voxelized data).
Preview image
An icon image, giving a notion about the contents of the file. Should be viewable by regular image viewers (xv).
Unbearable Lightness of Usage

Basic structure of an f3d file

The f3d format is an extension of the well known Portable Graymap (pgm) format, defined in the pbmplus and netpbm packages, which make it viewable (at least a part of it - an icon image) by standard image viewers. f3d extends pgm in several directions:

f3d specific commnets
The pgm format enables to include arbitrary text comments in the header part of the file. f3d takes advantage of this feature by specifying f3d comments with the following structure:

#!keyword value

The keywords have their counterparts in members of the f3dHeader. Detailed description can be found directly in the source code of the f3dReadHeader and f3dWriteHeader functions. The commLines keyword specifies number of application dependent comments, which can be used to transfer information between different application and do not have any specific format. These comments are labeled by the comment keyword. Of course, commLines must precede any comment line.

f3d file header example: A cubic grid with monochromatic voxels of unsigned char type.

  • P5 - pgm format (magic number)
  • 128 128 - pgm format (image dimensions - in this case the icon image)
  • #!f3d 0.25 - f3d parameter
  • #*******************************************************
  • #** f3d
  • #** Format for storage of 3D volumetric data sets
  • #**
  • #** http://www.cs.sunysb.edu/~milos/f3d
  • #*******************************************************
  • #!endian f3dBigEndian - f3d parameter, see endian
  • #!vdim 128 128 128 - f3d parameter, see nx, ny, nz
  • #!vtype f3dCubic - f3d parameter, see vtype
  • #!ctype f3dMono - f3d parameter, see ctype
  • #!dtype f3dUChar - f3d parameter, see dtype
  • #!units f3dUmm - f3d parameter, see units
  • #!commLines 3 - f3d parameter, see commentLines
  • #!comment vxt density 0.000000 254.000000 - f3d comment, see comment
  • #!comment vxt profile linear 1.800000 - f3d comment, see comment
  • #!comment File created by 'vxtGrid3D' - f3d comment, see comment
  • #!px 1.000000 - f3d parameter, see px
  • #!last - f3d parameter
  • 255 - pgm format

f3d icon image
The purpose of the icon image is to provide the user with a notion of what data is in the file. If f3dWriteSlice or f3dWriteCubGrid functions are used for storing the data, a standard icon image is created by summation of density values along X, Y or Z grid axis. This direction is determined by the iconDir member of f3d header structure and can have f3dIconX, f3dIconY and f3dIconZ values respectively.
Appended volumetric data
Volumetric data are appended directly after the pgm image data. The data is stored slice by slice, with the following fields for each slice:
  1. length of the compressed slice. It is stored as a 32 bit unsigned integer with MSB first order.
  2. the compressed slice data. The compress/uncompress pair of routines from the zlib package is used.
RGB color images are stored as 3 consecutive monochromatic layers in R-G-B order, each with the length a compressed data fields.

Distribution

f3d can be separated in two parts

f3d has been written in a unix environment (IRIX, Linux) and tested with both native compiler (cc/CC on IRIX) and gcc/g++. It was not tested in Windows NT/95/98 environment. However, I believe that porting should be straightforward.

Author:
\URL[Milos Sramek]{http:
Version:
0.25

alphabetic index hierarchy of classes


this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de