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

[MPI] fix image spacing implicit triangulation in 1d and 2d cases #1074

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

SylvainGerbaud
Copy link

In case of 1D or 2D vtkImageData, the function getSpacing might return 0 as spacing[1] and/or spacing[2].

Here is a liittle fix to ensure that spacing is at least 1 (it's an integer).

@@ -185,6 +185,12 @@ RegistryTriangulation
double spacing[3];
image->GetSpacing(spacing);

// 1D
if(!spacing[1])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if((!spacing[1])&&(!spacing[2])) looks safer to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants