We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
vtkCalculator does not work on vtkImageData because vtkImageData does not have a getPoints method.
getPoints
setFormulaSimple
calculator.setFormulaSimple( FieldDataTypes.POINT, ['scalars'], 'mask', value => value > 10 ? 1 : 0 );
getPoints is called in two locations in prepareArrays that cause problems for the above scenario:
prepareArrays
line 128: arraysIn.push(inData.getPoints()); (This is due to the coordinate data that gets added in augmentInputArrays)
arraysIn.push(inData.getPoints());
augmentInputArrays
line 194: (x) => x.getPoints().getNumberOfPoints(),
(x) => x.getPoints().getNumberOfPoints(),
I was able to get it working for my use case (applying a simple threshold to some image data) by placing checks before the getPoints calls:
if (inData.getPoints) arraysIn.push(inData.getPoints());
(x) => x.getPoints ? x.getPoints().getNumberOfPoints() : x.getNumberOfPoints()
Not sure if this is the preferred solution though.
The text was updated successfully, but these errors were encountered:
fix(calculator): make it work with vtkImageData input
f0e1a26
do not call getPoints on the input dataset if it not necessary fix Kitware#2257
46b13cc
do not call getPoints on the input dataset if it not necessary fix #2257
🎉 This issue has been resolved in version 28.12.3 🎉
The release is available on:
Your semantic-release bot 📦🚀
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
High-level description
vtkCalculator does not work on vtkImageData because vtkImageData does not have a
getPoints
method.Steps to reproduce
setFormulaSimple
, e.g.Detailed behavior
getPoints
is called in two locations inprepareArrays
that cause problems for the above scenario:line 128:
arraysIn.push(inData.getPoints());
(This is due to the coordinate data that gets added in
augmentInputArrays
)line 194:
(x) => x.getPoints().getNumberOfPoints(),
Expected behavior
I was able to get it working for my use case (applying a simple threshold to some image data) by placing checks before the
getPoints
calls:if (inData.getPoints) arraysIn.push(inData.getPoints());
(x) => x.getPoints ? x.getPoints().getNumberOfPoints() : x.getNumberOfPoints()
Not sure if this is the preferred solution though.
Environment
The text was updated successfully, but these errors were encountered: