[vtkusers] (no subject)

Saeed Mazrouei saeed.mazrouei at gmail.com
Mon Jul 7 12:41:50 EDT 2014


Hi all,

thanks to Yoshimi that gave me some ideas about transferring data from
cylindrical Cartesian.
I am pretty new in paraview and specially in scripting in it.
this is the script that he gave me:
// Get all data from the file
    vtkSmartPointer<vtkGenericDataObjectReader> reader =
        vtkSmartPointer<vtkGenericDataObjectReader>::New();
    reader->SetFileName(inputFilename.c_str());
    reader->Update();

    // convert cylindrical to Cartesian coordinate system
    vtkSmartPointer<vtkCylindricalTransform> cylTrans =
        vtkSmartPointer<vtkCylindricalTransform>::New();

    vtkSmartPointer<vtkTransformFilter> cylTransFilter =
        vtkSmartPointer<vtkTransformFilter>::New();
    cylTransFilter->SetInputData(reader->GetOutput());
    cylTransFilter->SetTransform(cylTrans);
    cylTransFilter->Update();

I would appreciate  if somebody help me to understand this script better
because I have some errors when I put it in paraviewfilterring .

Regards,
Saeed



On Sun, Jul 6, 2014 at 7:35 PM, kenichiro yoshimi <rccm.kyoshimi at gmail.com>
wrote:

> Hi Saeed,
>
> Please keep the discussion on the mailing list because I am not a VTK
> specialist.
>
> I think cylindrical transformation will do if you confirm that your input
> coordinate sequence is (r,theta,z) and write code similar to the following:
>
>     // Get all data from the file
>     vtkSmartPointer<vtkGenericDataObjectReader> reader =
>         vtkSmartPointer<vtkGenericDataObjectReader>::New();
>     reader->SetFileName(inputFilename.c_str());
>     reader->Update();
>
>     // convert cylindrical to Cartesian coordinate system
>     vtkSmartPointer<vtkCylindricalTransform> cylTrans =
>         vtkSmartPointer<vtkCylindricalTransform>::New();
>
>     vtkSmartPointer<vtkTransformFilter> cylTransFilter =
>         vtkSmartPointer<vtkTransformFilter>::New();
>     cylTransFilter->SetInputData(reader->GetOutput());
>     cylTransFilter->SetTransform(cylTrans);
>     cylTransFilter->Update();
>
> However there is a possibility that the transformed results will have a
> lack of  the resolution in the circumferential direction. In that case, you
> may need to subdivide in theta direction on input data preliminarily.
>
> Regards,
> yoshimi
>
>
> 2014-07-06 0:19 GMT+09:00 Saeed Mazrouei <saeed.mazrouei at gmail.com>:
>
> Hi,
>>
>> Thanks for your reply.
>>
>> I can read my data and make vtk structured grid but I do not know
>> How can I transform data to Cartesian coordinate system using
>> vtkCylindricalTransform.
>> Iwould appreciate if you tell me.
>> Regards
>> Saeed
>>
>>
>> On Sat, Jul 5, 2014 at 4:52 AM, kenichiro yoshimi <
>> rccm.kyoshimi at gmail.com> wrote:
>>
>>> Hi,
>>>
>>> Unfortunately there may be not the form for cylindrical coordinate
>>> system in vtk file format. But you can load your cylindrical data as
>>> vtkRectilinearDataSet or vtkStructuredGrid data set and then transform
>>> them to Cartecian coordinate system using vtkCylindricalTransform.
>>>
>>> Thanks,
>>> Yoshimi
>>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20140707/fd150588/attachment.html>


More information about the vtkusers mailing list