VolumeJ

## Class VJViewspaceUtil

• ```public class VJViewspaceUtil
extends Object```
VJViewspaceUtil implements viewspace utility methods, that can be used to relate a volume in a transformation matrix to the coordinates of that volume in viewspace. Copyright (c) 1999-2002, Michael Abramoff. All rights reserved.
• ### Constructor Summary

Constructors
Constructor and Description
`VJViewspaceUtil()`
• ### Method Summary

All Methods
Modifier and Type Method and Description
`int[]` ```centerVolume(Volume v, VJMatrix m)```
Determine the center of volume v in coordinate system m.
`static int[][]` ```minmax(Volume v, VJMatrix m)```
Calculate minimum and maximum extents in xyz viewspace coordinates of volume v.
`static int[]` ```suggestCineViewport(Volume v, VJMatrix m, double stepx, double stepy, double stepz, int n)```
Determine the optimal size for a cine rendering in coordinate system m of the whole v.
`static int[]` ```suggestViewport(Volume v, VJMatrix m)```
Determine the optimal size for the rendering in coordinate system m of the whole v.
• ### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`
• ### Constructor Detail

• #### VJViewspaceUtil

`public VJViewspaceUtil()`
• ### Method Detail

• #### suggestViewport

```public static int[] suggestViewport(Volume v,
VJMatrix m)```
Determine the optimal size for the rendering in coordinate system m of the whole v.
Parameters:
`v` - the volume to be rendered.
`m` - the transformation matrix translating from object space to viewspace.
Returns:
an int[3] containing the width int[0], height int[1] and depth int[2] of the optimal viewport.
• #### suggestCineViewport

```public static int[] suggestCineViewport(Volume v,
VJMatrix m,
double stepx,
double stepy,
double stepz,
int n)```
Determine the optimal size for a cine rendering in coordinate system m of the whole v. The size should allow for rotated volumes, therefore test the full extent of the rotation and use the maxima.
Parameters:
`v` - the volume to be rendered.
`m` - the transformation matrix translating from object space to viewspace.
`stepx,` - stepy, stepz the steps along each of the axes.
`n` - the number of steps.
Returns:
an int[3] containing the width int[0], height int[1] and depth int[2] of the optimal viewport.
• #### centerVolume

```public int[] centerVolume(Volume v,
VJMatrix m)```
Determine the center of volume v in coordinate system m.
Parameters:
`v` - the volume to be rendered.
`m` - the transformation matrix translating from object space to viewspace.
Returns:
an int[3] containing the x,y,z position of the center of v.
• #### minmax

```public static int[][] minmax(Volume v,
VJMatrix m)```
Calculate minimum and maximum extents in xyz viewspace coordinates of volume v. Transform the eight corners of the dataset from objectspace into view space using the transformation matrix m, which converts from objectspace into viewspace. These eight new points are the minimum and maximum i,j and k values, in view space, where voxels are present. It is an upper bound for where to cast rays from in viewspace.
Parameters:
`v` - the volume to be rendered.
`m` - the transformation matrix translating from object space to viewspace.
Returns:
an int[2][3] containing min [0][..] and max [1][..] for the i,j,k axes.