edu.uthscsa.ric.mango
Interface ViewerController

All Superinterfaces:
BasicController

public interface ViewerController
extends BasicController

ViewerController extends BasicController and adds methods for multi-window environments.


Field Summary
 
Fields inherited from interface edu.uthscsa.ric.mango.BasicController
SLICE_DIRECTION_AXIAL, SLICE_DIRECTION_CORONAL, SLICE_DIRECTION_SAGITTAL
 
Method Summary
 ViewerController addNewImage(ImageDimensions id, VoxelDimensions vd, ImageRange ir, ByteBuffer[] buffers, String orientation, String name)
          Adds new image.
 ViewerController addNewImage(ImageDimensions id, VoxelDimensions vd, String orientation, String name)
          Adds new image.
 void associatePluginWindow(String des, JFrame win)
          Associates a window generated by a plugin with the viewer.
 void closeAssociatedWindow(String des)
          Closes a viewer-associated window.
 JButton createColorPickerButton(MangoColorSelectedListener listener, boolean showUsedOnly)
          Create a ROI color picker button.
 Point findCenterRelativeToScreen(Dimension size)
          Returns location that will center window in current display.
 Point findCenterRelativeToViewer(Dimension size)
          Returns location that will center window relative to viewer.
 Rectangle findCurrentDisplayBounds()
          Returns bounds of display that viewer is currently within.
 Insets findCurrentDisplayInsets()
          Returns insets of display that viewer is currently within.
 Dimension findCurrentDisplaySize()
          Returns dimensions of display that viewer is currently within.
 Point findGoodPluginWindowLocation(Dimension size)
          Returns an appropriate location for a new window.
 ViewerController[] getAllViewerControllers(boolean includeSelf)
          Returns all currently open viewers.
 Atlas getAtlas(String atlasName)
          Returns an atlas found by name.
 JFrame getFrame()
          Returns viewer frame.
 File getLibDir()
          Returns a directory to store library files.
 File getTempDir()
          Returns a directory to store temporary data.
 void logToConsole(String str)
          Write a message to the Mango console.
 void setViewerLocation(Point aPoint)
          Sets the location of the viewer on the screen.
 void setViewerSize(int width)
          Sets the width (pixels) of the viewer.
 void toFront()
          Activates the viewer window.
 void updateAllViewers()
          Updates the image and ROI slice data in all viewers.
 
Methods inherited from interface edu.uthscsa.ric.mango.BasicController
addKeyListener, addMouseListener, addMouseMotionListener, addOverlay, addSliceListener, addTransform, buildSurface, convertIndexToWorldCoordinate, convertWorldToIndexCoordinate, doClickMenuItem, doMagicWandPreserve, doMagicWandRemove, getAtlas, getCoordinateType, getCurrentCoordinate, getCurrentIndex, getCurrentOverlayIndex, getCurrentROI, getCurrentTimepoint, getCurrentTransformIndex, getImageOrigin, getImageTitle, getLoadedFile, getMainImage, getMainImage, getMainImage, getMainImage, getMainImage, getMainSliceDirection, getMainSlicePosition, getMangoData, getMangoVersion, getROIColor, getROITool, getScreenTransform, getViewerLocation, getViewerSize, importROI, isClosing, isInWorkingState, isRadiologicalMode, isVOIMode, lookupDefaultBlue, lookupDefaultGreen, lookupDefaultRed, makeNewVolume, makePluginOverlay, makeProgressMeter, makeProgressMeter, pluginOperationCompleted, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePluginOverlays, removeSliceListener, removeTopOverlay, repaint, setCoordinateType, setCurrentCoordinate, setCurrentIndex, setCurrentTimepoint, setCurrentTimepoint, setImageOrigin, setMainSliceDirection, setMainSlicePosition, setNavigationDisabledState, setOriginTo, setROIColor, setROITool, setShowLowerCrosshairs, setShowMainCrosshairs, setStopPaintingState, updateRange, updateRange, updateToolBox, updateViewer, useTransform
 

