Hi Jason,<br><br>Thanks for spurring this discussion. I agree that having a single model for ROIs, or at least extremely compatible models, would be the best thing.<br><br>First of all, please realize that the earlier discussion was about implementation of ROIs in code, rather than modelling. Specifically, we need the ImgLib2 library (the foundation of the ImageJ2 data model) to support ROIs. All this talk of KD-trees and hyperrectangle searches is regarding how best to support the model using data structures. We want to be able to do things like iterate over all image pixels within a ROI, for which AFAIK there is no OME reference library. Hopefully ImageJ2/ImgLib2 will help provide such functionality. Perhaps there is something in OMERO.server or OMERO.insight that provides such abilities, but my understanding is that these sorts of features are not exposed as (nor intended to be) standalone modules for use with other applications. (Though perhaps we could collaborate on something like that!)<br>

<br>Lee wrote some proof of concept adapter classes that translate between ImgLib2/ImageJ2 RegionOfInterest objects and OME-XML ROI model objects (as defined in ome-xml.jar):<br><br>  <a href="http://dev.imagejdev.org/trac/imagej/browser/trunk/core/roi/src/main/java/imagej/roi/omero?rev=2612">http://dev.imagejdev.org/trac/imagej/browser/trunk/core/roi/src/main/java/imagej/roi/omero?rev=2612</a><br>

<br>At the moment this work is not part of the latest trunk, but we will explore it further later so that ImageJ can read/write ROIs from/to OME-XML. (And something similar will likely work for reading/writing from/to an OMERO server.)<br>

<br>Regarding the definition of the ImageJ2 ROI model, our first priority is to support everything that ImageJ1 supports. Fortunately, there is very strong (though not perfect) overlap between OME and ImageJ1 ROIs. As I said above, it should be straightforward to adapt them between each other.<br>

<br>If you feel adaptation is not sufficient and would like for us to co-develop a single unified ROI model, we could attempt it. However, my intuition is that it might be extremely difficult—recall our many discussions at past OME meetings and how we never fully came to a consensus even then. We would probably need to formalize such a project, meet in person more often, define the model as separate from OME-XML as a whole, and have a reference library for working with ROIs at various levels (data, display, etc.).<br>

<br>A related issue: when it comes to very general standards and foundations for imaging software, I think we need to move beyond the name &quot;Open Microscopy Environment.&quot; The ImageJ project is broader than just microscopy, being used by scientists of widely varying disciplines, and we need to respect that. One idea I mentioned to Josh is to use a &quot;backronym&quot; such as &quot;Open Metadata Environment&quot; (though Josh pointed out that is probably *too* broad) to keep the term &quot;OME&quot; while expanding its meaning beyond microscopy, as we have certainly been working to do technically.<br>

<br>Another thing that would make sense from a technical standpoint would be to split the OME-XML schema in half: have a base schema for describing image pixel structure, and an acquisition portion that is more microscopy and/or life sciences specific. I&#39;m not sure what the best place(s) to divide it would be. However, as things stand there are some issues with ImageJ2 saving as OME-TIFF by default even for non-microscopy images. There are quite a few microscopy-driven design considerations in the schema right now, such as implicit units. E.g., if ImageJ saves a calibrated photo of a satellite image as OME-TIFF, storing the spatial calibration as microns per pixel, rather than e.g. meters per pixel, is awkward.<br>

<br>Lately Kevin and I have been discussing how to improve Bio-Formats to include support for metadata models beyond OME-XML—or to put it another way, expand OME-XML beyond microscopy. The issue is a bit semantic, but regardless we are all working to create broadly useful tools for scientific imaging, and these growing pains merit further discussion.<br>

<br>Regards,<br>Curtis<br><br><div class="gmail_quote">On Tue, Jun 21, 2011 at 1:52 PM, Jason Swedlow <span dir="ltr">&lt;<a href="mailto:jason@lifesci.dundee.ac.uk">jason@lifesci.dundee.ac.uk</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<div style="word-wrap:break-word">Hi Gang-<div><br></div><div>Sorry to do this again-</div><div><br></div><div>For ROIs, see</div><div><br></div><div><a href="http://www.openmicroscopy.org/Schemas/ROI/2011-06/ROI.xsd" target="_blank">http://www.openmicroscopy.org/Schemas/ROI/2011-06/ROI.xsd</a></div>

<div><br></div><div>or a more readable version is at:</div><div><br></div><div><a href="http://git.openmicroscopy.org/src/develop/components/specification/Documentation/Generated/OME-2011-06/ome.html" target="_blank">http://git.openmicroscopy.org/src/develop/components/specification/Documentation/Generated/OME-2011-06/ome.html</a></div>

<div><br></div><div>(you&#39;ll have to scroll down a ways to the ROI schema).</div><div><br></div><div> If we want to achieve the interoperability that we often discuss, defining a single model for ROIs would help.  Tell us what you don&#39;t like and we&#39;ll work on it.  If you want to reject this, that&#39;s fine, and really not a problem.  If you can&#39;t map what we have to imglib2, then we need to scratch our heads and figure out how we might make that work.   There is no pretense that our existing model is perfect.  If you tell us what&#39;s broken, we&#39;ll work hard to fix it. </div>

<div><br></div><div>If you come up with a new ROI model, let us know, and we&#39;ll do the translation work (more work for the Bio-Formats developers, known to you as Melissa and Curtis).  Of course, if we all used the same one, or even worked to make the translation easy, wouldn&#39;t that be great?!?!?!</div>

<div><br></div><div>Cheers,</div><div><br></div><div>Jason</div><div><br></div><div><div><div></div><div class="h5"><br><div><div>On 21 Jun 2011, at 19:17, Lee Kamentsky wrote:</div><br><blockquote type="cite"><div>Thanks Tobias,<br>

I ended up not using the KD tree for my composite ROI, but I wrote a hyperrectangle search class, net.imglib2.algorithm.kdtree.VolumetricSearch, anyway. I&#39;m looking at net.imglib2.collection.KDTree and the searches in net.imglib2.neighborsearch and I can see those are better places for it now. I&#39;ll see if I can find some time to reimplement it there.<br>

<br>But, the one in algorithms works - it&#39;s pretty cool to have a database of N-dimensional intervals that you can search in log time.<br><br>--Lee<br><br>On 6/21/2011 1:21 PM, Tobias Pietzsch wrote:<br><blockquote type="cite">

On 06/10/2011 03:33 PM, Lee Kamentsky wrote:<br></blockquote><blockquote type="cite"><blockquote type="cite">Hi all, esp Dscho &amp; Stephan P. I&#39;m thinking of doing a composite region<br></blockquote></blockquote><blockquote type="cite">

<blockquote type="cite">of interest which would be a collection any other kinds of region of<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">interest. I&#39;m thinking that the most efficient way to do this is to use<br>

</blockquote></blockquote><blockquote type="cite"><blockquote type="cite">a K-D tree to store references to the sub-ROIs: Wikipedia says that you<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">

can search for hyper-rectangles (the bounds of the ROIs) by storing the<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">minimum and maximum extents as a 2N-d object in the hyperplane and then<br>

</blockquote></blockquote><blockquote type="cite"><blockquote type="cite">the search for rectangles containing a point becomes a range search in<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">

the 2N-d space for all points on one side of a hyperplane.<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">So 2 questions:<br>

</blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">1) Could I add a leaf that holds onto a real interval,<br></blockquote>

</blockquote><blockquote type="cite"><blockquote type="cite">&quot;RealntervalLeaf&lt;I extends RealInterval&gt;&quot;, a search method that returns<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">

all points on one side of a hyperplane (T point, Node&lt;T&gt; node, bool []<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">above = false to retrieve nodes less than point in the given dimension,<br>

</blockquote></blockquote><blockquote type="cite"><blockquote type="cite">true to retrieve nodes greater than point in the given dimension) and<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">

some wrapper class that purports to be a database of &quot;I extends<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">RealInterval&quot; with a simple interface for retrieving all RealIntervals<br>

</blockquote></blockquote><blockquote type="cite"><blockquote type="cite">containing a point?<br></blockquote></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">

Hi Lee,<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">I&#39;m a bit out of the loop right now, just getting back into imglib development. I don&#39;t know if this has been discussed in the Skype channel or something, but...<br>

</blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Did you consider using the new KDTree implementation in imglib2 core, instead of the net.imglib2.algorithm.kdtree?<br></blockquote><blockquote type="cite">

<br></blockquote><blockquote type="cite">The new KDTree does not require it&#39;s T to be a Leaf&lt; T &gt;<br></blockquote><blockquote type="cite">and there are implementations of the net.imglib2.neighborsearch.*NeighborSearch&lt; T &gt; interfaces.<br>

</blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">It uses exact median-finding algorithm for constructing the tree<br></blockquote><blockquote type="cite">(instead of the approximate one in net.imglib2.algorithm.kdtree).<br>

</blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">It is also faster, if I remember correctly.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">best regards,<br>
</blockquote>
<blockquote type="cite">Tobias<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite">

<blockquote type="cite">2) imglib2-algorithms is really useful. There are going to be other<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">cases where imglib2 or other components would like to use algorithms to<br>

</blockquote></blockquote><blockquote type="cite"><blockquote type="cite">construct things like NativeImg and RegionOfInterest. How do we manage<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">

this? It sure would be nice if imglib2 and imglib2-algorithms were<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">interdependent. If we&#39;re not going to allow that, I&#39;ll probably<br></blockquote>

</blockquote><blockquote type="cite"><blockquote type="cite">implement the composite ROI in imglib2-algorithms and I&#39;ll wait until<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">imglib2-algorithms to be completed before I use composite ROIs in ImageJ<br>

