Skip to content

Commit

Permalink
Fixed voxel_length in export_vti and updated fibers_with_orientation.vti
Browse files Browse the repository at this point in the history
  • Loading branch information
fedesemeraro committed Mar 13, 2024
1 parent 3704c78 commit 5f044c0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
Binary file modified python/pumapy/data/fibers_with_orientation.vti
Binary file not shown.
2 changes: 1 addition & 1 deletion python/pumapy/io/input.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ def import_sparta_implicit_surfaces(filename, dimension=3, voxel_length=1e-6, im
:Example:
>>> import pumapy as puma
>>> ws_sparta = puma.import_sparta_implicit_surfaces(puma.path_to_example_file("MAKE EXAMPLE FILE"), 1.0e-6, import_ws=True)
>>> ws_sparta = puma.experimental.import_sparta_implicit_surfaces(puma.path_to_example_file("MAKE EXAMPLE FILE"), 1.0e-6, import_ws=True)
Importing ...
"""
print("Importing " + filename + " ... ", end='')
Expand Down
7 changes: 4 additions & 3 deletions python/pumapy/io/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from pumapy.io.input import io_logs


def export_vti(filename, dict_data, voxel_length=1):
def export_vti(filename, dict_data, voxel_length=None):
""" Export either a puma.Workspace or numpy array to vti
:param filename: filepath and name
Expand All @@ -38,7 +38,7 @@ def export_vti(filename, dict_data, voxel_length=1):
if filename[-4:] != ".vti":
filename += ".vti"

print("Exporting " + filename + ".vti ... ", end='')
print("Exporting " + filename + " ... ", end='')

if isinstance(dict_data, dict):
if len(dict_data) == 0:
Expand All @@ -61,7 +61,8 @@ def export_vti(filename, dict_data, voxel_length=1):
if data.orientation.shape[:3] == data.matrix.shape:
orient = data.orientation
dimensions = mat.shape[:3]
if voxel_length is None: voxel_length = data.voxel_length
if voxel_length is None:
voxel_length = data.voxel_length
else:
if data.ndim == 2:
data = np.expand_dims(data, axis=2)
Expand Down

0 comments on commit 5f044c0

Please sign in to comment.