ome / omero-scripts

Core OMERO Scripts
https://pypi.org/project/omero-scripts/
12 stars 32 forks source link

ROI export with Well ID #173

Closed will-moore closed 2 years ago

will-moore commented 4 years ago

When exporting ROIs to csv from SPW data, it is useful to include Well ID (and Well row, column and label). This also adds the option to NOT export the Points coordinates string, which can cause a big increase in the size of the csv file.

This was needed for OMERO.parade prototype demo at https://youtu.be/FyjGhZxx6es?t=899

To test:

mtbc commented 4 years ago

Should we also omit the Points heading from COLUMN_NAMES if not include_points?

will-moore commented 4 years ago

Good to merge?

jburel commented 4 years ago

I understand that was needed for the prototype. Was the script tested when there is a large number of ROis and with the "include" points flag on. I am wondering if we should not indicate a limit, maybe in the help, before it starts going sideways

will-moore commented 4 years ago

The amount of work to decide on a limit (which will depend on your setup as well as the number of columns in the table and the size of the Polygons you're exporting) is not worth it I think.

The failure of this script when exporting large numbers of Polygons/Polylines is not new, and we haven't had anyone reporting problems.

will-moore commented 3 years ago

Another option is to export simplified Polygon to preserve the shape but without a long list of coordinates. See https://shapely.readthedocs.io/en/latest/manual.html#object.simplify As used at https://docs.google.com/presentation/d/1QzKYP6sXPefBMNfY4PW4H0AMoWVbw9HeNoweLmJg17Y/edit#slide=id.g823da5adf3_0_105

joshmoore commented 3 years ago

Might be interesting to also use that as an opportunity to allow exporting WKT (https://shapely.readthedocs.io/en/latest/manual.html#well-known-formats) so we could begin building up familiarity with that.

will-moore commented 3 years ago

Trying to get some old PRs merged... Can re-list if needed? But I think it has been approved already.

jburel commented 3 years ago

The PR was approved prior to that discussion and was part of some work on a prototype. So it seems like a good opportunity to test shapely as mentioned above

will-moore commented 3 years ago

The use of shapely is really unrelated to this PR (adding Well IDs). It will need a bit of investigation/decision on whether to add the shapely dependency to this script and script parameter options for using it. I added the comment on this PR since there was already a discussion about Points being too verbose. But that issue is not due to this PR. I have created a separate issue for that at https://github.com/ome/omero-scripts/issues/185

jburel commented 3 years ago

The points were previously included by default. To keep the same behaviour the include_points flag should be set to true in the various functions so the original behaviour is kept.

dominikl commented 2 years ago

Looks good to me. Tested on merge-ci, does what it says 👍

imagesc-bot commented 2 years ago

This pull request has been mentioned on Image.sc Forum. There might be relevant details there:

https://forum.image.sc/t/how-to-use-cellprofiler-per-image-results-from-plate-analyses-as-source-for-omero-parade/59894/9

will-moore commented 2 years ago

Re-listing for review again - trying to get some more PRs closed...