[vtkusers] GetRange(double rng[2]) crashes in execute of threaded image algorithm.

Maarten Beek beekmaarten at yahoo.com
Tue May 27 16:31:18 EDT 2014


Hi all,

I have been struggling with the following:


I have derived an image algorithm form vtkThreadedImageAlgorithm in which I need to know the range of the scalars of the input image.

inData->GetPointData()->GetScalars()->GetRange(rng);
inData->GetPointData()->GetScalars()->GetInformation()->Get(vtkDataArray::COMPONENT_RANGE(), rng));
both crash in the template execute function (I used vtkImageHSVToRGB as example).

The crash only seems to be happening in Release build.


When I use SetNumberOfThreads(1), the algorithm works fine.
When I hard-code the range (double rng[2] = { 0.0, 808000}; ), the algorithm works fine.

Is GetRange() not thread-safe? Should I get the range from the input before it is spread across threads?


Thanks - Maarten
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20140527/480f98ce/attachment.html>


More information about the vtkusers mailing list