使用Python获取DICOM图像的ROI的标准偏差

时间:2014-01-21 12:17:54

标签: python matlab dicom standard-deviation roi

我在Matlab中成功完成了这项工作:

function[std_dev_roi, rows, cols] = roi_circle(x,y,r,image)

for h = 0:r
    delta_y = sqrt((r^2) - (h^2));
    delta_y = round(delta_y);
    rows(h+1) = h;
    cols(h+1) = delta_y;
end
rows = [rows, fliplr(rows), -rows, -fliplr(rows)];
cols = [cols, -fliplr(cols), -cols, fliplr(cols)];
cols = cols + y;
rows = rows + x;

binary_mask = roipoly(image, rows, cols);
std_dev_roi = std(image(binary_mask));

end

但我希望函数在Python中执行此操作,但不知道如何考虑没有roipoly。

任何elp非常感谢

0 个答案:

没有答案