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

Projections can be incomplete if a selection in z is made #124

Open
bwvdnbro opened this issue Apr 19, 2022 · 7 comments
Open

Projections can be incomplete if a selection in z is made #124

bwvdnbro opened this issue Apr 19, 2022 · 7 comments
Assignees

Comments

@bwvdnbro
Copy link
Member

When you select a region in both x, y and z for projections, then the resulting projected map will not consistently include all contributions in z. Only particles with zmin<=z<=zmax are included, while particles could not satisfy this condition and still have a kernel sphere that overlaps with the projected region. Similarly, particles that satisfy the condition would be fully included in the projection, even if their kernel sphere only partially overlaps with the projected region.

As a result of this, projections with increasingly smaller thickness do not, as would be expected, resemble slices at the same position.

To remedy this, we could include all particles with overlapping kernels in the projection, and then multiply each contribution with an additional factor that quantifies how much of the kernel volume actually overlaps with the range in z. Particles that only partially overlap in x and/or y are already treated correctly, since their out-of-range contributions simply end up in pixels that are outside the image. So don't think we need to consider any additional corner cases. Or am I being too optimistic here?

@bwvdnbro
Copy link
Member Author

@MatthieuSchaller maybe you have additional thoughts?

@MatthieuSchaller
Copy link
Member

That would be good to do in principle, yes. Formally, we would want the projection to reduce to a slice in the limit z_min --> z_max.

Seems like a "bottom of the pile" improvement though. For most practical cases, the missing contributions are very likely negligible.

@JBorrow
Copy link
Member

JBorrow commented Apr 19, 2022

To do this formally correctly, you would need to integrate the 3D kernel in all cases. You could have:

     ┌─────────────────────────────┐
     │             xxxxxxx         │
     │       xxxxxxx     xxxx      │
     │    xxxx              xxx    │
     │   xx                   xx   │
     │  xx                     xxx │
     │ xx                        x │
     │ x                         xx│
     │ x            X             x│
─────┼─xx─────────────────────────x├───
     │  xxxxxxxxxxxxxxxxxxxxxxxx xx│
     │  xxxxxxxxxxxxxxxxxxxxxxxxxx │
     │  xxxxxxxxxxxxxxxxxxxxxx xxx │
     │   xxxxxxxxxxxxxxxxxxxxxxx   │
     │     xxxxxxxxxxxxxxxxxxxx    │
     │      xxxxxxxxxxxxxxxx       │
     │          xxxxxxxxx          │
     └─────────────────────────────┘

Horizontal line is z_max, circle the kernel, box the bounding box of particle. You'd have to remove the contribution of the xxx'd out region.

@JBorrow
Copy link
Member

JBorrow commented Apr 19, 2022

I suppose you could 'calibrate' this (to a multiplicative factor), but it would be different for every kernel...

@MatthieuSchaller
Copy link
Member

Yes, you would need to integrate the kernel volume that overlaps with the zrange. Potentially expensive but only required for very few particles.

Technically, there is also the opposite case. A particle whose centre is within zrange with parts of its kernel wings leaking out of the range. That leakage should not be counted.
That's less relevant for the case Bert mentioned above as in an infintely thin slice there won't be any particles in the slice.

@JBorrow
Copy link
Member

JBorrow commented Apr 20, 2022

That would be good to do in principle, yes. Formally, we would want the projection to reduce to a slice in the limit z_min --> z_max.

I don't think we do, actually. A projection in this case should return zeroes, as there's no depth to project out.

@bwvdnbro
Copy link
Member Author

In the actual limit, yes. But for an arbitrarily thin region with thickness dz it should still work and should return rho*dz, where rho is a the value of a slice at the same position.

When slicing was still broken, there was actually a use case for this. But maybe less so now.

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

No branches or pull requests

3 participants