[vtkusers] Modifying the vtkDataSet Object

David Doria daviddoria+vtk at gmail.com
Wed Dec 16 11:59:29 EST 2009


On Wed, Dec 16, 2009 at 10:26 AM, Naveen <a1naveen at gmail.com> wrote:
> Hi David,
> Thanks for helping me out. We are working on 3D Visualization Software
> called VisIt, which uses vtk. We have created a module for tracking features
> in 3D time varying datasets. Now, we need to track 2D datasets too, so we
> have to reconstruct a 3D structure from this 2D structure, since our module
> works only for 2D. So for this constructions, we have a 2D dataset with
> dimensions 384*256, there Z = 0, so we would like to stack together the same
> data from 384*256 points into different layers, like Z = 1 and so on. The
> number of such slices in the stack can by anything greater than 1.  All the
> slices have same values and X, Y coordinates, only the Z coordinates
> changes. In our dataset (384 * 256) there 97665 POINT_DATA values, so to
> make this a 3D dataset, we need to set Z-Dimension as 2, and give the values
> for those them as Z=0 and Z=1. And then i need to add 97665 POINT_DATA
> values to the existing object.
> The 3D visualization software, we are using just gives us the data as
> vtkDataSet object, so i need to modify the information in this object.  I
> can create an object of vtkRectilinearGrid as it is derived from vtkDataSet,
> then i can change its coordinate values and dimension, but what i am not
> able to understand is to change POINT_DATA values, i could not find any
> method like SetPointData(). How can I do this?
> I hope this makes some sense to you,
> Thanks,
> Naveen
>
> Message: 29
> Date: Tue, 15 Dec 2009 19:06:17 -0500
> From: David Doria <daviddoria+vtk at gmail.com>
> Subject: Re: [vtkusers] Modifying the vtkDataSet Object
> Cc: vtkusers at vtk.org
> Message-ID:
>        <c19fcadc0912151606k4f6c68d5yd504585f678955da at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> On Tue, Dec 15, 2009 at 6:54 PM, Naveen <a1naveen at gmail.com> wrote:
>> Hi,
>>
>> I am having some trouble modifying vtkDataSet object and would like to
>> know
>> how to proceed with the task. I have an object of vtkDataset having 97665
>> POINT_DATA values (2D) and the dimensions as (384, 256). Now we want to
>> convert this into 3D, so i have to add an additional Z coordinate to it.
>> In
>> order to do that, I want to add atleast 1 more layer on Z axis i.e add
>> 384*256 more POINT_DATA values to the existing vtkDataSet object. How can
>> I
>> do this modification?
>>
>> Thank you,
>> Naveen

Naveen,

Let's keep the discussion on the mailing list so everyone can benefit/help.

Jermoe had suggested:
"if your data are 2D grids, such as images, you can try to convert
your DataSet into ImageData and then pass them through vtkImageAppend
by setting the AppendAxis to 2 (z-axis)."

Did you try that? Also, I'm not sure if I follow this POINT_DATA that
you are talking about?

Thanks,

David



More information about the vtkusers mailing list