[vtkusers] Basic question, vtkStructuredPoints
Oeyvind Knudsen
knudsen at operamail.com
Thu Feb 12 05:53:10 EST 2004
Hi!
self.scalars is a long list declared from another place in the program. Actually it is read in by an octave file format reader (the data is originally in octave format) that puts it into a Numeric array.
The dimensions 81×81×1 is just an example, and the size of the data can vary dramatically. With that relatively small size, file access doesn't take a very long time, but then again it doesn't consume a lot of memory either. I want memory access to be the default as people tend to have quite alot of memory in these days. The file access strategy could be a secondary choice in the future.
But as my stratgey doesn't seem to work and your solution included some nasty looping, I guess I have to sit down and do some more precise timing and resource measurements.
I thank you for your input, it is very much appreciated. By the way, the program I'm working on is called SciCraft (www.scicraft.org)
Regards,
Øyvind Knudsen
----- Original Message -----
From: REGAT-BARREL Aurélien <arbvtk at yahoo.fr>
Date: Thu, 12 Feb 2004 02:14:39 +0100 (CET)
To: Oeyvind Knudsen <knudsen at operamail.com>
Subject: Re: [vtkusers] Basic question, vtkStructuredPoints
> Hello,
> Can you show us how is declared self.scalars ? Keep in mind that if you win CPU time by skipping file access, you lose memory place by having your data loaded in Python. I don't really know how the wrapping layer & SetVoidArray work, but I would not be surprised to learn that the data are duplicated by VTK.
> Is it so slow to load your 81x81x1 object ?
>
> Aurélien REGAT-BARREL
>
> Oeyvind Knudsen <knudsen at operamail.com> wrote:
> Hi!
> Thanks for the tip. Actually, I tried something similar:
>
> spData = vtkStructuredPoints()
> spData.SetDimensions(81, 81, 1)
> spData.SetOrigin(0.0, 0.0, 0.0)
> spData.SetSpacing(1.0, 1.0, 1.0)
> pData = spData.GetPointData()
> dArray = vtkDoubleArray()
> dArray.SetName("double Array")
> dArray.SetVoidArray("self.scalars", len(self.scalars), 1)
> pData.SetScalars(dArray)
>
> (self.scalars is the array of data given as argument)
>
> Would this be similar to your suggestion? The problem here is that the resulting object spData, does not look like the vtkStructuredPoints object obtained from the file at all.
> In fact the object given from the file reader looks quite empty, with no point data, no array, no nothing, not even the dimensions set correctly. Despite that, the surface is rendered.
>
> ---------------------------------
> Yahoo! Mail : votre e-mail personnel et gratuit qui vous suit partout !
Créez votre Yahoo! Mail
--
_____________________________________________________________
Web-based SMS services available at http://www.operamail.com.
>From your mailbox to local or overseas cell phones.
Powered by Outblaze
More information about the vtkusers
mailing list