[Paraview] use the same scalar data to create contour and color the surface

Tom Schoenemann toms at indiana.edu
Sun Apr 8 16:35:43 EDT 2012


Thanks Cory,

The file you sent won't open in my Paraview. It does not recognize the extension (?).  

I followed what you suggested, however:

1) Loaded the first file and selected "apply".  This file has only binary scalars (0=background, 1=surface)
2) Selected calculator and created a function that consisted of: "scalars*1", to be renamed "surface location"; pressed "apply" again
3) Loaded the second file and selected "apply"  This file has float scalar values ranging from 0 to 10.7
4) control-selected both the calculator and second file, and then selected "Append Attributes"; and pressed "apply" again.  This resulted in 3 new items in the pipeline, all called AppendAttributes1.  The one at the bottom had a box icon (the other two had only arrows).  

When I click on the bottom AppendAttributes1 file and look at the information tab, it says it has 2 data arrays.  One is a double called "surface location" (matching what I thought I created in step 2 above), and has value range of 0 to 1 (which is correct).  However, the other one, which I assume is the one from the file loaded in step 3 above, now has a range of only 0 to 1 also (not 0 to 10.7, like it should).  So either it is doing something odd (like rescaling data??) or it got that data elsewhere?  Why is it doing this?

If I then compute a contour based on the "surface location" array in AppendAttributes1, I get the surface I expect to see.

But the other array data is not any good (it isn't 0 to 10.7 anymore).  Even if it was, what exactly would I do then to color the surface with this other array?  Is that done with another filter?  Or is it done in the contour image?

Thanks for any further help!

-Tom

On Apr 8, 2012, at 10:22 AM, Cory Quammen wrote:

> Tom,
> 
> You can load your two images and, assuming they are the same size, use
> the Append Attributes filter to combine them. However, chances are
> good that the scalars in your image data will have the same name,
> meaning that Append attributes will grab only the scalar values from
> one of the images. To get around this limitation, you can "rename" the
> scalar field in one image by using a Calculator filter on it and
> setting the "Result Array Name" to something else. Your pipeline will
> look like this *before* applying the Append Attributes filter:
> 
> Image1
> ---|
>   Calculator1
> Image2
> 
> To apply the Append Attributes filter, select the Calculator1 filter
> and Image2. Use Ctrl-click on Windows to select more than one object
> in the pipeline browser. Then select Append Attributes from the
> Filters menu under the Alphabetical submenu.
> 
> Now you should have two scalar fields in an image data. You can use
> one to do the contouring and the other to do the pseudo-coloring.
> 
> I've attached a state file with two Wavelet sources in place of image
> inputs. It illustrates what I've described here.
> 
> Hope that helps,
> Cory
> 
> 
> On Sun, Apr 8, 2012 at 9:45 AM, Tom Schoenemann <toms at indiana.edu> wrote:
>> OK, but is there some way to combine two image files, each with its own
>> scalars, into one image?  What I'm thinking about is reading in 2 copies of
>> the same image, and using the scalars from one to display the contour, and
>> the scalars from the other to display the colors?  I tried doing this, but I
>> can't get it to work. I loaded one as the contour, and colored it one color
>> only (white).  I then added the copy, an tried to view it as a volume.  It
>> let me change the color map parameters, but it seems to display the color
>> UNDERNEATH the first one (that has the contour.  I'm sure there must be a
>> way to do this, but how?
>> 
>> Perhaps there is a way to add 2 scalar fields to one image? Maybe image
>> calculator could do this??
>> 
>> -Tom
>> 
>> On Apr 8, 2012, at 8:30 AM, Cory Quammen wrote:
>> 
>> Tom,
>> 
>> An isosurface by definition has the same scalar value everywhere on
>> the surface, so what you describe happening is exactly what should
>> happen, unless I misunderstand. You could contour by one scalar field
>> and color by another scalar field and expect to see different colors,
>> but if you try to color by the same scalar, you should expect to see
>> only one color on the surface.
>> 
>> Cory
>> 
>> On Sun, Apr 8, 2012 at 3:38 AM, Tom Schoenemann <toms at indiana.edu> wrote:
>> 
>> I have a single volume dataset that has scalar values only on a surface, and
>> 
>> zeros everywhere else.  The scalar values represent statistics we have
>> 
>> calculated for each point on a surface.  I've been able using the contour
>> 
>> filter to create an isosurface from this dataset, but I can't get the
>> 
>> surface to display anything other than a single color.  I have tried setting
>> 
>> "contour by" to "compute normals" and "compute scalars", and then going to
>> 
>> "display" and choosing "color by" scalars.  However, only a single value is
>> 
>> allowed.  I have tried unselecting "automatically rescale to fit data range"
>> 
>> and then entering my own range, but only my minimum value is accepted (even
>> 
>> if I enter a different value for the maximum).
>> 
>> 
>> Perhaps I am using paraview the wrong way, but I have to say, it isn't
>> 
>> intuitive.  Is there a way to use the same scalar data (same file) to both:
>> 
>> 1) create a surface, and 2) color code the surface based on the same scalar
>> 
>> values?
>> 
>> 
>> Thanks for any hints or suggestions.
>> 
>> 
>> -Tom
>> 
>> 
>> 
>> _______________________________________________
>> 
>> 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 ParaView Wiki at:
>> 
>> http://paraview.org/Wiki/ParaView
>> 
>> 
>> Follow this link to subscribe/unsubscribe:
>> 
>> http://www.paraview.org/mailman/listinfo/paraview
>> 
>> 
>> 
>> 
>> 
>> --
>> Cory Quammen
>> Research Associate
>> Department of Computer Science
>> The University of North Carolina at Chapel Hill
>> 
>> 
>> 
> 
> 
> 
> -- 
> Cory Quammen
> Research Associate
> Department of Computer Science
> The University of North Carolina at Chapel Hill
> <AppendAttributesExample.pvsm>

_________________________________________________
P. Thomas Schoenemann

Associate Professor
Department of Anthropology
Indiana University
Bloomington, IN  47405
Phone: 812-855-8800
E-mail: toms at indiana.edu

Open Research Scan Archive (ORSA) Co-Director
Consulting Scholar
Museum of Archaeology and Anthropology
University of Pennsylvania

Homepage: http://mypage.iu.edu/~toms/









-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20120408/db09a7a5/attachment-0001.htm>


More information about the ParaView mailing list