필터 지우기
필터 지우기

how to crop multiple files

조회 수: 4 (최근 30일)
yogesh jain
yogesh jain 2015년 10월 12일
댓글: Walter Roberson 2016년 9월 29일
hello guys , worked on triangular mask cropping of a DICOM image , here is the code -
clear all
I=dicomread('four.dcm');
I=uint16(I);
g=imshow(I,[0 600]);
axis on
[x,y]=ginput(3);
h = impoly(gca, [x,y]);
pos = wait(h);
BW = createMask(h,g);
BW=uint16(BW);
J=I.*BW;
figure,imshow(J,[0 600]);
I just want to perform this task on multiple DICOM images . used for loop but createMask is showing error about cell type data variables . what will be the approach ? please suggest me . Thank you
  댓글 수: 1
Walter Roberson
Walter Roberson 2015년 10월 12일
Please show your attempt with a for loop.

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

채택된 답변

Stalin Samuel
Stalin Samuel 2015년 10월 12일
for i = 1:length(fileList)
I=dicomread(fileList{i}); %fileList contains names of all dicom images
I=uint16(I);
g=imshow(I,[0 600]);
axis on
[x,y]=ginput(3);
h = impoly(gca, [x,y]);
pos = wait(h);
BW = createMask(h,g);
BW=uint16(BW);
J=I.*BW;
figure,imshow(J,[0 600]);
end
  댓글 수: 6
Sara Salimi
Sara Salimi 2016년 9월 29일
편집: Sara Salimi 2016년 9월 29일
Dear Walter, thank you very much.
Question: Does cropping affect the processing and and the performance of process/calculation? I mean smoothing or derivatives?
Thanks again
Walter Roberson
Walter Roberson 2016년 9월 29일
Generally speaking, operating on smaller matrices is faster, but for reasonably sized arrays operations like smoothing a sobel filters are pretty quick. Cropping is usually used to remove irrelevant information -- if you know that something is not part of the interesting part of the image, it is confusing to region find on it (for example might be text labels.)

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 DICOM Format에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by