Skip to content

Commit

Permalink
Use ImageGeom::getCoordsf to get voxel center for ComputeShapes
Browse files Browse the repository at this point in the history
* Fixes inconsistency between filters with where the voxel center
is assumed to be

Signed-off-by: Jared Duffey <[email protected]>
  • Loading branch information
JDuffeyBQ committed Nov 1, 2024
1 parent 9bee9ce commit 306a14d
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,10 @@ void ComputeShapes::find_moments()
for(size_t k = 0; k < xPoints; k++)
{
int32_t gnum = featureIds[zStride + yStride + k];
x = float(k * modXRes) + (origin[0] * static_cast<float>(m_ScaleFactor));
y = float(j * modYRes) + (origin[1] * static_cast<float>(m_ScaleFactor));
z = float(i * modZRes) + (origin[2] * static_cast<float>(m_ScaleFactor));
FloatVec3 voxelCenter = imageGeom.getCoordsf(k, j, i);
x = voxelCenter[0] * static_cast<float>(m_ScaleFactor);
y = voxelCenter[1] * static_cast<float>(m_ScaleFactor);
z = voxelCenter[2] * static_cast<float>(m_ScaleFactor);
x1 = x + (modXRes / 4.0f);
x2 = x - (modXRes / 4.0f);
y1 = y + (modYRes / 4.0f);
Expand Down

0 comments on commit 306a14d

Please sign in to comment.