Skip to content

Commit

Permalink
mrmesh: Fix marching cubes algorithm on float images
Browse files Browse the repository at this point in the history
  • Loading branch information
Lestropie committed Dec 6, 2016
1 parent c5d07b3 commit 57fd275
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/mesh/vox2mesh.h
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ namespace MR
// Calculate the precise position of this vertex, based on the
// image intensities in the two relevant voxels
const float alpha = (threshold - in_vertex_values[vertex_indices[0]]) / (in_vertex_values[vertex_indices[1]] - in_vertex_values[vertex_indices[0]]);
const Vertex pos = vertex_positions[0].cast<default_type>() + ((1.0f - alpha) * (vertex_positions[1] - vertex_positions[0]).cast<default_type>());
const Vertex pos = vertex_positions[0].cast<default_type>() + (alpha * (vertex_positions[1] - vertex_positions[0]).cast<default_type>());
vertices.push_back (pos);
} else {
edge_to_output_vertex[edge_index] = existing_zero->second;
Expand Down

0 comments on commit 57fd275

Please sign in to comment.