[vtkusers] StructuredPointsSource and ImageReslice problem, still

Kevin Teich kteich at cortechs.net
Thu Mar 28 12:09:09 EST 2002


I have never been able to get this working. I don't know what else to try.
If there's nothing my code is doing wrong, can someone say if it appears
that it _should_ be working?

To recap, I'm writing a subclass of StructuredPointsSource called
MutableStrucutredPointsSource that has a SetValue function. It has a
CopyInput function that takes a SPSource (acutally a subclass of
VolumeReader), copies its data, and then provides it as output in its
Execute function. The SetValue function changes a point in the data.

It's now working as the source of a ray cast mapper, and I can make a
renderable Volume from it without a problem. However, I am running into a
problem using it as the source for an ImageReslice. In a simple test Tcl
script, it shows garbage on the screen. In a more complex Tcl script, it
causes a segfault. With optimization off, it crashes on the line:

... Imaging/vtkImageReslice.cxx:2624
1133	    F result = (rx*(ryrz*inPtr0[i00] + ryfz*inPtr0[i01] +

Is there anything I can do to diagnose this problem better? I know this
isn't helpful, but I figure something is just not being set up properly
somewhere. Here's my vtkMutableStructuredPointsSource Execute() function:

void vtkMutableStructuredPointsSource::Execute()
{
  vtkStructuredPoints *output = this->GetOutput();

  output->SetWholeExtent(this->ImageData->GetWholeExtent());
  output->SetExtent(this->ImageData->GetExtent());
  output->SetNumberOfScalarComponents
    (this->ImageData->GetNumberOfScalarComponents());
  output->SetSpacing(this->ImageData->GetSpacing());
  output->SetOrigin(this->ImageData->GetOrigin());

  output->GetPointData()->SetScalars
    ( this->ImageData->GetPointData()->GetScalars() );
}

Pretty standard. Here's my reslicer setup:

vtkImageReslice reslice
reslice SetInput [volumeSource GetOutput]
reslice SetOutputOrigin 0 0 0
reslice SetOutputSpacing 1 1 1
reslice SetOutputExtent 0 255 0 255 0 255
reslice SetResliceAxesDirectionCosines 0 0 1 0 1 0 1 0 0
reslice SetOutputDimensionality 3
reslice OptimizationOff

Again, these three combinations work:

CustomVolumeReader -> Volume
CustomVolumeReader -> ImageReslice
MutableStructuredPointsSource -> Volume

This one shows garbage or causes a segfault:

MutableStructuredPointsSource -> ImageReslice

Any ideas or other things I should try out? Thanks.

-- 
Kevin Teich





More information about the vtkusers mailing list