Filter löschen
Filter löschen

how to crop multiple files

4 Ansichten (letzte 30 Tage)
yogesh jain
yogesh jain am 12 Okt. 2015
Kommentiert: Walter Roberson am 29 Sep. 2016
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 Kommentar
Walter Roberson
Walter Roberson am 12 Okt. 2015
Please show your attempt with a for loop.

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Stalin Samuel
Stalin Samuel am 12 Okt. 2015
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 Kommentare
Sara Salimi
Sara Salimi am 29 Sep. 2016
Bearbeitet: Sara Salimi am 29 Sep. 2016
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 am 29 Sep. 2016
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.)

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu DICOM Format finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by