de.unihalle.informatik.MiToBo.core.imageJ
Class RoiManagerAdapter

java.lang.Object
  extended by de.unihalle.informatik.MiToBo.core.imageJ.RoiManagerAdapter

public class RoiManagerAdapter
extends Object

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.

Author:
moeller

Method Summary
 void addBordersToRoiManager(MTBBorder2DSet borders)
          Adds a set of 2D borders to the ROI manager.
 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.
 MTBBorder2DSet getBorderSetFromRoiManager()
          Reads a ROI manager selection into a set of borders.
 MTBContour2DSet getContourSetFromRoiManager()
          Reads a ROI manager selection into a set of contours.
static RoiManagerAdapter getInstance()
          Single access point for singleton functionality.
 MTBPolygon2DSet getPolygonSetFromRoiFile(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 getRegionSetFromRoiFile(String file)
          Reads an ImageJ roi file into a set of regions.
 MTBRegion2DSet getRegionSetFromRoiFile(String file, double xMin, double yMin, double xMax, double yMax)
          Reads an ImageJ roi file into a set of regions.
 MTBRegion2DSet getRegionSetFromRoiManager()
          Reads a ROI manager selection into a set of regions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static RoiManagerAdapter getInstance()
Single access point for singleton functionality.

Returns:
Reference to the singleton instance.

addPolygonToRoiManager

public void addPolygonToRoiManager(MTBPolygon2D poly)
Adds the given polygon to the ROI manager.

Parameters:
poly - Polygon to be added to ROI manager.

addPolygonsToRoiManager

public void addPolygonsToRoiManager(MTBPolygon2DSet polys)
Adds a set of polygons to the ROI manager.

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.

Parameters:
polys - Set of polygons to be added to ROI manager.

addRegionsToRoiManager

public void addRegionsToRoiManager(MTBRegion2DSet regs)
Adds a set of 2D regions to the ROI manager.

Parameters:
regs - Set of regions to be added to ROI manager.

addContoursToRoiManager

public void addContoursToRoiManager(MTBContour2DSet conts)
Adds a set of 2D contours to the ROI manager.

Parameters:
conts - Set of contours to be added to ROI manager.

addBordersToRoiManager

public void addBordersToRoiManager(MTBBorder2DSet borders)
Adds a set of 2D borders to the ROI manager.

Parameters:
borders - Set of borders to be added to ROI manager.

getRegionSetFromRoiFile

public MTBRegion2DSet getRegionSetFromRoiFile(String file)
                                       throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException,
                                              de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
Reads an ImageJ roi file into a set of regions.

Parameters:
file - Input file.
Returns:
Set of regions; always non-null, but probably empty.
Throws:
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException

getRegionSetFromRoiFile

public MTBRegion2DSet getRegionSetFromRoiFile(String file,
                                              double xMin,
                                              double yMin,
                                              double xMax,
                                              double yMax)
                                       throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException,
                                              de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
Reads an ImageJ roi file into a set of regions.

Parameters:
file - Input file.
xMin - Minimal x value of user-specified domain.
yMin - Minimal y value of user-specified domain.
xMax - Maximal x value of user-specified domain.
yMax - Maximal y value of user-specified domain.
Returns:
Set of regions; always non-null, but probably empty.
Throws:
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException

getPolygonSetFromRoiFile

public MTBPolygon2DSet getPolygonSetFromRoiFile(String file,
                                                boolean asSnakes)
                                         throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException,
                                                de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
Reads an ImageJ roi file into a set of polygons/snakes.

Parameters:
file - Input file.
asSnakes - If true, function returns snakes, otherwise polygons.
Returns:
Set of polygons/snakes; always non-null, but probably empty.
Throws:
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException

getPolygonSetFromRoiManager

public MTBPolygon2DSet getPolygonSetFromRoiManager()
Reads ROI manager selections into a set of polygons/snakes.

Returns:
Set of polygons; always non-null, but probably empty.

getRegionSetFromRoiManager

public MTBRegion2DSet getRegionSetFromRoiManager()
Reads a ROI manager selection into a set of regions.

Returns:
Set of regions; always non-null, but probably empty.

getContourSetFromRoiManager

public MTBContour2DSet getContourSetFromRoiManager()
Reads a ROI manager selection into a set of contours.

Returns:
Set of contours; always non-null, but probably empty.

getBorderSetFromRoiManager

public MTBBorder2DSet getBorderSetFromRoiManager()
Reads a ROI manager selection into a set of borders.

Returns:
Set of borders; always non-null, but probably empty.

areRegionsInManagerAvailable

public boolean areRegionsInManagerAvailable()
Returns true if there are regions available in ROI manager.

Returns:
True, if region manager contains at least one region.


Copyright © 2010–2015 Martin Luther University Halle-Wittenberg. All rights reserved.