Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions avae/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,8 +349,15 @@ def read(self, filename):
return np.load(os.path.join(self.root_dir, filename))

elif self.datatype == "mrc":
with mrcfile.open(os.path.join(self.root_dir, filename)) as f:
return np.array(f.data)
try:
with mrcfile.open(os.path.join(self.root_dir, filename)) as f:
return np.array(f.data)
except ValueError:
raise ValueError(
"File {} is corrupted.".format(
os.path.join(self.root_dir, filename)
)
)

def voxel_transformation(self, x):

Expand Down