Image Processing

I would greatly appreciate help with coding the following image processing steps in matlab: - loading in an analyze image (type:hdr/img) and binarize it (BW image and the ROI are the white areas) - For each "white area" (defined either by a 1 or 0), create its own separate mask
I am having trouble flowing each step into the other and figuring it out. I have some experience with MATLAB but I am really having trouble with this combination. I would greatly appreciate anyone's help!
Thank you in advance!

3 Comments

Sven
Sven on 12 Nov 2011
Do you have the image processing toolbox, and have you checked out the docs about labeling black and white images?
http://www.mathworks.com/help/toolbox/images/f18-34186.html
Elle
Elle on 14 Nov 2011
I have looking into how to binarize the image to where it is a set of 0's and 1's but I could not figure out how to have it identify the 1s in the image and then group them. I thought of if the entire image after it was binarize was then made into a matrix of 1's and 0's and then just have each group of 1's separated and then made into a mask to utilize later but I wasn't sure it that would be possible because looking at the link you provided, the image is an image of the brain and not an exact shape such as a square. I do not have the image processing toolbox but I will definitely look into that.
Thanks!
bwlabel() to group the 1's.
regionprops() to get the individual masks.

Sign in to comment.

 Accepted Answer

Image Analyst
Image Analyst on 14 Nov 2011

1 vote

Look at my BlobsDemo - it does all that. Well, different image format (not hdr/img - whatever that is) but basically it finds and measures objects.
You should get the Image Processing Toolbox. It will be hard to do much image processing without it unless you love to spend lots of time reinventing wheels and things.

4 Comments

Elle
Elle on 2 Dec 2011
Thank you for the demo link! It does the step that I am looking for but I was wondering if it would still work for a 3-dimensional image? Would I be able to binarize it and outline the areas of interest for a 3-d image?
You'll probably need to change a few things, but it should still work. You said above that you don't have the Image Processing Toolbox, are you sure? Image Analyst's demos appear to rely heavily on it.
Elle
Elle on 2 Dec 2011
I was most definitely mistaken, I do indeed have the Image Processing Toolbox.
If by 3D image you mean a color image, check out my color segmentation examples. If you mean a gray scale volumetric image you'd have to change a few things perhaps. Some routines have a higher dimensional version like bwlabeln(), convn(), and so on. You could probably change bwlabel to bwlabeln() or bwconncomp() (which is newer and better/faster) and that would probably get a lot of it to work, like regionprops(). The cropping part wouldn't though since the cropping assumes 2D grayscale images.

Sign in to comment.

More Answers (2)

Walter Roberson
Walter Roberson on 14 Nov 2011

1 vote

It appears that there is at least one user contribution that can load data from ANALYZE files: http://www.mathworks.com/matlabcentral/fileexchange/8797

1 Comment

An additional toolset that can read ANALYZE files appears to be http://www.rotman-baycrest.on.ca/~jimmy/NIFTI/

Sign in to comment.

for easy automatic hdr/img reading:
doc analyze75read %and friends

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!