フィルターのクリア

How to calculate entropy of a DICOM image (16-bit depth)?

2 ビュー (過去 30 日間)
Abdul Gaffar
Abdul Gaffar 2021 年 6 月 11 日
コメント済み: Abdul Gaffar 2021 年 6 月 14 日
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?

採用された回答

DGM
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 件)

カテゴリ

Help Center および File ExchangeDICOM Format についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by