ome.services.roi
Class GeomTool

java.lang.Object
  extended by ome.services.roi.GeomTool
All Implemented Interfaces:
EventListener, org.springframework.context.ApplicationListener

public class GeomTool
extends Object
implements org.springframework.context.ApplicationListener

Strategy for handling the conversion between shapes and database-specific geometries. Implements ApplicationListener in order to keep the strategy-specific geometry columns in sync when a ShapeChangeMessage is published.

Since:
Beta4.1

Field Summary
protected  PixelData data
           
protected  Executor ex
           
protected  SessionFactory factory
           
protected  AtomicBoolean hasShapes
           
protected  org.springframework.jdbc.core.simple.SimpleJdbcOperations jdbc
           
protected  org.apache.commons.logging.Log log
           
protected  String uuid
           
 
Constructor Summary
GeomTool(PixelData data, org.springframework.jdbc.core.simple.SimpleJdbcOperations jdbc, SessionFactory factory)
           
GeomTool(PixelData data, org.springframework.jdbc.core.simple.SimpleJdbcOperations jdbc, SessionFactory factory, Executor ex, String uuid)
           
 
Method Summary
 void backgroundSynchronizeShapeGeometries()
           
 String dbPath(omero.model.Shape shape)
           
 Object discriminator(String string)
          Maps from multiple possible user-provided names of shapes (e.g.
 omero.model.Ellipse ellipse(double cx, double cy, double rx, double ry)
           
 omero.model.Ellipse ellipse(double cx, double cy, double rx, double ry, int t, int z)
           
 List<Long> findIntersectingRois(long imageId, omero.api.RoiOptions opts, omero.model.Shape... shapes)
           
 List<Long> findIntersectingRois(long imageId, omero.model.Shape... shapes)
           
 omero.api.ShapePoints getPoints(long shapeId, org.hibernate.Session session)
           
 List<Long> getShapeIds(long roiId)
           
 omero.api.RoiStats getStats(List<Long> shapeIds)
           
 omero.model.Line ln(double x1, double y1, double x2, double y2)
           
 void onApplicationEvent(org.springframework.context.ApplicationEvent event)
           
 omero.model.Point pt(double x, double y)
           
 List<omero.model.Shape> random(int count)
           
 omero.model.Rect rect(double x, double y, double w, double h)
           
 void synchronizeShapeGeometries(List<Long> shapeIds)
           
 void synchronizeShapeGeometry(long shapeId)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected org.apache.commons.logging.Log log

hasShapes

protected final AtomicBoolean hasShapes

jdbc

protected final org.springframework.jdbc.core.simple.SimpleJdbcOperations jdbc

factory

protected final SessionFactory factory

data

protected final PixelData data

ex

protected final Executor ex

uuid

protected final String uuid
Constructor Detail

GeomTool

public GeomTool(PixelData data,
                org.springframework.jdbc.core.simple.SimpleJdbcOperations jdbc,
                SessionFactory factory)

GeomTool

public GeomTool(PixelData data,
                org.springframework.jdbc.core.simple.SimpleJdbcOperations jdbc,
                SessionFactory factory,
                Executor ex,
                String uuid)
Method Detail

onApplicationEvent

public void onApplicationEvent(org.springframework.context.ApplicationEvent event)
Specified by:
onApplicationEvent in interface org.springframework.context.ApplicationListener

backgroundSynchronizeShapeGeometries

public void backgroundSynchronizeShapeGeometries()

synchronizeShapeGeometries

public void synchronizeShapeGeometries(List<Long> shapeIds)

synchronizeShapeGeometry

public void synchronizeShapeGeometry(long shapeId)

random

public List<omero.model.Shape> random(int count)

ln

public omero.model.Line ln(double x1,
                           double y1,
                           double x2,
                           double y2)

rect

public omero.model.Rect rect(double x,
                             double y,
                             double w,
                             double h)

pt

public omero.model.Point pt(double x,
                            double y)

ellipse

public omero.model.Ellipse ellipse(double cx,
                                   double cy,
                                   double rx,
                                   double ry)

ellipse

public omero.model.Ellipse ellipse(double cx,
                                   double cy,
                                   double rx,
                                   double ry,
                                   int t,
                                   int z)

dbPath

public String dbPath(omero.model.Shape shape)

findIntersectingRois

public List<Long> findIntersectingRois(long imageId,
                                       omero.model.Shape... shapes)

findIntersectingRois

public List<Long> findIntersectingRois(long imageId,
                                       omero.api.RoiOptions opts,
                                       omero.model.Shape... shapes)

getPoints

public omero.api.ShapePoints getPoints(long shapeId,
                                       org.hibernate.Session session)

getShapeIds

public List<Long> getShapeIds(long roiId)

getStats

public omero.api.RoiStats getStats(List<Long> shapeIds)

discriminator

public Object discriminator(String string)
Maps from multiple possible user-provided names of shapes (e.g. "::omero::model::Text", "Text", "TextI", "omero.model.TextI", "ome.model.roi.Text", ...) to the definitive database discriminator.

Parameters:
string -
Returns:


OmeroJava Api

Version: Beta-4.1.1-r5927-b91

Copyright © 2009 The University of Dundee. All Rights Reserved.