Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preview for the HCS images #2489

Open
NShaforostov opened this issue Jan 28, 2022 · 2 comments
Open

Preview for the HCS images #2489

NShaforostov opened this issue Jan 28, 2022 · 2 comments
Labels
goal/charlie 🐟 kind/enhancement New feature or request state/draft Draft issues, that are lacking description or not ready for the implementation state/has-case Issues that have test-cases

Comments

@NShaforostov
Copy link
Collaborator

Background

In similar way as we've implemented the support of the "Patology images" previews in the Cloud-Pipeline, we should implement the support of previews of HCS images received by confocal microscopy methods.

Approach

For our issue, each HCS image represents a scope of raw tiff images and metadata xml file(s) united by one measurement.
We shall implement the ability to preview that image bunches as united objects.

Short description of HCS image in context of our issue:

  • each measurement includes one or several plates with images
  • each plate contains wells. Possible count of wells in a plate is strictly defined. Wells can be with or without images "inside"
  • we are interested in wells with images. Inside each such well:
    • there is one or several fields. These fields are similar to puzzle parts (or patches on the patchwork) - all together they consist the well image
    • also, well images can be aggregated by different entities:
      • channels - defined the channels in which raw images were received (e.g. fluorescence)
      • planes - different planes of the scanning depth (different z-coordinates)
      • sequences - images that are made by certain timeseries

Data structure

The minimal intended structure for the raw images data in the object data storage should be the following:

  • all data is grouped into measurement folders. Each measurement is represented by one folder, and the name of that folder corresponds to the measurement name
  • inside each measurement folder, there are:
    • "Images" folder and inside that folder:
      • tiff raw image files corresponding to that measurement
      • an images info file in xml format ("Index.xml") created during the export of the raw data from the scanner
    • an additional "synthetic" file, created by DTS during the upload raw data to the storage:
      • this file should be tagged by necessary measurement metadata
      • this file shall have the name equals measurement name/ID and .hcs extension (TBD)
      • this file shall be indexed and added to the "Data catalog" search engine (i.e. showing in the Advanced search)
      • exactly for this file, we should add the ability to open preview of the HCS images corresponding to the specific measurement

Open preview

There shall be the following ways to open a preview for the HCS images:

  • from the "Attributes" panel of the measurement "synthetic" file - by the corresponding link
  • by click the specific icon near the measurement "synthetic" file name in the folder
    image
  • by click the info icon near the found "synthetic" file via the Advanced search:
    image

Preview pop-up

Preview pop-up shall contain:

  • measurement file name
  • object data storage name where the measurement is stored
  • full path to the measurement file
  • section of the measurement metadata
  • section with the preview

In general case, the preview pop-up should look like the following:
image

Plate panel

For each HCS measurement, there are one or several plates that include own bunches of images.
Plates are defined inside the <Plates> tag of the index.xml file.
At the Plate section, there should be:

  • dropdown list with all plates of the current measurement. By default, the first plate from the list should be loaded. Multiselect is not allowed
  • grid with wells. Size of the grid is defined by <PlateRows> (count of rows in this plate) and <PlateColumns> (count of columns in this plate) tags inside the <Plates> tag:
    • full-size wells grid should be shown
    • in the grid, wells that have images should be highlighted separately (blue color on the scheme above):
      • all such wells are described by tags <Well> inside the <Plates> tag
      • position of each well at the grid can be received from each <Well> tag - inside the <Wells> tag
    • in the grid, user can select a desired well - by click it:
      • selected well should be highlighted separately (yellow color on the scheme above)
      • user shall have the ability to select a well only from wells that have images
      • by default, the first well with the tag <Well> from inside the <Plates> tag should be selected
      • multiselect is not allowed

Well panel

This panel should include:

  • label with the selected well ID
  • the symbolic "map" that demonstrates which part of the image of the selected well is currently shown in the image preview frame on the left side

On the symbolic "map", should be shown:

  • available part of the whole selected well - part that is covered by images (blue color on the scheme above)
  • separately, the currently "zoomed" part of the whole image (yellow color on the scheme above)
    DETAILS WILL BE CLARIFIED LATER...

Each well includes one or several field. An own raw set of tiff files corresponds to each field.
So, the whole well image consists from all available fields.

Field of the image can be defined by the tag <FieldID> inside the <Image> tag.
Position of the fields on the well image can be defined by tags <PositionX> and <PositionY> inside the <Image> tag.

