Skip to content

Conversation

@SylvainGerbaud
Copy link
Contributor

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).

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.

@julien-tierny
Copy link
Collaborator

@SylvainGerbaud thanks for your PR.
can you fix the formatting CI error with clang?
also can you take my remark into consideration?
thanks a lot!

@julien-tierny
Copy link
Collaborator

alright, wonderful!
may that be the first of many contributions to TTK :)

@julien-tierny julien-tierny merged commit cca502d into topology-tool-kit:dev Jan 8, 2025
49 checks passed
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