</blockquote></blockquote><blockquote type="cite"><blockquote type="cite">2.0.<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">

I&#39;m probably going to do the first for the fun of it, the legacy ROI<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">code will need it, need a break from the GUI stuff and this will be<br>

</blockquote></blockquote><blockquote type="cite"><blockquote type="cite">refreshing. Tell me what you all think.<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote>

<blockquote type="cite"><blockquote type="cite">--Lee<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">_______________________________________________<br>

</blockquote></blockquote><blockquote type="cite"><blockquote type="cite">ImageJ-devel mailing list<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><a href="mailto:ImageJ-devel@imagejdev.org" target="_blank">ImageJ-devel@imagejdev.org</a><br>

</blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><a href="http://imagejdev.org/mailman/listinfo/imagej-devel" target="_blank">http://imagejdev.org/mailman/listinfo/imagej-devel</a><br></blockquote>

</blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">_______________________________________________<br></blockquote><blockquote type="cite">ImageJ-devel mailing list<br>

</blockquote><blockquote type="cite"><a href="mailto:ImageJ-devel@imagejdev.org" target="_blank">ImageJ-devel@imagejdev.org</a><br></blockquote><blockquote type="cite"><a href="http://imagejdev.org/mailman/listinfo/imagej-devel" target="_blank">http://imagejdev.org/mailman/listinfo/imagej-devel</a><br>

</blockquote><br><br>_______________________________________________<br>ImageJ-devel mailing list<br><a href="mailto:ImageJ-devel@imagejdev.org" target="_blank">ImageJ-devel@imagejdev.org</a><br><a href="http://imagejdev.org/mailman/listinfo/imagej-devel" target="_blank">http://imagejdev.org/mailman/listinfo/imagej-devel</a><br>

</div></blockquote></div><br></div></div><div>
<div style="font-family:Helvetica;font-size:12px"><br><br></div><div style="font-family:Helvetica;font-size:12px"><span style="font-family:Helvetica">**************************</span></div><div style="font-family:Helvetica;font-size:12px">

<font face="Arial">Wellcome Trust Centre for Gene Regulation &amp; Expression</font></div><div style="font-family:Helvetica;font-size:12px"><font face="Arial">College of Life Sciences</font></div><div style="font-family:Helvetica;font-size:12px">

<font face="Arial">MSI/WTB/JBC Complex</font></div><div style="font-family:Helvetica;font-size:12px"><span style="font-family:Helvetica">University of Dundee</span></div><div style="font-family:Helvetica;font-size:12px">
<span style="font-family:Helvetica">Dow Street</span></div>
<div style="font-family:Helvetica;font-size:12px"><span style="font-family:Helvetica">Dundee  DD1 5EH</span></div><div style="font-family:Helvetica;font-size:12px"><span style="font-family:Helvetica">United Kingdom</span></div>

<div style="font-family:Helvetica;font-size:12px"><br style="font-family:Helvetica"></div><div style="font-family:Helvetica;font-size:12px"><span style="font-family:Helvetica">phone (01382) 385819</span></div><div style="font-family:Helvetica;font-size:12px">

<span style="font-family:Helvetica">Intl phone:  44 1382 385819 </span></div><div style="font-family:Helvetica;font-size:12px"><span style="font-family:Helvetica">FAX   (01382) 388072 </span></div><div style="font-family:Helvetica;font-size:12px">

<span style="font-family:Helvetica">email: <a href="mailto:jason@lifesci.dundee.ac.uk" target="_blank">jason@lifesci.dundee.ac.uk</a></span></div><div style="font-family:Helvetica;font-size:12px"><br style="font-family:Helvetica">

</div><div style="font-family:Helvetica;font-size:12px"><span style="font-family:Helvetica">Lab Page: <a href="http://gre.lifesci.dundee.ac.uk/staff/jason_swedlow.html" target="_blank">http://gre.lifesci.dundee.ac.uk/staff/jason_swedlow.html</a></span></div>

<div style="font-family:Helvetica;font-size:12px"><span style="font-family:Helvetica">Open Microscopy Environment: <a href="http://openmicroscopy.org" target="_blank">http://openmicroscopy.org</a></span></div><div style="font-family:Helvetica;font-size:12px">

<span style="font-family:Helvetica">**************************</span></div><div style="font-family:Helvetica;font-size:12px"><br></div><div style="font-family:Helvetica;font-size:12px"><div>The University of Dundee is a Scottish Registered Charity, No. SC015096.</div>

</div><span style="font-size:12px"><br></span><br>
</div>
<br></div></div><br>_______________________________________________<br>
ome-nitpick mailing list<br>
<a href="mailto:ome-nitpick@lists.openmicroscopy.org.uk">ome-nitpick@lists.openmicroscopy.org.uk</a><br>
<a href="http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-nitpick" target="_blank">http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-nitpick</a><br>
<br></blockquote></div><br>