Commit d9a2710e authored by David Gobbi's avatar David Gobbi

BUG: Extra CellId check needed if image data cell dimensionality is not 3D.

parent 97bb36a3
......@@ -37,7 +37,7 @@
#include "vtkCamera.h"
#include "vtkAbstractCellLocator.h"
vtkCxxRevisionMacro(vtkSurfacePicker, "1.11");
vtkCxxRevisionMacro(vtkSurfacePicker, "1.12");
vtkStandardNewMacro(vtkSurfacePicker);
//----------------------------------------------------------------------------
......@@ -676,7 +676,7 @@ double vtkSurfacePicker::IntersectVolumeWithLine(const double p1[3],
this->CellIJK[j] = xi[j];
this->PCoords[j] = pcoords[j];
// Make sure cell is within bounds
if (xi[j] == extent[2*j + 1])
if (xi[j] == extent[2*j + 1] && xi[j] > 0)
{
this->CellIJK[j] = xi[j] - 1;
this->PCoords[j] = 1.0;
......@@ -793,7 +793,7 @@ double vtkSurfacePicker::IntersectImageActorWithLine(const double p1[3],
this->CellIJK[j] = int(floor(xj));
this->PCoords[j] = xj - this->CellIJK[j];
// Keep the cell in-bounds if it is on the edge
if (this->CellIJK[j] == extent[2*j+1])
if (this->CellIJK[j] == extent[2*j+1] && this->CellIJK[j] > 0)
{
this->CellIJK[j] -= 1;
this->PCoords[j] = 1.0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment