MantisBT - VTK | |||||
View Issue Details | |||||
ID | Project | Category | View Status | Date Submitted | Last Update |
0004931 | VTK | (No Category) | public | 2007-04-25 10:58 | 2014-09-15 12:14 |
Reporter | Paul Melis | ||||
Assigned To | David Gobbi | ||||
Priority | low | Severity | minor | Reproducibility | always |
Status | closed | Resolution | no change required | ||
Platform | OS | OS Version | |||
Product Version | |||||
Target Version | Fixed in Version | 5.10.0 | |||
Project | |||||
Type | |||||
Summary | 0004931: Python wrappers: input/output to and from string broken | ||||
Description | (This is using a recent (April 2007) CVS version) The VTK classes vtkDataWriter and vtkDataReader provide methods for writing and reading to/from a string, instead of the usual file. These are really handy for situations where a dataset isn't supposed or doesn't need to hit the disk (like when transferring over a network). Although VTK's Python wrappers do make the necessary methods available to Python scripts, they are not usable in their current form. This is because embedded NULL characters in input/output strings aren't correctly handled. Specifically: * vtkDataSetWriter.GetOutputString will return a Python string _up to the first \x00 in the output_, which for a binary VTK file, is somewhere after the header. * Working around the limitation by setting the file type to ASCII (so no embedded NULLs are in the output string) usually fails in vtkDataSetWriter.Write(). This seems to be related to the amount of space reserved for the output string. * vtkDataSetReader.Set(Binary)InputString does not allow to pass a Python string containing an embedded NULL character. * A work-around exists by passing a vtkCharArray instead of a string for the previous point, but this is really inefficient The problems at the VTK <-> Python boundary come from the specific Python C/API functions used to handle the string marshalling. | ||||
Steps To Reproduce | |||||
Additional Information | |||||
Tags | No tags attached. | ||||
Relationships | |||||
Attached Files | ![]() https://www.vtk.org/Bug/file/5984/write_sphere_to_string.py | ||||
Issue History | |||||
Date Modified | Username | Field | Change | ||
2011-02-26 10:42 | David Gobbi | Assigned To | Will Schroeder => David Gobbi | ||
2011-06-16 13:11 | Zack Galbreath | Category | => (No Category) | ||
2011-07-20 12:58 | Daniel Lea | Note Added: 0027030 | |||
2011-07-20 13:27 | David Gobbi | Note Added: 0027031 | |||
2011-07-20 13:28 | David Gobbi | Note Edited: 0027031 | bug_revision_view_page.php?bugnote_id=27031#r364 | ||
2011-07-20 15:18 | Daniel Lea | Note Added: 0027034 | |||
2014-09-15 12:14 | David Gobbi | Note Added: 0033342 | |||
2014-09-15 12:14 | David Gobbi | Status | backlog => closed | ||
2014-09-15 12:14 | David Gobbi | Resolution | open => no change required | ||
2014-09-15 12:14 | David Gobbi | Fixed in Version | => 5.10.0 |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|