[Paraview] Get Values of CSV sources with Programmable Filter

Magician f_magician at mac.com
Thu Feb 6 11:19:29 EST 2014


Hi Berk,


Thanks for your reply.

Hmmm...
My purpose is extracting CSVs to vtkImageData with the Programmable Filter.
And the CSVs don't have headers, so it's not so good idea for me to get values per columns.
If possible, I want to get the values as 2D numpy.array directly as numpy.loadtxt().


Magician


On Feb 6, 2014, at 0:03, Berk Geveci <berk.geveci at kitware.com> wrote:

> If one of the inputs to the programmable filter is a table, you can
> values (columns) from it with something like:
> 
> inputs[0].RowData['array_name']
> 
> This will give a (n,1) numpy array where n == number of rows.
> 
> Best,
> -berk
> 
> On Wed, Feb 5, 2014 at 9:29 AM, Magician <f_magician at mac.com> wrote:
>> Hi Utkarsh,
>> 
>> 
>> I already checked it, but there are no information about getting all values
>> of VTKTable with NumPy.
>> Now I'm using for-loops and the GetValue(i, j) function, but it's not smart.
>> Do you have any other information?
>> 
>> 
>> Magician
>> 
>> 
>> On Feb 5, 2014, at 4:05, Utkarsh Ayachit <utkarsh.ayachit at kitware.com> wrote:
>> 
>>> Here's some text that describes how to go back and forth between NumPy
>>> and VTK arrays :http://www.paraview.org/Wiki/ParaView/Users_Guide/Python_Programmable_Filter#Mixing_VTK_and_NumPy_APIs
>>> 
>>> Utkarsh
>>> 
>>> On Fri, Jan 31, 2014 at 10:30 PM, Magician <f_magician at mac.com> wrote:
>>>> Hi all,
>>>> 
>>>> 
>>>> I'm using PV 4.1.0 and trying to get values of CSV sources with Programmable Filter.
>>>> It's better to get them as numpy.array.
>>>> How can I code it?
>>>> 
>>>> 
>>>> Magician
>>>> _______________________________________________
>>>> 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



More information about the ParaView mailing list