[vtkusers] Direct access to the array of vtkImageData

Michael Jackson mike.jackson at bluequartz.net
Wed Mar 11 11:40:22 EDT 2009


vtkImageData* image = vtkImageData::New();
// Set the data type, allocate  all the data and stuff like that

double* data = (double*)(image->GetScalarPointer());

untested but should work.
_________________________________________________________
Mike Jackson                  mike.jackson at bluequartz.net
BlueQuartz Software                    www.bluequartz.net
Principal Software Engineer                  Dayton, Ohio



On Mar 11, 2009, at 11:23 AM, Dirk Kolb wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hello,
>
> I hope this is the right forum for my question. This is my first time
> with VTK.
>
> I need some hints for the following problem:
>
> I implemented a viewer for the presentation of spectral data.  
> Therefore
> I used the vtkImageViewer together with the vtkImageData. I get the
> spectral data in form of a double valued matrix (1000,4096). The  
> content
> of the matrix and also of the vtkImageData is time dependend. This  
> means
> the content of  e.g. the 100th line is in the next time step the  
> content
> of the 99th line and so on. The first line of the array is dropped  
> and a
> new line is pushed back.
>
> Is there a possibility for a fast implemtation? In my opinion I need  
> the
> direct access to the data array of a vtkImageData?
>
> Thanks in advance,
>
> Dirk
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.7 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iQEVAwUBSbfXgbwE2gIA90MNAQLcxQf+LD47juTxOex3YUh1Zqh4it5Qdm50HyGA
> 104KMNratrgXkCfe6mfe3lc4OMne9cmIyFHN45uHWDZmbuue5K4mCVs2osGs/qwI
> hAoRqU2/PUJlgPk2houmbL0jHOG7RiSFvajMjKz4rHnklx1rueq85Om55VwrGp3c
> Ds8jDJaiSfRdjZle2y+WW6b2uulX1jOP5qtGTN+DeCaoXTzdgOXKkxc1TNF5TPsC
> 2XXb6qMf3V+rI7U6m54QOpuAjjM8BHqyDLL/reaA+jBMg7tinieR0pLNG27TmUNW
> 7ZKTPJGNm+wtBnDw5SN5lJsT1oTGtpHFqEmNkTrId6JmGnit68TNJw==
> =7a6A
> -----END PGP SIGNATURE-----
> _______________________________________________
> 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
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers




More information about the vtkusers mailing list