MantisBT - VTK
View Issue Details
0001898VTK(No Category)public2005-05-31 16:442016-08-12 09:54
Mathieu Malaterre 
Will Schroeder 
lowmajoralways
closedmoved 
 
 
0001898: vtkImageIterator / GetScalarRange does not play well
The following code does not work:

void FillImage(vtkImageData *im, int ext[6], int timestep)
{
  vtkImageIterator<signed char> it(im,ext);
  while (!it.IsAtEnd())
    {
    signed char* imSI = it.BeginSpan();
    signed char* imSIEnd = it.EndSpan();

    while (imSI != imSIEnd)
      {
      *imSI = (signed char)timestep;
      ++imSI;
      }
    it.NextSpan();
    }
  im->GetPointData()->Modified();
  im->Modified();
}


int main()
{
  vtkImageData *im = vtkImageData::New();
  int ext[6] = {0,10,0,10,0,10};
  im->SetExtent(ext);
  im->SetScalarType ( VTK_SIGNED_CHAR );

  FillImage(im, ext, 0);
  double *range = im->GetScalarRange();
  std::cerr << range[0] << "," << range[1] << std::endl;
  std::cout << "V=" << im->GetScalarComponentAsDouble ( 0, 0, 0, 0) << std::endl;


  FillImage(im, ext, 100);
  double *range = im->GetScalarRange();
  std::cerr << range[0] << "," << range[1] << std::endl;
  std::cout << "V=" << im->GetScalarComponentAsDouble ( 0, 0, 0, 0) << std::endl;
}
No tags attached.
Issue History
2011-06-16 13:11Zack GalbreathCategory => (No Category)
2016-08-12 09:54Kitware RobotNote Added: 0036789
2016-08-12 09:54Kitware RobotStatusexpired => closed
2016-08-12 09:54Kitware RobotResolutionopen => moved

Notes
(0036789)
Kitware Robot   
2016-08-12 09:54   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current VTK Issues page linked in the banner at the top of this page.