[vtkusers] Copy matrix fast for VTK

David Gobbi david.gobbi at gmail.com
Thu Dec 16 14:11:02 EST 2010


Hi Italo,

Take a look at vtkImageImport, it is a special filter that allows you to
copy an array into an image data.

  David


On Thu, Dec 16, 2010 at 11:53 AM, Italo Ribeiro <italo.ribeiro at gmail.com> wrote:
> Hi,
> I have one matrix 512x512x108 and i want copy the values of all indices for
> any VTK data type but i dont want do:
> for(int i = 0; i<512; i++){
>     for(int j=0; j<512; j++){
>         for(int k=0; k<108; k++){
>             imageData->SetScalarComponentFromFloat(i, j, k, 0,
> matrix[i][j][k]);
>         }
>     }
> }
> VTK have one way to do copy like imageData->DeepCopy(matrix) ?
> --
> Ítalo Mendes
> ogre.irados.org



More information about the vtkusers mailing list