Code Monkey home page Code Monkey logo

omero-iviewer's Introduction

OMERO.iviewer

An OMERO.web app for visualizing images in OMERO.

Also see SUPPORT.md

Requirements

  • OMERO 5.6.0 or newer.

Install

Instructions on how to add the OMERO.iviewer app to your installed OMERO.web apps can be found in the OMERO.iviewer README.

Usage

A guide to using OMERO.iviewer can be found on https://omero-guides.readthedocs.io/en/latest/iviewer/docs/index.html

Settings

OMERO limits the size of Z-projections to reduce load on the server. The limit is defined as the number of bytes of raw pixel data in a Z-stack and the OMERO.server default is equivalent to 1024 * 1024 * 256 bytes. For example, a single-channel 8-bit image (1 byte per pixel) of XYZ size 1024 * 1024 * 256 is equal to the default threshold.

To double the limit, use:

$ omero config set omero.pixeldata.max_projection_bytes 536870912

If you wish to set a threshold for iviewer that is lower than for the server:

$ omero config set omero.web.iviewer.max_projection_bytes 268435456

NB: Z-projection is not supported for tiled images in OMERO (Images larger than 2048 * 2048 pixels per plane are tiled in iviewer).

OMERO uses Spectrum Color Picker for selecting ROI colors. The roi_color_palette option allows you to specify a grid of colors for users to choose for ROIs. Define rows with brackets, and use commas to separate values. By default, only the first color of each row is shown. A full grid is shown when the default color picker is hidden (see below) To define a color palette use:

$ omero config set omero.web.iviewer.roi_color_palette "[rgb(0,255,0)],[darkred,red,pink],[#0000FF]"

To hide the default color picker (and show a grid for the color palette), set show_palette_only to true You must define a palette and each row can display 4 colors:

$ omero config set omero.web.iviewer.show_palette_only true

When working with other images (coregistering MRIs for example), it is necessary to be able to mirror an image. There is now experimental support for runtime image mirroring. To enable mirroring set enable_mirror to true.

$ omero config set omero.web.iviewer.enable_mirror true

Known issues

For images with many channels (greater than approximately 30 channels), saving of rendering settings fails due to the length of the request string. See #321. A work-around is to configure gunicorn to allow longer request strings. For example, to double the allowed limit:

omero config set omero.web.wsgi_args ' --limit-request-line 8192'

When a palette is defined it will try to use the first value as the default ROI color. Currently only rgb() vals are correctly parsed. If you try to use hex or a css name it will default to black You can look up a conversion to rgb and set that as your first value for a workaround

Supported URLs

If you have configured OMERO.iviewer as your default viewer (see install) then double-clicking an Image in OMERO.web will open OMERO.iviewer as the OMERO.web viewer, passing the current Dataset if the Image is in a Dataset:

/webclient/img_detail/1/?dataset=2

You use the OMERO.webclient's 'Open with...' menu to open multiple selected Images or a Dataset or a Well in OMERO.iviewer directly:

/iviewer/?images=1,2,3
/iviewer/?dataset=4
/iviewer/?well=5

Other query parameters can be used to set the rendering settings for the first image, including channels in the form of index|start:end$color:

?c=1|100:600$00FF00,-2|0:1500$FF0000      # Channel -2 is off

You can also specify the rendering Model (greyscale or color) and Z-Projection (maximum intensity or normal):

?m=g            # g for greyscale, c for color
?p=intmax       # intmax for Maximum intensity projection, normal for no projection

The Z and/or T plane, X/Y center position and zoom can be defined by:

?z=10&t=20          # can use z or t on their own
?x=500&y=400        # need to specify center with x AND y
?zm=100             # percent

Development

In order to run and build you need:

To install node dependencies and build the JavaScript bundle:

$ cd omero-iviewer
$ npm install

# uncompressed build
$ npm run debug

# OR compressed for production
$ npm run prod

You will usually want to have OMERO.iviewer installed on a local omero-web server, to test the JavaScript built above. NB: first uninstall OMERO.iviewer if already installed, then:

$ cd plugin
$ pip install -e .

# config
$ omero config append omero.web.apps '"omero_iviewer"'
$ omero config set omero.web.viewer.view omero_iviewer.views.index

Now you can open Images from the webclient as normal.

For iterative development, it is recommended to use the webpack dev-server to build and serve OMERO.iviewer as this will re-compile automatically when files are saved.

