[Paraview] Coloring isocontour by the coordinates outputted from a Transform filter and some other questions

Cory Quammen cory.quammen at kitware.com
Sun Jul 9 21:11:48 EDT 2017


Shuhao,

Unfortunately, the tooltips for the clip function parameters do not
appear to be working (I filed bug
https://gitlab.kitware.com/paraview/paraview/issues/17593 describing
the problem).

It turns out the properties for the Box clip type are defined in a way
that is a bit trickier than I thought. They are relative to the
bounding box of the input data:

* Position - center of the box function relative to the center of the
input dataset bounding box
* Rotation - Eulerian angles about the X, Y, and Z axes describing the
rotation of the bounding box
* Scale - non-uniform scale factor applied in x, y, and z relative to
the input dataset bounding box

Given how these items are defined, it will actually really be a pain
to compute the properties for an arbitrary x-, y-, and z-range.

The way you described earlier with a cascade of Calculator and
Threshold filters will work. Another way would be to use a single
Python Calculator with the expression

numpy.all((xmin <= inputs[0].Points[:,0], inputs[0].Points[:,0] <=
xmax, ymin <= inputs[0].Points[:,1], inputs[0].Points[:,1] <= ymax,
zmin <= inputs[0].Points[:,2], inputs[0].Points[:,2] <= zmax),
axis=0).astype('int')

and then Threshold by the result, which will be 0 outside [xmin, xmax,
ymin, ymax, zmin, zmax] and 1 inside it.

Thanks,
Cory



On Fri, Jul 7, 2017 at 10:51 AM, Shuhao Wu <shuhao at shuhaowu.com> wrote:
> Is there documentation on how the Box clip type work? I'm not quite sure how
> to do the math to convert the threshold values to the position/scale values.
>
> Thanks,
> Shuhao
>
>
> On 2017-07-03 10:03 AM, Cory Quammen wrote:
>>
>> On Tue, Jun 20, 2017 at 9:33 PM, Shuhao Wu <shuhao at shuhaowu.com> wrote:
>>
>>> Hello Cory,
>>>
>>> I've been playing around a little bit more and followed your suggestion
>>> with using the calculator to "expose" the transformed coordinates.
>>> However,
>>> my understanding is that this Calculator will duplicate the memory usage
>>> for that coordinate and be an additional step in the filtering process,
>>> slowing it down.
>>
>>
>>
>> Yes, that's true unfortunately. By the way, if you need X, Y, and Z, you
>> can use one Calculator filter to produce all three with the expression
>>
>> iHat*coordsX + jHat*coordsY + kHat*coordsZ
>>
>> This produces a 3-component array - you can then color your isosurface by
>> just one of the components or by the magnitude.
>>
>> I have to use the Calculator filter to expose all 3 coordinates before
>>>
>>> using a threshold to filter for only a subset region that I want to plt,
>>> which results in a filtering chain as follows:
>>>
>>> ExposeX (Calculator) -> ExposeY (Calculator) -> ExposeZ (Calculator) ->
>>> ThresholdX (Threshold) -> ThresholdY (Threshold) -> ThresholdZ
>>> (Threshold).
>>
>>
>>
>>>
>> This is 6 filters, which is very slow with my data set (>29M nodes in a
>>>
>>> rectlinear grid). Is there a way to speed this up?
>>>
>>>
>> You could instead use a Clip filter with Clip Type set to Box. You have to
>> do a little math to convert from your threshold values to the box Scale
>> and
>> Position properties, but it shouldn't be too bad, and will make your
>> pipeline simpler and faster.
>>
>> Cory
>>
>>
>>> Thanks,
>>> Shuhao
>>>
>>>
>>> On 2017-06-07 03:29 PM, Cory Quammen wrote:
>>>
>>>> Shuhao,
>>>>
>>>> Welcome to ParaView!
>>>>
>>>> On Sun, Jun 4, 2017 at 6:33 PM, Shuhao Wu <shuhao at shuhaowu.com> wrote:
>>>>
>>>>> Hello all,
>>>>>
>>>>> Is there a way to color an isocontour via the coordinates outputted
>>>>> from
>>>>> a
>>>>> Transform filter? I'm using the Transform filter to "normalize" my
>>>>> coordinate systems and I want to display the isocontour colored by the
>>>>> normalized Y coordinates. Do I have to create yet another Calculator
>>>>> filter
>>>>> to recalculate the normalized Y value that is already calculated by the
>>>>> Transform filter?
>>>>>
>>>>
>>>> There is currently no direct way to color surfaces by coordinate
>>>> value. You can, however, add a Calculator after the Transform filter
>>>> and simply set the expression to coordsY - no recomputation of the
>>>> normalization is needed. This will copy your normalized Y coordinate
>>>> values to a new array named "Result", and you can then color the
>>>> isosurface by "Result". "Result" is just the default name - you can
>>>> change it however you wish.
>>>>
>>>> Also: is there a way to turn off one axis on the axis grid (so turn off
>>>>>
>>>>> the
>>>>> Y axis display and leave only X and Z)?
>>>>>
>>>>
>>>> Click the Edit button next to the Axes Grid option. Click the gear
>>>> icon in the top right of the dialog that appears. Under Face
>>>> Properties, click on the "Faces to Render" combo box. Turn off the
>>>> sides you do not wish to see by selecting them in the combo box.
>>>>
>>>> What about changing the interval on
>>>>>
>>>>> the axis itself (instead of incrementing by 100 as it chooses,
>>>>> increment
>>>>> by
>>>>> 250).
>>>>>
>>>>
>>>> In the same dialog described above, check the "X Axis Use Custom
>>>> Labels", and you can specify exactly the labels you want. There is no
>>>> property to directly change the increment.
>>>>
>>>> Best,
>>>> Cory
>>>>
>>>> I'm pretty new to Paraview (coming from Tecplot). Please bear with me as
>>>> I
>>>>>
>>>>> likely will have more question.
>>>>>
>>>>> Thanks,
>>>>> Shuhao
>>>>> _______________________________________________
>>>>> 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
>>>>>
>>>>
>>>>
>>>>
>>>>
>>
>>
>



-- 
Cory Quammen
Staff R&D Engineer
Kitware, Inc.


More information about the ParaView mailing list