Channel panel

This panel shall include all channels list corresponds to the current plate.
Total image in the image preview frame should be shown as additive blending of well images of the selected channels.
By default, all channels should be selected.
Full list of channels can be received from inside the <Map> tags - entries with ChannelID option.

For each channel item at the Channel panel, there should be:

  • checkbox to enable the channel
  • label with the channel name (from <ChannelName> tag inside the <Map> tag)
  • control to set the color in which images of that channel should be highlighted
    • TBD about the default color scheme
  • control to expand the channel settings:
    • here, the horizontal slider of the channel contrast should be placed

Example of the image above with the disabled violet channel (Ch_1):
image

Example of the image above with expanded violet channel settings and regulation of the channel contrast by the slider:
image

Stack panel

This panel shall allow to change the plane of the displayed well image (i.e. to view images on different depth by z-coordinate).
The count of well planes can be defined as max value of the PlaneID values (<PlaneID> tags inside the <Image> tags).
Stack panel should be shown for the plate, only if the count of planes is more than 1.

This panel should contain:

  • vertical slider to switch between the planes:
    • by default, the plane with ID equals 1 should be selected
  • each tick on the slider should corresponds to certain plane
  • each tick should shave the value of z-coordinate (<PositionZ> tags inside the <Image> tags) corresponds to that plane
  • label with the unit of the z-coordinate value

Example of the Stack panel for the well with 4 planes:
image

This panel should be located under Well panel (when the count of planes is more than 1).
Let's suggest that well image from the main scheme above has 3 planes and we've switched to another one. The view should be like:
image

Time series

Well images can be scanned in different time points. The series of the same well images in different time points are united in sequences.
Note: often, all images are made in a single time point of a single sequence

If there are several sequences for the plate or in any sequence the count of time points is greater than 1, the Time series panel should appear under the image preview.
By this panel, user shall have the ability to select a sequence or/and a time point in a sequence - to receive the well images corresponding this time moment.

The count of sequences can be defined as max value of the SequenceID values (<SequenceID> tags inside the <Image> tags).
The count of time points in a sequences can be defined as max value of the TimepointID values (<TimepointID> tags inside the <Image> tags) for the same SequenceID.

Time series panel should contain:

  • a list of expandable sections:
    • each section corresponds to a single sequence
    • label of the section should contain the sequence ID and count of the time points in this sequence
  • user shall have the ability to expand the desired sequence section and select the desired time point of the sequence
  • by default, the sequence and time points with IDs equal 1 should be selected
  • multiselect is not allowed

Example of the Time series panel with 3 sequences:
image

@NShaforostov NShaforostov added kind/enhancement New feature or request state/draft Draft issues, that are lacking description or not ready for the implementation goal/charlie 🐟 labels Jan 28, 2022
@Wedds
Copy link
Contributor

Wedds commented Feb 2, 2022

Preview files layout

This section describes the proposal regarding the structure of files to be consumed by a previewer.
Each sequence will be presented by a separate OME-TIFF file.
OME-TIFF is a multi-paged TIFF image, it supports wells' structure and allows working with image channels.

Besides, some previewers support index files to be used with OME-TIFF for optimizing the load time of remote files (ex. viv).

Assuming, that raw HCS data is stored in s3://hcs-data/Measurement123 directory, following files should be generated:

├── Measurement123/                   // raw HCS
├── Measurement123.hcs                // previewer entrypoint, called an 'additional synthetic file' before
└── .hcsparser/ 
│   ├── Measurement123/
│   │   ├── 1/                        // sequence level
│   │   │   ├── data.ome.tiff         // sequence data 
│   │   │   ├── data.offsets.json     // load-optimizing index
│   │   │   ├── wells_map.json        // navigation mapping

<ExperimentName>.hcs is a JSON file with the following schema:

{
    "sourceDir": "s3://hcs-data/Measurement123", 
    "previewDir": "s3://hcs-data/.hcsparser/Measurement123", 
    "plate_height": "8", 
    "plate_width": "12", 
    "time_series_details": { // map of (sequence: list<timepoints>) entries
        "1": ["1", "2"],
        "2": ["1", "2", "3"]
    }
}

