Next: Volume Creation from Up: Volume Manipulation Previous: Volume Manipulation

## Volume Coordinate Systems

A volume has two coordinate systems. The voxel coordinate system is simply the n-dimensional indexing coordinate system for a volume. A voxel coordinate of (0.0, 0.0, 0.0), for instance, corresponds to the centre of the first voxel in a three dimensional volume. A voxel coordinate of ( 99.0, 0.0, 0.0 ) corresponds to the centre of the last voxel in the first direction of a three dimensional volume of size ( 100, 200, 150 ). The second coordinate system is an arbitrary three dimensional coordinate system, usually referred to as the world coordinate system, often the Talairach coordinate system. The following functions provide conversion to and from these two coordinate systems:

```
public  void  convert_voxel_to_world(
Volume   volume,
Real     voxel[],
Real     *x_world,
Real     *y_world,
Real     *z_world )```

Given a volume and a real valued voxel index, passes back the corresponding world coordinate.

```
public  void  convert_3D_voxel_to_world(
Volume   volume,
Real     voxel1,
Real     voxel2,
Real     voxel3,
Real     *x_world,
Real     *y_world,
Real     *z_world )```

Same as convert_voxel_to_world except it applies only to three dimensional volumes.

```
public  void  convert_world_to_voxel(
Volume   volume,
Real     x_world,
Real     y_world,
Real     z_world,
Real     voxel[] )```

Converts a world coordinate into a voxel. In order to use these voxel coordinates as integer indices, for instance, as arguments to the GET_VALUE macros, each component of the argument voxel must first be rounded to the nearest integer.

```
public  void  convert_3D_world_to_voxel(
Volume   volume,
Real     x_world,
Real     y_world,
Real     z_world,
Real     *voxel1,
Real     *voxel2,
Real     *voxel3 )```

Same as convert_world_to_voxel except it applies only to three dimensional volumes.

```
public  void  convert_voxel_normal_vector_to_world(
Volume          volume,
Real            voxel1,
Real            voxel2,
Real            voxel3,
Real            *x_world,
Real            *y_world,
Real            *z_world )```

Converts a vector which is assumed to be a surface normal to the world coordinate system.

Next: Volume Creation from Up: Volume Manipulation Previous: Volume Manipulation

david@pet.mni.mcgill.ca
Fri Feb 17 15:37:42 EST 1995