[vtkusers] vtkImageData Cloning....

Ale notinmyhead at gmail.com
Mon Jul 9 04:20:13 EDT 2012


Hello,

I've been trying so long to have a copy of a vtkImageData content, starting from it's smart pointer... I use these piece of code:

fn (..., vtkImageData *volume) {
    if (volume != NULL) {
        vtkSmartPointer < vtkImageData > tmp = vtkSmartPointer < vtkImageData >::New();

        tmp->DeepCopy(volume);
        tmp->Update();
	this->MYINTERNALVTKIMAGEDATAPOINTER = tmp;
    }

...

}

If I try to use the internal pointer again, I get:

 ERROR: In ..... /VTK/Filtering/vtkImageData.cxx, line 1530
vtkImageData (0x9576790): GetScalarPointer: Pixel (0, 156718304, 156718320) not in memory.
 Current extent= (0, -1, 0, -1, 0, -1)

What's happening?

Ale


More information about the vtkusers mailing list