Skip to content

Commit

Permalink
Merge pull request #7 from thorstenwagner/patch-3
Browse files Browse the repository at this point in the history
Fix computation for val_cut_off
  • Loading branch information
thorstenwagner authored Aug 8, 2022
2 parents 423d272 + ac87e86 commit eb09b9b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cryocare/internals/CryoCAREDataModule.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,8 @@ def __compute_extraction_shapes__(self, even_path, odd_path, tilt_axis_index, sa
assert even.data.shape[2] > 2 * sample_shape[2]

val_cut_off = int(even.data.shape[tilt_axis_index] * validation_fraction)
if even.data.shape[tilt_axis_index] - val_cut_off < sample_shape[tilt_axis_index]:
val_cut_off = even.data.shape[tilt_axis_index] - sample_shape[tilt_axis_index]
if ((even.data.shape[tilt_axis_index] - val_cut_off) < sample_shape[tilt_axis_index]) or val_cut_off < sample_shape[tilt_axis_index]:
val_cut_off = even.data.shape[tilt_axis_index] - sample_shape[tilt_axis_index] - 1

extraction_shape_train = [[0, even.data.shape[0]], [0, even.data.shape[1]], [0, even.data.shape[2]]]
extraction_shape_val = [[0, even.data.shape[0]], [0, even.data.shape[1]], [0, even.data.shape[2]]]
Expand Down

0 comments on commit eb09b9b

Please sign in to comment.