<div dir="ltr">Hi Cyril,<div><br></div><div>Awesome that you are trying out the OPS functionality.</div><div><br></div><div>Yes, PointSet is deprecated. The latest ROI library is in the imglib2-roi component [1]. Unfortunately, there are not really any examples yet, since the new API was just created in January.</div><div><br></div><div>The main problem you are encountering here is a clash of "layers" of the ImageJ2 API designed at different times. The imagej-common classes (ImageDisplay and Overlay) were created before we started OPS, so they use the old ROI library of ImgLib2, including extensions built on top, such as PointSets. The imagej-ops classes are much newer and IMHO well-designed, but have mostly focused on building on top of ImgLib2 data structures. (OPS does use the ImgPlus class but that needs to be redesigned very soon.)</div><div><br></div><div>Ultimately, you have two options here:</div><div><br></div><div>A) Stick with the deprecated-but-still-available API of PointSet and StatisticsService [2]. You can call StatisticsService.arithmeticMean(Dataset, PointSet) to get the answer you are looking for here.</div><div><br></div><div>B) Use OPS, knowing you'll have to jump through some hoops right now as the layers of API are "repaved." In theory, you can compute the mean of a region using OPS, by doing something like:</div><div><br></div><div> opService.stats().mean(new DoubleType(), overlay.getRegionOfInterest());</div><div><br></div><div>But I have not tested this. ImageJ2 components downstream from ops (e.g., imagej-plugins-commands) are in dire need of an update to use OPS rather than the deprecated APIs, but we have not had time to work on it yet.</div><div><br></div><div>Regards,</div><div>Curtis</div><div><br></div><div>[1] <a href="https://github.com/imglib/imglib2-roi">https://github.com/imglib/imglib2-roi</a></div><div>[2] <a href="https://github.com/imagej/imagej-ops/blob/imagej-ops-0.15.0/src/main/java/net/imagej/measure/StatisticsService.java">https://github.com/imagej/imagej-ops/blob/imagej-ops-0.15.0/src/main/java/net/imagej/measure/StatisticsService.java</a></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jul 6, 2015 at 8:19 AM, Mongis Cyril <span dir="ltr"><<a href="mailto:cyril.mongis@googlemail.com" target="_blank">cyril.mongis@googlemail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div><div><div>Dear everyone,<br><br></div>I'm trying to calculate the statistics of a an overlay for the active display.<br></div>I try to use the PointSet but it doesn't work. The thread is just blocked :<br><br></div><div>public double getMean(ImageDisplay imageDisplay, Overlay overlay) {<br></div> final PointSet ps = new RoiPointSet(overlay.getRegionOfInterest());<br></div> return (double) opService.mean(ps);<br>}<br><br></div>The PointSet API seems to be deprecated and when I dig into the Ops code, it seems that the statistic function just accept an iterable. From what I understood, PointSet are set of coordinates inside the image. I guess I need to associate the coordinates to a dataset and get an Iterable/Function out of it. Is there a service that already does this ? Or is it the wrong approach ?<br><br></div>Cheers,<br><br></div>Cyril<br></div>
<br>_______________________________________________<br>
ImageJ-devel mailing list<br>
<a href="mailto:ImageJ-devel@imagej.net">ImageJ-devel@imagej.net</a><br>
<a href="http://imagej.net/mailman/listinfo/imagej-devel" rel="noreferrer" target="_blank">http://imagej.net/mailman/listinfo/imagej-devel</a><br>
<br></blockquote></div><br></div>