wells_map.json is a 'navigation' mapping, which helps to call a suitable OME well/field according to the values, selected in the previewer. It is required since not all the wells (and their fields) contain meaningful info, besides, OME-TIFF elements have continuous 'flat' indexing instead of 2 coordinates.

  • indices start from 1
  • plane coordinates specification is a string of X, Y joined with an underscore.
{    
	"2_2": {  // well (2;2) details
		"width": 12,
		"height": 12,
		"round_radius": 5.335, // radius from the center, informs whether the round line should be drawn; draw nothing in case `null` or missing
		"to_ome_wells_mapping": {
			"6_6": "ImageID:1", 
			"6_7": "ImageID:2",
			"7_6": "ImageID:3",
			"7_7": "ImageID:4" 
		}            
	},     
	...
	"4_2": {  
		"width": 12,
		"height": 12,
		"round_radius": 5.335,
		"to_ome_wells_mapping": {			
			"7_6": "ImageID:23",
			"7_7": "ImageID:24"
		}            
	},     
	...
	"7_3": {  
		"width": 12,
		"height": 12,
		"round_radius": 5.335,
		"to_ome_wells_mapping": {
			"6_6": "ImageID:45", 
			"6_7": "ImageID:46",
			"7_6": "ImageID:47",
			"7_7": "ImageID:48" 
		}            
	}    
}

AleksandrGorodetskii added a commit that referenced this issue Feb 7, 2022
…nds to main canvas. Sync scroll positions between canvas and legends
rodichenko added a commit that referenced this issue Feb 7, 2022
rodichenko added a commit that referenced this issue Feb 9, 2022
rodichenko added a commit that referenced this issue Feb 10, 2022
… structure

add hcs icon to public

HCS Control Grid (WIP)

Preview for the HCS images (#2489) - Control grid - handle clicks over canvas

Preview for the HCS images (#2489) - Add vertical and horisontal Legends to main canvas. Sync scroll positions between canvas and legends

Preview for the HCS images (#2489) - Cells now selectable. Cells with data filled with color

Preview for the HCS images (#2489) - initial preview structure

GUI HCS images: preview blank (#2499)

* initial component

* delete excessive logic

Preview for the HCS images (#2489) - Well & Field selectors; preview controls for HCS files

Preview for the HCS images (#2489) - Sequences selector

Preview for the HCS images (#2489) - Channels control, blending mode control

Preview for the HCS images (#2489) - Selected sequence panel expanded by default

Preview for the HCS images (#2489) - Time series control styling

Preview for the HCS images (#2489) - draw center dot on well selector

Preview for the HCS images (#2489) - Flip wells map vertically; fetch wells_map.json using signed urls

Preview for the HCS images (#2489) - zoomIn/zoomOut buttons

fix PropTypes

Preview for the HCS images (#2489) - Loading indicator, style fixes

Preview for the HCS images (#2489) - possibility to hide HcsControlGrid legends

GUI HCS Preview: info button with attributes panel (#2502)

* info button with attributes panel

* fixes

* rename methods, styles fixes

Co-authored-by: Mikhail Rodichenko <Mikhail_Rodichenko@epam.com>

Preview for the HCS images (#2489) - styles & component names refactoring

Preview for the HCS images (#2489) - "Channels settings" panel

Preview for the HCS images (#2489) - LICENSE file

Preview for the HCS images (#2489) - hcs-image-viewer module
rodichenko added a commit that referenced this issue Feb 11, 2022
AleksandrGorodetskii added a commit that referenced this issue Feb 16, 2022
rodichenko added a commit that referenced this issue Feb 16, 2022
rodichenko added a commit that referenced this issue Feb 21, 2022
Preview for the HCS images (#2489) - include HcsSequenceSelector to HcsImage right panel rendering

Preview for the HCS images (#2489) - z-plane physical coordinates

Preview for the HCS images (#2489) - sequence & time-series selector

Preview for the HCS images (#2489) - Stack panel

Preview for the HCS images (#2489) - keeping Z position
rodichenko added a commit that referenced this issue Feb 22, 2022
@maryvictol
Copy link
Collaborator

Test case was created by #2786 and located here.

@maryvictol maryvictol added the state/has-case Issues that have test-cases label Jan 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
goal/charlie 🐟 kind/enhancement New feature or request state/draft Draft issues, that are lacking description or not ready for the implementation state/has-case Issues that have test-cases
Projects
None yet
Development

No branches or pull requests

3 participants