Hello,
I am working on adding support for 2D ROIs to ImageJ-OMERO. In order to do this, I will need to expand the ImgLib2-Roi API. My basic plan for doing this is outlined below. @ctrueden, @tpietzsch, @dietzc, @axtimwalde, @joshmoore please let me know your thoughts on this plan, and if you have any questions/concerns regarding it.
Overview
- Create the below classes:
a. BinaryMask
b. Composite (OMERO allows for ROIs which are a union of shapes, this would be the equiavalent to that)
c. Rectangle2D
d. Ellipse2D
e. Polyline2D
f. Line2D
g. Point2D - Rename Polygon to Polygon2D
- Add methods to Regions to create:
a. BinaryMask
b. Composite
c. LabelRegions - Create GeomRegions in
net.imglib2.roi.geometric
and add methods to create the below ROIs to it:
a. Polygon2D
b. Rectangle2D
c. Ellipse2D
d. Polyline2D
e. Line2D
f. Point2D
Details
- All of the proposed new classes would implement the
Contains
interface, and theRealRandomAccessibleRealInterval
interface - Create all classes expect BinaryMask & Composite in `net.imglib2.roi.geometric’
- Create BinaryMask & Composite in
net.imglib2.roi
- BinaryMask would essentially be an
Img<BoolType>
- Composite
- Contain a list of ROIs in the composite
- Allow for operations (union, difference, etc.) between ROI structures via JTS Topology Suite
- Point2D would be a RealPoint
- Line2D would be defined by two
RealLocalizable
s - Polyline2D would be defined by a
List<RealLocalizable>
- Could also specify which points in the list are the start/end points. If not specified assume first point in list is start and last point in list is end
- Rectangle2D defined by width, height, center point, and
AffineTransform2D
-
AffineTransform2D
would allow for rotations if someone didn’t want a rectangle which was parallel to the xy-axes
-
- Ellipse2D defined by xy radii, center,
AffineTransform2D
Questions
- Do we want to include a method for creating LabelRegions in Regions? I can see keeping it separate or adding it …
- Would we prefer to define a rectangle by the four corner points? Or some other way? Or both?
- What should be the equivalent data structure in ImgLib2 for OMERO Label ROIs?
a. We could try to equate OMERO Labels to ImgLib2 LabelRegions
b. Or we could create a new type of label (either in ImgLib2 or ImageJ-OMERO), which is more of a direct equivalent to OMERO Labels
This is just a very high level plan. There’s still more details to work out, but I wanted to make sure we were ok with this basic structure before I proceeded. Please feel free to make suggestions or bring up any issues which I haven’t addressed.
Thanks,
Alison