-
Notifications
You must be signed in to change notification settings - Fork 9
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
WIP: add a new segmentation module #1
base: master
Are you sure you want to change the base?
Conversation
…emented. demo code for warping error added.
diff = np.ma.array(np.abs(pred - out), mask=-simple) | ||
|
||
# -- finding the largest deviation from the difference map | ||
max_idx = np.unravel_index(diff.argmax(), diff.shape) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! I learned something here, I missed unravel_index
from numpy >= 1.6.0 !
Looks awesome! I think we are missing the following
Anything else? |
image_size = np.float(image_true.size) | ||
|
||
# -- we transform the annotation image into an integer image | ||
image_true = np.where(image_true > 0, 1, 0).astype(DTYPE_I) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
image_true = (image_true > 0).astype(...)
see if that fits you. I have some examples also in |
Up ? |
# -- parameters | ||
|
||
DIRNAME = './verenaImages' | ||
CONNECTOMICS_DIRNAME = '/home/poilvert/Dropbox/0__Shared_with_Poilvert/' + \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hardcoded path again here...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
demo for ha (please discard)
python code
@npinto,
First draft for a new segmentation module. So far I needed the
pad2d
function fromsthor so I added it to the module, even though in the future we will remove that extra
code and depend on sthor.
I also made a proxy to the Adjusted Rand Index metric from sklearn that seems fast
enough. That metric though, is only usable on segmented images (on needs multiple
labels for each connected component).
I added a quick build script to build a small Cython module that I use in the warping error
code.
Finally here are the steps to make it (hopefully) work :
build_unique.sh
warping_error_demo.py
Cheese,
N.