Load Image -> CopyStructure(), GetArray() and AddArray() -> 'Save Data...' cannot work??
- Load some image data. (*.png etc.)
- Apply Programmable Filter.
- Apply 'Save Data...' to the Programmable Filter, but no data is saved with some warning.
The setting of the Programmable Filter is as follows:
# Output Data Set Type: Same as Input
# Script:
pdi = self.GetInput()
pdo = self.GetOutput()
pdo.CopyStructure(pdi)
pdo.GetPointData().AddArray(pdi.GetPointData().GetArray('PNGImage'))
And the warning is as follows:
Warning: In /Users/kitware/buildbot-slave/b99e1795/source-paraview/VTK/IO/Image/vtkPNGWriter.cxx, line 231
vtkPNGWriter (0x6000005a8260): PNGWriter only supports unsigned char and unsigned short inputs
This is just a tiny example. The actual codes are heavily complicated, but they also have the same issue.
This issue happens PV 5.2.0 or older version.