|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface BasicController
BasicController serves as an interface between MangoPlugin and the viewer window and toolbox. It provides methods to gather information about viewer state, update the viewer, as well as methods to fetch MangoData and other ViewerController objects.
Field Summary | |
---|---|
static int |
SLICE_DIRECTION_AXIAL
|
static int |
SLICE_DIRECTION_CORONAL
|
static int |
SLICE_DIRECTION_SAGITTAL
|
Method Summary | |
---|---|
void |
addKeyListener(KeyListener kl)
Adds a key listener to the viewer. |
void |
addMouseListener(MouseListener ml,
int sliceDir)
Adds a mouse listener to a screen slice. |
void |
addMouseMotionListener(MouseMotionListener ml,
int sliceDir)
Adds a mouse motion listener to a screen slice. |
void |
addOverlay(URI uri,
ImageVolume imageVolume,
String colorTable,
double transparency)
Add an overlay to the viewer. |
void |
addSliceListener(SliceListener sl,
int sliceDirection)
Adds a slice listener, which will be notified anytime a slice's position has changed. |
void |
addTransform(int type,
double[][] mat,
String name)
Deprecated. |
void |
buildSurface()
Build a surface using a default set of parameters. |
void |
convertIndexToWorldCoordinate(Coordinate coor)
Converts in place a coordinate from index to world space. |
void |
convertWorldToIndexCoordinate(Coordinate coor)
Converts in place a coordinate from world to index space. |
void |
doClickMenuItem(String name)
Used to programmatically click a viewer menu item. |
void |
doMagicWandPreserve(Point point)
Perform "magic wand" preserve operation on main slice. |
void |
doMagicWandRemove(Point point)
Perform "magic wand" remove operation on main slice. |
Atlas |
getAtlas()
Returns current atlas. |
int |
getCoordinateType()
Returns the currently selected coordinate type. |
Coordinate |
getCurrentCoordinate(Coordinate coor)
Returns the current coordinate. |
Coordinate |
getCurrentIndex(Coordinate coor)
Returns the current coordinate index. |
int |
getCurrentOverlayIndex()
Returns the index value of the currently selected overlay. |
int |
getCurrentROI()
Deprecated. |
int |
getCurrentTimepoint()
Returns the currently selected timepoint. |
int |
getCurrentTransformIndex()
Deprecated. |
Coordinate |
getImageOrigin()
Returns the image origin. |
String |
getImageTitle()
Returns the name of the image. |
File |
getLoadedFile()
Returns a file for the loaded base image of this viewer. |
BufferedImage |
getMainImage()
Returns a rendering of the main slice view. |
BufferedImage |
getMainImage(boolean exclude)
Returns a rendering of the main slice view. |
BufferedImage |
getMainImage(BufferedImage bi,
int slice)
Returns a rendering of the main slice view. |
BufferedImage |
getMainImage(BufferedImage bi,
int slice,
boolean exclude)
Returns a rendering of the main slice view. |
BufferedImage |
getMainImage(BufferedImage bi,
int slice,
int timeIndex,
boolean exclude)
Returns a rendering of the main slice view. |
int |
getMainSliceDirection()
Returns the slice direction of the main slice view. |
int |
getMainSlicePosition()
Returns the slice position of the main slice view. |
MangoData |
getMangoData()
This can be used to update the MangoData object. |
String |
getMangoVersion()
Returns the Mango version. |
int |
getROIColor()
Returns the current ROI color index. |
int |
getROITool()
Returns the current ROI tool code. |
AffineTransform |
getScreenTransform(int dir)
Returns the screen transform (can be used to convert mouse coordinates to image coordinates). |
Point |
getViewerLocation()
Returns the location of the viewer on the screen. |
Dimension |
getViewerSize()
Returns the viewer dimensions in pixels. |
void |
importROI(URI uri,
boolean forceWorldSpace,
boolean isMangoROI)
Imports an image as an ROI. |
boolean |
isClosing()
Returns true if viewer is in the process of closing. |
boolean |
isInWorkingState()
Returns true if viewer is doing an ROI or image operation, analyzing statistics, saving, or if navigation is disabled. |
boolean |
isRadiologicalMode()
Returns true if radiological mode is being used. |
boolean |
isVOIMode()
Returns the VOI mode state. |
int |
lookupDefaultBlue(int index)
Returns the blue lookup value for the default "Spectrum" lookup table. |
int |
lookupDefaultGreen(int index)
Returns the green lookup value for the default "Spectrum" lookup table. |
int |
lookupDefaultRed(int index)
Returns the red lookup value for the default "Spectrum" lookup table. |
ImageVolume |
makeNewVolume()
Create a new ImageVolume object. |
BufferedImage |
makePluginOverlay(int sliceDirection)
Makes a static slice overlay for painting by a plugin. |
ProgressMeter |
makeProgressMeter()
Creates a progress meter. |
ProgressMeter |
makeProgressMeter(String des)
Deprecated. |
void |
pluginOperationCompleted()
Notifies the viewer that plugin operation has been completed. |
void |
removeKeyListener(KeyListener kl)
Removes a key listener from the viewer. |
void |
removeMouseListener(MouseListener ml,
int sliceDir)
Removes a mouse listener from a screen slice. |
void |
removeMouseMotionListener(MouseMotionListener ml,
int sliceDir)
Removes a mouse motion listener from a screen slice. |
void |
removePluginOverlays()
Removes all plugin overlays. |
void |
removeSliceListener(SliceListener sl,
int sliceDirection)
Removes a slice listener. |
void |
removeTopOverlay()
Removes the top overlay in the stack. |
void |
repaint()
Repaints the viewer. |
void |
setCoordinateType(int type)
Set the coordinate type. |
void |
setCurrentCoordinate(Coordinate coor)
Sets the current coordinate. |
void |
setCurrentIndex(Coordinate coor)
Sets the current index. |
void |
setCurrentTimepoint(int timepoint)
Sets the current timepoint. |
void |
setCurrentTimepoint(int timepoint,
ImageVolume volume)
Sets the current timepoint. |
void |
setImageOrigin(Coordinate coor)
Deprecated. |
void |
setMainSliceDirection(int sliceDirection)
Sets the slice direction of the main slice view. |
void |
setMainSlicePosition(int slicePos)
Sets the main slice view position. |
void |
setNavigationDisabledState(boolean bool)
Disables navigation, puts viewer into "working state". |
void |
setOriginTo(Coordinate coor)
Sets the origin. |
void |
setROIColor(int color)
Sets the current ROI color. |
void |
setROITool(int tool)
Sets the current ROI tool code: |
void |
setShowLowerCrosshairs(boolean show)
Used to toggle the display of the lower slice views crosshairs. |
void |
setShowMainCrosshairs(boolean show)
Used to toggle the display of the main slice view crosshairs. |
void |
setStopPaintingState(boolean bool)
Disables viewer painting. |
void |
updateRange()
Scans the base image for its minimum and maximum values and updates the viewer with this range. |
void |
updateRange(ScreenImage si)
Scans a ScreenImage for its minimum and maximum values. |
void |
updateToolBox()
Updates the toolbox. |
void |
updateViewer()
Updates the image and ROI slice data. |
void |
useTransform(boolean use)
Toggles on/off the image transform. |
Field Detail |
---|
static final int SLICE_DIRECTION_AXIAL
static final int SLICE_DIRECTION_CORONAL
static final int SLICE_DIRECTION_SAGITTAL
Method Detail |
---|
void addKeyListener(KeyListener kl)
kl
- the key listener to addvoid addMouseListener(MouseListener ml, int sliceDir)
ml
- the mouse listener to addsliceDir
- the slice directionvoid addMouseMotionListener(MouseMotionListener ml, int sliceDir)
ml
- the mouse motion listener to addsliceDir
- the slice directionvoid addOverlay(URI uri, ImageVolume imageVolume, String colorTable, double transparency)
uri
- header fileimageVolume
- the volume to overlaycolorTable
- name of color table (if null, color table is automatically selected)transparency
- transparencyvoid addSliceListener(SliceListener sl, int sliceDirection)
sl
- the SliceListener to addsliceDirection
- the slice directionvoid buildSurface()
void convertIndexToWorldCoordinate(Coordinate coor)
coor
- the coordinatevoid convertWorldToIndexCoordinate(Coordinate coor)
coor
- the coordinatevoid doClickMenuItem(String name)
name
- menu item namevoid doMagicWandPreserve(Point point)
point
- point in current slice to perform operationvoid doMagicWandRemove(Point point)
point
- point in current slice to perform operationAtlas getAtlas()
int getCoordinateType()
Coordinate getCurrentCoordinate(Coordinate coor)
coor
- (optional) this Coordinate's values will be replaced with that of the current coordinate
Coordinate getCurrentIndex(Coordinate coor)
coor
- (optional) this Coordinate's values will be replaced with that of the current coordinate
int getCurrentOverlayIndex()
int getCurrentTimepoint()
Coordinate getImageOrigin()
String getImageTitle()
File getLoadedFile()
BufferedImage getMainImage()
BufferedImage getMainImage(boolean exclude)
exclude
- exclude non-image information (e.g., ROIs)
BufferedImage getMainImage(BufferedImage bi, int slice)
bi
- the image in which to store the image (typical to call after calling the no-arg method first)slice
- the slice to render
BufferedImage getMainImage(BufferedImage bi, int slice, boolean exclude)
bi
- the image in which to store the image (typical to call after calling the no-arg method first)slice
- the slice to renderexclude
- exclude non-image information (e.g., ROIs)
BufferedImage getMainImage(BufferedImage bi, int slice, int timeIndex, boolean exclude)
bi
- the image in which to store the image (typical to call after calling the no-arg method first)slice
- the slice to rendertimeIndex
- the timepoint to render (note, you must manually set the timepoint back to the correct position after this method is called)exclude
- exclude non-image information (e.g., ROIs)
int getMainSliceDirection()
int getMainSlicePosition()
MangoData getMangoData()
String getMangoVersion()
int getROIColor()
int getROITool()
AffineTransform getScreenTransform(int dir)
dir
- the slice direction
Point getViewerLocation()
Dimension getViewerSize()
void importROI(URI uri, boolean forceWorldSpace, boolean isMangoROI)
uri
- the image file to loadforceWorldSpace
- true if it is necessary that the image be added in world spaceisMangoROI
- true if this file represents a MangoROIboolean isClosing()
boolean isInWorkingState()
boolean isRadiologicalMode()
boolean isVOIMode()
int lookupDefaultBlue(int index)
index
- the index to lookup (0 - 255).
int lookupDefaultGreen(int index)
index
- the index to lookup (0 - 255).
int lookupDefaultRed(int index)
index
- the index to lookup (0 - 255).
ImageVolume makeNewVolume()
BufferedImage makePluginOverlay(int sliceDirection)
sliceDirection
- slice direction of the main slice view
ProgressMeter makeProgressMeter()
void pluginOperationCompleted()
void removeKeyListener(KeyListener kl)
kl
- the key listener to removevoid removeMouseListener(MouseListener ml, int sliceDir)
ml
- the mouse listener to removesliceDir
- the slice directionvoid removeMouseMotionListener(MouseMotionListener ml, int sliceDir)
ml
- the mouse motion listener to removesliceDir
- the slice directionvoid removePluginOverlays()
void removeSliceListener(SliceListener sl, int sliceDirection)
sl
- the SliceListener to removesliceDirection
- the slice directionvoid removeTopOverlay()
void repaint()
void setCoordinateType(int type)
type
- the coordinate typevoid setCurrentCoordinate(Coordinate coor)
coor
- the Coordinate to set the current coordinate valuesvoid setCurrentIndex(Coordinate coor)
coor
- the Coordinate to set the current coordinate valuesvoid setCurrentTimepoint(int timepoint)
timepoint
- current timepointvoid setCurrentTimepoint(int timepoint, ImageVolume volume)
timepoint
- current timepointvolume
- if multiple overlay timeseries are loaded, all other overlays will be aligned in time to this volumevoid setMainSliceDirection(int sliceDirection)
sliceDirection
- slice direction of the main slice viewvoid setMainSlicePosition(int slicePos)
slicePos
- main slice view positionvoid setNavigationDisabledState(boolean bool)
bool
- true to enable navigation disabled statevoid setOriginTo(Coordinate coor)
coor
- the new originvoid setROIColor(int color)
color
- index (0=red, 1=green, etc.)void setROITool(int tool)
Navigation: 0 = navigation Painting tools: 1 = ellipse edit 2 = ellipse erase 3 = ellipse paint 4 = rectangle edit 5 = rectangle erase 6 = rectangle paint Drawing tools: 7 = draw rectangle 8 = draw ellipse 9 = trace region 10 = trace line 11 = add point Magic wand tools: 12 = add region 13 = preserve region 14 = remove region 15 = dilate/erode region 16 = copy regiom
tool
- codevoid setShowLowerCrosshairs(boolean show)
show
- if true, the lower slice views crosshairs will be displayedvoid setShowMainCrosshairs(boolean show)
show
- if true, the main slice view crosshairs will be displayedvoid setStopPaintingState(boolean bool)
bool
- true to enable "stop painting" statevoid updateRange()
void updateRange(ScreenImage si)
si
- the ScreenImage to updatevoid updateToolBox()
void updateViewer()
void useTransform(boolean use)
use
- true to turn on the transform, false otherwise.@Deprecated void addTransform(int type, double[][] mat, String name)
type
- the ImageTransform typemat
- new transformation matrix as a 4x4 two-dimensional arrayname
- a name for the transform@Deprecated int getCurrentROI()
@Deprecated int getCurrentTransformIndex()
@Deprecated ProgressMeter makeProgressMeter(String des)
des
- the text to be displayed on the progress meter
makeProgressMeter()
@Deprecated void setImageOrigin(Coordinate coor)
coor
- the new image origin
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |