Interfacing vtImage
& SpatialImage
data structures¶
Attributes/method mapping¶
In the following table we detail the name mapping between the two data structures:
Attributes |
vtImage |
SpatialImage |
---|---|---|
Array shape |
|
|
Pixel/voxel size |
|
|
Origin |
|
|
Value bit depth |
|
|
Metadata |
|
|
Equality¶
In the following section we define equality for previously defines methods or attributes:
Array
vt.vtImage.copy_to_array() == SpatialImage.get_array()
Array shape
if sp.is2d():
vt.vtImage.shape()[:-1][::-1] == SpatialImage.shape
else:
vt.vtImage.shape()[::-1] == SpatialImage.shape
Pixel/voxel size
if sp.is2d():
vt.vtImage.spacing()[:-1] == SpatialImage.voxelsize
else:
vt.vtImage.spacing() == SpatialImage.voxelsize
Tests¶
These equality relationships are tested in test/test_vt_interface.py
.