Re: [Paraview] Extracting a block from a vtkMultiBlockDataSet in Paraview (Bug?)

2015-11-25 Thread Evan Kao
Thanks Jean!  That did the trick.

- Evan

On Wed, Nov 25, 2015 at 12:16 AM, Favre Jean  wrote:

> You are missing a RequestInformation Script to indicate the dimensions of
> the grid you wish to create.
>
> Set the type of the Output Data to "vtkStructuredGrid"
>
> you will need, at the minimum, the following two sections of python code
>
> in the "Script"
>
> mbds = inputs[0]
>
> block0 = mbds.GetBlock(0)
>
> output.ShallowCopy(block0)
>
> (make sure to toggle the Advanced Properties to make the second text input
> widget to appear, and fill in the "RequestInformation Script" with the
> following text:
>
> executive = self.GetExecutive()
>
> outInfo = executive.GetOutputInformation(0)
>
> mbds = inputs[0]
>
> block0 = mbds.GetBlock(0)
>
> dims = block0.GetDimensions()
>
> outInfo.Set(executive.WHOLE_EXTENT(), 0, dims[0]-1 , 0, dims[1]-1 , 0, 
> dims[2]-1)
>
> ==
> That's all!
>
> Jean/CSCS
>
>
___
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] Extracting a block from a vtkMultiBlockDataSet in Paraview (Bug?)

2015-11-25 Thread Evan Kao
Hi all,

I had an additional question.  I'd like to convert this script into a
Custom Filter using the python_filter_generator.py script
, but this requires the output
type to be set automatically.  Is that possible with the Programmable
Filter, i.e., is it possible to set the output type without manually using
the drop-down menu?

Thanks,
Evan Kao

On Wed, Nov 25, 2015 at 11:35 AM, Evan Kao  wrote:

> Thanks Jean!  That did the trick.
>
> - Evan
>
> On Wed, Nov 25, 2015 at 12:16 AM, Favre Jean  wrote:
>
>> You are missing a RequestInformation Script to indicate the dimensions of
>> the grid you wish to create.
>>
>> Set the type of the Output Data to "vtkStructuredGrid"
>>
>> you will need, at the minimum, the following two sections of python code
>>
>> in the "Script"
>>
>> mbds = inputs[0]
>>
>> block0 = mbds.GetBlock(0)
>>
>> output.ShallowCopy(block0)
>>
>> (make sure to toggle the Advanced Properties to make the second text
>> input widget to appear, and fill in the "RequestInformation Script" with
>> the following text:
>>
>> executive = self.GetExecutive()
>>
>> outInfo = executive.GetOutputInformation(0)
>>
>> mbds = inputs[0]
>>
>> block0 = mbds.GetBlock(0)
>>
>> dims = block0.GetDimensions()
>>
>> outInfo.Set(executive.WHOLE_EXTENT(), 0, dims[0]-1 , 0, dims[1]-1 , 0, 
>> dims[2]-1)
>>
>> ==
>> That's all!
>>
>> Jean/CSCS
>>
>>
>
___
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] Extracting a block from a vtkMultiBlockDataSet in Paraview (Bug?)

2015-11-25 Thread Favre Jean
You are missing a RequestInformation Script to indicate the dimensions of the 
grid you wish to create.

Set the type of the Output Data to "vtkStructuredGrid"

you will need, at the minimum, the following two sections of python code

in the "Script"

mbds = inputs[0]

block0 = mbds.GetBlock(0)

output.ShallowCopy(block0)

(make sure to toggle the Advanced Properties to make the second text input 
widget to appear, and fill in the "RequestInformation Script" with the 
following text:


executive = self.GetExecutive()

outInfo = executive.GetOutputInformation(0)

mbds = inputs[0]

block0 = mbds.GetBlock(0)

dims = block0.GetDimensions()

outInfo.Set(executive.WHOLE_EXTENT(), 0, dims[0]-1 , 0, dims[1]-1 , 0, 
dims[2]-1)

==
That's all!

Jean/CSCS


___
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] Extracting a block from a vtkMultiBlockDataSet in Paraview (Bug?)

2015-11-24 Thread Evan Kao
Hi all,

Is there a way to extract a block from a vtkMultiBlockDataSet in Paraview
without using Extract Block > Merge Blocks (which converts the data in an
Unstructured Grid)?

For example, I import EnSight data, which is read in as a
vtkMultiBlockDataSet with a single vtkStructuredGrid block.  A bug prevents
from me from visualizing multi-block dataset with volume rendering, so it
would be nice to extract the structured grid data.  I've tried to do so as
follows in a Programmable Filter:

mbi = self.GetInputDataObject(0,0)
sgo = self.GetStructuredGridOutput()
sgo.DeepCopy(mbi.GetBlock(0))

However, when I apply this filter, there is no output.  There is no visible
object in the render window and there is nothing to inspect in Spreadsheet
View.  But if I print sgo in the Programmable Filter, all the usual
vtkDataObject information is there.

What is happening here, and can I get around it?

Thanks,
Evan Kao
___
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