Re: [Paraview] OSPRay, scaled spheres

2017-10-25 Thread Heiland, Randy
Beauty. Thanks!! (I really need to take time to read the entire PV Guide)

> On Oct 25, 2017, at 5:14 PM, David E DeMarle  wrote:
> 
> click the gear to show advanced properties, or use search field for glyph 
> type.
> 
> 
> 
> David E DeMarle
> Kitware, Inc.
> Principal Engineer
> 21 Corporate Drive
> Clifton Park, NY 12065-8662
> Phone: 518-881-4909
> 
> On Wed, Oct 25, 2017 at 5:11 PM, Heiland, Randy  > wrote:
> You lost me - in the Glyph Source block,I select Glyph Type = 2D Glyph.  Then 
> where is VERTEX? In the Display block, I choose Representation = Points which 
> produces a blobby mess. But a very *smooth* blobby mess :)
> 
>> On Oct 25, 2017, at 4:46 PM, David E DeMarle > > wrote:
>> 
>> That control is only available if the representation type is surface, this 
>> could explain why you don't see it on the ProgrammableSource.
>> 
>> In the glyph filter, use 2D glyph, VERTEX.
>> 
>> 
>> 
>> 
>> 
>> David E DeMarle
>> Kitware, Inc.
>> Principal Engineer
>> 21 Corporate Drive 
>> 
>> Clifton Park, NY 12065 
>> -8662
>> Phone: 518-881-4909 
>> On Wed, Oct 25, 2017 at 4:29 PM, Heiland, Randy > > wrote:
>> I only see the “OSPRay Use Scale Array” on the Properties for Glyph, not the 
>> Props for the ProgrammableSource. Expected? And so, OSPRay is rendering the 
>> chunky polygonalized spherical glyphs (Representation = Surface).
>> 
>> If I could independently scale the implicit spheres and use OSPRay, I’d 
>> prefer that until I do the vtkCutter. (thanks for confirming, Note 2)
>> 
>> 
>> 
>>> On Oct 25, 2017, at 3:35 PM, David E DeMarle >> > wrote:
>>> 
>>> To change the size based on values:
>>> check "OSPRay Use Scale Array" on "Display" section or "Properties" Tab
>>> Choose the array name you want to scale by with "OSPRay Scale Array" 
>>> pulldown.
>>> Define your value to radius transfer function via the "OSPRay Scale 
>>> Function" popup editor.
>>> 
>>> Note 1: the transfer function is defined to map between 0.0 and 1.0 and 
>>> clamp outside of that range. Use a calculator to scale and bias into that 
>>> range. If you don't like having to do this, file a feature request to 
>>> remind the developers to implement it one of these days such that min is 
>>> defined to be array min and max.
>>> 
>>> Note 2:Cutter will not cut through the implicit spheres.
>>> 
>>> Note 3: Point Gaussian representation's Use Scalar Array, Guassian Scale 
>>> Array and Scale Transfer Function (which I riffed off of) are similar. I'm 
>>> not sure about scale and bias and cut with this GL shader based side.
>>> 
>>> 
>>> David E DeMarle
>>> Kitware, Inc.
>>> Principal Engineer
>>> 21 Corporate Drive 
>>> 
>>> Clifton Park, NY 12065 
>>> -8662
>>> Phone: 518-881-4909 
>>> On Wed, Oct 25, 2017 at 3:16 PM, Heiland, Randy >> > wrote:
>>> Just want to make sure I’m not missing something. In my Pgmable Source 
>>> PolyData, I render Points and love the OSPRay-rendered spheres. However, is 
>>> there any mechanism for (independently) scaling these, i.e., other than the 
>>> fixed Point Size? Or is the only way to get scalar-value scaled spheres via 
>>> the Glyph filter? If so, is it possible to control the 
>>> resolution/triangulation of that glyph? Basically, I’m looking for ways of 
>>> getting high-res spheres, but will also want to use vtkCutter on them later.
>>> 
>>> thanks, Randy
>>> ___
>>> 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:
>>> http://public.kitware.com/mailman/listinfo/paraview 
>>> 
>>> 
>>> 
>> 
>> 
> 
> 



smime.p7s
Description: S/MIME cryptographic signature
___
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: 

Re: [Paraview] OSPRay, scaled spheres

2017-10-25 Thread David E DeMarle
click the gear to show advanced properties, or use search field for glyph
type.



David E DeMarle
Kitware, Inc.
Principal Engineer
21 Corporate Drive
Clifton Park, NY 12065-8662
Phone: 518-881-4909

On Wed, Oct 25, 2017 at 5:11 PM, Heiland, Randy  wrote:

> You lost me - in the Glyph Source block,I select Glyph Type = 2D Glyph.
> Then where is VERTEX? In the Display block, I choose Representation =
> Points which produces a blobby mess. But a very *smooth* blobby mess :)
>
> On Oct 25, 2017, at 4:46 PM, David E DeMarle 
> wrote:
>
> That control is only available if the representation type is surface, this
> could explain why you don't see it on the ProgrammableSource.
>
> In the glyph filter, use 2D glyph, VERTEX.
>
>
>
>
>
> David E DeMarle
> Kitware, Inc.
> Principal Engineer
> 21 Corporate Drive
> 
> Clifton Park, NY 12065
> 
> -8662
> Phone: 518-881-4909 <(518)%20881-4909>
>
> On Wed, Oct 25, 2017 at 4:29 PM, Heiland, Randy  wrote:
>
>> I only see the “OSPRay Use Scale Array” on the Properties for Glyph, not
>> the Props for the ProgrammableSource. Expected? And so, OSPRay is rendering
>> the chunky polygonalized spherical glyphs (Representation = Surface).
>>
>> If I could independently scale the implicit spheres and use OSPRay, I’d
>> prefer that until I do the vtkCutter. (thanks for confirming, Note 2)
>>
>>
>>
>> On Oct 25, 2017, at 3:35 PM, David E DeMarle 
>> wrote:
>>
>> To change the size based on values:
>> check "OSPRay Use Scale Array" on "Display" section or "Properties" Tab
>> Choose the array name you want to scale by with "OSPRay Scale Array"
>> pulldown.
>> Define your value to radius transfer function via the "OSPRay Scale
>> Function" popup editor.
>>
>> Note 1: the transfer function is defined to map between 0.0 and 1.0 and
>> clamp outside of that range. Use a calculator to scale and bias into that
>> range. If you don't like having to do this, file a feature request to
>> remind the developers to implement it one of these days such that min is
>> defined to be array min and max.
>>
>> Note 2:Cutter will not cut through the implicit spheres.
>>
>> Note 3: Point Gaussian representation's Use Scalar Array, Guassian Scale
>> Array and Scale Transfer Function (which I riffed off of) are similar. I'm
>> not sure about scale and bias and cut with this GL shader based side.
>>
>>
>> David E DeMarle
>> Kitware, Inc.
>> Principal Engineer
>> 21 Corporate Drive
>> 
>> Clifton Park, NY 12065
>> 
>> -8662
>> Phone: 518-881-4909 <(518)%20881-4909>
>>
>> On Wed, Oct 25, 2017 at 3:16 PM, Heiland, Randy  wrote:
>>
>>> Just want to make sure I’m not missing something. In my Pgmable Source
>>> PolyData, I render Points and love the OSPRay-rendered spheres. However, is
>>> there any mechanism for (independently) scaling these, i.e., other than the
>>> fixed Point Size? Or is the only way to get scalar-value scaled spheres via
>>> the Glyph filter? If so, is it possible to control the
>>> resolution/triangulation of that glyph? Basically, I’m looking for ways of
>>> getting high-res spheres, but will also want to use vtkCutter on them later.
>>>
>>> thanks, Randy
>>> ___
>>> 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:
>>> http://public.kitware.com/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:
http://public.kitware.com/mailman/listinfo/paraview


Re: [Paraview] OSPRay, scaled spheres

2017-10-25 Thread Heiland, Randy
You lost me - in the Glyph Source block,I select Glyph Type = 2D Glyph.  Then 
where is VERTEX? In the Display block, I choose Representation = Points which 
produces a blobby mess. But a very *smooth* blobby mess :)

> On Oct 25, 2017, at 4:46 PM, David E DeMarle  wrote:
> 
> That control is only available if the representation type is surface, this 
> could explain why you don't see it on the ProgrammableSource.
> 
> In the glyph filter, use 2D glyph, VERTEX.
> 
> 
> 
> 
> 
> David E DeMarle
> Kitware, Inc.
> Principal Engineer
> 21 Corporate Drive
> Clifton Park, NY 12065-8662
> Phone: 518-881-4909
> 
> On Wed, Oct 25, 2017 at 4:29 PM, Heiland, Randy  > wrote:
> I only see the “OSPRay Use Scale Array” on the Properties for Glyph, not the 
> Props for the ProgrammableSource. Expected? And so, OSPRay is rendering the 
> chunky polygonalized spherical glyphs (Representation = Surface).
> 
> If I could independently scale the implicit spheres and use OSPRay, I’d 
> prefer that until I do the vtkCutter. (thanks for confirming, Note 2)
> 
> 
> 
>> On Oct 25, 2017, at 3:35 PM, David E DeMarle > > wrote:
>> 
>> To change the size based on values:
>> check "OSPRay Use Scale Array" on "Display" section or "Properties" Tab
>> Choose the array name you want to scale by with "OSPRay Scale Array" 
>> pulldown.
>> Define your value to radius transfer function via the "OSPRay Scale 
>> Function" popup editor.
>> 
>> Note 1: the transfer function is defined to map between 0.0 and 1.0 and 
>> clamp outside of that range. Use a calculator to scale and bias into that 
>> range. If you don't like having to do this, file a feature request to remind 
>> the developers to implement it one of these days such that min is defined to 
>> be array min and max.
>> 
>> Note 2:Cutter will not cut through the implicit spheres.
>> 
>> Note 3: Point Gaussian representation's Use Scalar Array, Guassian Scale 
>> Array and Scale Transfer Function (which I riffed off of) are similar. I'm 
>> not sure about scale and bias and cut with this GL shader based side.
>> 
>> 
>> David E DeMarle
>> Kitware, Inc.
>> Principal Engineer
>> 21 Corporate Drive 
>> 
>> Clifton Park, NY 12065 
>> -8662
>> Phone: 518-881-4909 
>> On Wed, Oct 25, 2017 at 3:16 PM, Heiland, Randy > > wrote:
>> Just want to make sure I’m not missing something. In my Pgmable Source 
>> PolyData, I render Points and love the OSPRay-rendered spheres. However, is 
>> there any mechanism for (independently) scaling these, i.e., other than the 
>> fixed Point Size? Or is the only way to get scalar-value scaled spheres via 
>> the Glyph filter? If so, is it possible to control the 
>> resolution/triangulation of that glyph? Basically, I’m looking for ways of 
>> getting high-res spheres, but will also want to use vtkCutter on them later.
>> 
>> thanks, Randy
>> ___
>> 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:
>> http://public.kitware.com/mailman/listinfo/paraview 
>> 
>> 
>> 
> 
> 



smime.p7s
Description: S/MIME cryptographic signature
___
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:
http://public.kitware.com/mailman/listinfo/paraview


Re: [Paraview] OSPRay, scaled spheres

2017-10-25 Thread David E DeMarle
That control is only available if the representation type is surface, this
could explain why you don't see it on the ProgrammableSource.

In the glyph filter, use 2D glyph, VERTEX.





David E DeMarle
Kitware, Inc.
Principal Engineer
21 Corporate Drive
Clifton Park, NY 12065-8662
Phone: 518-881-4909

On Wed, Oct 25, 2017 at 4:29 PM, Heiland, Randy  wrote:

> I only see the “OSPRay Use Scale Array” on the Properties for Glyph, not
> the Props for the ProgrammableSource. Expected? And so, OSPRay is rendering
> the chunky polygonalized spherical glyphs (Representation = Surface).
>
> If I could independently scale the implicit spheres and use OSPRay, I’d
> prefer that until I do the vtkCutter. (thanks for confirming, Note 2)
>
>
>
> On Oct 25, 2017, at 3:35 PM, David E DeMarle 
> wrote:
>
> To change the size based on values:
> check "OSPRay Use Scale Array" on "Display" section or "Properties" Tab
> Choose the array name you want to scale by with "OSPRay Scale Array"
> pulldown.
> Define your value to radius transfer function via the "OSPRay Scale
> Function" popup editor.
>
> Note 1: the transfer function is defined to map between 0.0 and 1.0 and
> clamp outside of that range. Use a calculator to scale and bias into that
> range. If you don't like having to do this, file a feature request to
> remind the developers to implement it one of these days such that min is
> defined to be array min and max.
>
> Note 2:Cutter will not cut through the implicit spheres.
>
> Note 3: Point Gaussian representation's Use Scalar Array, Guassian Scale
> Array and Scale Transfer Function (which I riffed off of) are similar. I'm
> not sure about scale and bias and cut with this GL shader based side.
>
>
> David E DeMarle
> Kitware, Inc.
> Principal Engineer
> 21 Corporate Drive
> 
> Clifton Park, NY 12065
> 
> -8662
> Phone: 518-881-4909 <(518)%20881-4909>
>
> On Wed, Oct 25, 2017 at 3:16 PM, Heiland, Randy  wrote:
>
>> Just want to make sure I’m not missing something. In my Pgmable Source
>> PolyData, I render Points and love the OSPRay-rendered spheres. However, is
>> there any mechanism for (independently) scaling these, i.e., other than the
>> fixed Point Size? Or is the only way to get scalar-value scaled spheres via
>> the Glyph filter? If so, is it possible to control the
>> resolution/triangulation of that glyph? Basically, I’m looking for ways of
>> getting high-res spheres, but will also want to use vtkCutter on them later.
>>
>> thanks, Randy
>> ___
>> 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:
>> http://public.kitware.com/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:
http://public.kitware.com/mailman/listinfo/paraview


Re: [Paraview] OSPRay, scaled spheres

2017-10-25 Thread Heiland, Randy
I only see the “OSPRay Use Scale Array” on the Properties for Glyph, not the 
Props for the ProgrammableSource. Expected? And so, OSPRay is rendering the 
chunky polygonalized spherical glyphs (Representation = Surface).

If I could independently scale the implicit spheres and use OSPRay, I’d prefer 
that until I do the vtkCutter. (thanks for confirming, Note 2)


> On Oct 25, 2017, at 3:35 PM, David E DeMarle  wrote:
> 
> To change the size based on values:
> check "OSPRay Use Scale Array" on "Display" section or "Properties" Tab
> Choose the array name you want to scale by with "OSPRay Scale Array" pulldown.
> Define your value to radius transfer function via the "OSPRay Scale Function" 
> popup editor.
> 
> Note 1: the transfer function is defined to map between 0.0 and 1.0 and clamp 
> outside of that range. Use a calculator to scale and bias into that range. If 
> you don't like having to do this, file a feature request to remind the 
> developers to implement it one of these days such that min is defined to be 
> array min and max.
> 
> Note 2:Cutter will not cut through the implicit spheres.
> 
> Note 3: Point Gaussian representation's Use Scalar Array, Guassian Scale 
> Array and Scale Transfer Function (which I riffed off of) are similar. I'm 
> not sure about scale and bias and cut with this GL shader based side.
> 
> 
> David E DeMarle
> Kitware, Inc.
> Principal Engineer
> 21 Corporate Drive
> Clifton Park, NY 12065-8662
> Phone: 518-881-4909
> 
> On Wed, Oct 25, 2017 at 3:16 PM, Heiland, Randy  > wrote:
> Just want to make sure I’m not missing something. In my Pgmable Source 
> PolyData, I render Points and love the OSPRay-rendered spheres. However, is 
> there any mechanism for (independently) scaling these, i.e., other than the 
> fixed Point Size? Or is the only way to get scalar-value scaled spheres via 
> the Glyph filter? If so, is it possible to control the 
> resolution/triangulation of that glyph? Basically, I’m looking for ways of 
> getting high-res spheres, but will also want to use vtkCutter on them later.
> 
> thanks, Randy
> ___
> 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:
> http://public.kitware.com/mailman/listinfo/paraview 
> 
> 
> 



smime.p7s
Description: S/MIME cryptographic signature
___
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:
http://public.kitware.com/mailman/listinfo/paraview


Re: [Paraview] OSPRay, scaled spheres

2017-10-25 Thread David E DeMarle
To change the size based on values:
check "OSPRay Use Scale Array" on "Display" section or "Properties" Tab
Choose the array name you want to scale by with "OSPRay Scale Array"
pulldown.
Define your value to radius transfer function via the "OSPRay Scale
Function" popup editor.

Note 1: the transfer function is defined to map between 0.0 and 1.0 and
clamp outside of that range. Use a calculator to scale and bias into that
range. If you don't like having to do this, file a feature request to
remind the developers to implement it one of these days such that min is
defined to be array min and max.

Note 2:Cutter will not cut through the implicit spheres.

Note 3: Point Gaussian representation's Use Scalar Array, Guassian Scale
Array and Scale Transfer Function (which I riffed off of) are similar. I'm
not sure about scale and bias and cut with this GL shader based side.


David E DeMarle
Kitware, Inc.
Principal Engineer
21 Corporate Drive
Clifton Park, NY 12065-8662
Phone: 518-881-4909

On Wed, Oct 25, 2017 at 3:16 PM, Heiland, Randy  wrote:

> Just want to make sure I’m not missing something. In my Pgmable Source
> PolyData, I render Points and love the OSPRay-rendered spheres. However, is
> there any mechanism for (independently) scaling these, i.e., other than the
> fixed Point Size? Or is the only way to get scalar-value scaled spheres via
> the Glyph filter? If so, is it possible to control the
> resolution/triangulation of that glyph? Basically, I’m looking for ways of
> getting high-res spheres, but will also want to use vtkCutter on them later.
>
> thanks, Randy
> ___
> 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:
> http://public.kitware.com/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:
http://public.kitware.com/mailman/listinfo/paraview


[Paraview] OSPRay, scaled spheres

2017-10-25 Thread Heiland, Randy
Just want to make sure I’m not missing something. In my Pgmable Source 
PolyData, I render Points and love the OSPRay-rendered spheres. However, is 
there any mechanism for (independently) scaling these, i.e., other than the 
fixed Point Size? Or is the only way to get scalar-value scaled spheres via the 
Glyph filter? If so, is it possible to control the resolution/triangulation of 
that glyph? Basically, I’m looking for ways of getting high-res spheres, but 
will also want to use vtkCutter on them later.

thanks, Randy

smime.p7s
Description: S/MIME cryptographic signature
___
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:
http://public.kitware.com/mailman/listinfo/paraview


Re: [Paraview] LiveInsituLink proxy in pvpython client

2017-10-25 Thread Kolja Petersen
Thank you, Andy,
unfortunately your answer has shown me how little I understand about
Catalyst. But maybe it leads in the right direction after some work from my
side.

Just to make sure that we are talking about the same thing: My pvpython
client is supposed to automate some of the visualization functionality of
the paraview GUI. The coprocessing.py is in charge of the other side of the
link, namely to provide data to the visualization side, if I understand
correctly? I rather followed what happens in the constructor
pqLiveInsituVisualizationManager::pqLiveInsituVisualizationManager(int
connection_port, pqServer* server), which creates a
vtkSMLiveInsituLinkProxy, not a vtkLiveInsituLink as coprocessing.py.

Now I saw that the vtkLiveInsituLink class can have ProcessType LIVE (for
the visualization side? as server side object of the proxy created by
paraview?) or INSITU (for the simulation side?). So apparently the same
class can take both roles? If yes, that'd clarify some of my confusion. But
still I don't see how coprocessing.py helps me to implement a python
visualization client?

Then, following the creation of a vtkSMLiveInsituLinkProxy in the
pqLiveInsituVisualizationManager constructor, this proxy's server side
vtkLiveInsituLink calls
"parallelController->TriggerRMIOnAllChildren(INITIALIZE_CONNECTION);"
inside vtkLiveInsituLink::InsituConnect(vtkMultiProcessController*
proc0NodesController). This seems to be the first RMI sent over the link.
Is there any possibility to log the transmission or reception of this RMI?
I don't find it in the cslogs.
I think I could make some progress if I am able to debug where those
messages are sent to, and why the python client doesn't react to them.
Thank you
Kolja

On Wed, Oct 25, 2017 at 4:05 PM, Andy Bauer  wrote:

> Hi Kolja,
>
> I can't recall if anyone tried the Catalyst Live connection through
> pvpython but I don't think anyone has done that yet. The design was meant
> to go through the GUI. My suggestion would be to start looking at the
> DoLiveVisualization() method in coprocessing.py.
>
> Cheers,
> Andy
>
> On Tue, Oct 24, 2017 at 12:49 PM, Kolja Petersen 
> wrote:
>
>> Hello,
>> Are there any examples how to receive extracts from Catalyst simulations
>> in a batch pvpython script?
>>
>> My first attempt looks as attached. I connect to a pvserver running on
>> localhost. Then I create a LiveInsituLink proxy, set the insitu port to
>> 2 and initialize the proxy. Finally, I repeat ProcessEvents(), which I
>> hoped would allow me to interact with the Catalyst simulation.
>>
>> However, when I first start pvserver, then the "coproc.py" script
>> (attached), and finally a Catalyst example (e.g.
>> Examples/Catalyst/CFullExample/FEDriver.c), nothing useful happens. The
>> callback, which should react to any LiveInsituLink events, is only called
>> during initialization (UpdatePropertyEvent and ModifiedEvent), then never
>> again. lil.GetTimeStep() in the endless loop shows always the same
>> (uninitialized?) value, there are no Debug messages from the LiveInsituLink
>> proxy.
>>
>> How can I receive a notification, when a Catalyst simulation connects?
>> How can I get a list of available extracts?
>> Thank you
>> Kolja
>>
>> ___
>> 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:
>> http://public.kitware.com/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:
http://public.kitware.com/mailman/listinfo/paraview


Re: [Paraview] multiple scalar fields

2017-10-25 Thread David E DeMarle
Give each array a name (vtkDataArray::SetName()) and use AddArray
(vtkFieldData:AddArray()) instead of using the atttibutes based API
(vtkDataSetAttributes::Set{Scalars/Tensors/Vectors})

ParaView uses named array access almost exclusively anyway.



David E DeMarle
Kitware, Inc.
Principal Engineer
21 Corporate Drive
Clifton Park, NY 12065-8662
Phone: 518-881-4909

On Wed, Oct 25, 2017 at 12:32 PM, Heiland, Randy  wrote:

> How does one use 2 (or more) scalar fields in a dataset, e.g. one for a
> colormap, one to scale glyphs?  E.g., Pgmable Source:
>
> pdo = self.GetPolyDataOutput()
>
> num_pts = 2
> newPts = vtk.vtkPoints()
> cell_color_ID = vtk.vtkFloatArray()
> cell_radius = vtk.vtkFloatArray()
>
> cell_color_ID.SetName('cell_color_ID')
> cell_radius.SetName('cell_radius')
>
> newPts.InsertPoint(0, -1,0,0)
> cell_color_ID.InsertNextValue(1)
> cell_radius.InsertNextValue(0.2)
>
> newPts.InsertPoint(1, 1,0,0)
> cell_color_ID.InsertNextValue(2)
> cell_radius.InsertNextValue(0.3)
>
> pdo.SetPoints(newPts)
> pdo.GetPointData().SetScalars(cell_color_ID)
> pdo.GetPointData().SetScalars(cell_radius)   # overrides the 1st
>
> verts = vtk.vtkCellArray()
> for idx in range(0, num_pts):
>   verts.InsertNextCell(1)
>   verts.InsertCellPoint(idx)
> pdo.SetVerts(verts)
>
>
> thanks, Randy
> ___
> 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:
> http://public.kitware.com/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:
http://public.kitware.com/mailman/listinfo/paraview


