Thread Subject: thresholding MR Images

Subject: thresholding MR Images

From: David Bennett

Date: 19 Mar, 2010 12:36:02

Message: 1 of 5

Hi,
I am opening vendor specific MRI images (not dicom) whose elements are unsigned 16-bit integers. I tried thresholding the "images" using graythresh but always received back a "level" of 0.0. Then I tried saving the MR image data as a TIFF file and applying graythresh() to the TIFF file - same result, i.e., the result of the code:

I = imread('MRI.tiff'); % or imread('MRI.bin')
level = graythresh(I);
BW = im2bw(I,level);
imview(BW)
 
is all logical 1s.

I can manually insert a “level” (say 0.0035) into the im2bw(I,level) to give a meaningful result from im2bw but I want to remove the manual threshholding step (obviously).

any suggestions are greatly appreciated!

thank you

Subject: thresholding MR Images

From: ImageAnalyst

Date: 19 Mar, 2010 13:18:47

Message: 2 of 5

Well that's where the "art" comes in. You have to look at a bunch of
histograms and think up a custom threshold selection algorithm that
works for the type of histograms that you encounter. Most likely it
won't be the Otsu method like graythresh uses if you pass in no
parameter. You have to look at where .0035 falls on the histogram and
figure out how to chop the histogram at that same location even if the
location needs to be adjusted slightly because the shape of the
histogram is slightly different.

Subject: thresholding MR Images

From: David Bennett

Date: 19 Mar, 2010 17:56:04

Message: 3 of 5

Hi ImageAnalyst,
thank you for your advice.
I don't know anything about Otsu's method, but I would assume that the algorithm would always pick some threshold (or "level") for a grayscale image (even if the image is noisy). Also, when graythresh returns "level" = 0.0, I don't know what that means, i.e. is the image too noisy to find a level, or, because my image elements are 16-bit, was there information lost in the conversion to 8-bit (although the author of graythresh says that the function can take uint16 data....I just don't see in the graythresh code how uint16 data is handled differently) ?

cheers
-Dave

ImageAnalyst <imageanalyst@mailinator.com> wrote in message <b5311ba1-f020-4b79-bf60-c4f5b912a08a@b7g2000yqd.googlegroups.com>...
> Well that's where the "art" comes in. You have to look at a bunch of
> histograms and think up a custom threshold selection algorithm that
> works for the type of histograms that you encounter. Most likely it
> won't be the Otsu method like graythresh uses if you pass in no
> parameter. You have to look at where .0035 falls on the histogram and
> figure out how to chop the histogram at that same location even if the
> location needs to be adjusted slightly because the shape of the
> histogram is slightly different.

Subject: thresholding MR Images

From: ImageAnalyst

Date: 19 Mar, 2010 18:23:11

Message: 4 of 5

Don't worry about what it does - you're not going to use it. Like I
said, chances are it won't pick the right threshold for you anyway.
You can look up the Otsu method if you want (basically it chooses a
threshold such that the RMS difference between the binary image and
the original image is minimized I believe), but you're most likely
going to need to develop your own algorithm for thresholding.

Subject: thresholding MR Images

From: ImageAnalyst

Date: 20 Mar, 2010 02:41:51

Message: 5 of 5

David:
I just stumbled across a kmeans segmentation routine in the File
Exchange.
http://www.mathworks.com/matlabcentral/fileexchange/8379-kmeans-image-segmentation
I didn't download it or run it - I just looked at the screenshot - but
it does classification of an MRI image. Check it out if you want.

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
image thresholding David Bennett 19 Mar, 2010 13:59:26
rssFeed for this Thread

Contact us at files@mathworks.com