[Paraview] use the same scalar data to create contour and color the surface
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
Re: [Paraview] Qt QTWEBKIT library not found
Utkarsh, I rebuilt Qt with -webkit option, but cmake still dumped same errors. My Qt source is: ftp://ftp.trolltech.no/qt/source/qt-everywhere-opensource-src-4.7.4.tar.gz Comparing my Mac (able to build ParaView), I could find: QT_QTWEBKIT_INCLUDE_DIR /opt/local/include/QtWebKit QT_QTWEBKIT_LIBRARY_RELEASE /opt/local/lib/libQtWebKit.dylib So I tried to find my QtWebKit and libQtWebKit on my CentOS. I found QtWebKit in: /usr/local/include/Qt /usr/local/include/QtWebKit But no libQtWebkit was found by find command. I rebuild Qt again :( Magician On 2012/04/07, at 0:16, Utkarsh Ayachit wrote: Since you're building Qt from source, try to reconfigure and build Qt with WebKit enabled. Your configure command for QT should look something like follows: ./configure -webkit -xmlpatterns any other params Then, before Qt starts building, it spits out a block of text saying what features were enabled/disabled. Pay close attention to that. Post that piece of test if needed. That should tell you if webkit was enabled or disabled. ParaView doesn't currently support not building with WebKit support (except for using John's patch). Utkarsh ___ 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
Re: [Paraview] use the same scalar data to create contour and color the surface
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 t...@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 ___ 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
Re: [Paraview] Paraviewweb
Hi Jane, keep the prarview mailing list in the loop so anyone could contribute and learn. In your case that will be pretty simple. If you use jQuery as JavaScript library that could look like that: var sourceProxy = paraview.FindSource({name:Fluid_f2.vtk}); var representation = paraview.GetDisplayProperties({proxy: sourceProxy}); $('.my-button-class').click(function() { if($(this).toggleClass(showLabel).hasClass(showLabel)) { representation.setSelectionPointLabelVisibility(1); } else { representation.setSelectionPointLabelVisibility(0); } }); Or you can create a python script on the server side that can be called from the JavaScript. For more details on that you can read the plugin documentation of ParaViewWeb here. http://www.paraview.org/Wiki/ParaViewWeb_Plugins Seb On Sun, Apr 8, 2012 at 4:10 AM, Jane Hickmott jane.hickm...@yahoo.com wrote: Thank you, Seb. Much appreciated. Sorry I'm a novice in Javascript. Here is a python trace of what I would like to accomplish - can anyone please show me how to convert this to javascript? Many thanks. As an aside is there no way to call an external python module from within javascript? That would solve everything. Jane. try: paraview.simple except: from paraview.simple import * paraview.simple._DisableFirstRenderCameraReset() Fluid_f2 = FindSource(Fluid_f2.vtk) DataRepresentation1 = GetDisplayProperties(Fluid_f2) RenderView1 = GetRenderView() DataRepresentation1.SelectionPointLabelVisibility = 1 RenderView1.InteractionMode = 'Selection' RenderView1.CameraClippingRange = [19767.705902611211, 38094.489486240847] RenderView1.InteractionMode = '3D' Render() From: Sebastien Jourdain sebastien.jourd...@kitware.com To: Jane Hickmott jane.hickm...@yahoo.com Cc: paraview@paraview.org paraview@paraview.org Sent: Saturday, 7 April 2012, 19:29 Subject: Re: [Paraview] Paraviewweb Hi Jane, The best thing to do to figure out what is needed in your use case, is to load your state inside ParaView and do the action that you want to achieve while the Python trace is recording your changes. Once you get the trace of your actions you can either convert that code to JavaScript or write a plugin that execute somehow the same action in Python as we are using python to write ParaViewWeb plugins. The access of the trace mechanism is inside the Tools menu of ParaView. If you need some help to figure out the conversion between Python and JS, just post the trace on the mailing list. I'm glad you managed to produce your own first Web application using ParaViewWeb. Seb On Sat, Apr 7, 2012 at 6:44 AM, Jane Hickmott jane.hickm...@yahoo.com wrote: Hi Paraview community! I am trying to develop a paraviewweb application that involves loading of a state file plus the creation of a 'button' to allow data labels to appear on the plot. I can load the state file but have no idea how to create the necessary button and functionality. I would be grateful to anyone kind enough to give me a few pointers. Thank you. Jane ___ 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 ___ 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
Re: [Paraview] use the same scalar data to create contour and color the surface
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 t...@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 ___ 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
Re: [Paraview] Paraviewweb
Hi Seb, Thank you for your help. However, your code appears to only toggle 'SelectionPointLabelVisibility' on/off. What I really need is the equivalent of 'select points on' button as on the GUI that will enable me to interactively select an area on the plot to display labels on. I can do this easily interactively, but the python trace appears not to record all of the clicks. There is something I'm missing... Frustrated... :( Jane. From: Sebastien Jourdain sebastien.jourd...@kitware.com To: Jane Hickmott jane.hickm...@yahoo.com Cc: paraview@paraview.org Sent: Sunday, 8 April 2012, 14:44 Subject: Re: [Paraview] Paraviewweb Hi Jane, keep the prarview mailing list in the loop so anyone could contribute and learn. In your case that will be pretty simple. If you use jQuery as JavaScript library that could look like that: var sourceProxy = paraview.FindSource({name:Fluid_f2.vtk}); var representation = paraview.GetDisplayProperties({proxy: sourceProxy}); $('.my-button-class').click(function() { if($(this).toggleClass(showLabel).hasClass(showLabel)) { representation.setSelectionPointLabelVisibility(1); } else { representation.setSelectionPointLabelVisibility(0); } }); Or you can create a python script on the server side that can be called from the JavaScript. For more details on that you can read the plugin documentation of ParaViewWeb here. http://www.paraview.org/Wiki/ParaViewWeb_Plugins Seb On Sun, Apr 8, 2012 at 4:10 AM, Jane Hickmott jane.hickm...@yahoo.com wrote: Thank you, Seb. Much appreciated. Sorry I'm a novice in Javascript. Here is a python trace of what I would like to accomplish - can anyone please show me how to convert this to javascript? Many thanks. As an aside is there no way to call an external python module from within javascript? That would solve everything. Jane. try: paraview.simple except: from paraview.simple import * paraview.simple._DisableFirstRenderCameraReset() Fluid_f2 = FindSource(Fluid_f2.vtk) DataRepresentation1 = GetDisplayProperties(Fluid_f2) RenderView1 = GetRenderView() DataRepresentation1.SelectionPointLabelVisibility = 1 RenderView1.InteractionMode = 'Selection' RenderView1.CameraClippingRange = [19767.705902611211, 38094.489486240847] RenderView1.InteractionMode = '3D' Render() From: Sebastien Jourdain sebastien.jourd...@kitware.com To: Jane Hickmott jane.hickm...@yahoo.com Cc: paraview@paraview.org paraview@paraview.org Sent: Saturday, 7 April 2012, 19:29 Subject: Re: [Paraview] Paraviewweb Hi Jane, The best thing to do to figure out what is needed in your use case, is to load your state inside ParaView and do the action that you want to achieve while the Python trace is recording your changes. Once you get the trace of your actions you can either convert that code to JavaScript or write a plugin that execute somehow the same action in Python as we are using python to write ParaViewWeb plugins. The access of the trace mechanism is inside the Tools menu of ParaView. If you need some help to figure out the conversion between Python and JS, just post the trace on the mailing list. I'm glad you managed to produce your own first Web application using ParaViewWeb. Seb On Sat, Apr 7, 2012 at 6:44 AM, Jane Hickmott jane.hickm...@yahoo.com wrote: Hi Paraview community! I am trying to develop a paraviewweb application that involves loading of a state file plus the creation of a 'button' to allow data labels to appear on the plot. I can load the state file but have no idea how to create the necessary button and functionality. I would be grateful to anyone kind enough to give me a few pointers. Thank you. Jane ___ 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 ___ 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
Re: [Paraview] Paraviewweb
Ok, I miss understood your goal. Then, the missing part should be something like that. var view = paraview.GetRenderView(); // this is optional if you already have a reference to the view... view.setInteractionMode(2); Although, I've quickly tried it online with firebug and I did not manage to see the selection. I'm wondering if we are both missing something here... Like the creation of a selection proxy that is created to get the selected screen area and convert it to a set of cellId... Utkarsh might have a better insight on that selection part. Seb PS: Here is the mapping based on the string values file: ParaView-SRC/ParaViewCore/ServerImplementation/Resources/views_and_representations.xml IntVectorProperty name=InteractionMode command=SetInteractionMode number_of_elements=1 default_values=0 EnumerationDomain name=enum Entry text=3D value=0 / Entry text=2D value=1 / Entry text=Selection value=2 / /EnumerationDomain /IntVectorProperty On Sun, Apr 8, 2012 at 12:43 PM, Jane Hickmott jane.hickm...@yahoo.com wrote: Hi Seb, Thank you for your help. However, your code appears to only toggle 'SelectionPointLabelVisibility' on/off. What I really need is the equivalent of 'select points on' button as on the GUI that will enable me to interactively select an area on the plot to display labels on. I can do this easily interactively, but the python trace appears not to record all of the clicks. There is something I'm missing... Frustrated... :( Jane. From: Sebastien Jourdain sebastien.jourd...@kitware.com To: Jane Hickmott jane.hickm...@yahoo.com Cc: paraview@paraview.org Sent: Sunday, 8 April 2012, 14:44 Subject: Re: [Paraview] Paraviewweb Hi Jane, keep the prarview mailing list in the loop so anyone could contribute and learn. In your case that will be pretty simple. If you use jQuery as JavaScript library that could look like that: var sourceProxy = paraview.FindSource({name:Fluid_f2.vtk}); var representation = paraview.GetDisplayProperties({proxy: sourceProxy}); $('.my-button-class').click(function() { if($(this).toggleClass(showLabel).hasClass(showLabel)) { representation.setSelectionPointLabelVisibility(1); } else { representation.setSelectionPointLabelVisibility(0); } }); Or you can create a python script on the server side that can be called from the JavaScript. For more details on that you can read the plugin documentation of ParaViewWeb here. http://www.paraview.org/Wiki/ParaViewWeb_Plugins Seb On Sun, Apr 8, 2012 at 4:10 AM, Jane Hickmott jane.hickm...@yahoo.com wrote: Thank you, Seb. Much appreciated. Sorry I'm a novice in Javascript. Here is a python trace of what I would like to accomplish - can anyone please show me how to convert this to javascript? Many thanks. As an aside is there no way to call an external python module from within javascript? That would solve everything. Jane. try: paraview.simple except: from paraview.simple import * paraview.simple._DisableFirstRenderCameraReset() Fluid_f2 = FindSource(Fluid_f2.vtk) DataRepresentation1 = GetDisplayProperties(Fluid_f2) RenderView1 = GetRenderView() DataRepresentation1.SelectionPointLabelVisibility = 1 RenderView1.InteractionMode = 'Selection' RenderView1.CameraClippingRange = [19767.705902611211, 38094.489486240847] RenderView1.InteractionMode = '3D' Render() From: Sebastien Jourdain sebastien.jourd...@kitware.com To: Jane Hickmott jane.hickm...@yahoo.com Cc: paraview@paraview.org paraview@paraview.org Sent: Saturday, 7 April 2012, 19:29 Subject: Re: [Paraview] Paraviewweb Hi Jane, The best thing to do to figure out what is needed in your use case, is to load your state inside ParaView and do the action that you want to achieve while the Python trace is recording your changes. Once you get the trace of your actions you can either convert that code to JavaScript or write a plugin that execute somehow the same action in Python as we are using python to write ParaViewWeb plugins. The access of the trace mechanism is inside the Tools menu of ParaView. If you need some help to figure out the conversion between Python and JS, just post the trace on the mailing list. I'm glad you managed to produce your own first Web application using ParaViewWeb. Seb On Sat, Apr 7, 2012 at 6:44 AM, Jane Hickmott jane.hickm...@yahoo.com wrote: Hi Paraview community! I am trying to develop a paraviewweb application that involves loading of a state file plus the creation of a 'button' to allow data labels to appear on the plot. I can load the state file but have no idea how to create the necessary button and functionality. I would be grateful to anyone kind enough to give me a few pointers. Thank you. Jane ___ Powered by www.kitware.com Visit
Re: [Paraview] use the same scalar data to create contour and color the surface
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 t...@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 t...@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
Re: [Paraview] use the same scalar data to create contour and color the surface
On Sun, Apr 8, 2012 at 4:35 PM, Tom Schoenemann t...@indiana.edu wrote: Thanks Cory, The file you sent won't open in my Paraview. It does not recognize the extension (?). That's odd. Did you load it through the File - Load State menu item? I didn't mention that's what you needed to do to load that file, but in any case, it sounds like you were able to apply my suggestion, albeit not with the outcome I had hoped. 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? That is strange. As far as I know, there should be no rescaling or even any recasting performed on the inputs to the Append Attributes filter. At least I can't think of a reason there would need to be; ParaView (actually, the VTK library underneath ParaView) supports images with scalar fields with different component types. One thing to try would be to put a calculator filter on your second image and creating an Append Attributes filter on the outputs of both calculators. The output from the calculator filters consists of double arrays, so if the Append Attributes filter has a problem with different array types, then putting both your images through a calculator filter should fix that. If you are able to post example data, I could give it a try and see what is going on. 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? Once you've created the contour, you can select it in the pipeline browser (if it is not already selected), click on the Display tab, find the Color panel, and choose the scalar field by which you want to color the surface from the Color by menu. Cory 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 t...@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
Re: [Paraview] use the same scalar data to create contour and color the surface
Thanks Cory, I did not know about Load State! My bad… I was indeed able to load it. I still have problems with the data range being truncated, even if I do the calculator step on both files. For example, on your Wavelet1 and Wavelet2 files, the data ranges are: 37.3531 to 276.829. This stays the same for the calculator step (highlighting Calculator1 and looking at the Information Tab), as well as the AppendAttributes step (again, as listed in the Information tab). However, when I do contour, and create the contour (pressing apply), then go to the Information tab, the data range is now 157.091 to 157.091. Thus, the range is lost, and the color coding is not what I'd want. Is this what you also get on your machine? I've discovered that it has something to do with the Isosurfaces value ranges. If I leave the default value there (which for your data is 157.091), then the range in the other scalar is truncated to exactly this value: 157.091 (i.e., no range). But if I delete all and then New range (and accept the 10 default values it lists), then the range of the remaining scalars extends at least to the next-to-last values on each end of the range. This makes absolutely no sense to me, but there may be a reason for it? I don't have enough knowledge of Paraview to know if this is a bug or if it is supposed to do this for some reason. In any case, for my data, I got it to work by using a binary image of my surface (a brain endocast) and then AppendAttributes this to the stat data file. For the binary image, I get the full range of stat values if I set the Isosurfaces range value to 1. It works, but I don't know why. In any case, thank you very much for helping me with this!! I'd attach a copy of the file if you want to take a look, but it is 52 MB. I can post it if you are interested, but I seem to get the same odd behavior with your data too. -Tom On Apr 8, 2012, at 8:39 PM, Cory Quammen wrote: On Sun, Apr 8, 2012 at 4:35 PM, Tom Schoenemann t...@indiana.edu wrote: Thanks Cory, The file you sent won't open in my Paraview. It does not recognize the extension (?). That's odd. Did you load it through the File - Load State menu item? I didn't mention that's what you needed to do to load that file, but in any case, it sounds like you were able to apply my suggestion, albeit not with the outcome I had hoped. 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? That is strange. As far as I know, there should be no rescaling or even any recasting performed on the inputs to the Append Attributes filter. At least I can't think of a reason there would need to be; ParaView (actually, the VTK library underneath ParaView) supports images with scalar fields with different component types. One thing to try would be to put a calculator filter on your second image and creating an Append Attributes filter on the outputs of both calculators. The output from the calculator filters consists of double arrays, so if the Append Attributes filter has a problem with different array types, then putting both your images through a calculator filter should fix that. If you are able to post example data, I could give it a try and see what is going on. 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? Once you've created the contour, you can select it in the pipeline browser (if it is not already selected), click on the Display tab, find the Color panel, and choose the scalar field by which you want to color the surface from the Color