Isolate structures from image
Clash Royale CLAN TAG#URR8PPP
up vote
4
down vote
favorite
I have a medical brain image from which I'm trying to isolate the brain (the gray pixels) from the rest (black and white parts).
I'm looking for some functions that are best suited for this.
Thanks
image-processing
add a comment |Â
up vote
4
down vote
favorite
I have a medical brain image from which I'm trying to isolate the brain (the gray pixels) from the rest (black and white parts).
I'm looking for some functions that are best suited for this.
Thanks
image-processing
Something likeDeleteSmallComponents@Dilation[Binarize[img, 0.4, 0.6], 1]
perhaps.
â C. E.
1 hour ago
add a comment |Â
up vote
4
down vote
favorite
up vote
4
down vote
favorite
I have a medical brain image from which I'm trying to isolate the brain (the gray pixels) from the rest (black and white parts).
I'm looking for some functions that are best suited for this.
Thanks
image-processing
I have a medical brain image from which I'm trying to isolate the brain (the gray pixels) from the rest (black and white parts).
I'm looking for some functions that are best suited for this.
Thanks
image-processing
image-processing
asked 1 hour ago
holistic
1,143620
1,143620
Something likeDeleteSmallComponents@Dilation[Binarize[img, 0.4, 0.6], 1]
perhaps.
â C. E.
1 hour ago
add a comment |Â
Something likeDeleteSmallComponents@Dilation[Binarize[img, 0.4, 0.6], 1]
perhaps.
â C. E.
1 hour ago
Something like
DeleteSmallComponents@Dilation[Binarize[img, 0.4, 0.6], 1]
perhaps.â C. E.
1 hour ago
Something like
DeleteSmallComponents@Dilation[Binarize[img, 0.4, 0.6], 1]
perhaps.â C. E.
1 hour ago
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
4
down vote
accepted
This can actually be done quite gracefully. Since it seems like there's no full white within the brain itself, we replace all the White with Black, then use ImageCrop
.
ImageCrop[DeleteSmallComponents@ColorReplace[i, White -> Black]]
You can use RemoveBackground
as well if you don't want black in the background.
older attempt
We use RemoveBackground with a marker in the centre of the image, then crop, delete small leftovers of the borders, crop again, and finally replace transparency with black.
RemoveAlphaChannel[
ImageCrop[
ColorNegate[
DeleteSmallComponents[
ColorNegate[
ImageCrop[
RemoveBackground[i, "Foreground", ImageDimensions[i]/2]]]]]],
RGBColor[0.`, 0.`, 0.`]]
Or, since it seems like the image is relatively standard, you can just set given borders for the brain and crop to that every time.
Thank you very much, that was easier than I thought :)
â holistic
1 hour ago
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
4
down vote
accepted
This can actually be done quite gracefully. Since it seems like there's no full white within the brain itself, we replace all the White with Black, then use ImageCrop
.
ImageCrop[DeleteSmallComponents@ColorReplace[i, White -> Black]]
You can use RemoveBackground
as well if you don't want black in the background.
older attempt
We use RemoveBackground with a marker in the centre of the image, then crop, delete small leftovers of the borders, crop again, and finally replace transparency with black.
RemoveAlphaChannel[
ImageCrop[
ColorNegate[
DeleteSmallComponents[
ColorNegate[
ImageCrop[
RemoveBackground[i, "Foreground", ImageDimensions[i]/2]]]]]],
RGBColor[0.`, 0.`, 0.`]]
Or, since it seems like the image is relatively standard, you can just set given borders for the brain and crop to that every time.
Thank you very much, that was easier than I thought :)
â holistic
1 hour ago
add a comment |Â
up vote
4
down vote
accepted
This can actually be done quite gracefully. Since it seems like there's no full white within the brain itself, we replace all the White with Black, then use ImageCrop
.
ImageCrop[DeleteSmallComponents@ColorReplace[i, White -> Black]]
You can use RemoveBackground
as well if you don't want black in the background.
older attempt
We use RemoveBackground with a marker in the centre of the image, then crop, delete small leftovers of the borders, crop again, and finally replace transparency with black.
RemoveAlphaChannel[
ImageCrop[
ColorNegate[
DeleteSmallComponents[
ColorNegate[
ImageCrop[
RemoveBackground[i, "Foreground", ImageDimensions[i]/2]]]]]],
RGBColor[0.`, 0.`, 0.`]]
Or, since it seems like the image is relatively standard, you can just set given borders for the brain and crop to that every time.
Thank you very much, that was easier than I thought :)
â holistic
1 hour ago
add a comment |Â
up vote
4
down vote
accepted
up vote
4
down vote
accepted
This can actually be done quite gracefully. Since it seems like there's no full white within the brain itself, we replace all the White with Black, then use ImageCrop
.
ImageCrop[DeleteSmallComponents@ColorReplace[i, White -> Black]]
You can use RemoveBackground
as well if you don't want black in the background.
older attempt
We use RemoveBackground with a marker in the centre of the image, then crop, delete small leftovers of the borders, crop again, and finally replace transparency with black.
RemoveAlphaChannel[
ImageCrop[
ColorNegate[
DeleteSmallComponents[
ColorNegate[
ImageCrop[
RemoveBackground[i, "Foreground", ImageDimensions[i]/2]]]]]],
RGBColor[0.`, 0.`, 0.`]]
Or, since it seems like the image is relatively standard, you can just set given borders for the brain and crop to that every time.
This can actually be done quite gracefully. Since it seems like there's no full white within the brain itself, we replace all the White with Black, then use ImageCrop
.
ImageCrop[DeleteSmallComponents@ColorReplace[i, White -> Black]]
You can use RemoveBackground
as well if you don't want black in the background.
older attempt
We use RemoveBackground with a marker in the centre of the image, then crop, delete small leftovers of the borders, crop again, and finally replace transparency with black.
RemoveAlphaChannel[
ImageCrop[
ColorNegate[
DeleteSmallComponents[
ColorNegate[
ImageCrop[
RemoveBackground[i, "Foreground", ImageDimensions[i]/2]]]]]],
RGBColor[0.`, 0.`, 0.`]]
Or, since it seems like the image is relatively standard, you can just set given borders for the brain and crop to that every time.
edited 1 hour ago
answered 1 hour ago
Carl Lange
1,313318
1,313318
Thank you very much, that was easier than I thought :)
â holistic
1 hour ago
add a comment |Â
Thank you very much, that was easier than I thought :)
â holistic
1 hour ago
Thank you very much, that was easier than I thought :)
â holistic
1 hour ago
Thank you very much, that was easier than I thought :)
â holistic
1 hour ago
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f184234%2fisolate-structures-from-image%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Something like
DeleteSmallComponents@Dilation[Binarize[img, 0.4, 0.6], 1]
perhaps.â C. E.
1 hour ago