VolumeJ
Class VJViewspaceUtil
java.lang.Object
|
+--VolumeJ.VJViewspaceUtil
- public class VJViewspaceUtil
- extends java.lang.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.
Method Summary |
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. |
protected static int[] |
suggestCineViewport(Volume v,
VJMatrix m,
float stepx,
float stepy,
float stepz,
int n)
Determine the optimal size for a cine rendering in coordinate system m of the whole v. |
protected 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 |
VJViewspaceUtil
public VJViewspaceUtil()
suggestViewport
protected 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
protected static int[] suggestCineViewport(Volume v,
VJMatrix m,
float stepx,
float stepy,
float 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.
Submit a bug or feature
Copyright (c) 1997-2003 Michael Abramoff
Licensing available. All Rights Reserved.