Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/fix-voxel-indices' into 1.7-main…
Browse files Browse the repository at this point in the history
…tenance
  • Loading branch information
hobu committed Apr 6, 2018
2 parents b295cda + ca9ae47 commit 7ec8d38
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions filters/VoxelCenterNearestNeighborFilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ PointViewSet VoxelCenterNearestNeighborFilter::run(PointViewPtr view)
double y = view->getFieldAs<double>(Dimension::Id::Y, id);
double x = view->getFieldAs<double>(Dimension::Id::X, id);
double z = view->getFieldAs<double>(Dimension::Id::Z, id);
size_t r = static_cast<size_t>(floor(y - bounds.miny) / m_cell);
size_t c = static_cast<size_t>(floor(x - bounds.minx) / m_cell);
size_t d = static_cast<size_t>(floor(z - bounds.minz) / m_cell);
size_t r = static_cast<size_t>((y - bounds.miny) / m_cell);
size_t c = static_cast<size_t>((x - bounds.minx) / m_cell);
size_t d = static_cast<size_t>((z - bounds.minz) / m_cell);
populated_voxels.emplace(std::make_tuple(r, c, d));
}

Expand Down
6 changes: 3 additions & 3 deletions filters/VoxelCentroidNearestNeighborFilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ PointViewSet VoxelCentroidNearestNeighborFilter::run(PointViewPtr view)
double y = view->getFieldAs<double>(Dimension::Id::Y, id);
double x = view->getFieldAs<double>(Dimension::Id::X, id);
double z = view->getFieldAs<double>(Dimension::Id::Z, id);
size_t r = static_cast<size_t>(floor(y - bounds.miny) / m_cell);
size_t c = static_cast<size_t>(floor(x - bounds.minx) / m_cell);
size_t d = static_cast<size_t>(floor(z - bounds.minz) / m_cell);
size_t r = static_cast<size_t>((y - bounds.miny) / m_cell);
size_t c = static_cast<size_t>((x - bounds.minx) / m_cell);
size_t d = static_cast<size_t>((z - bounds.minz) / m_cell);
populated_voxel_ids[std::make_tuple(r, c, d)].push_back(id);
}

Expand Down

0 comments on commit 7ec8d38

Please sign in to comment.