Skip to content
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

Iso-distance profiler #1

Open
anderskaestner opened this issue Jun 15, 2021 · 0 comments
Open

Iso-distance profiler #1

anderskaestner opened this issue Jun 15, 2021 · 0 comments

Comments

@anderskaestner
Copy link
Member

anderskaestner commented Jun 15, 2021

Have you considered implementing an iso-distance profiler? It is more general purpose

Something like:

import numpy as np
from scipy.ndimage import distance_transform_edt as edt

dist     = edt(bi_level_img) # round off to the needed number of digits
dlist    = np.unique(dist.ravel())

profile = np.zeros_like(dlist)
for idx,d in enumerate(dlist) :
    profile[idx] = dist[dist==d].mean()

This is not the most efficient implementation (you have to scan the image as many times as you have distances), but it is a baseline for the principle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant