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

Rescale layers for different voxel sizes on remote import #7213

Merged
merged 13 commits into from
Aug 24, 2023

Conversation

frcroth
Copy link
Member

@frcroth frcroth commented Jul 18, 2023

URL of deployed dev instance (used for testing):

Steps to test:

To-dos:

Issues:


(Please delete unneeded items, merge only when none are left open)

  • Updated changelog
  • Needs datastore update after deployment

@philippotto
Copy link
Member

@frcroth I just pushed the necessary frontend changes. let me know if you need anything else 📫

@frcroth
Copy link
Member Author

frcroth commented Jul 25, 2023

@philippotto
Not sure what the problem is right now. You can also test it for the two layers in the issue. The backend gets the preferred voxel size correctly and returns a datasource with a coordinate transformation, but it does not seem to affect the frontend, so the datasource configuration does not include a coordinate transformation.

@philippotto
Copy link
Member

@philippotto Not sure what the problem is right now. You can also test it for the two layers in the issue. The backend gets the preferred voxel size correctly and returns a datasource with a coordinate transformation, but it does not seem to affect the frontend, so the datasource configuration does not include a coordinate transformation.

If I see it correctly, the backend defines the coordinate transformations once for the entire datasource. However, the transformations should be defined per layer. For example, if there are two layers (with differing voxel sizes), the first shouldn't have a transformation, but the second should get one so that it matches the 1st. Does this make sense?

@frcroth
Copy link
Member Author

frcroth commented Jul 25, 2023

@philippotto Yes, thank you, your comment helped me and now it works 🎉

@frcroth frcroth changed the title [WIP] Explore sources with different voxel sizes separately Rescale layers for different voxel sizes on remote import Jul 25, 2023
@frcroth frcroth requested a review from fm3 July 25, 2023 13:09
@frcroth frcroth marked this pull request as ready for review July 25, 2023 13:09
Copy link
Member

@fm3 fm3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Backend looking good, just left two cosmetic suggestions.

As I mentioned before, this variant is not going to be able to register situations where e.g. the segmentation exists only starting at mag2 (but theoretically has the same voxel size). With this, it will register both starting at their individual mag1 with a transformation. In that particular case, my guess is that we would prefer calling it mag2, and have a uniform voxel size. However, I don’t know how to properly distinguish which case we want, with the limited information we are getting.

@philippotto Do you have an idea how this distinction could be made? I guess we could look for power-of-two divisibility, but that may yield false positives.

Otherwise, I’d say it is fine as is. One could also argue it is more correct to always call the “finest” existing mag of a layer mag1.

app/models/binary/explore/ExploreRemoteLayerService.scala Outdated Show resolved Hide resolved
app/models/binary/explore/ExploreRemoteLayerService.scala Outdated Show resolved Hide resolved
@philippotto
Copy link
Member

@philippotto Do you have an idea how this distinction could be made? I guess we could look for power-of-two divisibility, but that may yield false positives.

I've thought a bit about this and think that this is a pretty good heuristic. In the rare event of a false positive, the rendering should still be fine. Enumerating the mags differently could still be seen as a plausible way of bringing two layers together, in my opinion.

@fm3
Copy link
Member

fm3 commented Jul 27, 2023

I've thought a bit about this and think that this is a pretty good heuristic.

Ok, in this case, I’d like to ask you @frcroth to add this heuristic. I assume an epsilon check is needed for checking the divisibility.

For a test dataset, you could use the zarr streaming links from a webknossos instance (directly link to a mag, so no ngff metadata is used)

@frcroth frcroth requested a review from fm3 August 1, 2023 09:02
Copy link
Member

@fm3 fm3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I read the code correctly, the rounding of minVoxelSize/preferredVoxelSize the could be a problem. If one layer has 2.3 times the other’s voxel size, this might be wrongly detected as mag2, right? I think the isPowerOfTwo check has to be done on the doubles there, possibly with epsilon comparison.

Apart fromt hat, it looks good to me now :)

@frcroth
Copy link
Member Author

frcroth commented Aug 21, 2023

@fm3 Was this what you had in mind?

Copy link
Member

@fm3 fm3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, perfect!

@frcroth frcroth merged commit f4301a3 into master Aug 24, 2023
2 checks passed
@frcroth frcroth deleted the different-voxel-sizes branch August 24, 2023 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support adding multiple layers with different voxel sizes separately
3 participants