Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

voxel2mesh fixes #3049

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion cmd/voxel2mesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,10 @@ void run ()
Surface::Algo::image2mesh_blocky (input, mesh);

} else {

auto input = Image<float>::open (argument[0]);
const default_type threshold = get_option_value ("threshold", Filter::estimate_optimal_threshold (input));
auto opt = get_options("threshold");
const default_type threshold = opt.empty() ? Filter::estimate_optimal_threshold (input) : opt[0][0];
Surface::Algo::image2mesh_mc (input, mesh, threshold);

}
Expand Down
1 change: 1 addition & 0 deletions src/surface/algo/image2mesh.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ namespace MR
const auto existing = vox2vertindex.find (voxels[in_vertex]);
if (existing == vox2vertindex.end()) {
triangle_vertices[out_vertex] = vertices.size();
vox2vertindex.insert(std::make_pair(voxels[in_vertex], vertices.size()));
Eigen::Vector3d pos_voxelspace (default_type(voxels[in_vertex][0]) - 0.5, default_type(voxels[in_vertex][1]) - 0.5, default_type(voxels[in_vertex][2]) - 0.5);
vertices.push_back (transform.voxel2scanner * pos_voxelspace);
} else {
Expand Down
Loading