Finding Min Max Pixels and Co-ordinates from DICOM images?
조회 수: 2 (최근 30일)
이전 댓글 표시
hey, i am new here, i have dicom images i need to get 4 max pixel values and their co-ordinates and aromatically crop the 128 by 128 4 patches from that image keeping the center pixel one of the max pixel that has been found? please how can i do it
채택된 답변
Image Analyst
2016년 11월 1일
To get the 4 max values, sort the image in descending order:
sortedValues = sort(grayImage, 'descend');
% Get the 4 max values and their coords
for k = 1 : 4
thisValue = sortedValues(k);
% Find where it occurs
[rows, columns] = find(grayImage, thisValue);
% Plot them over the image
for k2 = 1 : length(rows)
thisRow = rows(k2);
thisColumn = columns(k2);
plot(thisColumn, thisRow, 'r+');
hold on;
text(thisColumn, thisRow, num2str(k));
% Crop into a new image
row1 = thisRow - 64;
row2 = row1 + 127;
col1 = thisColumn - 64;
col2 = col1 + 127;
subImage = grayImage(row1:row2, col1:col2);
% Now do something with subimage....
end
end
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 DICOM Format에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!