Bio-Formats Image Position

@dgault @NicoKiaru @Alex_H

Do you know whether

Length getPlanePositionX(int imageIndex, int planeIndex);

in BioFormats always returns the image center position?
Or could it also sometimes be, e.g. the upper left corner?

@Christian_Tischer Good question! I am also curious. I checked the description from the OME-XML schema, but the documentation only says:

The X position of the stage. Units are set by PositionXUnit.

1 Like

In our case we have slide scanner data (vsi file) with multiple scans at multiple locations, areas and resolutions and the overlay works nicely assuming the image plane location is the corner of the plane: https://www.youtube.com/watch?v=tuiaEXmFVyE.
The video overlays low res whole slide overview + multiple high res fluorescent scans. The overlay fits nicely between the macro RGB image and the high res scans (look at the top left part of the video which shows the bounding boxes of BigDataViewer Sources).

@Christian_Tischer so you have some data showing where it’s the center which is defined? Maybe it depends on the file format ?

-> Link to the github discussion: https://github.com/BIOP/bigdataviewer-bioformats/issues/6

1 Like

If it is the x-position of the stage it should essentially be the center position, because the stage position does not change if the user on the microscope decides to, e.g. change the objective lens and acquire a larger image, whereas the position of the upper left corner of the image would change if the size of the image changes.

@schorb do you know what the convention is for EM metadata?

2 Likes

Totally agree, but sometimes a serie is already consisting of stitched tiles in the file ( cf slide scanner images above ). Then the stage position is not meaningful anymore (you have many). A choice has to be made. In the case of Vsi, I do not know whether it’s bioformats or Olympus who did the choice, but the result is the corner of the image.

Do you have an example dataset where it’s the center ? The one you gave me yesterday ? Is it the center ? If that’s the case, at the moment, one need to consider and implement both cases. Ideally a corner/center tag within bioformats would exist and the user would not need to set it…

2 Likes

The ones I gave you yesterday (Nikon microscope) is a center case.
I just changed the code to make it work for it:

@Christian_Tischer Is your code handling both cases ?

In Bio-Formats this will be dependant on the underlying format, we store the position as it was in the original file and are not translating or adjusting it in any way.

4 Likes

Not yet, I think we have to essentially write something on top of Bio-Formats, which depending on the image file format does the right thing…
Unless @dgault would like to add such functionality to Bio-Formats itself?

There are different conventions in the different file types. We usually prefer to always use the center. However when converting into BDV XML, the translation that is part of the AffineTransformation seems to refer to the upper-left corner.

2 Likes