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

Nodes are shown in wrong slice when moving back and forth with low clipping distance #5653

Open
fm3 opened this issue Aug 5, 2021 · 4 comments
Assignees

Comments

@fm3
Copy link
Member

fm3 commented Aug 5, 2021

Context

I am annotating a dataset for alignment corrections. For this it is important to set nodes in the precise z coordinate of specific image tiles. For this I turn the clipping distance very low. I then move back and forth a lot by using the scroll wheel or d/f.

Expected Behavior

Nodes with z=10 should be visible exactly when position’s z is shown as 10 in the toolbar.

Current Behavior

Sometimes the node is shown in the neighboring slice and not in slice 10.

Steps to Reproduce the bug

Your Environment for bug

Firefox Linux

Related issue

I suspect this is closely related to #5233 and the old PR #5201, which is mentioned there

@philippotto
Copy link
Member

I think, we should try to fix #5233 (see my newest comment) first. I assume, this issue here will be either solved automatically or should be easier to grasp.

@philippotto
Copy link
Member

I implemented the approach I suggested in #5233 (PR: #5801). I still think that the change should soften the problem which is described in the current issue here. However, the actual problem is probably as follows:

  • The clipping distance goes in both directions (so, if the clipping distance is large enough you can see nodes before and after the current slice). This is by design and should probably not change (even if we changed it, the actual problem wouldn't be solved either).
  • Due to the floating point position, a fixed clipping distance cannot ensure that only nodes of the current slice are rendered. For example, if I'm at z=0.5, the clipping distance would need to be 0.5 to only see the node in the current slice. If I'm at z=0.6, it would need to be 0.4 in one direction and 0.6 in the other --> doesn't work.

For this particular use case ("I only want to see nodes in the current slice"), I would consequently suggest to:

For now, I suggest to wait a bit to see how #5801 will improve things (hopefully). Afterwards, we can decide how to proceed.

@fm3
Copy link
Member Author

fm3 commented Oct 20, 2022

I just noticed #4366 is a duplicate of this issue. closing it now, but to preserve the info, I’m quoting from the description there:

My scenario is quite rare I guess:
my dataset is downsampled with z=1, I’m looking at mag 64-64-1, going through slice by slice.
The clipping distance is lower than the z resolution, I want to see my nodes only in the slice where I created them.
I frequently get into the situation that I see my nodes only in the slice next to the one they were created in, and not in their real one.
My hypothesis is that the camera position is a float, and in this situation the camera is just slightly below the correct slice, leading to showing the slice below, but the clipping distance determines that the nodes from above be shown.

-------------X------- slice (not shown) with node (shown)
             | small distance
····················· camera
             |
             |
             |
             |
             |
---------------------next slice without node (shown)

If this is in fact the reason, this might be fixed by showing the slice closest to the camera rather than the slice next below the camera. I may be mistaken though, and of course I’m not sure what other side-effects this would have (it’s still important that nodes are created at the slice that was visible during the click)

@philippotto
Copy link
Member

I think, your hypothesis is spot-on. It probably boils down to the following conflict:

  • node positions can be fractional (soon to be integers?)
  • the camera position is fractional
    • thus, the clipping distance considers the (fractional) distance between camera and nodes
    • the camera position is floored (!) in the position input box
    • the rendered plane is looked up by flooring (!) the current position

We could change the two floor-operations to round, but I'm also hesitant about the consequences.

I frequently get into the situation that I see my nodes only in the slice next to the one they were created in, and not in their real one.

Two thoughts:

  • if you center a node with "S", the camera position should be integer again so that pressing f/d should deliver the desired experience for you (under the assumption that the node position is integer)
  • quoting myself from above:

For this particular use case ("I only want to see nodes in the current slice"), I would consequently suggest to:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants