function [a, b, c, d, e, f, g, h] = sharpeningprocess(img)

    % (a) Image of whole body bone scan.
    a = img;
    a = im2gray(a);
    a = im2double(a);
    
    % (b) Laplacian of (a).
    lap = fspecial('laplacian', 0);
    b = imfilter(a, lap, 'replicate');
    
    % (c) Sharpened image obtained by adding (a) and (b).
    c = a - b;
    
    % (d) Sobel gradient of image (a).
    sx = fspecial('sobel');
    sy = sx';
    asx = imfilter(a, sx, 'replicate');
    asy = imfilter(a, sy, 'replicate');
    d = abs(asx) + abs(asy);
    
    % (e) Sobel image smoothed with a 5 × 5 box filter.
    e = imfilter(d, fspecial('average', [5 5]), 'replicate');
    
    % (f) Mask image formed by the product of (b) and (e).
    f = b .* e;
    
    % (g) Sharpened image obtained by the adding images (a) and (f).
    g = a - f;
    
    % (h) Final result obtained by applying a powerlaw transformation to (g).
    h = imadjust(g, [0.1 0.6], [0 1], 1.0);

end

