1

I am trying to find the threshold of a 3D image that is 258 x 318 x 801 double. I first reshaped the image into 1D array and then used graythresh

ROI = reshape(postImg,[],1);
thresh = graythresh(ROI);

But I was trying to find the actually intensity threshold instead of a value between 0 and 1. Is there a way to convert this other than using multithresh?

March2020
  • 13
  • 4
  • What does "actually intensity threshold" mean if not "a value between 0 and 1"? What value do you expect? – beaker Apr 13 '20 at 17:03
  • I am expecting a value ranging from 1000 -100000. some value like that – March2020 Apr 14 '20 at 17:24
  • Why are you expecting that? Can you provide a *small* sample image and your expected threshold? I still don't understand what you're calling the "actual intensity threshold". – beaker Apr 14 '20 at 17:26
  • I actually figured that that.. I just need to de-normalize the value – March2020 Apr 18 '20 at 14:34
  • Cool, but just for my curiosity I'd like to know what kind of image has an intensity value from 1000 - 100000. Intensity values normally range from 0-1 for floating-point or 0-255 for uint8 images. – beaker Apr 18 '20 at 15:12
  • it is a ct scanned image of a bone (with tissue and vessels). The vessels part has a intensity value around >=7000, and the edge of the bone has a intensity value around 2000~.. and then it gets lower as it moves out of the bone to the empty space – March2020 Apr 18 '20 at 15:41
  • Oh, cool. Yeah, definitely not normal image numbers ;) – beaker Apr 18 '20 at 15:45

1 Answers1

1

From MATLAB documentation:

The graythresh function converts multidimensional arrays to 2-D arrays, using reshape, and ignores any nonzero imaginary part of I.

So, your reshape is probably redundant. I think this would do:

thresh = graythresh(postImg); % postIm can be 3D
BinIm = imbinarize(postIm,thresh); % creates a binary mask of your image
If_You_Say_So
  • 1,195
  • 1
  • 10
  • 25