Program on digital processing of thoracic x-ray images

1 view (last 30 days)
I have to make a code that allows me to calculate the RCT, this is the quocient between the width of the heart and the width of the lungs. I am provided with a briefcase that has several images of separate hearts and lungs. These images are identified with the patient ID and structure (heart ou lungs). I also already have a function that allows me to calculate the width and the position of heart or lungs, depends on the image chosen. However, there are patients who only have one of the tests, for exemple, only lungs or only hearts. I think I have to creat an "if" cycle, so that if the patient only has one of the tests, issue an error message, if the patient has both exams calculate the width for each image and then the quotient between them. But I do not know how to do it. If you can help me, I'd appreciate it. Thank you very much.
P.S: I can not use the native Matlab functions

Answers (1)

Image Analyst
Image Analyst on 23 Jan 2022
If you cannot use MATLAB, then I'm afraid we cannot help. This is a forum for helping people with their MATLAB programming.
% Call your custom-written functions depending on what kind of tests
% this particular patient had performed.
if patientHadHeartTestPerformed % For example, get this flag from your table or database.
heartResults = ProcessImageForHeart(yourImage);
end
if patientHadLungTestPerformed
lungResults = ProcessImageForLungs(yourImage);
end
  5 Comments
Maria  Vilas Boas
Maria Vilas Boas on 25 Jan 2022
My teacher gave me a list of functions I can use. However the list has reticence, so I can use a few more. The list he gave me is this one:
clear, clc, close, dir, xlsread, xlswrite, imread, imwrite, length, isempty, size, zeros, ones, eye, double, uint8, uint16, str2num, num2str, figure, subplot, plot, imshow, histogram, title, xlabel, ylabel, ginput, input, disp, fprintf, inputdlg, questdlg, listdlg, strcmp, erase, try, catch, exist, inpolygon, readtable, table2struct, creatMask, imbinarize, regionfill, varargin, varargout, isa, imhist, isfile, datetime, errordlg, pause, cell2mat, menu, im2uint16, break, "for", "if", "and", isnan, return, warning,...
Image Analyst
Image Analyst on 25 Jan 2022
OK, I think my original answer stands:
% Call your custom-written functions depending on what kind of tests
% this particular patient had performed.
if patientHadHeartTestPerformed % For example, get this flag from your table or database.
heartResults = ProcessImageForHeart(yourImage);
end
if patientHadLungTestPerformed
lungResults = ProcessImageForLungs(yourImage);
end
You said "I also already have a function that allows me to calculate the width and the position of heart or lungs" so you would just use that function in place of my "ProcessImageForHeart" or "ProcessImageForLungs" function. Just make sure your function doesn't use any of the banned functions. You should ask your professor to review your code just to make sure.

Sign in to comment.

Categories

Find more on View and Analyze Simulation Results in Help Center and File Exchange

Products


Release

R2020a

Community Treasure Hunt

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

Start Hunting!