Hyper Image intensity level

Hi,
How can I find The total number of possible intensity levels in 3D hyper image?
is it the total number of bands? or the sum of the wavelength values ? I'm not sure
I'm calculating the threshold Otsu for hyper image.
Many thanx,

 Accepted Answer

Iain
Iain on 25 Jun 2013
You need to know the bit depth of each "slice" of your hypercube. (We can't tell you this, but its normally 8 bit for a standard RGB image, but can be as high as 24 or as low as 4, for whatever it is that you're looking at.)
Once you know that:
total_number_of_colours = 2^depth_slice_1 * 2^depth_slice_2 * 2^depth_slice_3 ...
Intensity is a little bit different,
Basic_max_intensity = (2^depth_slice_1 - 1) + (2^depth_slice_2 - 1) + (2^depth_slice_3 - 1) ...
Optical_max = (2^depth_slice_1 - 1)*scale_1 + (2^depth_slice_2 - 1) *scale_2 + (2^depth_slice_3 - 1) * scale_3 ... % Where "scale" is a conversion from pixel values to an optical power or energy.

7 Comments

how do I know the bit depth of each slice ?
(my test image in bsq extention)
To "know", you'll need to review the documentation for the bsq file, or the hardware that produced it.
To "have a good guess", if you find the maximum value in each slice, take the log base 2 of that value, and round up (probably to the nearest even number), that'll give you some indication. I would also check that the smallest difference between pixel levels is 1 - if its 2, 4, 8 etc., you may need to divide the max by that number.
ok, How do I slice my hypercube ? in matlab code plz. I'm just a beginner
Thank you for your time and effort.
my image is 16 bit (uint 16) . does that mean the intensity level is 65536 ?
The maximum intensity you can store in a 16 bit integer, is indeed 65535.
The maximum intensity you can store in a 8 bit integer is 255.
It is not convenient to store 10, 12 or 14 bit integers in anything other than 16 bit, so it could be that your intensity is 1023, 4095, 16383 of 65535.
Q1)-Aha so 65536 is the total number of possible intensity levels in 16 bit image?
Q2)-Do you know how to get the average of the intensities of all pixels in the hyper image?
does this code give me the average ?
the_avg = mean2(HyperImage);
Thank you very much :)
Q1)-Aha so 65536 is the total number of possible intensity levels in 16 bit image?
65536 is the total number of possible values a 16 bit integer can take. Your image is stored in 16 bit integers. This does NOT mean that all 65536 are used by your image format and that there isn't something else to look at in your image format. - You need to check the documentation of the file format you have been given to know the possible intensity levels in your files.
Q2)-Do you know how to get the average of the intensities of all pixels in the hyper image?
average = mean(HyperImage(:));
Will take the average of every 16 bit element in HyperImage

Sign in to comment.

More Answers (2)

Mona
Mona on 25 Jun 2013
or is it just like 2D images? 256?
please help thanx
Walter Roberson
Walter Roberson on 25 Jun 2013
Each portion of information will have a number of possible states. Multiply together the number of states per portion.
For example, if band #1 had 5 possible values, and band #2 had 32 possible values, then the total number of intensity levels would be (5 x 32) = 160.
When a particular portion is defined as being a certain number of bits, and all of the variations are allowed, then the number of states for that portion is 2 to the power of the number of bits. I could, for example, have defined band #2 as having 5 bits, 2^5 = 32

2 Comments

how can I write this as a code? like how can I calculate the possible values of each band and multiply the values to find the intensity levels then save the number of the intensity levels in a variable ?
many many thanx,
I have a wavelength file that has the values of the wavelength for each band. is those are the possible values? for example: band 1: 363 band 2: 364 band 3: 364 band 4: 365 and so on
365 366 367 367

Sign in to comment.

Categories

Find more on Read, Write, and Modify Image in Help Center and File Exchange

Asked:

on 25 Jun 2013

Community Treasure Hunt

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

Start Hunting!