next up previous contents
Next: Single voxel, voxel data Up: Reading and writing data Previous: Specifying coordinates and lengths   Contents

Details of voxel conversion

Conversion from real to voxel data, or from voxel to real data, can be expressed by the following relationships:

V(c) = ((R(c) - R_{min}(c)) / (R_{max}(c)-R_{min}(c)) * (V_{max} - V_{min})) + V_{min}
\end{displaymath} (1)

R(c) = ((V(c) - V_{min}) / (V_{min} - V_{max}) * (R_{max}(c) - R_{min}(c)) + R_{min}(c)
\end{displaymath} (2)

Where $R(c)$ is the real value of the image at location $c$, and $V(c)$ is the voxel value of the image at the same coordinate. The $R_{max}(c)$ and $R_{min}(c)$ values correspond to the maximum and minimum real values, which may also be a function the location, although at a reduced dimensionality. The values of $V_{max}$ and $V_{min}$ are global to the volume and do not vary with position.

For more information on these scaling values, see the functions:

int miget_volume_valid_range(mihandle_t volume, 
                             double *valid_max,
                             double *valid_min);

int miget_slice_range(mihandle_t volume,
                      const unsigned long location[],
                      double *slice_max,
                      double *slice_min);

Robert VINCENT 2004-05-28