guiwitz / MorphoDynamics

A Python package for tracking the deformation of biological cells.
https://guiwitz.github.io/MorphoDynamics/mydocs/Introduction.html
BSD 3-Clause "New" or "Revised" License
6 stars 3 forks source link

Error during "rasterizing" #20

Closed wldko closed 2 years ago

wldko commented 3 years ago

After a clean install and update of the newest version.

During a regular run on ilastik-based segmentation on 325 frames in 2 channels, all looks good until:

frames splining: 100%|██████████| 325/325 [00:09<00:00, 33.57it/s] frames rasterize: 55%|█████▌ | 180/325 [00:11<00:09, 15.59it/s]

IndexError Traceback (most recent call last) /opt/anaconda3/envs/morphodynamics/lib/python3.7/site-packages/morphodynamics/morpho_segmentation.py in run_segmentation(self, b) 321 self.param, 322 self.client, --> 323 skip_segtrack=self.skip_trackseg, 324 ) 325 if self.do_createUI:

/opt/anaconda3/envs/morphodynamics/lib/python3.7/site-packages/morphodynamics/analysis_par.py in analyze_morphodynamics(data, param, client, only_seg, keep_seg, skip_segtrack) 94 95 # align curves across frames and rasterize the windows ---> 96 s0prm_all, ori_all = align_all(s_all, data.shape, param.n_curve, param, client) 97 98 # origin shifts have been computed pair-wise. Calculate the cumulative

/opt/anaconda3/envs/morphodynamics/lib/python3.7/site-packages/morphodynamics/analysis_par.py in align_all(s_all, im_shape, num_points, param, client) 298 for k in tqdm(range(0, num_frames), "frames rasterize"): 299 future = spline_compute[k] --> 300 s0prm_all[k - 1], oriall[k], = future.result() 301 future.cancel() 302

/opt/anaconda3/envs/morphodynamics/lib/python3.7/site-packages/distributed/client.py in result(self, timeout) 218 if self.status == "error": 219 typ, exc, tb = result --> 220 raise exc.with_traceback(tb) 221 elif self.status == "cancelled": 222 raise result

/opt/anaconda3/envs/morphodynamics/lib/python3.7/site-packages/morphodynamics/analysis_par.py in spline_align_rasterize() 749 if align: 750 s0_shifted, origin = align_curves(N, s0, s, 0) --> 751 c = rasterize_curve(N, im_shape, s, origin) 752 skimage.io.imsave(filename, c, check_contrast=False) 753

/opt/anaconda3/envs/morphodynamics/lib/python3.7/site-packages/morphodynamics/displacementestimation.py in rasterize_curve() 589 for n in range(N + 1): # For each point p[:, n] on the contour... 590 if ( --> 591 d0[n] < delta[pi[1, n], pi[0, n]] 592 ): # ... if the distance to the nearest pixel is the smallest so far... 593 delta[pi[1, n], pi[0, n]] = d0[n] # ... remember this distance...

IndexError: index 712 is out of bounds for axis 1 with size 712

guiwitz commented 3 years ago

These are very rare errors that are incredibly hard to catch. In the end we'll just skip such frames and replace them with their neighbours (with a warning) but before we get to that I'd like to actually fix as many such problems as we can. So ideally, you should point me to the actual dataset and settings (e.g. window number) that you used so that I can investigate the bug.

wldko commented 3 years ago

All right, clear. I will first gather more of these, and then send an overview. It was just a random data set I tried.

On 29 Apr 2021, at 22:22, Guillaume Witz @.***> wrote:

These are very rare errors that are incredibly hard to catch. In the end we'll just skip such frames and replace them with their neighbours (with a warning) but before we get to that I'd like to actually fix as many such problems as we can. So ideally, you should point me to the actual dataset and settings (e.g. window number) that you used so that I can investigate the bug.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/guiwitz/MorphoDynamics/issues/20#issuecomment-829570103, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQIPFRTEMURVAYH2IJEJTTTTLG5ZRANCNFSM43VAGO5Q.