Two for two! Thanks...
Terry J. Ligocki
tjligocki at lbl.gov
Tue Oct 5 12:17:31 EDT 1999
Well, I'm impressed. I received several answers to both questions
I posted yesterday (more details below) and I was able to solve both my
problems using these answers! Talk about service with a smile, :-).
My first question was: How do I do arithmetic manipulations and data
type conversion of scalars associated with structured points? Both Matt
Clarkson and Charles Law pointed me in the right direction. They noted
that "vtkStructuredPoints" and "vtkImageData" are closely related. In
some versions of Vtk it was necessary to convert between these but in
the version I'm using (Vtk 2.3) it isn't. Thus, I can use all the
"vtkImageData" filters which in some cases also let you change data
types, "SetOutputScalarTypeTo..." (I needed "vtkImageShiftScale" in my
specific case). The data type conversion can also be done with
"vtkImageCast". I've tried this out and it worked perfectly!
My second question was: How can I warp a 2D plane using one set of
scalars (I knew how to do this) and color it using a different set of
scalars (I didn't know how to do this)? In both cases I had the scalars
as "vtkStructuredPoints" in 3D (dim z = 1, z = 0). Charles Law
suggested:
... set up reading of height and temp and set up warping...
read_temp->Update();
warp_height->Update();
warp_height->GetOutput()->GetPointData()->SetScalar(read_temp->GetOutput()->GetPointData()->GetScalar());
What a mouthful! He also noted that this breaks the pipeline and has
all the drawbacks that implies. In any case, with this caveat it worked
wonderfully!
Charles suggested that the correct solution (i.e. without breaking the
pipeline) might be to carry the temperature along as "Field Data" in the
structured points that held the height scalars and then move/copy the
"Field Data" to the "Scalars" at the right moment. I haven't tried this
yet as I don't know much about "Field Data" and the ways it can be
manipulated! I'll look into this and if it seems useful, I'll report
what I found.
Thanks again to everyone who responded to my questions! This e-mail
list has been a very useful resource...
Terry J. (Ligocki, tjligocki at lbl.gov)
-----------------------------------------------------------------------------
This is the private VTK discussion list. Please keep messages on-topic.
Check the FAQ at: <http://www.automatrix.com/cgi-bin/vtkfaq>
To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
<majordomo at gsao.med.ge.com>. For help, send message body containing
"info vtkusers" to the same address. Live long and prosper.
-----------------------------------------------------------------------------
More information about the vtkusers
mailing list