[vtkusers] Direct access to the array of vtkImageData
Dirk Kolb
dirkkolb at gmail.com
Wed Mar 11 15:06:44 EDT 2009
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi,
thanks for the fast reply. I tested your advise but without success.
I used the
image->SetScalarComponentFromDouble(idxFreq,idxTime,0,0,value)
method, which worked without any problems. I tried the method
double* data = (double*)(image->GetScalarPointer(idxFreq,idxTime,0))
in order to check the functionality of GetScalarPointer. The results
was, that data consisted of a non initalized value, e.g. -212121412. So
is there something wrong with the assumption, that "data[0]" should be
equal to "value"?
Many thanks,
Dirk
Michael Jackson schrieb:
> 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:
>
> 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
_______________________________________________
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
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iQEVAwUBSbgLxLwE2gIA90MNAQKlPwgAhjKTDyNQ/z1iWZAq0OpOVvG1ER4CzTe/
s8wuje+MyjWPJKhzrfG7hgu+F1HxaBhMedOXCqa6RXbq1Rz9Ix1kHVar9yt3JesU
LjJSfTqOLWCH8v+Vj/vdKmDpaTmI7MXZOxRBbXeEuBGEazTsUNZc/WCBN+P03e04
XHp+dTHGlCnMGzYLudlnv+joBsIwphyhUklWaD636IBnsoreu7Pcj7O5dA/Xz8k8
iD0W8uXE7FwfIaMSO4ZeputDnS3693ZyxAFMO9bJtbqxtq3mxHDYx3O4AA1+vXiv
bBLH7kbmZEfa0lCe6x6dxxy+WDkQss9uPoDviBG2OVzn4MpSJqfwFQ==
=L3/I
-----END PGP SIGNATURE-----
More information about the vtkusers
mailing list