View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0012993VTK(No Category)public2012-03-13 12:202013-07-22 16:14
ReporterBernd Hentschel 
Assigned ToDave DeMarle 
PriorityhighSeverityminorReproducibilityhave not tried
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version5.6.1 
Target VersionFixed in Version 
Summary0012993: vtkImageData::FindCell returns valid cellId for outside points
DescriptionvtkImageData::FindCell will return a valid cellId (>=0) for points that lie outside the data set bounds. This should never happen for cartesian grids. More specifically, I noticed that only points that lie outside the domain but within one spacing in either dimension are handled in this fashion. Please find attached a short test program illustrating the issue.

Looking at the code of FindCell(...) and vtkImageData::ComputeStructuredCoordinates(...) it looks like this is a combination of a truncation error when moving from physical to grid coordinates combined with an issue in the subsequent computation of the corresponding cellId.

As a short term fix, I might suggest testing the input coords against the bounds in the first place (early exit). However, I wondered why the mapping to a grid point is made in the first place, because it's pretty straightforward to compute the correct cellId from the input coords right away without referring to grid points altogether.
TagsNo tags attached.
ProjectTBD
Typeincorrect functionality
Attached Filescpp file icon BugReportVtkImageData.cpp [^] (2,999 bytes) 2012-03-13 12:20

 Relationships

  Notes
(0028403)
Leo Liu (developer)
2012-03-29 14:30

I ran your attached code with the latest VTK. I got "Cell search worked correctly" for all the points. Perhaps this has been fixed?
(0028410)
Bernd Hentschel (reporter)
2012-03-30 05:25

I specifically reported this bug for 5.6.1 and not for the latest version. It's entirely possible that this has been fixed. However, I did not find a bug report on this. Since "bugs don't just go away" would you mind diffing the code mentioned in the report between 5.6.1 and trunk?
(0028421)
Leo Liu (developer)
2012-04-02 14:02

This was indeed a bug fix. In commit 35c074345, bounding box was introduced to reject anything out of bound---pretty much as you suggested.
(0031169)
Dave DeMarle (administrator)
2013-07-22 16:11

reported fixed in 5.10
(0031170)
Dave DeMarle (administrator)
2013-07-22 16:14

meant to close, not expire last time as Leo found this fixed and pointed out patch responsible

 Issue History
Date Modified Username Field Change
2012-03-13 12:20 Bernd Hentschel New Issue
2012-03-13 12:20 Bernd Hentschel File Added: BugReportVtkImageData.cpp
2012-03-29 14:30 Leo Liu Note Added: 0028403
2012-03-29 14:30 Leo Liu Resolution open => unable to reproduce
2012-03-30 05:25 Bernd Hentschel Note Added: 0028410
2012-04-02 14:02 Leo Liu Note Added: 0028421
2013-07-22 16:11 Dave DeMarle Note Added: 0031169
2013-07-22 16:11 Dave DeMarle Status backlog => expired
2013-07-22 16:11 Dave DeMarle Assigned To => Dave DeMarle
2013-07-22 16:13 Dave DeMarle Status expired => backlog
2013-07-22 16:13 Dave DeMarle Resolution unable to reproduce => reopened
2013-07-22 16:14 Dave DeMarle Note Added: 0031170
2013-07-22 16:14 Dave DeMarle Status backlog => todo
2013-07-22 16:14 Dave DeMarle Status todo => active development
2013-07-22 16:14 Dave DeMarle Status active development => closed
2013-07-22 16:14 Dave DeMarle Resolution reopened => fixed


Copyright © 2000 - 2018 MantisBT Team