[vtk-developers] SetInput fails?

Tim Peeters thjmpeeters at gmail.com
Sat May 29 21:31:26 EDT 2010


Hi all,

To make it a bit more clear, I wrote a test plug-in with the following function:

void VTKPipelineTestPlugin::dataSetAdded(data::DataSet* ds)
{
	if (ds->getKind() != "DTI") return;

	vtkImageData* dti = ds->getVtkImageData();
	Q_ASSERT(dti);

	QString basename = ds->getName();
	qDebug()<<"Dataset"<<ds<<"with name"<<basename<<"and
kind"<<ds->getKind()<<"seems usable.";

	vtkSimpleImageFilterExample* filter = vtkSimpleImageFilterExample::New();
	qDebug()<<"setting intput to"<<dti;
	filter->SetInput(dti);
	qDebug()<<"input is"<<filter->GetInput();
}

when I run the software, and this function is executed, the output is
as follows:

Dataset 0x101db9ed0 with name "1" and kind "DTI" seems usable.
setting intput to 0x11aa5a8f0
input is 0x0

What can be wrong here? Where can I look to find out why Set or
GetInput() fails?

Thanks,
Tim.

On Fri, May 28, 2010 at 20:53, Tim Peeters <thjmpeeters at gmail.com> wrote:
> Dear developers,
>
> I am developing a VTK-based application that uses a plug-in system to
> add functionality to the core system.
> I am loading plug-ins (which are loaded as DLL's on Windows) using the
> Qt plugin system.
>
> The following code, in one of the plugins, fails:
>
> vtkTensorToEigensystemFilter* eigen = vtkTensorToEigensystemFilter::New();
> // dti is a valid vtkImageData object
> eigen->SetInput(dti);
> vtkImageData* eigenOut = eigen->GetOutput();
> // eigenOut == NULL
>
>
> vtkTensorToEigensystemFilter is a subclass of
> vtkSimpleImageToImageFilter which basically only implements the
> SimpleExecute() function and thus does not change the {Get,Set}Input()
> function(s). Since eigenOut == NULL, I assume that SetInput or
> GetOutput() fails, and I have been debugging but I get lost in the VTK
> pipeline and I cannot trace back the error. In a different place I use
> vtkExtractVOI in a similar way as vtkTensorToEigenSystemFilter, and I
> get the same problem.
>
> dti is a vtkImageData that is constructed in a different plugin and is
> the output of a reader. All the functions used to work in one "big"
> application that did not use plugins, but now it fails in MSVC2008
> express on Windows. I usually do my development on Linux (Ubuntu and
> Slackware), and with GCC on Linux everything works fine. On Windows,
> different parts of the pipeline are built in different dll's
> (plugins), but the image data (dti) and its producer port seem to be
> consistent in the plugin that creates the dti dataset and the plugin
> that uses it.
>
> Does anyone have any clues how I can track where this problem comes from?
>
> Thanks a lot!
> Tim.
>



More information about the vtk-developers mailing list