You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Imagine an image with only two foreground pixels, offset by {1, 1, 0}. When extracting the surface of this image as a mesh, it is necessary to duplicate the coincident edge, creating two disconnected cubes, in order to ensure that the result is manifold. A slice through the z plane would show:
*---*---*
| A | |
*---*---*
| | B |
*---*---*
Now imagine that these foreground pixels are still flanked by background pixels in the z plain, but are "connected" into the same connected component by foreground pixels in the two adjacent z plains:
Z-1 Z Z+1
*---*---* *---*---* *---*---*
| X | X | | A | | | X | X |
*---*---* *---*---* *---*---*
| | X | | | B | | | X |
*---*---* *---*---* *---*---*
Here, the coincident edge of pixels A and B must again be duplicated; but unlike the first example, the two distinct edges actually connect the same two vertices. Quite reasonably, when asked to create a face which would require an edge between two vertices, itk::QuadEdgeMesh checks [1] to see whether there is an existing edge, and refuses to create a new edge if one already exists:
QEPrimal * edge = this->FindEdge(pid0, pid1);
if (edge)
{
if (edge->IsLeftSet())
{
itkDebugMacro("Edge [" << i << " " << ((i + 1) % N) << " has a left face.");
return (QEPrimal *)nullptr;
}
}
}
Most of the time, this is what we want--but in the case described above, it acts as a bug. It's not immediately obvious to me how to detect when this check is and is not necessary; as I work through this problem, I thought I would post it as an issue in case anyone else had any insight--pun intended. ;-D
Imagine an image with only two foreground pixels, offset by
{1, 1, 0}
. When extracting the surface of this image as a mesh, it is necessary to duplicate the coincident edge, creating two disconnected cubes, in order to ensure that the result is manifold. A slice through the z plane would show:Now imagine that these foreground pixels are still flanked by background pixels in the z plain, but are "connected" into the same connected component by foreground pixels in the two adjacent z plains:
Here, the coincident edge of pixels
A
andB
must again be duplicated; but unlike the first example, the two distinct edges actually connect the same two vertices. Quite reasonably, when asked to create a face which would require an edge between two vertices,itk::QuadEdgeMesh
checks [1] to see whether there is an existing edge, and refuses to create a new edge if one already exists:Most of the time, this is what we want--but in the case described above, it acts as a bug. It's not immediately obvious to me how to detect when this check is and is not necessary; as I work through this problem, I thought I would post it as an issue in case anyone else had any insight--pun intended. ;-D
[1] https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/Core/QuadEdgeMesh/include/itkQuadEdgeMesh.hxx#L1211-L1221
Here's a MCE demonstrating the issue:
The text was updated successfully, but these errors were encountered: