-
Notifications
You must be signed in to change notification settings - Fork 48
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
Label Morphological Filter: Erosion Operation for touching labels #76
Comments
Hi, Well, for the moment this is the expected kind of result, so nothing wrong a priori. The aim to this plugin was to generalize erosion and dilation to label maps. Of course, one has to decide what to do when several labels are found in the neighborhood of current pixel! For erosion, I have made the decision to apply erosion only if a background pixel or voxel (label 0) is found in the neighborhood. Therefore, a the boundary of two regions, no erosion occur as there is no background. I was thinking about this, and it could be possible to add an additionnal option, to erode if a different label (either 0 or another one) is present in the neighborhood. This would have some side effects on other kind of images, but if the option can be chosen by the user, this should be fine. I will try to add it in a future release. Stay tuned... |
this is what I would have expected it to do....essentially erode each label as if it was a lonely binary mask. it would be great if that could be added. I would make it the default behaviour, as I don't know a use-case right now for the current implementation, do you have a use-case? |
Hey guys! What about imposing label (zero) boundaries and then eroding? |
Actually, in case of "dense" label maps (like a watershed result without dams), applying erosion would create new background pixels within groups of regions. The apparition of background may be questionable... But If the option to use background instead of other label is more natural, maybe I can change default option.
This is a solution as well! But then it is necessary to iterate over labels, create new image for each label, and then concatenating the results. |
Hi, I have updated the plugin, and drafted a new release (https://github.com/ijpb/MorphoLibJ/releases/tag/v1.6.0-LabelMapFiltering) You can play with the new jar, and tell me if this is better now! |
fixed in release 1.6.2 |
Dear all,
I am trying to erode a label mask in such a way that I have non-touching labels using MorpholibJ
![image](https://private-user-images.githubusercontent.com/17739639/240939870-f5571ffd-30d6-4f6d-a673-96dec1d07ea4.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2MTgxNTksIm5iZiI6MTczOTYxNzg1OSwicGF0aCI6Ii8xNzczOTYzOS8yNDA5Mzk4NzAtZjU1NzFmZmQtMzBkNi00ZjZkLWE2NzMtOTZkZWMxZDA3ZWE0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE1VDExMTA1OVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTI0OTUzZjA5OTA5ZDAzZTE4MGNjMjIxNDlhMGIwMWQzOTQwNGY5YTRhMzc5OWEzMzRjMjk4NWIwNmRkMjVmYmQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.jR5D2nvnygqkI4hyz3za9KCN3XsEXdnlrEuO2YdImc0)
Label Morphological Filter
options.I get the following result:
Left: original label mask, Right: label mask after erosion with radius = 9
I used
radius = 9
but was not able to separate them. Can you please help to get the non-touching labels, maybe I am doing something wrong or is it supposed to work that way?Attaching one example
![C2-Composite](https://private-user-images.githubusercontent.com/17739639/240940986-ea9b156f-6fbe-4f6c-962f-d4fecdb77f86.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2MTgxNTksIm5iZiI6MTczOTYxNzg1OSwicGF0aCI6Ii8xNzczOTYzOS8yNDA5NDA5ODYtZWE5YjE1NmYtNmZiZS00ZjZjLTk2MmYtZDRmZWNkYjc3Zjg2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE1VDExMTA1OVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTcxOWEwNDVkMmNkYmFjZmZiMTQ3YTcyYmU0ODJhOThlYTdmZTU3OGFlZDFjZWU2MjFmMWFmZjI3MTFhNWM3YzImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.KF7E_OUVbk8gM8Y8sVYBKBqbhBQLceB_szvRANlEvv8)
Thanks a lot!
The text was updated successfully, but these errors were encountered: