-
-
Notifications
You must be signed in to change notification settings - Fork 382
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
[Feature] Remove implicit Float default type in vtkDataArray in favor of an explicit Error #3172
Comments
(Not only the type was not correct, but in your example you alos made one copy too many...) Regarding your suggestion, I don't have a preference. |
Copying may or may not be an issue depending on the use case, but the implicit assumption of using |
VTK use float(32) by default for its points unless stated otherwise. As we only have 1 generic vtkDataArray we picked the same default. Are you saying we should remove the default and through an error if a typed array is not provided? |
Can |
We will break a lot of apps out there that are fine to that float conversion. But that could be rolled into a breaking change release. @floryst what do you think? |
How about logging a console warning about defaulting to Float32Array if |
Warning is good for now, but maybe in future If you have other changes that might cause many apps to crash, consider bundling this one with them in the same version. |
Motivation
vtkDataArray implicitly assumes a default data type of Float, which I believe is a mistake.
While debugging a deep issue in Cornerstone, I discovered my mistake in my code:
The data type defaulted to float, which caused problems with rendering floats in labelmap rendering with colors and outlines. Once I defined a typed array correctly, the issue was resolved.
I don't think there are many implicit assumptions elsewhere in vtk. I strongly support explicitly throwing an error or defining a typed array instead of using an array of numbers.
What do you think?
Detailed Description
Above
The text was updated successfully, but these errors were encountered: