[vtk-developers] [VTK 0012993]: vtkImageData::FindCell returns valid cellId for outside points
Mantis Bug Tracker
mantis at public.kitware.com
Tue Mar 13 12:20:46 EDT 2012
The following issue has been SUBMITTED.
======================================================================
http://vtk.org/Bug/view.php?id=12993
======================================================================
Reported By: Bernd Hentschel
Assigned To:
======================================================================
Project: VTK
Issue ID: 12993
Category: (No Category)
Reproducibility: have not tried
Severity: minor
Priority: high
Status: backlog
Project: TBD
Type: incorrect functionality
Resolution: open
Fixed in Version:
======================================================================
Date Submitted: 2012-03-13 12:20 EDT
Last Modified: 2012-03-13 12:20 EDT
======================================================================
Summary: vtkImageData::FindCell returns valid cellId for
outside points
Description:
vtkImageData::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.
======================================================================
Issue History
Date Modified Username Field Change
======================================================================
2012-03-13 12:20 Bernd HentschelNew Issue
2012-03-13 12:20 Bernd HentschelFile Added: BugReportVtkImageData.cpp
======================================================================
More information about the vtk-developers
mailing list