MEDICAL-IMAGE-FILTER-CODE

版本 1.1.0 (218 字节) 作者: Tobi Joshua Samuel
The code allows users to input a scanned medical image file (e.g. tif, .jpeg )
30.0 次下载
更新时间 2023/9/1
This MATLAB script-file can applies several filters to a CT scan image of a patient to isolate and observe different tissues for lung cancer research. The program applies a 5x5 low pass filter, a 3x3 high pass filter, and a 3x3 edge detection filter to the original image. The filtered and unfiltered images are displayed in a figure with four subplots, including the original image, the smoothed image, the sharpened image, and the edge detection image. Additionally, an extra credit task is included, which removes pixels with intensities less than 200 and greater than 700 and displays the resulting image in a separate figure.
% Enter the Scanned Image File (e.g .tif,.jpeg)
image = imread('input'); % Please replace the 'input' with the image file.
% Display the original image
subplot(2, 2, 1);
imshow(image);
title('Original Image');
% Apply a 5X5 low pass filter to smoothen the image
Low_pass_filter = [1,1,1,1,1;1,1,1,1,1;1,1,1,1,1;1,1,1,1,1;1,1,1,1,1]/5;
smoothed_image = conv2(Low_pass_filter, double(image));
% Display the smoothed image
subplot(2, 2, 2);
imshow(smoothed_image);
title('Smoothed Image');
% Apply a 3X3 high pass filter to sharpen the image
High_pass_filter = [-1,-1,-1;-1,9,-1;-1,-1,-1];
sharpened_image = conv2(smoothed_image, double(High_pass_filter));
% Display the sharpened image
subplot(2, 2, 3);
imshow(sharpened_image);
title('Sharpened Image');
% Apply an edge detection filter to detect the edges of the lungs
edge_detection_filter = [-1,-1,-1;-1,5,-1;-1,-1,-1];
edge_image = conv2(smoothed_image, double(edge_detection_filter));
% Display the edge detection image
subplot(2, 2, 4);
edge(edge_image);
title('Edge Detection Image');
% Display the color bar showing the intensity
colormap(gray);
colorbar;
% Remove pixels outside the range [200, 700]
removed_pixels_image = smoothed_image;
removed_pixels_image(removed_pixels_image < 200) = 0;
removed_pixels_image(removed_pixels_image > 700) = 0;
% Display the removed pixels image
figure;
imshow(removed_pixels_image);
title('Removed Pixels Image');
colormap(gray);
colorbar;

引用格式

Tobi Joshua Samuel (2024). MEDICAL-IMAGE-FILTER-CODE (https://github.com/Tobi-joshua/MEDICAL-IMAGE-FILTER-MATLAB-CODE/releases/tag/1.1.0), GitHub. 检索时间: .

MATLAB 版本兼容性
创建方式 R2023a
兼容任何版本
平台兼容性
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!
版本 已发布 发行说明
1.1.0

See release notes for this release on GitHub: https://github.com/Tobi-joshua/MEDICAL-IMAGE-FILTER-CODE/releases/tag/1.1.0

1.0.0

要查看或报告此来自 GitHub 的附加功能中的问题,请访问其 GitHub 仓库
要查看或报告此来自 GitHub 的附加功能中的问题,请访问其 GitHub 仓库