Quantcast

vtkPoints and vector/matrix Operations like Eigen?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

vtkPoints and vector/matrix Operations like Eigen?

Kyosev, Yordan

Hi,

 

Is there any way or type vtkObject, which can perform vector/matrix operations like addition/substraction, multiplication with scalar, vector/scalar products,

In the same way as Eigen do it?

 

Now I am using vtkPoints->GetPoint     -> double[3]  -> Eigen::Vector3D

 

Actually enough will be to have vtkPoint (single point) for this case.

The vtkMath classes seems to be not nice for following complex equations…

 

Best regards

 

Yordan

 

 


_______________________________________________
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 VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: vtkPoints and vector/matrix Operations like Eigen?

Cory Quammen-2
Yordan,

I think the closest thing to that kind of functionality in VTK is the
vtkArrayCalculator [1], but it is limited to vector-type operations,
not matrix-vector multiply, for instance.

If you like Python and NumPy, there is a Python adapter module that
lets you go between VTK data objects and NumPy with relative ease. See
[2] for details.

HTH,
Cory

[1] http://www.vtk.org/doc/nightly/html/classvtkArrayCalculator.html
[2] https://blog.kitware.com/improved-vtk-numpy-integration/

On Thu, Mar 30, 2017 at 3:41 PM, Kyosev, Yordan
<[hidden email]> wrote:

> Hi,
>
>
>
> Is there any way or type vtkObject, which can perform vector/matrix
> operations like addition/substraction, multiplication with scalar,
> vector/scalar products,
>
> In the same way as Eigen do it?
>
>
>
> Now I am using vtkPoints->GetPoint     -> double[3]  -> Eigen::Vector3D
>
>
>
> Actually enough will be to have vtkPoint (single point) for this case.
>
> The vtkMath classes seems to be not nice for following complex equations…
>
>
>
> Best regards
>
>
>
> Yordan
>
>
>
>
>
>
> _______________________________________________
> 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 VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>



--
Cory Quammen
Staff R&D Engineer
Kitware, Inc.
_______________________________________________
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 VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: vtkPoints and vector/matrix Operations like Eigen?

David Lonie-2
See vtkVector. It's quite similar to Eigen's vectors, though not as
optimized. Note that you'll need to include both vtkVector.h and
vtkVectorOperators.h to get the multiplication etc operators.

You can use them with vtkPoints like:

vtkPoints *points = ...;
assert(points->GetData()->GetNumberOfComponents() == 3);
vtkVector3d point;
for (...)
{
  points->GetPoint(id, point.GetData());
  // Do work with point
}

HTH,
Dave


On Thu, Mar 30, 2017 at 4:10 PM, Cory Quammen <[hidden email]> wrote:

> Yordan,
>
> I think the closest thing to that kind of functionality in VTK is the
> vtkArrayCalculator [1], but it is limited to vector-type operations,
> not matrix-vector multiply, for instance.
>
> If you like Python and NumPy, there is a Python adapter module that
> lets you go between VTK data objects and NumPy with relative ease. See
> [2] for details.
>
> HTH,
> Cory
>
> [1] http://www.vtk.org/doc/nightly/html/classvtkArrayCalculator.html
> [2] https://blog.kitware.com/improved-vtk-numpy-integration/
>
> On Thu, Mar 30, 2017 at 3:41 PM, Kyosev, Yordan
> <[hidden email]> wrote:
>> Hi,
>>
>>
>>
>> Is there any way or type vtkObject, which can perform vector/matrix
>> operations like addition/substraction, multiplication with scalar,
>> vector/scalar products,
>>
>> In the same way as Eigen do it?
>>
>>
>>
>> Now I am using vtkPoints->GetPoint     -> double[3]  -> Eigen::Vector3D
>>
>>
>>
>> Actually enough will be to have vtkPoint (single point) for this case.
>>
>> The vtkMath classes seems to be not nice for following complex equations…
>>
>>
>>
>> Best regards
>>
>>
>>
>> Yordan
>>
>>
>>
>>
>>
>>
>> _______________________________________________
>> 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 VTK FAQ at:
>> http://www.vtk.org/Wiki/VTK_FAQ
>>
>> Search the list archives at: http://markmail.org/search/?q=vtkusers
>>
>> Follow this link to subscribe/unsubscribe:
>> http://public.kitware.com/mailman/listinfo/vtkusers
>>
>
>
>
> --
> Cory Quammen
> Staff R&D Engineer
> Kitware, Inc.
> _______________________________________________
> 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 VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
_______________________________________________
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 VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
Loading...