[Paraview] multiple scalar fields

2017-10-25 Thread Heiland, Randy
How does one use 2 (or more) scalar fields in a dataset, e.g. one for a 
colormap, one to scale glyphs?  E.g., Pgmable Source:

pdo = self.GetPolyDataOutput()

num_pts = 2
newPts = vtk.vtkPoints()
cell_color_ID = vtk.vtkFloatArray()
cell_radius = vtk.vtkFloatArray()

cell_color_ID.SetName('cell_color_ID')
cell_radius.SetName('cell_radius')

newPts.InsertPoint(0, -1,0,0)
cell_color_ID.InsertNextValue(1)
cell_radius.InsertNextValue(0.2)

newPts.InsertPoint(1, 1,0,0)
cell_color_ID.InsertNextValue(2)
cell_radius.InsertNextValue(0.3)

pdo.SetPoints(newPts)
pdo.GetPointData().SetScalars(cell_color_ID)
pdo.GetPointData().SetScalars(cell_radius)   # overrides the 1st

verts = vtk.vtkCellArray()
for idx in range(0, num_pts):
  verts.InsertNextCell(1)
  verts.InsertCellPoint(idx)
pdo.SetVerts(verts)


thanks, Randy

smime.p7s
Description: S/MIME cryptographic signature
___
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:
http://public.kitware.com/mailman/listinfo/paraview


Re: [Paraview] Python Scripting - Acess vtkOpenGL cameras from .pvx files information

2017-10-25 Thread Utkarsh Ayachit
Leo,

To handle 90-degree pitch or elevation, do the following:

camera.Pitch(90)
camera.OrthogonalizeViewUp()
Render()

Utkarsh


On Tue, Oct 24, 2017 at 2:50 PM, Léo Pessanha 
wrote:

> Thanks Utkarsh!
>
> This change would take a build right? Can't do it right now =/
>
> My goal is to know what should I do after a
>
> cameraInstance.Pitch(90)
>>
>
> and before a
>
> Render()
>>
>
> In order not to get the warning
>
> Resetting view-up since view plane normal is parallel
>>
>
> I've tried
>
> cameraInstance.ComputeViewPlaneNormal()
>>
>
> but with no sucess...
>
> Do you know why and can explain me the reason of this warning ?
> More important, how to get rid of it? hahaha
> My goal trying to print the camera attributes was to debug this info!
>
> Thanks in advance!
>
>
>
> Leonardo Pessanha
> Laboratory of Computational Methods in Engineering
> Federal University of Rio de Janeiro - COPPE
> Rio de Janeiro, RJ, Brasil
>
>
> 2017-10-23 13:01 GMT-02:00 Utkarsh Ayachit :
>
>> Leo,
>>
>> You can't access it in Python since the Python script is not run on the
>> server side. If your goal is to debug what thet camera is set to, you can
>> put cout's to print the camera in 
>> `vtkCaveSynchronizedRenderers::HandleStartRender`.
>> That's where the local camera on each rank is "prepped" for rendering a
>> frame.
>>
>> Utkarsh
>>
>> On Mon, Oct 23, 2017 at 9:20 AM, Léo Pessanha <
>> leonardopessanh...@gmail.com> wrote:
>>
>>> Hi!
>>>
>>> I would like to know if there's a way to acess the
>>> information/attributes of the cameras there are created trough a .pvx file
>>>
>>> To acess the attributes in the camera of the active Layout/RenderView  I
>>> do:
>>>
>>> 1 - Open Python Shell
>>> 2 - camera = GetActiveCamera()
>>> 3 - print(camera)
>>>
>>> And the output is:
>>>
>>> vtkOpenGLCamera (0x4a45e80)
>>>
>>> Debug: Off
>>>
>>> Modified Time: 405029
>>>
>>> Reference Count: 5
>>>
>>> Registered Events:
>>>
>>> Registered Observers:
>>>
>>> (none)
>>>
>>> ClippingRange: (1.63277, 5.56498)
>>>
>>> DirectionOfProjection: (0.526409, 0.492965, -0.692733)
>>>
>>> Distance: 3.37001
>>>
>>> EyeAngle: 2
>>>
>>> FocalDisk: 1
>>>
>>> FocalPoint: (0, 0, 0)
>>>
>>> ViewShear: (0, 0, 1)
>>>
>>> ParallelProjection: Off
>>>
>>> ParallelScale: 0.872667
>>>
>>> Position: (-1.77401, -1.6613, 2.33452)
>>>
>>> Stereo: Off
>>>
>>> Left Eye: 1
>>>
>>> Thickness: 3.93221
>>>
>>> ViewAngle: 30
>>>
>>> UseHorizontalViewAngle: 0
>>>
>>> UserTransform: (none)
>>>
>>> (none)
>>>
>>> FreezeFocalPoint: (none)
>>>
>>> ViewPlaneNormal: (-0.526409, -0.492965, 0.692733)
>>>
>>> ViewUp: (-0.0865543, 0.841596, 0.533127)
>>>
>>> WindowCenter: (0, 0)
>>>
>>> UseOffAxisProjection: (0)
>>>
>>> ScreenBottomLeft: (-0.5, -0.5, -0.5)
>>>
>>> ScreenBottomRight: (0.5, -0.5, -0.5)
>>>
>>> ScreenTopRight: (0.5, 0.5, -0.5)
>>>
>>> EyeSeparation: (0.06)
>>>
>>> WorldToScreenMatrix: (0x4a457c0
>>>
>>> Debug: Off
>>>
>>> Modified Time: 155883
>>>
>>> Reference Count: 1
>>>
>>> Registered Events: (none)
>>>
>>> Elements:
>>>
>>> 1 0 0 0
>>>
>>> 0 1 0 0
>>>
>>> 0 0 1 0
>>>
>>> 0 0 0 1
>>>
>>> )
>>>
>>> EyeTransformMatrix: (0x4a458b0
>>>
>>> Debug: Off
>>>
>>> Modified Time: 155885
>>>
>>> Reference Count: 1
>>>
>>> Registered Events: (none)
>>>
>>> Elements:
>>>
>>> 1 0 0 0
>>>
>>> 0 1 0 0
>>>
>>> 0 0 1 0
>>>
>>> 0 0 0 1
>>>
>>> )
>>>
>>> ModelTransformMatrix: (0x4a459a0
>>>
>>> Debug: Off
>>>
>>> Modified Time: 155887
>>>
>>> Reference Count: 1
>>>
>>> Registered Events: (none)
>>>
>>> Elements:
>>>
>>> 1 0 0 0
>>>
>>> 0 1 0 0
>>>
>>> 0 0 1 0
>>>
>>> 0 0 0 1
>>>
>>> )
>>>
>>> ProjectionTransform: (0x4a46280
>>>
>>> Debug: Off
>>>
>>> Modified Time: 405415
>>>
>>> Reference Count: 1
>>>
>>> Registered Events: (none)
>>>
>>> Inverse: (0)
>>>
>>> Matrix: (0x4a46330)
>>>
>>> Debug: Off
>>>
>>> Modified Time: 405416
>>>
>>> Reference Count: 1
>>>
>>> Registered Events: (none)
>>>
>>> Elements:
>>>
>>> 3.76067 0 0 0
>>>
>>> 0 3.73205 0 0
>>>
>>> 0 0 -1.83046 -4.62147
>>>
>>> 0 0 -1 0
>>>
>>> Input: (0)
>>>
>>> InverseFlag: 0
>>>
>>> NumberOfConcatenatedTransforms: 1
>>>
>>> 0: vtkSimpleTransform at 0x6ecdae0
>>>
>>> )
>>>
>>>
>>> *How to get these informations of the cameras created from a .pvx file?*
>>>
>>>
>>>
>>> Thanks in advance,
>>> Leonardo Pessanha
>>> Laboratory of Computational Methods in Engineering
>>> Federal University of Rio de Janeiro - COPPE
>>> Rio de Janeiro, RJ, Brasil
>>>
>>>
>>> ___
>>> 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:
>>> http://public.kitware.com/mailman/listinfo/paraview
>>>
>>>
>>
>

Re: [Paraview] LiveInsituLink proxy in pvpython client

2017-10-25 Thread Andy Bauer
Hi Kolja,

I can't recall if anyone tried the Catalyst Live connection through
pvpython but I don't think anyone has done that yet. The design was meant
to go through the GUI. My suggestion would be to start looking at the
DoLiveVisualization() method in coprocessing.py.

Cheers,
Andy

On Tue, Oct 24, 2017 at 12:49 PM, Kolja Petersen 
wrote:

> Hello,
> Are there any examples how to receive extracts from Catalyst simulations
> in a batch pvpython script?
>
> My first attempt looks as attached. I connect to a pvserver running on
> localhost. Then I create a LiveInsituLink proxy, set the insitu port to
> 2 and initialize the proxy. Finally, I repeat ProcessEvents(), which I
> hoped would allow me to interact with the Catalyst simulation.
>
> However, when I first start pvserver, then the "coproc.py" script
> (attached), and finally a Catalyst example (e.g.
> Examples/Catalyst/CFullExample/FEDriver.c), nothing useful happens. The
> callback, which should react to any LiveInsituLink events, is only called
> during initialization (UpdatePropertyEvent and ModifiedEvent), then never
> again. lil.GetTimeStep() in the endless loop shows always the same
> (uninitialized?) value, there are no Debug messages from the LiveInsituLink
> proxy.
>
> How can I receive a notification, when a Catalyst simulation connects?
> How can I get a list of available extracts?
> Thank you
> Kolja
>
> ___
> 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:
> http://public.kitware.com/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:
http://public.kitware.com/mailman/listinfo/paraview


Re: [Paraview] superbuild: fontconfig too old to compile (current does)

2017-10-25 Thread Ben Boeckel
On Wed, Oct 25, 2017 at 13:35:51 +0200, Fabian Wein wrote:
> thank you! So the current master will have the upgrade within a few days?

It's not so simple :( . There's a build failure with older compilers:

https://open.cdash.org/viewNotes.php?buildid=5114526

--Ben
___
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:
http://public.kitware.com/mailman/listinfo/paraview


Re: [Paraview] Programmable filter VTK/numpy

2017-10-25 Thread Cory Quammen
You should change 'array_name' to 'MetaImage'. Sorry I didn't make it clear
that 'array_name' is just a placeholder for whatever name your array has.

Cory

On Wed, Oct 25, 2017 at 7:46 AM, Edoardo Pasca 
wrote:

> Hallo Cory and all,
>
> I've spent a few minutes trying to find out where my script crashes:
>
> 1) I load a MetaImage and the scalars are named 'MetaImage'
>
> 2) Paraview crashes if I use inData = dsa.WrapDataObject(inputs[0])
>
> B = inData.PointData['array_name'] # best practice is to name the array
>
>
> 3) If I use the outData = dsa.WrapDataObject(output)
>
> outData.PointData.append(A,'new_array_name')
>
>
> the output contains nothing. It says type Uniform Rectilinear Grid but there 
> is no point inside.
>
>
> Thanks
>
>
> Edo
>
>
> On Fri, Oct 20, 2017 at 3:48 PM, Cory Quammen 
> wrote:
>
>> On Thu, Oct 19, 2017 at 11:02 AM, Edoardo Pasca 
>> wrote:
>>
>>> Hi Cory,
>>>
>>> thanks for your reply. I'd love to simplify the code like that but there
>>> are 2 issues with that programmable filter
>>>
>>> 1) I miss information on the input and output variables. Where are
>>> defined?
>>>
>>
>> It's a bit complicated to select them in the user interface, but it is
>> possible. There was a related discussion on the mailing list recently on
>> how to do this: http://paraview.markmail.org/thread/j4ynkclxcucpqoa5
>>
>> In the worst case, you can hard-code the array names if they don't
>> change. Relying on the active scalar attribute is old-style VTK and may go
>> away someday in the not-too-near future. Or you could just keep your
>> original code for defining array B.
>>
>>
>>> 2) Paraview crashes. Paraview for windows 5.4.1 and 5.3.0 (official
>>> kitware build)
>>>
>>> It seems a memory access problem.
>>>
>>
>> To debug, I suggest writing your Programmable Filter script a few lines
>> at a time to determine which line causes the crash.
>>
>> HTH,
>> Cory
>>
>>
>>> Edo
>>>
>>> On Thu, Oct 19, 2017 at 2:52 PM, Cory Quammen 
>>> wrote:
>>>
 Hi Edo,

 Documentation for the VTK/Numpy adapter can be found here:

 https://www.paraview.org/ParaView/Doc/Nightly/www/py-doc/par
 aview.vtk.numpy_interface.html?highlight=numpy_interface#num
 py-interface-package

 You will likely be interested in the dataset_adapter module that
 provides a convenient way to wrap VTK data objects in a Python class that
 provides easy read/write access to VTK data arrays as Numpy arrays.

 You could simplify your code quite a bit using this adapter as in the
 following:

 import numpy

 from vtk.util import numpy_support, vtkImageImportFromArray

 import vtk.numpy_interface.dataset_adapter as dsa


 inData = dsa.WrapDataObject(inputs[0])

 B = inData.PointData['array_name'] # best practice is to name the array


 #B = numpy_support.vtk_to_numpy(

 #inputs[0].GetPointData().GetScalars())


 ifLarger = lambda x,M: x if x<=M else 0

 fgt = numpy.frompyfunc(ifLarger,2,1)

 #A = fgt(B,int(2**16*0.8))


 ifSmaller = lambda x,M: x if x>M else 0

 flt = numpy.frompyfunc(ifSmaller,2,1)

 #A = flt(B,int(2**16*0.3))


 ifBetween = lambda x,m,M: ifSmaller(x,m) if x<=M else 0

 fbetw = numpy.frompyfunc(ifBetween,3,1)


 A = fbetw(B,int(2**16*0.3), int(2**16*0.95))


 outData = dsa.WrapDataObject(output)

 outData.PointData.append(A,'new_array_name')


 #A = numpy.asarray(A,dtype=uint16)

 #dims = inputs[0].GetDimensions()

 #A = numpy.reshape(A, (dims[2],dims[1],dims[0]), order='C')

 #A = numpy.ascontiguousarray(A)

 #importer = vtkImageImportFromArray.vtkImageImportFromArray()

 #importer.SetArray(A)

 #importer.SetDataSpacing(inputs[0].GetSpacing())

 #importer.SetDataOrigin(inputs[0].GetOrigin())

 #importer.Update()


 #output.DeepCopy(importer.GetOutput())


 Hope that helps,

 Cory

 On Tue, Oct 17, 2017 at 10:38 AM, Edoardo Pasca 
 wrote:

> Hi there,
>
> In my programmable filter I want to use numpy to perform some
> operations on the pixels (in this case a simple thresholding). I've come 
> up
> with this solution which works. I'm wondering if there are other ways to 
> do
> the conversion from numpy array to vtkImageData.
>
> in the following code I get a numpy array out of the input
> vtkImageData as B. Then I do something on the content an store the result
> in a numpy array, A.
>
> Then I convert the numpy array to a vtkImageData with
> vtkImageImportFromArray importer class.
> Finally I copy the importer output to the output of the programmable
> filter.
>
> Thanks 

Re: [Paraview] superbuild: fontconfig too old to compile (current does)

2017-10-25 Thread Ben Boeckel
On Wed, Oct 25, 2017 at 13:35:51 +0200, Fabian Wein wrote:
> thank you! So the current master will have the upgrade within a few days?

Hopefully. I need to get `gperf` onto the build machine since it is a
new build dependency of fontconfig.

--Ben
___
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:
http://public.kitware.com/mailman/listinfo/paraview


Re: [Paraview] Programmable filter VTK/numpy

2017-10-25 Thread Edoardo Pasca
Hallo Cory and all,

I've spent a few minutes trying to find out where my script crashes:

1) I load a MetaImage and the scalars are named 'MetaImage'

2) Paraview crashes if I use inData = dsa.WrapDataObject(inputs[0])

B = inData.PointData['array_name'] # best practice is to name the array


3) If I use the outData = dsa.WrapDataObject(output)

outData.PointData.append(A,'new_array_name')


the output contains nothing. It says type Uniform Rectilinear Grid but
there is no point inside.


Thanks


Edo


On Fri, Oct 20, 2017 at 3:48 PM, Cory Quammen 
wrote:

> On Thu, Oct 19, 2017 at 11:02 AM, Edoardo Pasca 
> wrote:
>
>> Hi Cory,
>>
>> thanks for your reply. I'd love to simplify the code like that but there
>> are 2 issues with that programmable filter
>>
>> 1) I miss information on the input and output variables. Where are
>> defined?
>>
>
> It's a bit complicated to select them in the user interface, but it is
> possible. There was a related discussion on the mailing list recently on
> how to do this: http://paraview.markmail.org/thread/j4ynkclxcucpqoa5
>
> In the worst case, you can hard-code the array names if they don't change.
> Relying on the active scalar attribute is old-style VTK and may go away
> someday in the not-too-near future. Or you could just keep your original
> code for defining array B.
>
>
>> 2) Paraview crashes. Paraview for windows 5.4.1 and 5.3.0 (official
>> kitware build)
>>
>> It seems a memory access problem.
>>
>
> To debug, I suggest writing your Programmable Filter script a few lines at
> a time to determine which line causes the crash.
>
> HTH,
> Cory
>
>
>> Edo
>>
>> On Thu, Oct 19, 2017 at 2:52 PM, Cory Quammen 
>> wrote:
>>
>>> Hi Edo,
>>>
>>> Documentation for the VTK/Numpy adapter can be found here:
>>>
>>> https://www.paraview.org/ParaView/Doc/Nightly/www/py-doc/par
>>> aview.vtk.numpy_interface.html?highlight=numpy_interface#
>>> numpy-interface-package
>>>
>>> You will likely be interested in the dataset_adapter module that
>>> provides a convenient way to wrap VTK data objects in a Python class that
>>> provides easy read/write access to VTK data arrays as Numpy arrays.
>>>
>>> You could simplify your code quite a bit using this adapter as in the
>>> following:
>>>
>>> import numpy
>>>
>>> from vtk.util import numpy_support, vtkImageImportFromArray
>>>
>>> import vtk.numpy_interface.dataset_adapter as dsa
>>>
>>>
>>> inData = dsa.WrapDataObject(inputs[0])
>>>
>>> B = inData.PointData['array_name'] # best practice is to name the array
>>>
>>>
>>> #B = numpy_support.vtk_to_numpy(
>>>
>>> #inputs[0].GetPointData().GetScalars())
>>>
>>>
>>> ifLarger = lambda x,M: x if x<=M else 0
>>>
>>> fgt = numpy.frompyfunc(ifLarger,2,1)
>>>
>>> #A = fgt(B,int(2**16*0.8))
>>>
>>>
>>> ifSmaller = lambda x,M: x if x>M else 0
>>>
>>> flt = numpy.frompyfunc(ifSmaller,2,1)
>>>
>>> #A = flt(B,int(2**16*0.3))
>>>
>>>
>>> ifBetween = lambda x,m,M: ifSmaller(x,m) if x<=M else 0
>>>
>>> fbetw = numpy.frompyfunc(ifBetween,3,1)
>>>
>>>
>>> A = fbetw(B,int(2**16*0.3), int(2**16*0.95))
>>>
>>>
>>> outData = dsa.WrapDataObject(output)
>>>
>>> outData.PointData.append(A,'new_array_name')
>>>
>>>
>>> #A = numpy.asarray(A,dtype=uint16)
>>>
>>> #dims = inputs[0].GetDimensions()
>>>
>>> #A = numpy.reshape(A, (dims[2],dims[1],dims[0]), order='C')
>>>
>>> #A = numpy.ascontiguousarray(A)
>>>
>>> #importer = vtkImageImportFromArray.vtkImageImportFromArray()
>>>
>>> #importer.SetArray(A)
>>>
>>> #importer.SetDataSpacing(inputs[0].GetSpacing())
>>>
>>> #importer.SetDataOrigin(inputs[0].GetOrigin())
>>>
>>> #importer.Update()
>>>
>>>
>>> #output.DeepCopy(importer.GetOutput())
>>>
>>>
>>> Hope that helps,
>>>
>>> Cory
>>>
>>> On Tue, Oct 17, 2017 at 10:38 AM, Edoardo Pasca 
>>> wrote:
>>>
 Hi there,

 In my programmable filter I want to use numpy to perform some
 operations on the pixels (in this case a simple thresholding). I've come up
 with this solution which works. I'm wondering if there are other ways to do
 the conversion from numpy array to vtkImageData.

 in the following code I get a numpy array out of the input vtkImageData
 as B. Then I do something on the content an store the result in a numpy
 array, A.

 Then I convert the numpy array to a vtkImageData with
 vtkImageImportFromArray importer class.
 Finally I copy the importer output to the output of the programmable
 filter.

 Thanks for any suggestions

 Edo

 import numpy

 from vtk.util import numpy_support, vtkImageImportFromArray

 import vtk.numpy_interface.dataset_adapter as dsa


 B = numpy_support.vtk_to_numpy(

 inputs[0].GetPointData().GetScalars())


 ifLarger = lambda x,M: x if x<=M else 0

 fgt = numpy.frompyfunc(ifLarger,2,1)

 #A = fgt(B,int(2**16*0.8))

Re: [Paraview] superbuild: fontconfig too old to compile (current does)

2017-10-25 Thread Fabian Wein

I've pushed an MR for the common-superbuild here:


Ben,

thank you! So the current master will have the upgrade within a few days?

Cheers,

Fabian
___
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:
http://public.kitware.com/mailman/listinfo/paraview


Re: [Paraview] Equally spaced points on a slice (for the streamlines)

2017-10-25 Thread Andrew
Hello, sorry for being late.
The slice may be oriented arbitrary, it may be not a flat but cylinder
slice e.t.c. But often I need just axis-aligned slices. Thanks for
suggestion about sources.

2017-10-23 18:03 GMT+03:00 Utkarsh Ayachit :

> Is the slice axis aligned? If so, you can use a regular source eg. Wavelet
> or Mandlebrot to generate the evenly spaced points by setting the extents
> appropriately.
>
> Utkarsh
>
> On Mon, Oct 23, 2017 at 2:41 AM, Andrew  wrote:
>
>> Hello.
>> I need to distribute points on a slice equally to start streamlines from
>> these points. The problem is that the Mask Points filter seems to not to
>> have such option. I tried all combinations of randomizing in this filter
>> but the problem persist. My mesh is unstructured tetra with inflation
>> layers on wall so there are lots of cells (points) at the wall and almost
>> all streamlines start in near-wall region while I need their starting
>> points to be equally distributed along the slice. Is there a way to do it
>> in ParaView?
>> Thanks for attention...
>>
>> ___
>> 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:
>> http://public.kitware.com/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:
http://public.kitware.com/mailman/listinfo/paraview