[vtkusers] Array Calculator to combine two vtk arrays

Saeed Mahdizadeh Bakhshmand saeedbakhshmand at gmail.com
Mon Oct 12 15:40:54 EDT 2015


Hello,

I have a vtkMRMLModelnode that I want to combine two of its scalar
overlays(labels) and generate a new set (union of given scalars). Here is
what I do:

Labels = Model.GetPolyData().GetPointData()
Label1 = Labels.GetArray(1)  /* Label1(name:alpha) and Label2(name:betha)
are vtkfloatarray with */
Label2 = Labels.GetArray(2)
calc = vtkArrayCalculator()
calc.AddScalarArrayName('alpha')
calc.AddScalarArrayName('betha')
calc.SetFunction('betha+alpha') // I am not sure if "+" will concatenate
these two arrays??

Would you please correct my code if there is something wrong or missing?

Best,
SMB
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20151012/969e9045/attachment.html>


More information about the vtkusers mailing list