The dev build of OMERO.iviewer will attempt to connect to a local OMERO server at http://127.0.0.1:4080. The web server at this location will need to have CORS enabled and you should login to the webclient there.

The OMERO.iviewer will try to open an Image or other data from your local server, using IDs specified in index-dev.html:

<html>
    <head>
        <link rel="stylesheet" type="text/css" href="build/css/all.min.css" />

        <script type="text/javascript">
            // modify according to your needs
            // in particular: choose an existing id !
            window.INITIAL_REQUEST_PARAMS = {
                    'VERSION': "DEV_SERVER",
                    'WEB_API_BASE': 'api/v0/',
                    'IMAGES': "12345",
                    // 'DATASET': "1",
                    //'WELL': "1"
            };
        </script>
...

Edit the IMAGES ID in that file and save, then start the dev server:

$ npm run dev

To connect to an omero-web server at a different URL or port, you will need to modify all proxy target entries in webpack.dev.config.js:

devServer: {
    proxy: {
        '/iviewer/**': {
            target: 'http://localhost:your_port'
        },
        '/api/**': {
            target: 'http://localhost:your_port'
        }, ...
    }
}

If you want to bind the webpack dev server to a port other than 8080 you will need to change its port property in webpack.dev.config.js:

devServer: {
    port: your_port
}

Testing

To run all tests, run:

$ ant unit-tests

For more details on testing, see https://github.com/ome/omero-iviewer/tree/master/tests

Documentation

A high-level description of the OMERO.iviewer application can be found at https://github.com/ome/omero-iviewer/tree/master/docs.

To build the JavaScript code documentation in build/docs, run:

$ npm run docs

ol3-viewer

The OMERO.iviewer's internal image viewer is based on OpenLayers,

For details on how to run and test this viewer independently of the OMERO.iviewer, see https://github.com/ome/omero-iviewer/tree/master/plugin/ol3-viewer

More details

More detailed resources on how to create a web app and development setup can be found at:

  1. CreateApp
  2. Deployment

omero-iviewer's People

Contributors

barrettmcw avatar dependabot[bot] avatar jburel avatar joshmoore avatar manics avatar mtbc avatar sbesson avatar waxenegger avatar will-moore avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

omero-iviewer's Issues

"Scaled" coordinates

From https://www.openmicroscopy.org/community/viewtopic.php?f=6&t=8703&p=20688#p20688
By default, OMERO iviewer indicates X and Y coordinates of the mouse pointer in terms of pixels.

