dvhcalc.py 文件源码

python
阅读 32 收藏 0 点赞 0 评论 0

项目:DVH 作者: glucee 项目源码 文件源码
def calculate_contour_dvh(mask, doseplane, maxdose, dd, id, structure):
    """Calculate the differential DVH for the given contour and dose plane."""
    # Multiply the structure mask by the dose plane to get the dose mask
    mask = ma.array(doseplane * dd['dosegridscaling'] * 100, mask=~mask)
    # Calculate the differential dvh
    hist, edges = np.histogram(mask.compressed(),
                               bins=maxdose,
                               range=(0, maxdose))

    # Calculate the volume for the contour for the given dose plane
    vol = sum(hist) * ((id['pixelspacing'][0]) *
                       (id['pixelspacing'][1]) *
                       (structure['thickness']))
    return hist, vol

# ========================== Test DVH Calculation =========================== #
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号