Skip to content
Snippets Groups Projects
Commit 927c3ff3 authored by Christian Kento Rasmussen's avatar Christian Kento Rasmussen
Browse files

added support for menmap

parent 562e173f
Branches
No related tags found
2 merge requests!45Save files function,!44Load vol files
......@@ -372,10 +372,11 @@ class DataLoader:
case _:
raise ValueError(f"Unsupported data type: {dt}")
if self.virtual_stack:
vol = np.memmap(vol_path, dtype=dt, mode='r', shape=(dims[2], dims[0], dims[1]))
else:
vol = np.fromfile(vol_path, dtype=dt, count=np.prod(dims))
# Reshape and transposes the volume to match standard orientation
vol = np.reshape(vol, (dims[2], dims[0], dims[1]))
vol = vol.transpose((0, 2, 1))
if self.return_metadata:
return vol, meta_data
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment