[Paraview] Transform Filter Loses Colors

Sven Buijssen sven.buijssen at tu-dortmund.de
Fri Sep 11 12:25:56 EDT 2009


Actually, the loop got accidentally more complicated than necessary:

---
inp = self.GetInput()
out = self.GetOutput()

numCells  = inp.GetNumberOfCells()
data = inp.GetCellData().GetArray("Colors")

newData = vtk.vtkUnsignedCharArray()
newData.SetName('Colors_converted')
newData.SetNumberOfComponents(3)
for i in range(0, 3*numCells):
  val = int(data.GetValue(i))
  newData.InsertNextValue(val)
out.GetCellData().AddArray(newData)
---

Sven


> ----- Original Message -----
> From: David Doria <daviddoria at gmail.com>
> To: ParaView <paraview at paraview.org>
> CC: ParaView <paraview at paraview.org>
> Sent: 09/11/09 17:46:54
> Subject: [Paraview] Transform Filter Loses Colors
>> On Fri, Sep 11, 2009 at 11:40 AM, Utkarsh Ayachit
>> <utkarsh.ayachit at kitware.com <mailto:utkarsh.ayachit at kitware.com>> wrote:
>>
>>     I am not sure why, but the transform filter converts the "Colors"
>>     array from unsigned-char to float. And hence, map-scalars is no longer
>>     available.
>>
>>     Utkarsh
>>
>>
>> So this essentially breaks the coloring right? The colors now appear as
>> shades between blue and red - there is no way to tell Paraview to use
>> float [0,1] RGB coloring? Is the course of action from here to ask the
>> VTK developers why this happens and if it can be specified/changed?
>>
>> Thanks,
>>
>> David
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> 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