OVS-2 Stratum File Format

OVS: 2
Title: Stratum File Format
Author: DocW <docwhomc at gmail.com>
Version: _draft_

The Open Voxel Standards Stratum File Format (OVS SFF) encodes voxel composition using the following sections:

  1. header
  2. material
    1. strata
    2. segments
    3. voxels
  3. supplemental data
    1. strata
    2. segments
    3. voxels
  4. footer Voxel composition consists of a material and optional supplemental data.

Header Section

The header section consists of:

  1. the OVS SFF magic number;
  2. the OVS SFF version according to which the file is encoded;
  3. the dimensions of the domain described by the file;
  4. the number of stratum, segment, and voxel entries in their respective subsections of the material and supplemental data sections; and
  5. the default material and supplemental data.

Material and Supplemental Data Sections

In the material section composition = material, while in the supplemental data section composition = supplemental-data. To avoid needing to specify the composition of all voxels, a default material and a default supplemental data shall be used for those voxel whose respective attributes are not explicitly specified.

The material symbol represents a fixed or variable width encoding a voxel material. The exact correspondence between the encoded and decoded material forms is beyond the scope of this standard as it is dependent on the materials defined by the application.

The supplemental-data symbol represents a variable length encoding of additional data (i.e., data other than material) regarding the composition of voxels. The format of the supplemental data itself is not specified by the current draft.

Strata Subsections

Strata subsections shall begin by specifying the format used via an big endian, unsigned, two-bit integer value. The options are:

  1. range strata format (strata = range-strata),
  2. continuum strata format (strata = continuum-strata), and
  3. implicit level strata format (strata = implicit-level-strata).

In the range strata format, each strata specification consists of a z-range followed by the composition data of the section.

range-strata = { range-stratum } ;
range-stratum = z-range, composition ;

The value of z-stop shall always be greater than or equal to that of z-start.

z-range = z-start, z-stop ;

The z-ranges of different strata may overlap—with the composition of succeeding strata taking precedence over that of preceding strata—subject to the following rules and restrictions:

  • For any two overlapping strata, the z-range of one stratum must be fully enclosed by the z-range of the other stratum, respectively, the enclosed stratum, included stratum, or inclusion and the enclosing stratum.
  • Strata shall be ordered by ascending z-value. As a consequence of the preceding requirement, strata cannot have the same z-start or z-stop values and inclusions must succeed the strata enclosing them.

The composition of succeeding strata shall take precedence over that of preceding strata.

Since overlapping strata are inconsistent with the continuum and implicit level strata formats, their strata shall simply be ordered by ascending z-level.

continuum-strata = z-start, { continuum-stratum } ;
continuum-stratum = z-size, composition ;

In the implicit level strata format, each strata consists of a single voxel high layer and the composition of each layer is explicitly specified (i.e., no layers are skipped). As a result, the z-values of those levels need not be specified explicitly.

implicit-level-strata = { implicit-level-stratum } ;
implicit-level-stratum = { composition } ;

Segments Subsections

segments = { segment } ;
segment = xyz-range, composition ;
xyz-range = xyz-start, xyz-stop ;
xyz-start = x-start, y-start, z-start
xyz-stop = x-stop, y-stop, z-stop ;

Voxels Subsections

voxels = { voxel } ;
voxel = xyz, composition ;
xyz = x, y, z ;

Mathematical Definition

Let S be the set of strata.

∀ si ∈ S, ∃ zi,0, zi,1 ∈ &integers; s.t. zi,0 ≤ zi,1 where zi,0 and zi,1 are respectively the first and last z-levels of the stratum si.

∀ s0, s1 ∈ S:

  • s0 and s1 are disjoint are disjoint iff r0,1 < r1,0 ∨ r1,1 < r0,0;
  • s1 is an inclusion in s0 iff r0,0 < r1,0 ∧ r1,1 < r0,1; and
  • s0 is an inclusion in s1 iff (r1,0 < r0,0 ∧ r0,1 < r1,1).