Re: [Paraview] Plot selection over time for threshold
Hi Ken This is EXACTLY what I wanted! Thank you so much. Is it possible to create a custom filter to do this, so that I dont have to follow these steps? Jairaj Mathur Mechanical Engineering Washington University in St Louis On Jan 8, 2018 2:23 PM, "Moreland, Kenneth"wrote: > Jairaj, > > > > I’m not sure what exactly you mean by “the threshold,” but there are many > ways to plot the average of a threshold-selection of cells over time. > > > > The most straightforward way is to open up the Find Data dialog box, > select the cells you want to plot, and then create a Plot Selection Over > Time filter. Specifically, here are steps that will do such a plot: > > > >1. Open your data in ParaView. Apply. >2. Open the Find Data dialog box (Edit → Find Data or click the >toolbar button on the top toolbar). >3. In the top row, set the left combo box to either “Cell(s)” or >“Point(s)” depending on whether your data is cell or point data. In the >longer combo box to the right, make sure that your data is selected. >4. In the second row, set the left combo box to the field you want to >threshold on. Change the next combo box to say “is between”. This will >create to text edit boxes where you enter the minimum and maximum values of >your threshold range. >5. Click the “Run Selection Query” button. This will select all cells >or points matching your threshold. >6. Click the “Plot Selection Over Time” at the bottom of the Find Data >dialog box. This will create a filter in the pipeline browser. >7. Close the Find Data dialog box and click the Apply button. > > > > -Ken > > > > *From:* ParaView [mailto:paraview-boun...@paraview.org] *On Behalf Of *Jairaj > Mathur > *Sent:* Friday, January 5, 2018 4:53 PM > *To:* paraview > *Subject:* [EXTERNAL] [Paraview] Plot selection over time for threshold > > > > Dear all > > > > How can I plot the average over time of only the threshold cells? It > should only average the cells that are within the threshold. > > > > Thanks a lot! > > > > -- > > Jairaj Mathur, > Mechanical Engineering > > Washington University in St Louis > > > ___ 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 Search the list archives at: http://markmail.org/search/?q=ParaView Follow this link to subscribe/unsubscribe: https://paraview.org/mailman/listinfo/paraview
Re: [Paraview] ParaView - Variables and different Time Steps
Carolin, Check this post out: https://blog.kitware.com/improved-vtk-numpy-integration-part-5/ The input to your filter as a vtkMultiBlockDataSet with each block being a timestep, you can access individual arrays as described in the post or you can use the following approach: from paraview.vtk.numpy_interface import dataset_adapter as dsa dataset_time0 = dsa.WrapDataObject(inputs[0].GetBlock(0)) dataset_time1 = dsa.WrapDataObject(inputs[0].GetBlock(1)) etc. Utkarsh On Thu, Jan 11, 2018 at 5:34 AM, Carolin Helbigwrote: > Dear Utkarsh, > > thank you very much for your help. It looks like it would work for my case, > but I have some more question. How can I access the different time steps in > the programmable filter? I thought they are the inputs (inputs[0], > inputs[1], ...), but that doesn't work. > > Thanks again! > > Carolin. > > > > Am 10.01.2018 um 16:06 schrieb Utkarsh Ayachit: >> >> The easiest way to do such a thing is as follows: >> >> 1. Apply Extract TimeSteps filter to your reader/source to choose the >> timesteps of interest. >> 2. Apply Group TimeSteps filter to it to group the timesteps extracted >> in (1) into a mutliblock dataset with 1 block for each selected >> timestep in order. >> 3. Now add your programmable filter to (2) and you can access all >> timesteps of interest as blocks in your input. >> >> You can skip (1) if you want to use all timesteps, and not just a subset. >> >> Utkarsh >> >> On Wed, Jan 10, 2018 at 4:56 AM, Carolin Helbig >> wrote: >>> >>> Dear ParaView team, >>> >>> I read a post at the ParaView website concerning variables and different >>> time steps (see >>> https://public.kitware.com/pipermail/paraview/2014-May/031054.html). I >>> have >>> a similar problem and I want to access values from different time steps >>> using the programmable filter with multiple inputs. I unfortunately have >>> no >>> idea how to access other time steps using the programmable filter. Could >>> you >>> give me some advice or a hint where I can find detailed information about >>> that issue? I would be very happy if you could help me. >>> >>> Best regards, >>> Carolin. >>> >>> -- >>> Dr. Carolin Helbig >>> Department Umweltinformatik >>> Helmholtz-Zentrum für Umweltforschung GmbH - UFZ >>> Permoserstraße 15 I 04318 Leipzig >>> Tel.: +49 341 235 - 1032 >>> Email: carolin.hel...@ufz.de >>> WWW: http://www.ufz.de >>> https://www.ufz.de/index.php?en=31616 >>> >>> >>> Sitz der Gesellschaft >>> Registergericht: Amtsgericht Leipzig >>> Handelsregister Nr.: B 4703 >>> Vorsitzender des Aufsichtsrats: MinDirig Wilfried Kraus >>> Wissenschaftlicher Geschäftsführer: Prof. Dr. Dr. h.c. Georg Teutsch >>> Administrative Geschäftsführerin: Prof. Dr. Heike Graßmann >>> >>> ___ >>> 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 >>> >>> Search the list archives at: http://markmail.org/search/?q=ParaView >>> >>> Follow this link to subscribe/unsubscribe: >>> https://paraview.org/mailman/listinfo/paraview > > > -- > Dr. Carolin Helbig > Department Umweltinformatik > Helmholtz-Zentrum für Umweltforschung GmbH - UFZ > Permoserstraße 15 I 04318 Leipzig > Tel.: +49 341 235 - 1032 > Email: carolin.hel...@ufz.de > WWW: http://www.ufz.de > https://www.ufz.de/index.php?en=31616 > > > Sitz der Gesellschaft > Registergericht: Amtsgericht Leipzig > Handelsregister Nr.: B 4703 > Vorsitzender des Aufsichtsrats: MinDirig Wilfried Kraus > Wissenschaftlicher Geschäftsführer: Prof. Dr. Dr. h.c. Georg Teutsch > Administrative Geschäftsführerin: Prof. Dr. Heike Graßmann > ___ 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 Search the list archives at: http://markmail.org/search/?q=ParaView Follow this link to subscribe/unsubscribe: https://paraview.org/mailman/listinfo/paraview
Re: [Paraview] CS Wrapper for plugins ignores preprocessor variable
Two approaches: 1. put the two is separate headers and pick the approach header based on if _DETAILED was defined at cmake configure time. 2. change header as follows: #ifndef __VTK_WRAP__ #ifdef __DETAILED #define vtkAlgorithm vtkMultiBlockDataSetAlgorithm #else #define vtkAlgorithm vtkRectilinearGridAlgorithm #endif #endif class ... MyPlugin: public vtkAlgorithm { static MyPlugin* New(); vtkTypeMacro(MyPlugin, vtkRectilinearGridAlgorithm); #ifndef __VTK_WRAP__ #undef vtkAlgorithm #endif }; Here, the wrapper will not provide any API on the the real superclass but most likely, you only care about API in vtkAlgorithm to be wrapped. See vtkFloatArray as an example on how this is done. Utkarsh On Thu, Jan 11, 2018 at 7:51 AM, Alexander Straubwrote: > Hello ParaView community, > > > > while programming a ParaView filter I encountered a problem with the CS > wrapping. In the following I will describe the problem. The ParaView version > I am currently using is 5.3.0. > > > > In my project I created a filter that has one of two possible outputs, > depending on a preprocessor variable. The idea behind this is, that there is > a define “_DETAILED” that can be set via cmake. If it is not defined, a > vtkRectilinearGrid is created. It it is defined, the plugin outputs a > multiblock data set with an additional polydata object. > > > > The problem now is that the generation of the MyPluginClientServer.cxx > doesn’t account for the preprocessor variable and just takes the last > defined algorithm. In my case, this means that in the > MyPluginClientServer.cxx file the line is always written as > > const char* commandName = "vtkRectilinearGridAlgorithm"; > > This leads to a runtime error when applying the filter because it > erroneously tries to downcast the plugin to the wrong algorithm data type. > > > > Here the error message: > > ERROR: In > T:\paraview\source\ParaView-v5.3.0\ParaViewCore\ServerImplementation\Core\vtkPVSessionCore.cxx, > line 371 > > vtkPVSessionCore (01D0D3633550): Cannot cast MyPlugin object to > vtkRectilinearGridAlgorithm. This probably means the class specifies the > incorrect superclass in vtkTypeMacro. > > while processing > > Message 0 = Invoke > > Argument 0 = vtk_object_pointer {MyPlugin (01D080685680)} > > Argument 1 = string_value {SetInputConnection} > > Argument 2 = vtk_object_pointer {vtkAlgorithmOutput (01D0E3D49AB0)} > > > > The following is how I create the plugin class: > > […] > > #ifdef _DETAILED > > // Create multi block data set for additional output as polydata > > #include "vtkMultiBlockDataSetAlgorithm.h" > > > > class VTK_EXPORT MyPlugin : public vtkMultiBlockDataSetAlgorithm > > { > > public: > >static MyPlugin* New(); > >vtkTypeMacro(MyPlugin, vtkMultiBlockDataSetAlgorithm); > > #else > > // Create rectilinear grid > > #include "vtkRectilinearGridAlgorithm.h" > > > > class VTK_EXPORT MyPlugin : public vtkRectilinearGridAlgorithm > > { > > public: > >static MyPlugin* New(); > >vtkTypeMacro(MyPlugin, vtkRectilinearGridAlgorithm); > > #endif > > […] > > > > The work-around so far is to manually edit the MyPluginClientServer.cxx file > to use the correct algorithm base class. This however is very unpractical as > the code is supposed to be distributed to others. As I don’t have enough > knowledge of the inner workings of ParaView, especially the wrapping that is > done, I don’t know where or how to fix this. I would be glad if someone was > able to help me with this issue. > > > > Kind regards, > > Alex > > > ___ > 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 > > Search the list archives at: http://markmail.org/search/?q=ParaView > > Follow this link to subscribe/unsubscribe: > https://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 Search the list archives at: http://markmail.org/search/?q=ParaView Follow this link to subscribe/unsubscribe: https://paraview.org/mailman/listinfo/paraview
[Paraview] CS Wrapper for plugins ignores preprocessor variable
Hello ParaView community, while programming a ParaView filter I encountered a problem with the CS wrapping. In the following I will describe the problem. The ParaView version I am currently using is 5.3.0. In my project I created a filter that has one of two possible outputs, depending on a preprocessor variable. The idea behind this is, that there is a define "_DETAILED" that can be set via cmake. If it is not defined, a vtkRectilinearGrid is created. It it is defined, the plugin outputs a multiblock data set with an additional polydata object. The problem now is that the generation of the MyPluginClientServer.cxx doesn't account for the preprocessor variable and just takes the last defined algorithm. In my case, this means that in the MyPluginClientServer.cxx file the line is always written as const char* commandName = "vtkRectilinearGridAlgorithm"; This leads to a runtime error when applying the filter because it erroneously tries to downcast the plugin to the wrong algorithm data type. Here the error message: ERROR: In T:\paraview\source\ParaView-v5.3.0\ParaViewCore\ServerImplementation\Core\vtkPVSessionCore.cxx, line 371 vtkPVSessionCore (01D0D3633550): Cannot cast MyPlugin object to vtkRectilinearGridAlgorithm. This probably means the class specifies the incorrect superclass in vtkTypeMacro. while processing Message 0 = Invoke Argument 0 = vtk_object_pointer {MyPlugin (01D080685680)} Argument 1 = string_value {SetInputConnection} Argument 2 = vtk_object_pointer {vtkAlgorithmOutput (01D0E3D49AB0)} The following is how I create the plugin class: [...] #ifdef _DETAILED // Create multi block data set for additional output as polydata #include "vtkMultiBlockDataSetAlgorithm.h" class VTK_EXPORT MyPlugin : public vtkMultiBlockDataSetAlgorithm { public: static MyPlugin* New(); vtkTypeMacro(MyPlugin, vtkMultiBlockDataSetAlgorithm); #else // Create rectilinear grid #include "vtkRectilinearGridAlgorithm.h" class VTK_EXPORT MyPlugin : public vtkRectilinearGridAlgorithm { public: static MyPlugin* New(); vtkTypeMacro(MyPlugin, vtkRectilinearGridAlgorithm); #endif [...] The work-around so far is to manually edit the MyPluginClientServer.cxx file to use the correct algorithm base class. This however is very unpractical as the code is supposed to be distributed to others. As I don't have enough knowledge of the inner workings of ParaView, especially the wrapping that is done, I don't know where or how to fix this. I would be glad if someone was able to help me with this issue. Kind regards, Alex ___ 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 Search the list archives at: http://markmail.org/search/?q=ParaView Follow this link to subscribe/unsubscribe: https://paraview.org/mailman/listinfo/paraview