[vtkusers] Basic question, vtkStructuredPoints
Oeyvind Knudsen
knudsen at operamail.com
Thu Feb 12 10:12:20 EST 2004
----- Original Message -----
From: "Oeyvind Knudsen" <knudsen at operamail.com>
Date: Thu, 12 Feb 2004 16:09:43 +0100
To: "REGAT-BARREL Aurélien" <arbvtk at yahoo.fr>
Subject: Re: [vtkusers] Basic question, vtkStructuredPoints
> Hi!
>
> Looks like a bit more detailed description of the work done is required. The data is read in from a different place in the program. It is read in from an octave file and stored in a matrix (list in list). This matrix is fed into my visualization code and is called self.data.
> From there self.scalars takes over:
>
> self.scalars = []
> for i in range(len(self.data)):
> self.scalars = self.scalars + list(self.data[i])
>
> The scalars were then fed into a file via PyVTK:
>
> vtk = VtkData(StructuredPoints([len(self.data[0]), len(self.data),1]), PointData(Scalars(self.scalars, 'Scalars0', 'default')), 'data')
>
> filename = os.path.join(Config.homedir, Config.scicraftuserdir)
> filename = os.path.join(filename, "surfaceData.vtk")
> vtk.tofile(filename)
>
> Right after this the file is read with the vtkStructuredPointsReader and the data is returned as vtkStructuredPoints which is rendered fine.
> All I wanted to do was to skip the whole file- in and out process and construct the vtkStructuredPoints object directly with the data already at my disposal. The thing I forgot to mention in my first posts was that the python data has always been accessible to the class as a matrix, and it must continue to do so, the problem is that I had to write/read to a file to construct the vtkStructuredPoints successfully from it.
>
> Regards,
> Øyvind Knudsen
>
> ----- Original Message -----
> From: REGAT-BARREL Aurélien <arbvtk at yahoo.fr>
> Date: Thu, 12 Feb 2004 13:09:55 +0100 (CET)
> To: Oeyvind Knudsen <knudsen at operamail.com>
> Subject: Re: [vtkusers] Basic question, vtkStructuredPoints
>
> > Hello,
> > Can you past few lines of your self.scalars declaration. My soft is currently working on data which size is 512x121x60. It is read from a custom format, and files are about 15Mo. Reading the data is very fast and need less than 1 sec. It is done in C++ and the code is not efficient at all (byte by byte). I think vtk readers are much faster. Do you have performance issues with vtk readers ? By the way, your (big) Python source file also needs to be read from disk...So, IMHO, it would be better to keep your vtk data file, to read it when your Python file is loaded and keep the vtk object in memory ready to be used later.
> > Good luck.
> >
> > Aurélien REGAT-BARREL
> >
> > Oeyvind Knudsen <knudsen at operamail.com> wrote:
> > 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
> >
> >
> > ---------------------------------
> > 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
--
_____________________________________________________________
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