-
Notifications
You must be signed in to change notification settings - Fork 25
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
Allow specifying a root position of the tree #95
Comments
Never mind, I see that I can pass an argument for it. |
Hi! Yes, there is that burried option in trace.py, but you do have to do some other steps manually to use it. To what degree though would your issues be solved by a rotation of the final skeleton? |
What do you mean by rotation of the final skeleton? I would prefer fixing the root point as I have that information. Regarding the root point, what steps do I need to take? I tried to pass it with Teaser parameters as below. skels = kimimaro.skeletonize(
mask,
teasar_params={
"scale": scale,
"const": 2 * voxel_res, # physical units
"pdrf_scale": 100000,
"pdrf_exponent": 4,
"soma_acceptance_threshold": 10000, # physical units
"soma_detection_threshold": 10000, # physical units
"soma_invalidation_const": 300, # physical units
"soma_invalidation_scale": 2,
"max_paths": 10000, # default None
"root": root_position, # default None
},
# object_ids=[ ... ], # process only the specified labels
# extra_targets_before=[ (27,33,100), (44,45,46) ], # target points in voxels
# extra_targets_after=[ (27,33,100), (44,45,46) ], # target points in voxels
dust_threshold=200 * voxel_res, # skip connected components with fewer than this many voxels
anisotropy=(voxel_res, voxel_res, voxel_res), # default True
fix_branching=True, # default True
fix_borders=True, # default True
fill_holes=False, # default False
fix_avocados=False, # default False
progress=True, # default False, show progress bar
parallel=0, # <= 0 all cpu, 1 single process, 2+ multiprocess
parallel_chunk_size=100, # how many skeletons to process before updating progress bar
) I also commented out the line so the trace function gets the root position. Now the algorithm just keeps running for a long time. Looking a bit deeper, I see that
Any help would be appreciated. |
If the final skeleton includes the root point, I think you could do a "tree rotation" to put your favored point at the root of the skeleton. It's probably something I should include in the skeleton package. However, if your point isn't in the final skeleton then yes, you need to trace from that point.
This issue is now fixed on master per #93 I'm working on a new release, something is breaking in testing that is probably unrelated.
Currently, there is no official way to pick your own root. I'll have to add this feature. |
Let's say that my favored root point is included in the final skeleton as shown in the below screenshot. Will this tree rotation, recreate the skeleton, by tracing from the favored root point? That is important because I would like to fix the major bifurcation marked in the screenshot. |
Ok, I see what you're trying to do now. No, a rotation will not fix this. I thought you just wanted to organize your skeleton a bit differently, not change the structure. I think you can eliminate that spurious tail with either increasing |
I adjusted the soma parameters which fixes the root issue in some cases. I ended up replacing the detected soma with my root position and got the desired result. |
Hi William,
I am using Kimimaro, to generate centerline graphs for the Parse 2022 challenge dataset. It works well, however, the selected starting or root point is usually incorrect and leads to an incorrect graph. It would be great if we could provide the root point position. I see that there is an old open issue by you that maybe mentions this. Was this ever implemented? You can see an example of the issue below, the larger red marker shows the chosen root point.
Thank you for your amazing work.
The text was updated successfully, but these errors were encountered: