qupath / qupath-extension-omero-web

QuPath extension to work with images through OMERO's web API
GNU General Public License v3.0
8 stars 12 forks source link

Code organization #28

Closed Rylern closed 3 months ago

Rylern commented 10 months ago

This issue explains how the code of this extension is organized.

Java code

This corresponds to the src/main/java/qupath/ext/omero folder.

OmeroExtension

The OmeroExtension class add actions and menus to the QuPath Extensions menu (see the gui section).

gui

The gui folder contains all UI elements of the extension (and only the UI, see the core section for the core functionalities). Each package of this folder corresponds to an action/menu installed in the Extension menu of QuPath (see the OmeroExtension section).

A few things can be added:

imageserver

The imageserver folder contains the ImageServer used by any image opened from an OMERO server and its corresponding ImageServerBuilder. The functionalities of the image server (e.g. reading pixels, getting metadata) are mostly delegated to functions present in the core folder.

When opening an image coming from an OMERO server, a connection is established to the server if it's not already the case.

core

The core folder contains everything else, i.e. the core functionalities of the extension.

Miscellaneous

Resources

This corresponds to the src/main/resources/qupath/ext/omero folder.

Tests

This corresponds to the src/test/java/qupath/ext/omero folder. Tests on one class Class are grouped into a TestClass class. Usually, most of the public functions of a class are tested. They are a good way to see how the functions of the extension should be used.

Unit tests

Unit tests have been implemented on functions not requiring access to an OMERO server and not part of the UI. They will always be executed when running tests.

Integration tests

Integration tests have been implemented on classes requiring access to an OMERO server. These classes extend the OmeroServer class which gives access to an OMERO server hosted on a local Docker container. If Docker can't be found on the host machine, all integration tests are skipped.

The TestContainer library is used to communicate with Docker. Three containers are installed:

A bash script and some files in the src/test/resources/omero-server folder are transferred to the OMERO.server container. They are used to initialize the server with basic data (some datasets, images...). The files in src/test/resources/omero-web are used to initialize the web server (for example by installing the OMERO Pixel Data Microservice on it).

Miscellaneous

sample-scripts

The sample-scripts folder contains examples of scripts that use several functionalities of this extension.