[vtkusers] Setting vtkImageData from regular float array

Aron Helser aron.helser at kitware.com
Mon Jan 1 10:32:23 EST 2018


HI!
Check out this example:
https://lorensen.github.io/VTKExamples/site/Cxx/ImageData/ImageIteratorDemo/

it shows how to iterate through image data and modify it's value. You can
assign values from your float array.
HTH,
Aron

On Mon, Jan 1, 2018 at 4:20 AM, Gib Bogle <g.bogle at auckland.ac.nz> wrote:

> There is probably a better way, but one way is to create an ITK image then
> convert it to a VTK image:
>
> https://itk.org/ITKExamples/src/Bridge/VtkGlue/
> ConvertAnitkImageTovtkImageData/Documentation.html
>
> It is easy to create an ITK image, allocate the buffer then copy your data
> into the buffer.  Of course this requires you to have ITK installed.
> ________________________________________
> From: vtkusers <vtkusers-bounces at vtk.org> on behalf of VTKJunky <
> hadas.judah at gmail.com>
> Sent: Monday, 1 January 2018 9:24 p.m.
> To: vtkusers at vtk.org
> Subject: [vtkusers] Setting vtkImageData from regular float array
>
> I have float array which represents a 2-D image. I'd like to set it into
> vtkImageData, but can't work out how to do this. The problem is, all the
> examples use a vtkReader to read in the data, I already have the data.
>
>
> Any help would be greatly appreciated,
> Thanks!
>
>
>
>
> --
> Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html
> _______________________________________________
> 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:
> https://vtk.org/mailman/listinfo/vtkusers
> _______________________________________________
> 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:
> https://vtk.org/mailman/listinfo/vtkusers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://vtk.org/pipermail/vtkusers/attachments/20180101/109b3043/attachment.html>


More information about the vtkusers mailing list