Orientation Field File Format¶
The orientation field indicates the orientation of the morphology at each voxel position in the form of quaternion. The coefficients of the quaternion is encoded in the order of (w, x, y, z).Therefore, each voxel stores a 4d vector of float number in the NRRD file.
Specification¶
The meta data stored in the NRRD file should follow the specification below:
Field |
Value Type |
Suggested Value |
Comments |
---|---|---|---|
dimension |
integer |
4 |
dimension of the image is 4, with the 4th dimension indicating the quaternion 4d vector |
encoding |
string |
gzip |
use ‘gzip’ for compressing the data |
endian |
string |
little |
use ‘little’ for x86 machines |
kinds |
list of string |
[‘quaternion’, ‘domain’, ‘domain’, ‘domain’] |
use ‘quaternion’ to indicate the type of the first data dimension, use ‘domain’ to indicate the other dimensions are image axis |
sizes |
list of integer |
[4, {size_x}, {size_y}, {size_z}] |
the 1st element is the size of quaternion vector which is 4, together with the size of the voxels in x, y, z dimension |
space directions |
3d matrix |
[u’none’, {3d matrix}] |
‘none’ indicate the first dimension does not represent the image space. the second part is a 3D matrix indicating the orientation of the image data, with the value indicating the spacing of the voxel |
space origin |
list of float |
[{origin_x}, {origin_y}, {origin_z}] |
physical coordinates of the image origin |
space |
string |
{x_orientation}-{y_orientation}-{z_orientation} |
the orientation of the image data, should be consistent with the space direction |
type |
string |
float (default) or int8 (optional) |
the default type of the values stored in the voxels is float. alternatively, the type of the values stored in the voxels can be signed 1-byte integer to minimize the file size |
Example:
{
u'space origin': ['-46.540000915527344', '-152.15999984741211', '-152'],
u'space directions': [u'none', ['16', '0', '0'], ['0', '16', '0'], ['0', '0', '16']],
u'sizes': [4, 308, 495, 464],
u'space': 'left-posterior-superior',
u'encoding': 'gzip',
u'endian': 'little',
u'kinds': ['quaternion', 'domain', 'domain', 'domain'],
u'type': 'int8',
u'dimension': 4
}