Describe the bug
We get a ZeroDivisionError with an image shape of (2, 84, 580, 576). This issue is a reminder to our future selves.
To Reproduce
Steps to reproduce the behavior:
Get two 3D timepoints
Make hyperstack with t=2
Run denoising
See error
Expected behavior
No error, smooth run.
Screenshots
Traceback (most recent call last):
File "/Users/ahmetcan.solak/Dev/AhmetCanSolak/aydin/aydin/gui/_qt/job_runners/worker.py", line 60, in run
result = self.fn(*self.args, **self.kwargs)
File "/Users/ahmetcan.solak/Dev/AhmetCanSolak/aydin/aydin/gui/_qt/job_runners/denoise_job_runner.py", line 60, in start_func
self.denoiser.train(
File "/Users/ahmetcan.solak/Dev/AhmetCanSolak/aydin/aydin/restoration/denoise/noise2selffgr.py", line 279, in train
self.it.train(
File "/Users/ahmetcan.solak/Dev/AhmetCanSolak/aydin/aydin/it/base.py", line 280, in train
self.blind_spots, autocorrelogram = auto_detect_blindspots(
File "/Users/ahmetcan.solak/Dev/AhmetCanSolak/aydin/aydin/analysis/blind_spot_analysis.py", line 105, in auto_detect_blindspots
image = representative_crop(image, crop_size=int(1e6), favour_odd_lengths=True)
File "/Users/ahmetcan.solak/Dev/AhmetCanSolak/aydin/aydin/util/crop/rep_crop.py", line 235, in representative_crop
translation = tuple(
File "/Users/ahmetcan.solak/Dev/AhmetCanSolak/aydin/aydin/util/crop/rep_crop.py", line 236, in <genexpr>
(randrange(0, max(1, (s - cs) // g)) * g if cs != s else 0)
ZeroDivisionError: integer division or modulo by zero
Additional context
Add any other context about the problem here.
Describe the bug We get a ZeroDivisionError with an image shape of (2, 84, 580, 576). This issue is a reminder to our future selves.
To Reproduce Steps to reproduce the behavior:
Expected behavior No error, smooth run.
Screenshots
Additional context Add any other context about the problem here.