-
Notifications
You must be signed in to change notification settings - Fork 4
Adding Key Value pairs
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.
Extracting k-v pairs from filenames
- Select a dataset or several data sets (by holding shift/command).
- Click the run script icon
. - Select MIF >
Add Key Val... - Click the refresh icon
to see the changes.
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:
- Select a Dataset and click on the
Dataset Detailsin the General tab of the metadata pane. Add the kay-values as follows- Add the line
# global key-valueto theDataset 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
- Add the line
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
Key-value pairs can also be extracted from the names of the images in a dataset.
- The script reads 'slot numbers' and keys from the
Dataset Details. - It then chops up each file name and extracts the values to store key value pairs.
To do this the file names need some structure. The rules for this script are:
- No white space in the name.
- The name is separated into fields by underscore (
_). - The number of fields is the same.
The rules defined in
How to add key-value pairs from: