mobie / mobie-viewer-fiji

BSD 2-Clause "Simplified" License
33 stars 13 forks source link

Registration - Enter transformation adding transform twice #1122

Open jhennies opened 8 months ago

jhennies commented 8 months ago

@tischi When adding a transformation using "Registration - Enter transformation" the transform is essentially added twice to the dataset.json This is me trying to add a transformation to the "photosynthetic_dinoflagellate" EM volume:

    "photosynthetic_dinoflagellate-custom-affine": {
      "uiSelectionGroup": "EM",
      "sourceDisplays": [
        {
          "imageDisplay": {
            "sources": [
              "photosynthetic_dinoflagellate-custom-affine"
            ],
            "color": "r=255,g=255,b=255,a=255",
            "contrastLimits": [
              0.0,
              255.0
            ],
            "showImagesIn3d": false,
            "invert": false,
            "name": "photosynthetic_dinoflagellate-custom-affine",
            "opacity": 1.0,
            "visible": true,
            "blendingMode": "sum"
          }
        }
      ],
      "sourceTransforms": [
        {
          "affine": {
            "parameters": [
              -1.0,
              0.0,
              0.0,
              94.69780764707536,
              0.0,
              0.0,
              -1.0,
              125.83256535618035,
              0.0,
              1.0,
              0.0,
              11.297899906604163
            ],
            "name": "Additional transformation",
            "sources": [
              "photosynthetic_dinoflagellate"
            ]
          }
        },
        {
          "affine": {
            "parameters": [
              -1.0,
              0.0,
              0.0,
              94.69780764707536,
              0.0,
              0.0,
              -1.0,
              125.83256535618035,
              0.0,
              1.0,
              0.0,
              11.297899906604163
            ],
            "name": "custom-affine",
            "sources": [
              "photosynthetic_dinoflagellate"
            ],
            "sourceNamesAfterTransform": [
              "photosynthetic_dinoflagellate-custom-affine"
            ]
          }
        }

If I delete the upper of the two affines, the data is correctly transformed

tischi commented 8 months ago

This is using the main MoBIE update site?

jhennies commented 8 months ago

Yes, the main MoBIE site

jhennies commented 8 months ago

This seems to only happen if you click 'preview' before applying the transform. In other words, if you don't click preview, it's fine

jhennies commented 8 months ago

... well not entirely fine. Then when using the defaults (doesn't matter if use viewer transform is clicked or not), the resulting transformed image cannot be used in a view

So what I was trying was:

  1. Add light microscopy images
  2. Add EM image
  3. move the EM to the correct location by entering the transform
  4. create a view with the EM and LM overlay focused on the EM (right click -> save current view)

The last step creates the view but when I try to open it, it gives an error like this:

Exception in thread "Thread-141" java.lang.RuntimeException: photosynthetic_dinoflagellate-custom-affine2 is not part of the current image data.
    at org.embl.mobie.DataStore.getImage(DataStore.java:158)
    at org.embl.mobie.lib.view.ViewManager.show(ViewManager.java:529)
    at org.embl.mobie.lib.view.ViewManager.show(ViewManager.java:248)
    at org.embl.mobie.ui.UserInterfaceHelper.lambda$null$23(UserInterfaceHelper.java:952)
    at java.lang.Thread.run(Thread.java:748)
tischi commented 8 months ago
  1. Add light microscopy images
  2. Add EM image
  3. move the EM to the correct location by entering the transform
  4. create a view with the EM and LM overlay focused on the EM (right click -> save current view)

I thought the latest version of MoBIE would force you to

3.1. create a new EM image with the transform

correct?

jhennies commented 8 months ago

No, only if you add it as image from fiji, not if you add it as ome.zarr.

my version mobie-viewer-fiji-4.4.2.jar should be the latest, right?

tischi commented 8 months ago

Ah, so you are talking about the Project Creator here?

I was thinking about:

image
jhennies commented 8 months ago

Yes, this is my step3

tischi commented 8 months ago

But why does then step 3.1 depend on how you added the image?