Skip to content

Commit

Permalink
Fix voxel size loading (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
LorenzLamm authored Jul 27, 2023
1 parent a5cece6 commit 70313eb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/membrain_seg/segmentation/dataloading/data_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,17 +241,18 @@ def load_tomogram(
data = tomogram.data.copy()
data = np.transpose(data, (2, 1, 0))
header = tomogram.header
voxel_size = tomogram.voxel_size
if normalize_data:
data = img_as_float32(data)
data -= np.mean(data)
data /= np.std(data)

if return_header:
if return_pixel_size:
return data, header, tomogram.voxel_size
return data, header, voxel_size
return data, header
if return_pixel_size:
return data, tomogram.voxel_size
return data, voxel_size
return data


Expand Down

0 comments on commit 70313eb

Please sign in to comment.