I am working with dicom chest PA's. I have no problem loading the images and doing basic thresholding work, however I need to apply some filters. I will be designing my own filters in the future but for now I want to use the MATLAB ones. The images are 16bit and in MATLAB docs it says that fspecial
works fine with 16bit images.
When I try using fspecial
or the edge
functions i get similar results to the images as shown below.
My question: why is this happening and how do i fix it?
Your help is appreciated. Regards,
full_path = 'I:\Find and Treat\Anonymized_Data\000026_20050607112512_1.dcm';
dicominfo_image = dicominfo(full_path);
dicomread_image = dicomread(dicominfo_image);
dicomread_image = mat2gray(dicomread_image);
c = imcomplement(dicomread_image);
figure,
subplot(1,3,1)
imshow(c)
f = fspecial('laplacian');
cf = filter2(f,c);
subplot(1,3,2)
imshow(cf)
f1 = fspecial('log');
cf1 = filter2(f1,c);
subplot(1,3,3)
imshow(cf1)
EDIT
I added and modified the following code to take into account the dynamic range and plotted a mesh plot i obtained the following result and error message.
Warning: Error updating LineStrip.
Update failed for unknown reason
Warning: Error updating LineStrip.
Update failed for unknown reason
figure,
subplot(2,3,1)
imshow(c, [])
f=fspecial('laplacian');
cf=filter2(f,c);
subplot(2,3,2)
imshow(cf, [])
f1=fspecial('log');
cf1=filter2(f1,c);
subplot(2,3,3)
imshow(cf1, [])
subplot(2,3,4)
mesh(c)
subplot(2,3,5)
mesh(cf)
subplot(2,3,6)
mesh(cf1)
EDIT
imshow(cf1, [])
? – JohnnyQfilter
. If the mesh output looks ok, then you should look at your vizualisation. – Steffen