Skip to content
This repository was archived by the owner on Dec 21, 2021. It is now read-only.

Adding Key Value pairs

Christian Evenhuis edited this page Mar 29, 2018 · 32 revisions

Key-value pairs are a flexible way to store metadata. The script Add Key Val provides twi ways ti add key value pairs to datasets and images in OMERO.

Running the script

Extracting k-v pairs from filenames

Running the script

  1. Select a dataset or several data sets (by holding shift/command).
  2. Click the run script icon .
  3. Select MIF > Add Key Val...
  4. Click the refresh icon to see the changes.

Adding global key-value pairs

A set of key-value pairs can be added to dataset and every image contained in the data set. This is useful for including metadata common to the entire data set. For example, the dataset may be of a single organism or the temperature may be the same.

To do this:

  1. Select a Dataset and click on the Dataset Details in the General tab of the metadata pane. Add the kay-values as follows
    • Add the line # global key-value to the Dataset Details
    • Below this list the key-value pairs separated by a : . You can leave empty lines or comment lines with #.
    • Finish with # end key-value

For example, to add details about the lab book add the following to Dataset Details text box clicking on the edit icon .

 # global key-value
 labbook_ID   : 10 
 labbook_page : 45 
 # end key-value

The web client should look something like this.

When the script is run the key-value pairs are added to the dataset(s) and to all the images contained in the dataset(s).

The key values can now be seen in the Key-Value pairs drop down. For this example it should look like this

Extracting key value pairs from filenames

Key-value pairs can also be extracted from the names of the images in a dataset.

  1. The script reads 'slot numbers' and keys from the Dataset Details.
  2. It then chops up each file name and extracts the values to store key value pairs.

Rules for names of images

To do this the file names need some structure. The rules for this script are:

  1. No white space in the name.
  2. The name is separated into fields by underscore (_).
  3. The number of fields is the same.

Defining the rules for key-value extraction

The rules defined in

Clone this wiki locally