Skip to content

Get ROI count#4550

Merged
sbesson merged 5 commits intoome:regionsfrom
dominikl:get_roi_count_regions
Apr 7, 2016
Merged

Get ROI count#4550
sbesson merged 5 commits intoome:regionsfrom
dominikl:get_roi_count_regions

Conversation

@dominikl
Copy link
Copy Markdown
Member

At the moment Insight loads all ROIs and counts them on the client side for showing the number of ROIs in the right hand side meta data panel. This PR adds a method for directly getting the number of ROIs via an HQL query.

Test: Check some images with ROIs, make sure the ROI count (right hand side metadata panel) is correct.

(based on #4549 to avoid merge conflicts)

@dominikl dominikl mentioned this pull request Mar 31, 2016
@gusferguson
Copy link
Copy Markdown

@dominikl

Tested using OMERO.insight-5.3.0-m1-153-53a0751-ice35-b82-mac regions-omero.docker.openmicroscopy.org DB: user-14

Multiselected 16 of 18 existing ROIs on image - added to newly created folder - count correct.
Multiselected remaining 2 ROIs and tried to add to newly created folder - on clicking “Save” received error message shown below.
Error window re-opened every time tried to close - had to quit Insight to escape.

On logging back in I could see the second ROI folder had been created and the ROIs added despite the error.

I tried to delete the first folder to free up some ROIs for retesting and received the same error message as below. This time the error window closed and Insight crashed.

Reproducible on another image with both existing and newly created ROIs.

Log entry shows repeated error:

2016-04-01 07:40:35,100 INFO  [   o.o.s.env.data.login.LoginServiceImpl] (nitializer) Logged onto OMERO at: regions-omero.docker.openmicroscopy.org
User Name: user-14 -- Password: ***

2016-04-01 07:40:35,677 WARN  [     o.o.s.a.m.editor.AnnotationTaskPane] (nitializer) UI for displaying ROIS annotations not implemented yet!
2016-04-01 07:40:36,022 DEBUG [       omero.gateway.facility.Facility$1] ( Thread-12) Created new BrowseFacility
2016-04-01 07:40:50,529 DEBUG [       omero.gateway.facility.Facility$1] ( Thread-24) Created new ROIFacility
2016-04-01 07:40:50,546 DEBUG [       omero.gateway.facility.Facility$1] ( Thread-24) Created new DataManagerFacility
2016-04-01 07:40:52,368 WARN  [     o.o.s.a.m.editor.AnnotationTaskPane] (entQueue-0) UI for displaying ROIS annotations not implemented yet!
2016-04-01 07:43:12,283 ERROR [      o.o.s.a.m.view.MeasurementViewerUI] (entQueue-0) An unexpected error occurred while handling ROI null
2016-04-01 07:45:23,776 ERROR [      o.o.s.a.m.view.MeasurementViewerUI] (entQueue-0) An unexpected error occurred while handling ROI null
2016-04-01 07:45:27,276 ERROR [      o.o.s.a.m.view.MeasurementViewerUI] (entQueue-0) An unexpected error occurred while handling ROI null
2016-04-01 07:45:28,508 ERROR [      o.o.s.a.m.view.MeasurementViewerUI] (entQueue-0) An unexpected error occurred while handling ROI null
2016-04-01 07:45:29,507 ERROR [      o.o.s.a.m.view.MeasurementViewerUI] (entQueue-0) An unexpected error occurred while handling ROI null
2016-04-01 07:45:31,076 ERROR [      o.o.s.a.m.view.MeasurementViewerUI] (entQueue-0) An unexpected error occurred while handling ROI null

Error message:

java.lang.Exception: java.lang.NullPointerException
    at org.jdesktop.swingx.treetable.AbstractMutableTreeTableNode.remove(AbstractMutableTreeTableNode.java:114)
    at org.openmicroscopy.shoola.agents.measurement.util.roitable.ROINode.remove(ROINode.java:343)
    at org.openmicroscopy.shoola.agents.measurement.view.ROITable.removeROIShape(ROITable.java:713)
    at org.openmicroscopy.shoola.agents.measurement.view.ObjectManager.removeFigure(ObjectManager.java:824)
    at org.openmicroscopy.shoola.agents.measurement.view.MeasurementViewerUI.removeROI(MeasurementViewerUI.java:975)
    at org.openmicroscopy.shoola.agents.measurement.view.MeasurementViewerControl.figureRemoved(MeasurementViewerControl.java:605)
    at org.jhotdraw.draw.AbstractDrawing.fireFigureRemoved(AbstractDrawing.java:226)
    at org.jhotdraw.draw.AbstractDrawing.remove(AbstractDrawing.java:142)
    at org.openmicroscopy.shoola.util.ui.drawingtools.DrawingComponent.removeAllFigures(DrawingComponent.java:205)
    at org.openmicroscopy.shoola.agents.measurement.view.MeasurementViewerModel.removeAllROI(MeasurementViewerModel.java:943)
    at org.openmicroscopy.shoola.agents.measurement.view.MeasurementViewerComponent.setUpdateROIComponent(MeasurementViewerComponent.java:940)
    at org.openmicroscopy.shoola.agents.measurement.ROIFolderSaver.handleResult(ROIFolderSaver.java:170)
    at org.openmicroscopy.shoola.env.data.events.DSCallAdapter.eventFired(DSCallAdapter.java:90)
    at org.openmicroscopy.shoola.env.data.views.BatchCallMonitor$1.run(BatchCallMonitor.java:124)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
    at java.awt.EventQueue.access$500(EventQueue.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.awt.EventQueue$3.run(EventQueue.java:703)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

    at org.openmicroscopy.shoola.env.ui.UserNotifierImpl.showErrorDialog(UserNotifierImpl.java:189)
    at org.openmicroscopy.shoola.env.ui.UserNotifierImpl.notifyError(UserNotifierImpl.java:289)
    at org.openmicroscopy.shoola.env.ui.UserNotifierImpl.notifyError(UserNotifierImpl.java:257)
    at org.openmicroscopy.shoola.agents.measurement.view.MeasurementViewerUI.handleROIException(MeasurementViewerUI.java:1118)
    at org.openmicroscopy.shoola.agents.measurement.view.MeasurementViewerUI.removeROI(MeasurementViewerUI.java:980)
    at org.openmicroscopy.shoola.agents.measurement.view.MeasurementViewerControl.figureRemoved(MeasurementViewerControl.java:605)
    at org.jhotdraw.draw.AbstractDrawing.fireFigureRemoved(AbstractDrawing.java:226)
    at org.jhotdraw.draw.AbstractDrawing.remove(AbstractDrawing.java:142)
    at org.openmicroscopy.shoola.util.ui.drawingtools.DrawingComponent.removeAllFigures(DrawingComponent.java:205)
    at org.openmicroscopy.shoola.agents.measurement.view.MeasurementViewerModel.removeAllROI(MeasurementViewerModel.java:943)
    at org.openmicroscopy.shoola.agents.measurement.view.MeasurementViewerComponent.setUpdateROIComponent(MeasurementViewerComponent.java:940)
    at org.openmicroscopy.shoola.agents.measurement.ROIFolderSaver.handleResult(ROIFolderSaver.java:170)
    at org.openmicroscopy.shoola.env.data.events.DSCallAdapter.eventFired(DSCallAdapter.java:90)
    at org.openmicroscopy.shoola.env.data.views.BatchCallMonitor$1.run(BatchCallMonitor.java:124)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
    at java.awt.EventQueue.access$500(EventQueue.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.awt.EventQueue$3.run(EventQueue.java:703)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

@gusferguson
Copy link
Copy Markdown

@dominikl

Another issue seen on testing.

Created a number of new ROIs on an image and all of the previously created ROIs remained selected despite clicking on toolbar and creation of new ROIs - see screenshot.

main

@dominikl
Copy link
Copy Markdown
Member Author

dominikl commented Apr 1, 2016

I just realized that you're actually testing #4549 as well, as I based this PR on it, sorry. The errors are probably caused by #4549, will fix them in that PR. Thanks for spotting them.

@jburel jburel added the regions label Apr 1, 2016
@dominikl dominikl force-pushed the get_roi_count_regions branch from f4e9284 to bbb2e31 Compare April 1, 2016 10:35
@dominikl dominikl force-pushed the get_roi_count_regions branch from bbb2e31 to 8b0f2cb Compare April 4, 2016 12:56
@gusferguson
Copy link
Copy Markdown

@dominikl

Tested with OMERO.insight-5.3.0-m1-229-2b1e3eb-ice35-b86-win Win 8.1 regions-omero.docker.openmicroscopy.org DB: user-14

  • Test: Check some images with ROIs, make sure the ROI count (right hand side metadata panel) is correct.

The counts are correct for existing ROIs on selecting image in data tree - both in Right Hand Pane General tab of main viewer and in General tab of rendering settings pane in Full Viewer.
However if I then add ROIs to the image - save and refresh using green arrows in the full image viewer the rendering settings General Tab ROI Count does not update - see screenshot.
If ROIs are saved and Full Viewer closed the ROI count does not update In the Main window General Tab.
Have to refresh data tree using green arrows before ROI Count updates to reflect added ROIs.
If re-open image ROI count is now correct in Rendering Settings General tab.

  • Previous NullPointerException

Not occurring any more - no problem creating new folder with multi-selected ROIs

  • Previous issue with persistent selection of ROIs created in Measurement Tool

Not occurring any more - behaves as expected.

parallels desktop

@dominikl
Copy link
Copy Markdown
Member Author

dominikl commented Apr 6, 2016

Review: Only last two commits; check that the ROI count (right hand side metadata panel) is updated when ROIs are created or deleted (Note: if single ROIs are deleted they are actually just removed from the view, the real deletion happens in that case after clicking on the "save" button, that's when the ROI count gets updated in these cases).

@gusferguson
Copy link
Copy Markdown

@dominikl

Tested using OMERO.insight-5.3.0-m1-248-0ddee08-ice35-b90-mac regions-omero.docker.openmicroscopy.org DB: user-14

Adding ROIs to folder gives correct number in Folder title.
Delete of single ROI causes immediate update of ROI count in General pane of both Full Viewer and main window.
Delete of all ROIs triggers immediate update.
Addition of ROI does not update ROI count until “Save” triggered - then updates correctly in both places.
Behaves as expected. No issues.
Good to merge.

@sbesson sbesson merged commit a345e89 into ome:regions Apr 7, 2016
@dominikl
Copy link
Copy Markdown
Member Author

dominikl commented Apr 7, 2016

Thanks @gusferguson . This PR might also be worth rebasing to develop, as it's also a problem in 5.2.2, and it doesn't contain any 'regions' branch specific things. Your thougths @jburel ?

@dominikl dominikl deleted the get_roi_count_regions branch April 15, 2016 09:35
@sbesson sbesson added this to the 5.3.0 milestone Apr 20, 2016
@dominikl dominikl mentioned this pull request Apr 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants