Download this file

28 lines (26 with data), 684 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
%% Quantification of Trabeculae Inside the Heart from MRI Using Fractal Analysis
%% This code is written by-
%Md. Kamrul Hasan, M1 MAIA
%Md. Fakrul Islam Tushar, M1 MAIA
%%
clc
clear all
close all
%%
X= dicomread(dicominfo('Image1'));
figure
imshow(X,[]);
%% Binary Image Formations
X=uint8(X);
level = graythresh(X);
Binary_Image = im2bw(X,level);
%% Box Ploting for FD
figure
[n,r] = boxcount(Binary_Image,'slope');
df = -diff(log(n))./diff(log(r));
disp(['Fractal dimension, Df = ' num2str(mean(df(4:8))) ' +/- ' num2str(std(df(4:8)))]);
%% Probability P=0.8,
Countour = randcantor(0.8);
figure
boxcount(Countour)
%% END