Skip to content

Commit

Permalink
add check on tomo mask shape
Browse files Browse the repository at this point in the history
  • Loading branch information
sroet committed Aug 7, 2024
1 parent 0793404 commit cac21af
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/pytom_tm/tmjob.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,11 @@ def __init__(
self.tomogram_mask = tomogram_mask
if tomogram_mask is not None:
temp = read_mrc(tomogram_mask)
if temp.shape != self.tomo_shape:
raise ValueError(
"Tomogram mask does not have the same number of pixels as the tomogram.\n"
"Tomogram mask shape: {temp.shape}, tomogram shape: {self.tomo_shape}"
)
if np.all(temp <= 0):
raise ValueError(
f"No values larger than 0 found in the tomogram mask: {tomogram_mask}"
Expand Down

0 comments on commit cac21af

Please sign in to comment.