YuelongWu / feabas

Finite-Element Assisted Brain Assembly System for stitching & alignment of connectomics data
MIT License
11 stars 5 forks source link

non-noded intersection between LINESTRING #9

Open niltonlk opened 2 months ago

niltonlk commented 2 months ago

I get this exception on some pairs when running

python scripts/align_main.py --mode matching

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/home/users/feabas/scripts/align_main.py", line 455, in match_main(match_list) File "/home/users/feabas/scripts/align_main.py", line 150, in match_main num_matches = match_section_from_initial_matches(mname, mesh_dir, loaders, match_dir, align_config) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/users/feabas/feabas/aligner.py", line 119, in match_section_from_initial_matches xy0, xy1, weight = section_matcher(mesh0, mesh1, loader0, loader1, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/users/feabas/feabas/matcher.py", line 334, in section_matcher xy0_t, xy1_t, wtt, = iterative_xcorr_matcher_w_mesh(msh0_t.copy(), msh1_t.copy(), ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/users/feabas/feabas/matcher.py", line 553, in iterative_xcorr_matcher_w_mesh pt0, pt1, cnf = job.result() ^^^^^^^^^^^^ File "/home/users/.conda/envs/feabas/lib/python3.11/concurrent/futures/_base.py", line 449, in result return self.get_result() ^^^^^^^^^^^^^^^^^^^ File "/home/users/.conda/envs/feabas/lib/python3.11/concurrent/futures/_base.py", line 401, in get_result raise self._exception shapely.errors.GEOSException: TopologyException: found non-noded intersection between LINESTRING (36341.4 13275.7, 36565.4 13273.4) and LINESTRING (36566.4 13265.5, 36348.7 13275.7) at 36350.73715528036 13275.642693755399

any ideas?

YuelongWu commented 2 months ago

It seems that the error happened inside a worker process, and had something to do with shapely... Is it possible to temporarily set matching>matcher_config>num_workers in alignment_configs.yaml to 1 to see exactly which line went wrong?

niltonlk commented 2 months ago

Thanks for the quick response!

Surprisingly, processing with num_workers = 1 resulted in no errors. I saw this problem in other two pairs, but all passed with num_workers = 1. I am still processing more data, and I will keep with num_workers = 1. I will report back if I find any other issues.

Thanks

YuelongWu commented 2 months ago

hmm... I think I have a vague idea what's going on. Would num_workers = 1 make things too slow for you? If my hunch is right, you may have a chance to make it work with the worker number larger than 1 but different from your previous setting.

And if it's possible, I wonder if you could share a minimal reproducible example for me to reproduce this error? I'd like fix this bug but it hasn't happened with my own data. Thanks!

niltonlk commented 2 months ago

Good to know that. I will see if I can reproduce it with a smaller dataset, and will get back to you. Thanks