google / google/neuroglancer

feat: Improve screenshot resolution report

Open
#928 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
1.5k
Forks
389
Avg merge
3d 21h
Merged PRs (30d)
3

Description

As always with transformations I think this whole section is a bit subtle and complicated and I'm not sure how that affects this approach. I think there are several different layers between the voxel arrays and the neuroglancer field of view. I'll just make up some names.

1. Data Voxel Space, i.e. the raw arrays. Different MIP levels have different voxel spaces and these are dynamically switched between by Neuroglancer.
2. "Data Physical Space" where the voxel space is mapped to physical space by a certain nm/voxel and translation, which aligns MIP levels. This differs between layers.
3. "Neuroglancer Physical Space" which is the result of the applying the transforms on each layer, and there is only one Neuroglancer Physical Space shared by all layers.
4. "Neuroglancer FOV Space" which is the result of changing the view scaling mapping the pixels you see to the Neuroglancer Physical Space (usually simply 1x,1x,1x, but can be changed with the dimensions box in the upper left).

One thing that that's a bit confusing in the screenshot interface is that the top row has a "Physical scale" that shows the distance / pixel of the screenshot in Neuroglancer Physical Space (correctly handling the FOV space transformation, too).

However, the "Physical voxel resolution" in the second row, which we're discussing here, seems to refer to some combination of the Data Voxel Space and the Data Physical Space.

image

For example, this came from 8,8,40 nm/vx data, but zoomed out enough that we need only the 32,32,40 mip layer at the screenshot scaling requested. So the values that you're computing here is "if I move 1 voxel along the x/y/z direction in the Data Voxel Space we are visualizing now, how far do I travel in Neuroglancer Physical Space?" The fix that you described here does this math correctly, but it's not clear to me that is the key number for non-rigid transformations. I don't sit with imagery data collection much, so I'm not sure if this is a value that's used frequently.

In particular, I wonder it's useful to separate the MIP resolution aspect from the transformation aspect here? I feel like what I really want to know here is something like "How many data voxels at what MIP per image pixel", which is a different number. For example, if I did a shearing in x and y of `[[1,0],[1,1]]`, then the voxel area is unchanged and so my x and y voxels per pixel are unchanged. But these are different numbers. Maybe "voxel sampling"?

Either way, I think a different name for the "Physical voxel resolution" that more directly notes what is being measured would be useful, since it's a different and more ambiguous quantity than "Physical scaling".

_Originally posted by @ceesem in https://github.com/google/neuroglancer/pull/876#discussion_r2722534832_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.