Hi,<br>I am loading a volume using:<br> reader = builder->createReader(QString("internal_sources"), QString("XMLImageDataReaderCore"), files, server);<br>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:<br>
<br> vtkSMProxyManager *pm = vtkSMObject::GetProxyManager();<br> <br> rep = vtkSMClientDeliveryRepresentationProxy::SafeDownCast(pm->NewProxy("representations","ClientDeliveryRepresentation"));<br>
<br> rep->AddInput((vtkSMSourceProxy*)proxy, "DONTCARE"); <br> rep->SetReductionType(1);<br> rep->UpdateVTKObjects();<br> rep->Update();<br> <br> currVolume = (vtkImageData*)(rep->GetOutput());<br>
<br>Once I have the data as a vtkImageData, I use<br> currVolume->SetScalarComponentFromFloat(i, j, k, 0, value);<br><br>to set the data. This is a very slow way to access the data. I also tried:<br> float* pixel = static_cast<float*> (currVolume->GetScalarPointer(i,j,k));<br>
pixel[0] = value;<br><br>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.<br>
<br>Is there a better way to do this with paraview objects?<br><br>Any input is appreciated<br>Thanks!!<br><br>