Closed martinschorb closed 8 months ago
@martinschorb you have to show me in person; let's mattermost chat to find a date.
this happens with the segmentations in here: https://github.com/mobie/environmental-dinoflagellate-vCLEM
I feel the issue is that due to your coordinate system the mesh has negative coordinates. It may be that the 3D viewer code has issue with this.
I think the main issue right now for navigation is that it computes a totally wrong bounding box of the mesh.
Is there any way you could test this in a coordinate system, where your y-axis is shifted such that we have only positive coordinates?
Super weird:
The min and max of the mesh seem to be wrong:
But the bounds are correct:
I think this 1.4E-45
is the issue. No idea where that comes from...
Did you check the corresponding table? Maybe this was some issue related to the empty objects. If you tell me which of the segmentations causes these issues I can also check.
I found the bug. It is within the ImageJ 3D Universe code:
public void calculateMinMaxCenterPoint(final Point3f min, final Point3f max,
final Point3f center)
{
if (mesh == null || mesh.size() == 0) {
min.set(0, 0, 0);
max.set(0, 0, 0);
center.set(0, 0, 0);
return;
}
min.x = min.y = min.z = Float.MAX_VALUE;
max.x = max.y = max.z = Float.MIN_VALUE; // <= WRONG, correct would be: -Float.MAX_VALUE
for (int i = 0; i < mesh.size(); i++) {
final Point3f p = mesh.get(i);
if (p.x < min.x) min.x = p.x;
if (p.y < min.y) min.y = p.y;
if (p.z < min.z) min.z = p.z;
if (p.x > max.x) max.x = p.x;
if (p.y > max.y) max.y = p.y;
if (p.z > max.z) max.z = p.z;
}
center.x = (max.x + min.x) / 2;
center.y = (max.y + min.y) / 2;
center.z = (max.z + min.z) / 2;
}
I think I fixed it (follow the link above).
However, whether and when this fix will be shipped with Fiji is not clear.
I think there are three (non-exclusive) options:
Hi, I have transformed segmentations (3D CLEM both LM and EM, none is centered at the origin) that we like to visualize in the 3D viewer.
Can the origin of the 3D viewer be set to the center of the bounding box containing all visible objects instead of
0,0,0
? The 3DViewer is barely usable otherwise (rotations are crazy).