Monai中intensity相关的Transform

医学图像中的intensity变化较大,且有具体含义,查看不同的部位需要使用不同的窗宽和窗位,因此我们在对数据预处理时也需要采用合适的窗宽和窗位。如对脾脏的分割中,只需要脾脏的CT值范围(假设在-300-- +300之间),而不需要骨头等高强度的信号(大于2000)。Monai中为了更合理的intensity的范围设置了几种Transform。

一、ScaleIntensityRanged or ScaleIntensityRange

将[a_min, a_max]范围的intensity变换到[b_min, b_max],intensity > a_max, b_max; intensity < a_ min, b_min.
img = (img - a_min) / (a_max - a_min)
img = img * (b_max - b_min) + b_min
if clip = True: img = clip(img, b_min, b_max) # if an interval of [0, 1] is specified, values smaller than 0 become 0, and values larger than 1 become 1.

ScaleIntensityRanged(
            keys=["image"],
            a_min=0,
            a_max=500,
            b_min=0.0,
            b_max=1.0,
            clip=True,
        ),

在这里插入图片描述

二、 ThresholdIntensityd or ThresholdIntensity

ThresholdIntensityd(keys=['image'], threshold=500., above=True, cval=0.), # intensity < threshold(对应above=True)的置为cval
ThresholdIntensityd(keys=['image'], threshold=3000., above=False, cval=3000.),   # intensity > threshold(对应above=False)的值置为cval

三、ScaleIntensityd or ScaleIntensity

最大最小归一化

ScaleIntensityd(keys=['image'], minv=0., maxv=1.),

在这里插入图片描述

四、NormalizeIntensityd or NormalizeIntensity

均值标准差归一化, x = (x - miu) / sigma
在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值