Class VolumeSculptor
- java.lang.Object
-
- gov.nih.mipav.view.renderer.J3D.volumeview.Sculptor
-
- gov.nih.mipav.view.renderer.J3D.volumeview.VolumeSculptor
-
- All Implemented Interfaces:
java.awt.event.MouseListener
,java.awt.event.MouseMotionListener
,java.util.EventListener
public class VolumeSculptor extends Sculptor
Implementation of Volume Sculpting for the RayCast and ShearWarp Volume Renderers. See Sculptor.java.- Author:
- Alexandra Bokinsky, Ph.D. Under contract from Magic Software.
- See Also:
ViewJFrameVolumeView
,RayCastVolumeRenderer
,ShearWarpVolumeRenderer
-
-
Field Summary
Fields Modifier and Type Field Description private ModelImage
kImageAref
References to the sculpt image.private ModelImage
kImageBref
DOCUMENT ME!protected boolean
m_bShear
DOCUMENT ME!protected VolumeRenderer
m_kVolumeRenderer
The volume renderer that is currently rendering the volume data:.-
Fields inherited from class gov.nih.mipav.view.renderer.J3D.volumeview.Sculptor
dAMinAlpha, dAMinBlue, dAMinGreen, dAMinRed, dBMinAlpha, dBMinBlue, dBMinGreen, dBMinRed, fImageBMin, fImageMin, LINES, m_aiImageA_backup, m_aiImageB_backup, m_aiXPoints, m_aiYPoints, m_bMousePressed, m_bSculptDrawn, m_bSculptEnabled, m_iColorSculpt, m_iFirstX, m_iFirstY, m_iLastX, m_iLastY, m_iNumberPoints, m_iOriginalHeight, m_iOriginalWidth, m_iPreviousX, m_iPreviousY, m_iSculptImageHeight, m_iSculptImageWidth, m_iXMax, m_iXMin, m_iYMax, m_iYMin, m_kCanvas3D, m_kProgress, m_kSavedImage, m_kSculptImage, m_kSculptImageOpaque, RECTANGLE
-
-
Constructor Summary
Constructors Constructor Description VolumeSculptor(VolumeRenderer kVolumeRenderer, int iSculptWidth, int iSculptHeight)
Constructor:
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
applySculpt()
applySculpt: called by ViewJFrameVolumeView when the user presses the "Apply Sculpt" button.void
clearSculpt()
clearSculpt: called by ViewJFrameVolumeView when the user presses the "Clear Ouline" button, clearing the sculpt outline from the canvas image.void
disposeLocal(boolean flag)
Sets all variables to null, disposes, and garbage collects.void
enableSculpt(boolean bEnabled)
enableSculpt: called by the ViewJFrameVolumeView object when the Draw Sculpt button is pressed.void
finalize()
Calls disposeLocal.void
save(FileWriteOptions options, int filterType)
Creates save dialog so that the image can be saved // This should be moved to imageModel.save();void
undoSculpt()
undoSculpt: called by the ViewJFrameVolumeView object when the user presses the "Undo Sculpt" button.void
update()
Update the underlying volume and rerender.private void
updateRenderedVolume(ViewJComponentRenderImage kRenderImageXY)
This sequence causes the m_kVolumeRenderer to rerender the volume data, from the current ModelImage, not the data that is stored in the Renderer.-
Methods inherited from class gov.nih.mipav.view.renderer.J3D.volumeview.Sculptor
backupImage, backupImage, blendColor, calculateMinMaxValues, drawRectangleArea, fill, getEnable, getFrameBuffer, initVolumeSculptor, invertSculpt, line, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, outlineRegion, processMouseReleased, sculptImage, setDrawingShape, sortCrossingPoints, undoSculpt
-
-
-
-
Field Detail
-
m_bShear
protected boolean m_bShear
DOCUMENT ME!
-
m_kVolumeRenderer
protected VolumeRenderer m_kVolumeRenderer
The volume renderer that is currently rendering the volume data:.
-
kImageAref
private ModelImage kImageAref
References to the sculpt image.
-
kImageBref
private ModelImage kImageBref
DOCUMENT ME!
-
-
Constructor Detail
-
VolumeSculptor
public VolumeSculptor(VolumeRenderer kVolumeRenderer, int iSculptWidth, int iSculptHeight)
Constructor:- Parameters:
kVolumeRenderer
- reference to current rendereriSculptWidth
- Canvas WidthiSculptHeight
- Canvas Height
-
-
Method Detail
-
applySculpt
public boolean applySculpt()
applySculpt: called by ViewJFrameVolumeView when the user presses the "Apply Sculpt" button. This function has several steps: 1. Getting the ModelImage volume data and correctly calculating the center of the volume and the spacing of the volume. 2. Calculating the viewing Transformations. 3. Determining which voxels in the volume fall within the sculpt region drawn on the screen, and setting those values to the minimum voxel value.- Specified by:
applySculpt
in classSculptor
- Returns:
- DOCUMENT ME!
-
clearSculpt
public void clearSculpt()
clearSculpt: called by ViewJFrameVolumeView when the user presses the "Clear Ouline" button, clearing the sculpt outline from the canvas image. The function disables sculpting and reactivates the mouse events for the m_kVolumeRenderer.- Overrides:
clearSculpt
in classSculptor
-
disposeLocal
public void disposeLocal(boolean flag)
Sets all variables to null, disposes, and garbage collects.- Overrides:
disposeLocal
in classSculptor
- Parameters:
flag
- DOCUMENT ME!
-
enableSculpt
public void enableSculpt(boolean bEnabled)
enableSculpt: called by the ViewJFrameVolumeView object when the Draw Sculpt button is pressed. This function deactivates the m_kVolumeRenderer's mouse response, so the mouse can be used to draw the sculpt outline.- Overrides:
enableSculpt
in classSculptor
- Parameters:
bEnabled
- DOCUMENT ME!
-
finalize
public void finalize() throws java.lang.Throwable
Calls disposeLocal.
-
save
public void save(FileWriteOptions options, int filterType)
Creates save dialog so that the image can be saved // This should be moved to imageModel.save();- Parameters:
options
- File-write options.filterType
- only used if >= 0
-
undoSculpt
public void undoSculpt()
undoSculpt: called by the ViewJFrameVolumeView object when the user presses the "Undo Sculpt" button. It resets the volume data back to the original values, using the data stored in the m_aiImage_backup data members.- Specified by:
undoSculpt
in classSculptor
-
update
public void update()
Update the underlying volume and rerender. This function is called when the volume has changed.
-
updateRenderedVolume
private void updateRenderedVolume(ViewJComponentRenderImage kRenderImageXY)
This sequence causes the m_kVolumeRenderer to rerender the volume data, from the current ModelImage, not the data that is stored in the Renderer.- Parameters:
kRenderImageXY
- DOCUMENT ME!
-
-