clc;
close all;
clear all;

img = imread('leuk100.bmp');
img = double( rgb2gray(img) );

mbg = comp_stat( img );
positive = (img - mbg > 0).*(img - mbg);
negative = (img - mbg < 0).*(mbg - img);
absolute = abs(img - mbg) + mbg;

[X, Y] = meshgrid(1:length(img), 1:length(img));

vaxis = [0   200     0   200   -50   100];

figure;
mesh(X, Y, img - mbg);
title('Original image');
axis(vaxis);
view(115, 40);

figure;
mesh(X, Y, positive);
title('Positive part');
axis(vaxis);
view(115, 40);

figure;
mesh(X, Y, -negative);
title('Negative part');
axis(vaxis);
view(115, 40);

figure;
mesh(X, Y, absolute - mbg);
title('Absolute part');
axis(vaxis);
view(115, 40);