Method Detail

addNewImage

ViewerController addNewImage(ImageDimensions id,
                             VoxelDimensions vd,
                             ImageRange ir,
                             ByteBuffer[] buffers,
                             String orientation,
                             String name)
Adds new image.

Parameters:
id - the ImageDimensions
vd - the VoxelDimensions
ir - the ImageRange
buffers - an array of FloatBuffers, one per timepoint
orientation - the orientation string
name - the name of the new image
Returns:
the new viewer (then using getMangoData() in the new ViewerController will provide access to image data)

addNewImage

ViewerController addNewImage(ImageDimensions id,
                             VoxelDimensions vd,
                             String orientation,
                             String name)
Adds new image.

Parameters:
id - the ImageDimensions
vd - the VoxelDimensions
orientation - the orientation string
name - the name of the new image
Returns:
the new viewer (then using getMangoData() in the new ViewerController will provide access to image data)

associatePluginWindow

void associatePluginWindow(String des,
                           JFrame win)
Associates a window generated by a plugin with the viewer. An associated window will appear in the Toolbox window menu and will close automatically when the viewer closes.

Parameters:
des - the name of the window
win - the window

closeAssociatedWindow

void closeAssociatedWindow(String des)
Closes a viewer-associated window.

Parameters:
des - the name of the window (as it would appear in the ToolBox window menu)

createColorPickerButton

JButton createColorPickerButton(MangoColorSelectedListener listener,
                                boolean showUsedOnly)
Create a ROI color picker button. The button icon is a square swatch of the currently selected ROI color. When clicked the button will display a ROI color picker widget.

Parameters:
listener - callback after user selects color
showUsedOnly - true to only show used ROI colors in picker, false to show all colors
Returns:
the button

findCenterRelativeToScreen

Point findCenterRelativeToScreen(Dimension size)
Returns location that will center window in current display.

Parameters:
size - the size of window
Returns:
location

findCenterRelativeToViewer

Point findCenterRelativeToViewer(Dimension size)
Returns location that will center window relative to viewer.

Parameters:
size - the size of window
Returns:
location

findCurrentDisplayBounds

Rectangle findCurrentDisplayBounds()
Returns bounds of display that viewer is currently within.

Returns:
bounds

findCurrentDisplayInsets

Insets findCurrentDisplayInsets()
Returns insets of display that viewer is currently within.

Returns:
insets

findCurrentDisplaySize

Dimension findCurrentDisplaySize()
Returns dimensions of display that viewer is currently within.

Returns:
dimensions

findGoodPluginWindowLocation

Point findGoodPluginWindowLocation(Dimension size)
Returns an appropriate location for a new window. Takes into consideration viewer location, new window size, and display bounds.

Parameters:
size - new window size
Returns:
new location

getAllViewerControllers

ViewerController[] getAllViewerControllers(boolean includeSelf)
Returns all currently open viewers.

Parameters:
includeSelf - include this ViewerController in the list
Returns:
an array of all currently open viewers

getAtlas

Atlas getAtlas(String atlasName)
Returns an atlas found by name.

Parameters:
atlasName - name of the atlas
Returns:
the atlas, or null if none were found by that name

getFrame

JFrame getFrame()
Returns viewer frame.

Returns:
viewer frame

getLibDir

File getLibDir()
Returns a directory to store library files.

Returns:
the library directory

getTempDir

File getTempDir()
Returns a directory to store temporary data. These data files will be deleted when the application quits.

Returns:
the temporary directory

logToConsole

void logToConsole(String str)
Write a message to the Mango console.

Parameters:
str - message to log

setViewerLocation

void setViewerLocation(Point aPoint)
Sets the location of the viewer on the screen.

Parameters:
aPoint - the location of the viewer

setViewerSize

void setViewerSize(int width)
Sets the width (pixels) of the viewer.

Parameters:
width - number of pixels

toFront

void toFront()
Activates the viewer window.


updateAllViewers

void updateAllViewers()
Updates the image and ROI slice data in all viewers.