Given that the image data holds the scaling factor, once you set a reference point in an image by giving X, Y and Z coordinates (in terms of a mouse brain atlas [http://chamber.mrc.ox.ac.uk/iviewer/?dataset=51], they can actually represent anteroposterior, dorsoventral, and mediolateral for example), then OMERO can work out the X, Y, Z coordinates in µm or mm in the real world. This would be helpful in some use cases I believe.

For example, ImageJ supports this kind of scaling, though it does not allow you to choose arbitrary reference point.

smart scale bar

From https://www.openmicroscopy.org/community/viewtopic.php?f=6&t=8704
Currently, the scale bar is not cool.

The length of the bar stays the same, and instead the number associated with the scale bar changes, often taking a weird number, like, 0.476 mm.

So far the feedback I received about this scale bar is not great.

People prefer to see a scale bar with more sensible numbers, eg. 0.500 mm or 200 µm etc.

Could it be possible to write code to find the right length of the scale bar, eg, 100, 200, 500, 1000, 2000, 5000,...?

This might take a few milliseconds away, but the user experience might be much better.

Projections and tiled images threshold

I'm only now seeing that projections are not available for some images because of this PR: #202
Is there a specific reason to set the threshold for tiled images at 4000000 (multiple of 1000) instead of 4194304 (multiple of 1024)?

2048x2048 images are excluded although they're quite common (I think)...

I guess people can always ask for a slightly higher threshold, but I'm under the impression that images often have resolutions based on powers of 2, and the closest threshold for 2000 would be 2048, which is close, where as bigger images with a "standard" resolution would surely be at least 2560 (if not 3072 or 4096), which is considerably larger.

missing slider

When you open multiple images in one viewer, slider is gone from the first one.
To reproduce, double click on the second image in the same dataset

Screenshot 2019-04-25 at 14 17 03

Show ROIs "Pins" in iViewer

It would be very useful to provide a tool within the viewer to aid the discovery of ROIs.

This could work in 2 ways:

  1. Proximity: Moving the mouse across an image should cause ROIs to be "highlighted", when the mouse is near to a ROI - a "pin" would then appear (a la Google Maps), allowing the user to click to it, to show the ROI in the list on the RHS. This functionality could be switched on and off as a viewer preference.
    (This functionality would help as Point ROIs, in particular, are very difficult to locate within the image)

  2. Individual ROI: Clicking on a ROI on the RHS, should cause the ROI within the image to be indicated by producing a "Pin" on the image.

Similar functionality is used in the eMouseatlas Histology
( https://www.emouseatlas.org/eAtlasViewer_ema/application/ema/kaufman/plate_38c.php?image=b )
( https://www.emouseatlas.org/emap/about/what_is_eHistology.html )

Strange Z slice number display.

If you open a Z stack in the viewer the Z display has a control region with a vertical stack of the total number of slices at the top, an up arrow, the slider, a down arrow then the current slice, an Z-slice icon, play arrow and the letter Z.

The fact the top is labeled with the maximum Z slice but the bottom with the current slice is a bit strange. If you move to the top slice you end up with a slider labeled at the top and bottom with the same number, which direction does the stack go in? I think the design needs to have 1 at the bottom and max Z at the top and then the current slice somewhere slightly different, maybe the Z label should be replaced with Z:Slice, like the floating indicator as you move the slider in Z?

iviewer Settings

There are various parameters that users would like to set on the iviewer:

Some of these might be configured by sysadmin for the whole install E.g. the 'interpolate pixels' setting (https://docs.openmicroscopy.org/omero/5.5.0/sysadmins/config.html#omero-client-viewer-interpolate-pixels)
Others might be on a per-user scope (e.g. remember that I last used "dark theme", or even a per-image basis (e.g. auto-show ROIs, sort these ROIs by comments).

Most transient would be in the URL parameters themselves e.g. ?rois=123,234 to select ROIs on load (similar to ?x=500&y=450 for coordinates).

In each case, we probably want a hierarchy (similar to css) where the lowest level setting takes precedence:

  • global ( bin/omero config set ...)
  • user's preferences
  • settings on image/dataset (set by owner)
  • settings on image (set by me - IF I can annotate. Not for public user)

Settings could be stored in Map Annotations with a given namespace and could get auto-set at the image level when you make changes in iviewer (e.g. settings > "dark theme", or "show ROIs on load").

wrong group context in opening well's images

With our normal test user setup:

  1. Identify a plate in read-annotate-1 owned by user-5.
  2. Log into OMERO.web as user-3.
  3. Select the thumbnail of one of the plate's wells (top-center pane).
  4. Use the "Open with..." icon to open in OMERO.iviewer.
  5. FAIL: See "No Image Data".

BUG: Opening well sample

While preparing data for testing another PR, I selected a well sample with 180 timepoints (problem not related to the number of timepoints).
The viewer is stuck in the Loading Image Data state

cc @will-moore

Open iviewer page using session key instead of going through login page

Hi,
We are working on a project using SSO and want a link to redirect to iviewer without requesting user to input at login page again.
According to this https://docs.openmicroscopy.org/omero/5.4.1/sysadmins/public.html?highlight=bsession#reusing-omero-session, If it is possible to open iviewer link by giving session key like this?
https://omero-sample-site.com/iviewer/?images=2&dataset=2?server=SERVER_ID&bsession=OMERO_SESSION_KEY

Preset Viewer Opening Parameters

Add extra parameters to the URL that opens iViewer:
https://.../iviewer/?images=3407

It would be extremely useful to be able to open the viewer via a URL with extra parameters for:

  1. X and Y Coordinates - opens the viewer with the image centred around this point;
  2. Magnification - opens the viewer with the image at this magnification.

eg.
https://.../iviewer/?images=3407&X=63012&Y=26852
https://.../iviewer/?images=3407&Mag=15
https://.../iviewer/?images=3407&X=63012&Y=26852&Mag=15

OMERO.iviewer ignores plane DeltaT units in timestamp display

Reproduced with the current development version of iviewer as well as with the current released version.

To test, the two following sample OME-TIFF filesets can be used:

timelapse-hours.zip
timelapse-seconds.zip

These are strictly identical timelapse images with the only difference being the unit of the DeltaT in the plane metadata:

sbesson@ls30630:tmp $ diff test.companion.ome test2.companion.ome 
23,27c23,27
<           <Plane DeltaT="0" DeltaTUnit="h" TheC="0" TheT="0" TheZ="0"/>
<           <Plane DeltaT="1" DeltaTUnit="h" TheC="0" TheT="1" TheZ="0"/>
<           <Plane DeltaT="2" DeltaTUnit="h" TheC="0" TheT="2" TheZ="0"/>
<           <Plane DeltaT="3" DeltaTUnit="h" TheC="0" TheT="3" TheZ="0"/>
<           <Plane DeltaT="4" DeltaTUnit="h" TheC="0" TheT="4" TheZ="0"/>
---
>           <Plane DeltaT="0" DeltaTUnit="s" TheC="0" TheT="0" TheZ="0"/>
>           <Plane DeltaT="1" DeltaTUnit="s" TheC="0" TheT="1" TheZ="0"/>
>           <Plane DeltaT="2" DeltaTUnit="s" TheC="0" TheT="2" TheZ="0"/>
>           <Plane DeltaT="3" DeltaTUnit="s" TheC="0" TheT="3" TheZ="0"/>
>           <Plane DeltaT="4" DeltaTUnit="s" TheC="0" TheT="4" TheZ="0"/>

The image with plane timestamps in seconds displays as expected both in the Acquisition pane as well as in the timestamp in the central pane of iviewer

Screenshot 2020-08-18 at 15 23 33
Screenshot 2020-08-18 at 15 23 56

The image with plane timestamps in hours have the correct unit in the Acquisition pane but the timestamp displayed in the central pane of iviewer is identical to the above e.g. it displayes as 00:00:02:000 while I would have expected 02:00:00:000

Screenshot 2020-08-18 at 15 23 38
Screenshot 2020-08-18 at 15 24 17

large number of ROIs: tool not responsive

The tool is totally unusable when an image has a large number of ROIs with several shapes.

  • Loading the data is very slow (nightshade)
  • interaction with roi/shape on right-hand panel (tree) implies that a wrong click and the user will have to wait
  • if the user opts to show one roi only and click on a shape belonging to that rois, all the other rois are again loaded and display even if "show" is not selected.
  • No option to delete all the rois.

Basically there is no way to follow one roi over time when playing the movie
cc @pwalczysko @will-moore

opening images in a share

I'm in OMERO-web 5.5 and iViewer 0.8.1 so I do not know if this issue has been fixed meanwhile.

When I double click on an image in a share the iViewer window opens but I get no images to view. I would expect to have a view of the share, as if it was a dataset.
I should have access to see the data and viewing the data in the preview panel on the left of the main web client is working fine.

ROIs in Webgateway

The Webgateway function "render_roi_thumbnail" sometimes produces an Error image when the ROI is too big. Instead, produce a "clipped" ROI instead of an Error image. If the ROI thumbnail is too large, calculate the middle of the ROI and then produce the largest possible thumbnail from this calculatd mid-point of the ROI.

Orthogonal view

Would it be possible to add an orthogonal view option to OMERO view?

Display annotations on ROIs

Motivated by the QuPath workflow and the usage of https://github.com/glencoesoftware/ome-omero-roitool . This tool imports MapAnnotations on ROIs (via an export script in QuPath and then import as OME-XML into OMERO). The MapAnnotations capture important info such as whether this ROI is an Annotation in QuPath sense (big region demarking an area of interest) or a Detection in QuPath sense (a smaller ROI encompassing a detected cell inside an Annotation). Further, things added manually in QuPath on Annotation-ROI, such as classifications (Tumor etc.).

These MapAnnotations are correctly saved on the ROIs in OMERO, but atm invisible in iviewer.

Although https://trello.com/c/gzGqioJm/222-scoping-rois-and-annotations-ui-display seems to deal with similar topics, the approach taken on that trello card is still very image-centric. I cannot see a use case such as here scoped or thought about there.

Arguably, an interesting use case for IDR too ?

cc @joshmoore @sbesson @jburel @will-moore

Incorrect histogram?

Not quite sure if this is a real problem, or if I just misunderstand how the histogram is supposed to work.

Looking at IDR Image 9621401 (https://idr.openmicroscopy.org/webclient/?show=image-9621401) in iviewer with just the Hoechst (DNA) channel turned on:

image

If I set the max pixel value to 32767 (half the range for uint16), the max line on the histogram moves to the center as expected:

image

If I set the max pixel value so that the max line on the histogram is slightly to the right of the peak:

image

I would have expected that to result in a fairly bright red image based upon the histogram. Similarly, moving the max line to the left of the peak in the histogram:

image

The details of the image only start to become visible once the max value is set so that the entire histogram is to the right of the max line:

image

In all cases, I waited a minute between changing the max value and taking a screenshot to make sure this wasn't just a case of the rendering setting changes not being applied yet.

A similar test with a small uint8 image (https://idr.openmicroscopy.org/webclient/img_detail/1920028/?dataset=358) works as I would expect, so my guess is that this behavior is specific to pixel types with at least 16 bits.

iviewer caching request

From feedback at TIM2020.

Try to cache things like plane intensities and thus increase the perceived speed of the app for the user. Very important for a naive user. (for example, the intensity querying takes a second or two to pop up atm).

cc @will-moore @jburel @manics

Download entire image stack for 3D-4D samples [suggestion]

I would like to be able to download an entire image stack for 3D images, but don't seem to be able. In the attached screenshot, it shows that the image has 988 Z-sections, but when I 'Export as TIFF' I can only download a single slice.
image

Propagate shapes

Feature available in insight and requested again during a recent workshop:
Ability to propagate shape across Z and T. The shapes belong to the same ROI
This allows to create tracks, volumes etc.
cc @pwalczysko

The top corners of scale bars are rounded

The top corners of scale bars are rounded with dark background.

3950552515-Image003

The following seems to work well.

.ol-scale-line.ol-unselectable.ol-control {
    border-radius: 0;
}

RFE: draw line between sliders more strongly

For example, when I set the "pancakes" projection icon and get two Z sliders, it'd be helpful to see the line in between them drawn in black. That also helps to draw attention to the fact that another slider has appeared at all.

npm run dev fails at ant prepare-css command

Build fails with error:

BUILD FAILED
Target "prepare-css" does not exist in the project "ol3-viewer".

I am new to omero.iviewer and apache ant. By checking the options with ant -p command, I did not find prepare-css but instead found prepare-css-debug and prepare-css-prod. Updating the dev script in package.json with prepare-css-debug fixed the build error.

Am I missing something or the package.json needs to be updated? Thanks

RFE: Make title bar configurable

The title bar of iviewer currently states simple "OMERO". As with other clients, having this string configurable perhaps also with an optional icon and URL for clicks would improve branding for dedicated projects.

(Relatedly, would it be manageable to have all configuration parameters in the README or some other markdown file for easy discoverability?)

Projection save dialog seems confusing

I had to ask @pwalczysko before I managed to find the "make a projection" at all but even after that I was asked,
save-dialog
As somebody who just logged into their institution's OMERO and double-clicked a thumbnail to open the image I don't know how I'd know what either "Webclient" or "iviewer" are, they don't mention their name in their main displays, at least that I see. Maybe we could phrase these alternatives differently?

color picker on ROIs with no color set

Have some ROIs with no color set, i.e. these rois are coming from Fiji.

Then, try to set a line color different than the one you see (typically white, you set something else, e.g. purple).
Click "Choose"
Click Save
Refresh the browser.

Observe that instead of the ROI having the line color you chose for it, it is kinda white+your-color on the same line - this does not seem to be remedied by anything you are doing later to this ROI - the line color is somehow not right.

Screen Shot 2019-10-24 at 11 54 16

Project-Dataset-Image breadcrumb trail

From Michael Porter: would like to know the Project -> Dataset context of the current Image.
Could show this as a Breadcrumb trail:

Project > Dataset >

This would need ?project=1 in the URL to know the context that the image was opened (same as currently done for Dataset).

Also, would like improved visibility of image (thumbnail) names. Currently the native tooltip is quite slow if you're searching through the thumbnails for a particular image. An instant tooltip would help, or some other way of showing image names more prominently.

multiview channels off

  • Open 2 images in multiview
  • Synch z/t and channels.
  • Turn off all channels on one image
  • Turn them back on, The second image remains black

viewer1

SavetoAll

  • Change the settings of an image
  • Click Save to All
  • Only the image currently viewed is updated, not the similar ones

viewer2

Direct links to ROIs

  • From the viewer, users should be able to copy a ROI url link.
  • A user going to that link should preferably see the same view as the user sending the link, i.e. viewer

Thumbnails of Image Sub-Areas

The Webgateway function "render_image_region" can produce a sub-area of the image, however, this sub-area cannot be scaled. It would be useful to generate a thumbnail of this sub-area.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.