How to calculate entropy of a DICOM image (16-bit depth)?
2 ビュー (過去 30 日間)
古いコメントを表示
According to MatLab,
- By default, entropy uses two bins for logical arrays and 256 bins for uint8, uint16, or double arrays.
- entropy converts any class other than logical to uint8 for the histogram count calculation so that the pixel values are discrete and directly correspond to a bin value.
How to calculate exact value of entropy for 16-bit DICOM image without converting to uint8 class, i.e, utilizing 2^(16) bins?
0 件のコメント
採用された回答
DGM
2021 年 6 月 12 日
Just open up entropy() or look at the docs to see how it works.
% just grab some image and make it into an example
inpict = imread('cameraman.tif'); % this is uint8
inpict = im2uint16(inpict); % make it uint16
% process it to move the data outside of 2^8 locations
inpict = imfilter(inpict,fspecial('disk',3));
% this is what entropy() does
counts = imhist(inpict(:),2^16);
numel(counts) % it's using 65536 bins
counts = counts(counts~=0); % get rid of empty bins
numel(counts) % how many bins are left?
counts = counts/numel(inpict); % normalize the sum
E = -sum(counts.*log2(counts)) % this is the result with 65536 bins
F = entropy(inpict) % this is the result with 256 bins
For illustrative purposes, try commenting out the imfilter() line and see what happens to the bin counts and the relationship between E and F.
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!