Skip to content

Commit

Permalink
Add python binding to interpolate_scalars_to_mesh
Browse files Browse the repository at this point in the history
  • Loading branch information
akenmorris committed Apr 3, 2024
1 parent ca4fe6a commit 006888b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Libs/Mesh/Mesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1697,7 +1697,7 @@ void Mesh::interpolate_scalars_to_mesh(std::string name, Eigen::VectorXd positio
// assign scalar value based on a weighted scheme
float weighted_scalar = 0.0f;
float distanceSum = 0.0f;
float distance[8];
float distance[8] = {0.0f};
bool exactly_on_point = false;
float exact_scalar = 0.0f;
for (unsigned int p = 0; p < closest_points->GetNumberOfIds(); p++) {
Expand Down
3 changes: 3 additions & 0 deletions Libs/Python/ShapeworksPython.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1097,6 +1097,9 @@ PYBIND11_MODULE(shapeworks_py, m) {
.def("computeThickness", &Mesh::computeThickness, "Computes cortical thickness", "ct"_a, "dt"_a = nullptr,
"maxDist"_a = 10000, "medianRadius"_a = 5.0, "distanceMesh"_a = "")

.def("interpolate_scalars_to_mesh", &Mesh::interpolate_scalars_to_mesh, "Interpolate scalars to mesh", "name"_a,
"positions"_a, "scalar_values"_a)

;

// MeshWarping
Expand Down

0 comments on commit 006888b

Please sign in to comment.