[vtkusers] Copy of vtkImageData

Jorge Perez josp.jorge at gmail.com
Tue Mar 3 05:38:21 EST 2015


Hi if the scalar type is the same it could work for you. In other case you
can create it with something like this:

// Create an image data
vtkSmartPointer<vtkImageData> imageData = vtkSmartPointer<vtkImageData>::New
();

// Specify the size of the image data

imageData->SetDimensions(10,20,30);

// allocate the data array
imageData->AllocateScalars(VTK_CHAR, 1);

HTH,

Jorge



2015-03-03 11:03 GMT+01:00 Zein Salah <zeinsalah at gmail.com>:

> Hi,
>
> I need to create mask of a vtkImageData, i.e., a binary image with
> exactly the same properties (dimensions, spacing, origin, etc.) of the
> original data image.
>
> For the creation,would a DeepCopy be ok or I would better create a new
> object and set the attributes like  img->SetExtent(...),
> img->SetSpacing(), etc.
>
> Thanks,
> Zeno
> _______________________________________________
> 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 VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20150303/f9fa4176/attachment.html>


More information about the vtkusers mailing list