Imp
[using it]
Interface Manipulation Package v4.0 (2008-06-25) a-projector ©copyright Author


imp.ima
Class Volume

java.lang.Object
  extended by imp.ima.Volume

public class Volume
extends Object

This class encapsulates a data-volume.


Nested Class Summary
static class Volume.Filter
          Defines an iterative filter on a volume.
 
Constructor Summary
Volume(double[] voxels, int width, int height, int depth)
          Constructs a volume of the given sizes.
Volume(String file)
          Constructs a volume from an inrimage file.
 
Method Summary
 Volume diff(Volume volume)
          Gets the difference of two volumes of the same size.
 double get(int x, int y, int z)
          Gets a voxel value.
 int getDepth()
          Gets image Z dimension.
 int getHeight()
          Gets image Y dimension.
 String getName()
          Gets image name.
 RgbImage getSlide(int n, char slide, double min, double max)
          Gets an image slide.
 Volume getSmooth(int size)
          Gets an isotropic Gaussian smoothing the this volume.
 double[] getVoxels()
          Gets image buffer.
 int getWidth()
          Gets image X dimension.
 Volume save(String file)
          Saves this volume in an inrimage file and return this.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Volume

public Volume(double[] voxels,
              int width,
              int height,
              int depth)
Constructs a volume of the given sizes.

Parameters:
voxels - [optional, default is {.. 0, ..}] Volume voxels, such that Volume(i, j, k) = voxels[i + width * (j + height * k)]
width - Volume X dimension.
height - Volume Y dimension.
depth - Volume Z dimension.

Volume

public Volume(String file)
       throws IOException
Constructs a volume from an inrimage file.

Parameters:
file - An inrimage file which pixel TYPE is unsigned fixed, PIXSIZE is 16 bits and VDIM is 1. Other inrimage format must be converted before being read, e.g. via inrcast -t ushort -val 0,32000 <input> -o <output>
Throws:
IOException
Method Detail

diff

public Volume diff(Volume volume)
Gets the difference of two volumes of the same size.


get

public double get(int x,
                  int y,
                  int z)
Gets a voxel value.

Returns:
getVoxels()[x + getWidth() * (y + getHeight() * x)]

getDepth

public int getDepth()
Gets image Z dimension.


getHeight

public int getHeight()
Gets image Y dimension.


getName

public String getName()
Gets image name.


getSlide

public RgbImage getSlide(int n,
                         char slide,
                         double min,
                         double max)
Gets an image slide.

Parameters:
n - Slide index.
slide - [optional, default is f] Slide orientation: [f]rontal (width x height), [s]aggital (depth x height), [h]orizontal (width x depth).
min - [optional, default is image-min-value] The image intensity corresponding to the 0 output value.
max - [optional, default is image-max-value] The image intensity corresponding to the 255 output value.
Returns:
A blue image with output values between 0 and 255.

getSmooth

public Volume getSmooth(int size)
Gets an isotropic Gaussian smoothing the this volume.

Parameters:
size - Smoothing window size.

getVoxels

public double[] getVoxels()
Gets image buffer.

Returns:
An image buffer such that Volume(i, j, k) = voxels[i + width * (j + height * k)] with 0 <= i < width, 0 <= j < height, 0 <= k < depth.

getWidth

public int getWidth()
Gets image X dimension.


save

public Volume save(String file)
            throws IOException
Saves this volume in an inrimage file and return this.

Parameters:
file - The inrimage file name.
Throws:
IOException