Commit d1da60ca04f4ee8d85d7b1e5184d394524453786
1 parent
8a0e7bf8
Exists in
master
and in
68 other branches
ADD: Import methods on polydata_utils and imagedata_utils
Showing
2 changed files
with
6 additions
and
1 deletions
Show diff stats
invesalius/data/imagedata_utils.py
| ... | ... | @@ -165,7 +165,7 @@ def Export(imagedata, filename, bin=False): |
| 165 | 165 | writer.SetInput(imagedata) |
| 166 | 166 | writer.Write() |
| 167 | 167 | |
| 168 | -def Read(filename): | |
| 168 | +def Import(filename): | |
| 169 | 169 | reader = vtk.vtkXMLImageDataReader() |
| 170 | 170 | reader.SetFileName(filename) |
| 171 | 171 | #reader.WholeSlicesOn() | ... | ... |
invesalius/data/polydata_utils.py
| ... | ... | @@ -127,3 +127,8 @@ def Export(polydata, filename, bin=False): |
| 127 | 127 | writer.SetInput(polydata) |
| 128 | 128 | writer.Write() |
| 129 | 129 | |
| 130 | +def Import(filename): | |
| 131 | + reader = vtk.vtkXMLPolyDataReader() | |
| 132 | + reader.SetFileName(filename) | |
| 133 | + reader.Update() | |
| 134 | + return reader.GetOutput() | ... | ... |