Hi,
I am loading a volume using:
reader = builder->createReader(QString("internal_sources"),
QString("XMLImageDataReaderCore"), files, server);
after creating a view and representation for the volume. I need to access
the volume data and change it. I am using the following to access the
volume data:
vtkSMProxyManager *pm = vtkSMObject::GetProxyManager();
rep =
vtkSMClientDeliveryRepresentationProxy::SafeDownCast(pm->NewProxy("representations","ClientDeliveryRepresentation"));
rep->AddInput((vtkSMSourceProxy*)proxy, "DONTCARE");
rep->SetReductionType(1);
rep->UpdateVTKObjects();
rep->Update();
currVolume = (vtkImageData*)(rep->GetOutput());
Once I have the data as a vtkImageData, I use
currVolume->SetScalarComponentFromFloat(i, j, k, 0, value);
to set the data. This is a very slow way to access the data. I also tried:
float* pixel = static_cast<float*> (currVolume->GetScalarPointer(i,j,k));
pixel[0] = value;
this is faster, but I would like to create an array, fill it with new data
(without accessing ImageData) and then use it to replace the array stored
within the ImageData without having to iterate.
Is there a better way to do this with paraview objects?
Any input is appreciated
Thanks!!
_______________________________________________
Powered by www.kitware.com
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
Please keep messages on-topic and check the ParaView Wiki at:
http://paraview.org/Wiki/ParaView
Follow this link to subscribe/unsubscribe:
http://www.paraview.org/mailman/listinfo/paraview