[vtkusers] vtkprobefilter: probing an image with a line

Beau Sapach beau.sapach at ualberta.ca
Fri Feb 4 13:45:01 EST 2005


Hello everyone,

I'm trying to use vtkProbeFilter to probe a vtkImageData but it keeps
crashing.  Here is a code snippet:

	vtkProbeFilter * Probe = vtkProbeFilter::New();
	vtkLineSource * ProbeLine = vtkLineSource::New();
	vtkDataSet * Data;

	ProbeLine->SetPoint1(5,10,0);
	ProbeLine->SetPoint2(10,5,0);
	ProbeLine->SetResolution(11);
	ProbeLine->Update();

	Probe->SetSource(ProbeLine->GetOutput());
	Probe->SetInput(DS->GetCurrentImage());
	Probe->Update();

	Data = Probe->GetOutput();

Is there something obvious that I'm missing?  I can verify that my
DS->GetCurrentImage() function returns a proper vtkImageData because I use
it with vtkImageActor. The program breaks in vtkprobefilter.cxx on line 151:

if (output->IsA("vtkImageData"))
    {
    vtkImageData *out = (vtkImageData*)output;
    vtkDataArray *s = outPD->GetScalars();
**out->SetScalarType(s->GetDataType());
    out->SetNumberOfScalarComponents(s->GetNumberOfComponents());
    }


Where s=0x00... outPD looks valid thoug, I don't get it.... 

----------------------------------------
Beau Sapach
Network Administrator
Biomedical Engineering
University of Alberta
Phone: (780) 492-8098
Fax: (780) 492-8259
Email: beau.sapach at ualberta.ca
----------------------------------------




More information about the vtkusers mailing list