-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
orthogonalize AP/PD src/sink edges #377
Conversation
nice, will give it a try! |
sorry still WIP - some formatting bugs to fix! hopefully push an update in a few hours |
should be working now, and I also managed to speed up the laplace-beltrami solver by replacing a for loop with a vectorized approach (I noticed from the logger that just setting the boundary conditions was taking a while) |
Adds a check and raises an exception if any of src/sink is zero. Also writes a proper label gifti (was missing the label table), and refactored that in a write function. NOTE: still need to set the structure label..
might need a bit more tweaks for robustness to ensure the counts are at least 1 vertex, as this fails now for the ds002168 dataset that I had working correctly before.. Haven't had a chance to look at that fix yet, but made some cosmetic changes just now.. |
OK just had a chance to look at this again for my failed test case (dentate for ds002168) Looks like just needed more iterations than the capped 10.. I'll do a bit more clean-up then I thnk should be ready to merge. |
OK one thing I also just pushed: we can make the distance scaling additive rather than multiplicative in order to match what we were doing before with iterations of dilation |
Actually I still have an issue now with the resulting labels being multiple connected components, so may have to add in connected components for robustness.. |
Yes, I'm aware of the issue and I've been trying to debug it. We are using nunnet's official conda package and it's pinned in the env configuration file, i.e., hippunfold/workflow/envs/nnunet.yaml so I doubt it's something we changed. I wanted to cross check the issue by running the pipeline with
I'll open an issue. |
- turns out the additive approach is better (looks like our commits crossed, but we had the same implementation).. - adds logs - adds structure labels for workbench
OK this cleans things up a bit more and now is working well on my test dataset -- it needed the additive approach (I didn't see your commit until I was done, but looks like we did the same thing).. I'll merge this in to move things along.. |
This approach continues with the distance transform logic introduced by #371, and closes #373.
We want to ensure that all edge vertices are assigned to an AP or PD source or sink (4 possible labels), without overlapping or missing any vertices (I will call this orthogonal edge conditions). Otherwise we can end up with "corners" that are entire missing from the unfolded space, or other funny distortions in the unfolding.
Here, we introduce a new script to fix this up:
we also now apply largest connected component to finding boundary vertices to prevent issues with holes
TODO: