Hello everybody. I hope you are ok.
I have a get_segmentation_size() function, which allows opening the resulting binary mask from targeting a certain structure (eg the lungs or heart) of a certain patient and calculates its maximum width, maximum height and area (white region):
function [Width,Height,Area]=get_segmentation_size(SegmentationImage)
Area=0;
Height1=0;
Height2=100000;
Width1=0;
Width2=100000;
for i=1:2048
for j=1:2048
if SegmentationImage(i,j)~=0
Area=Area+1;
if Width1<=j
Width1=j;
end
if Width2>=j
Width2=j;
end
if Height1<=i
Height1=i;
end
if Height2>=j
Height2=j;
end
end
end
end
Width=Width1-Width2
Height=Height1-Height2
Area=Area
end
Now I have to develop another script that demonstrates the use of this function.
How can I do this?
Thanks for helping

댓글 수: 6

Geoff Hayes
Geoff Hayes 2022년 1월 14일
@Joao Joao - do you a SegmentationImage that you can pass into this function? Is that all that is missing or are you required to do something else?
Rik
Rik 2022년 1월 14일
It seems much more productive to write actual documentation for this function, instead of hiding it away in an example script. Comments will explain what is happening in this function.
Joao Joao
Joao Joao 2022년 1월 14일
@Geoff Hayes I think that's all that's missing. I didn't do this function. A friend of mine did and now I have to create a script that demonstrates this function
Joao Joao
Joao Joao 2022년 1월 14일
@Rik I agree with you. But in this work I have to hide it in a script that demonstrates the use of the function. How do I make this script?
Rik
Rik 2022년 1월 14일
I would suggest going back to whoever gave you this task and attempt to explain why it is counterproductive. If code is not commented/documented, it is not important.
Joao Joao
Joao Joao 2022년 1월 15일
ok thanks

댓글을 달려면 로그인하십시오.

 채택된 답변

Steven Lord
Steven Lord 2022년 1월 14일

0 개 추천

If you're trying to create examples like the ones in this part of the documentation take a look at the tools described on this documentation page.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

제품

릴리스

R2020a

질문:

2022년 1월 14일

댓글:

2022년 1월 15일

Community Treasure Hunt

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

Start Hunting!

Translated by