Package gov.nih.mipav.view.renderer.J3D
Class ViewJComponentTriSliceImage
- java.lang.Object
-
- gov.nih.mipav.view.renderer.J3D.ViewJComponentTriSliceImage
-
public class ViewJComponentTriSliceImage extends java.lang.Object
Image plane displayed in the surface renderer. The image plane is initialized with one of the following orientations: FileInfoBase.AXIAL, FileInfoBase.CORONAL, FileInfoBase.SAGITTAL. ViewJComponentTriSliceImage contains oriented 2D slices of the ModelImage data, reconfigured to the axial, sagittal, and coronal coordinates. It passes the oriented 2D ModelImage slice buffer to the SurfaceRender object where it is used as a Texture2D object on a texture-mapped polygon.- Version:
- 0.1 Nov 18, 1997
- Author:
- Matthew J. McAuliffe, Ph.D. (primary)
- See Also:
SurfaceRender
,PatientSlice.java
-
-
Field Summary
Fields Modifier and Type Field Description private float
alphaBlend
AlphaBlending values for compositing two images.private SurfaceRender
frame
Frame where the component image is displayed.private ModelImage
imageA
Model for image A.private ModelImage
imageActive
Model for active image.private ModelImage
imageB
Model for image A.private java.awt.image.BufferedImage
img
BufferedImage to hold the slice image.private int[]
localImageExtents
Extents of the 3D image.private PatientSlice
m_kPatientSlice
PatientSlice contains all the Patient Coordinate System view-specific data for rendering this component:private int
orientation
Orientation of this component image.
-
Constructor Summary
Constructors Constructor Description ViewJComponentTriSliceImage(SurfaceRender _frame, ModelImage _imageA, ModelImage _imageB, int _orientation)
Constructs new component image plane with the appropriate arrays.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
disposeLocal()
Sets all variables to null, disposes, and garbage collects.protected void
finalize()
Calls garbage collector to release system resources.float
getAlphaBlend()
Accessor that returns the alphablend of the two image.boolean
getAxisAligned()
Returns whether the slice is axis-aligned or rotated.java.awt.image.BufferedImage
getImage()
Get the buffered image.ModelImage
getImageA()
Accessor that returns the image A.ModelImage
getImageB()
Accessor that returns the image B.int
getOrientation()
Accessor that returns the component's orientation either FileInfoBase.AXIAL, FileInfoBase.CORONAL, FileInfoBase.SAGITTAL, or FileInfoBase.UNKNOWN_ORIENTvoid
Interpolate(boolean bSample)
When set to true, the m_kPatientSlice.showDiagonal function does tri-linear interpolation of the ModelImage data:void
setAlphaBlend(int value)
Sets the alpha blending of parameter for two image displaying.void
setBuffers(float[] imgBufferA, float[] imgBufferB)
Sets the buffers for the actual data, the displayable image, and the paint.void
setCenter(int i, int j, int k)
setCenter sets the PatientSlice center:void
setImageA(ModelImage image)
Sets component's Image A.void
setImageB(ModelImage image)
Sets component's Image B.void
setImageBufferB(float[] buffer)
Sets component's Image B data buffer.void
setLUTa(ModelLUT LUT)
Accessor that sets the model lut for the image A.void
setLUTb(ModelLUT LUT)
Accessor that sets the model lut for the image B.void
setOrientation(int _orientation)
Accessor that sets the orientation of the component either FileInfoBase.AXIAL, FileInfoBase.CORONAL, FileInfoBase.SAGITTAL, or FileInfoBase.UNKNOWN_ORIENTvoid
setRGBTA(ModelRGB RGBT)
Sets the RGB table for ARGB image A.void
setRGBTB(ModelRGB RGBT)
Sets the RGB table for ARGB image B.void
setSlice(int _slice)
Accessor that sets the slice of the image component.boolean
show(int tSlice, int zSlice, ModelLUT _LUTa, ModelLUT _LUTb, boolean forceShow, javax.vecmath.Vector3f[] akVertices)
Shows the image.
-
-
-
Field Detail
-
alphaBlend
private float alphaBlend
AlphaBlending values for compositing two images.
-
frame
private SurfaceRender frame
Frame where the component image is displayed.
-
imageA
private ModelImage imageA
Model for image A.
-
imageActive
private ModelImage imageActive
Model for active image.
-
imageB
private ModelImage imageB
Model for image A.
-
localImageExtents
private int[] localImageExtents
Extents of the 3D image.
-
img
private java.awt.image.BufferedImage img
BufferedImage to hold the slice image.
-
orientation
private int orientation
Orientation of this component image.
-
m_kPatientSlice
private PatientSlice m_kPatientSlice
PatientSlice contains all the Patient Coordinate System view-specific data for rendering this component:
-
-
Constructor Detail
-
ViewJComponentTriSliceImage
public ViewJComponentTriSliceImage(SurfaceRender _frame, ModelImage _imageA, ModelImage _imageB, int _orientation)
Constructs new component image plane with the appropriate arrays.- Parameters:
_frame
- The SurfaceRender parent frame_imageA
- Model of the image that will be displayed._imageB
- Model of the image that will be displayed._orientation
- Orientation of the image.
-
-
Method Detail
-
disposeLocal
public void disposeLocal()
Sets all variables to null, disposes, and garbage collects.
-
getAlphaBlend
public float getAlphaBlend()
Accessor that returns the alphablend of the two image.- Returns:
- Opacity of paint.
-
getImage
public java.awt.image.BufferedImage getImage()
Get the buffered image.- Returns:
- BufferedImage Buffered image.
-
getImageA
public ModelImage getImageA()
Accessor that returns the image A.- Returns:
- Image A.
-
getImageB
public ModelImage getImageB()
Accessor that returns the image B.- Returns:
- Image B.
-
getOrientation
public int getOrientation()
Accessor that returns the component's orientation either FileInfoBase.AXIAL, FileInfoBase.CORONAL, FileInfoBase.SAGITTAL, or FileInfoBase.UNKNOWN_ORIENT- Returns:
- Image orientation (AXIAL, CORONAL, SAGITTAL)
-
Interpolate
public void Interpolate(boolean bSample)
When set to true, the m_kPatientSlice.showDiagonal function does tri-linear interpolation of the ModelImage data:- Parameters:
bSample
- when true interpolate the ModelImage data
-
setAlphaBlend
public void setAlphaBlend(int value)
Sets the alpha blending of parameter for two image displaying.- Parameters:
value
- Amount [0,100] that is the percentage of Image A to be displayed.
-
setBuffers
public void setBuffers(float[] imgBufferA, float[] imgBufferB)
Sets the buffers for the actual data, the displayable image, and the paint.- Parameters:
imgBufferA
- Storage buffer used to display image A.imgBufferB
- Storage buffer used to display image B.
-
setImageA
public void setImageA(ModelImage image)
Sets component's Image A.- Parameters:
image
- The component's image A.
-
setImageB
public void setImageB(ModelImage image)
Sets component's Image B.- Parameters:
image
- The component's image B.
-
setImageBufferB
public void setImageBufferB(float[] buffer)
Sets component's Image B data buffer.- Parameters:
buffer
- The component's image B data buffer.
-
setLUTa
public void setLUTa(ModelLUT LUT)
Accessor that sets the model lut for the image A.- Parameters:
LUT
- The model LUT for image A.
-
setLUTb
public void setLUTb(ModelLUT LUT)
Accessor that sets the model lut for the image B.- Parameters:
LUT
- The model LUT for image B.
-
setOrientation
public void setOrientation(int _orientation)
Accessor that sets the orientation of the component either FileInfoBase.AXIAL, FileInfoBase.CORONAL, FileInfoBase.SAGITTAL, or FileInfoBase.UNKNOWN_ORIENT- Parameters:
_orientation
- Orientaiton of image slice to be displayed.
-
setRGBTA
public void setRGBTA(ModelRGB RGBT)
Sets the RGB table for ARGB image A.- Parameters:
RGBT
- RGB table.
-
setRGBTB
public void setRGBTB(ModelRGB RGBT)
Sets the RGB table for ARGB image B.- Parameters:
RGBT
- RGB table.
-
setSlice
public void setSlice(int _slice)
Accessor that sets the slice of the image component.- Parameters:
_slice
- Image slice to be displayed.
-
setCenter
public void setCenter(int i, int j, int k)
setCenter sets the PatientSlice center:- Parameters:
i
- FileCoordinatesj
- FileCoordinatesk
- FileCoordinates
-
show
public boolean show(int tSlice, int zSlice, ModelLUT _LUTa, ModelLUT _LUTb, boolean forceShow, javax.vecmath.Vector3f[] akVertices)
Shows the image.- Parameters:
tSlice
- t (time) slice to showzSlice
- z slice to show_LUTa
- LUTa - to change to new LUT for imageA else null._LUTb
- LUTb - to change to new LUT for imageB else null.forceShow
- Forces this method to import image and recalculate java image.akVertices
- four corners of the cut-plane bounding box for diagonal slices- Returns:
- Confirms if the show updated the image
-
finalize
protected void finalize() throws java.lang.Throwable
Calls garbage collector to release system resources.- Overrides:
finalize
in classjava.lang.Object
- Throws:
java.lang.Throwable
- if there is a problem encountered during memory clean-up
-
getAxisAligned
public boolean getAxisAligned()
Returns whether the slice is axis-aligned or rotated.- Returns:
- true when the slice is axis-aligned, false otherwise.
-
-