|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.unihalle.informatik.MiToBo.core.imageJ.RoiManagerAdapter
public class RoiManagerAdapter
Convenience functions for interaction with ImageJ's ROI manager.
This class is implemented as singleton. To access its functionality, use the getAdapter() function to get the singleton instance and call its methods.
Nested Class Summary | |
---|---|
private static class |
RoiManagerAdapter.RoiReader
Class for parsing ImageJ roi files and zip archives. |
Field Summary | |
---|---|
private static java.lang.Object |
classLock
Lock variable to make singleton thread-safe. |
private static RoiManagerAdapter |
roiAdapt
The object instance. |
private ij.plugin.frame.RoiManager |
roiManager
Reference to the current ImageJ roi manager. |
Constructor Summary | |
---|---|
private |
RoiManagerAdapter()
Hidden constructor, never called from outside. |
Method Summary | |
---|---|
void |
addContoursToRoiManager(MTBContour2DSet conts)
Adds a set of 2D contours to the ROI manager. |
void |
addPolygonsToRoiManager(MTBPolygon2DSet polys)
Adds a set of polygons to the ROI manager. |
void |
addPolygonToRoiManager(MTBPolygon2D poly)
Adds the given polygon to the ROI manager. |
void |
addRegionsToRoiManager(MTBRegion2DSet regs)
Adds a set of 2D regions to the ROI manager. |
boolean |
areRegionsInManagerAvailable()
Returns true if there are regions available in ROI manager. |
private boolean |
checkSelectionConsistency()
|
MTBContour2DSet |
getContourSetFromRoiManager()
Reads a ROI manager selection into a set of contours. |
static RoiManagerAdapter |
getInstance()
Single access point for singleton functionality. |
MTBPolygon2DSet |
getPolygonSetFromRoiFile(java.lang.String file,
boolean asSnakes)
Reads an ImageJ roi file into a set of polygons/snakes. |
MTBPolygon2DSet |
getPolygonSetFromRoiManager()
Reads ROI manager selections into a set of polygons/snakes. |
MTBRegion2DSet |
getRegionSetFromRoiManager()
Reads a ROI manager selection into a set of regions. |
private void |
openRoiManager()
Gets an instance of the current ROI manager of ImageJ. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static java.lang.Object classLock
private static RoiManagerAdapter roiAdapt
private ij.plugin.frame.RoiManager roiManager
Constructor Detail |
---|
private RoiManagerAdapter()
Method Detail |
---|
public void addContoursToRoiManager(MTBContour2DSet conts)
conts
- Set of contours to be added to ROI manager.public void addPolygonsToRoiManager(MTBPolygon2DSet polys)
Note that the set is destroyed by this operation, i.e. it cannot be recovered lateron from the ROI manager as it does not support to group several polygons into a logic entity.
polys
- Set of polygons to be added to ROI manager.public void addPolygonToRoiManager(MTBPolygon2D poly)
poly
- Polygon to be added to ROI manager.public void addRegionsToRoiManager(MTBRegion2DSet regs)
regs
- Set of regions to be added to ROI manager.public boolean areRegionsInManagerAvailable()
private boolean checkSelectionConsistency()
public MTBContour2DSet getContourSetFromRoiManager()
public static RoiManagerAdapter getInstance()
public MTBPolygon2DSet getPolygonSetFromRoiFile(java.lang.String file, boolean asSnakes) throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException, de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
file
- Input file.asSnakes
- If true, function returns snakes, otherwise polygons.
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
public MTBPolygon2DSet getPolygonSetFromRoiManager()
public MTBRegion2DSet getRegionSetFromRoiManager()
private void openRoiManager()
If there is already a roi manager open, get a reference to that one, otherwise open a new one.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |