Skip to content

Commit

Permalink
mris_reposition_surface.cpp. #NF Will now use brute force if it canno…
Browse files Browse the repository at this point in the history
…t find a vertex in the hash.
  • Loading branch information
Douglas Greve committed Jun 4, 2021
1 parent 2e74280 commit 720bc22
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion mris_reposition_surface/mris_reposition_surface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,11 @@ int main(int argc, char **argv)
for (auto it = points.begin(); it != points.end(); it++) {
PointSet::Point p = *it;
int vno = MHTfindClosestVertexNoXYZ(hash, surf, p.x, p.y, p.z, &distance);
if (vno < 0) fs::fatal() << "failed to find closest vertex";
if (vno < 0){
printf("Failed to find closest vertex in hash, using brute force\n");
vno = MRISfindClosestVertex(surf, p.x, p.y, p.z, &distance, CURRENT_VERTICES);
//fs::fatal() << "failed to find closest vertex";
}
MRISrepositionSurfaceToCoordinate(surf, mri, vno, p.x, p.y, p.z, nsize, sigma, 0);
}
MRIScomputeNormals(surf);
Expand Down

0 comments on commit 720bc22

Please sign in to comment.