[vtkusers] vtkImageIterator - feature request?

Dean Inglis dean.inglis at camris.ca
Fri Feb 27 10:53:26 EST 2004


I'm almost certain, but please correct me if I'm wrong,
that there is no way to reset a vtkImageIterator after
it has been used: e.g., 

  vtkImageIterator<T> inIt(inData, outExt);
  vtkImageIterator<T> outIt(outData, outExt);

  // copy input to output 
  while (!outIt.IsAtEnd())
    {
    T* inSI = inIt.BeginSpan();
    T* outSI = outIt.BeginSpan();
    T* outSIEnd = outIt.EndSpan();
    while (outSI != outSIEnd)
      {
      *outSI++ = *inSI++;
      }
    inIt.NextSpan();
    outIt.NextSpan();
    }

// further on ...

  // Loop through output pixels agian

// but this will never execute since after the first execution
//  outIt.IsAtEnd() always returns true


  while (!outIt.IsAtEnd())  
    {
    T* outSI = outIt.BeginSpan();
    T* outSIEnd = outIt.EndSpan();
    while (outSI != outSIEnd)
      {
      if(*outSI == processed)
        {   
        *outSI = outValue;
        }  
      outSI++; 
      }
    outIt.NextSpan();
    }

Can such a feature be implemented?

Dean



 




More information about the vtkusers mailing list