简体   繁体   English

使用sitk获取偏置场

[英]Get bias field using sitk

I'm trying to use sitk library to clear biased Mr image (MRI).我正在尝试使用 sitk 库来清除有偏见的 Mr 图像(MRI)。

I'm able to get the corrected image but can't get the bias image.我能够获得校正后的图像,但无法获得偏差图像。

Set the following parameters:设置以下参数:

shrink_factor=1,
mask_image=mask, 
number_of_iterations=100, 
number_of_fitting_levels=4

This is the code I tried这是我试过的代码

corrected_image = corrector.Execute(image, maskImage)

log_bias_field = corrector.GetLogBiasFieldAsImage(inputImage)
bias_exp = sitk.Cast(sitk.Exp(log_bias_field), sitk.sitkFloat64)
bias = inputImage / bias_exp
bias = sitk.GetArrayFromImage(bias)
bias = bias / bias.max()

But I get this image:但我得到了这张图片:

偏见^^

Do you know how to get the bias only?你知道如何获得偏见吗?

To get the bias field function you need to decide on what resolution, for the full resolution image:要获得偏置场 function,您需要决定全分辨率图像的分辨率:

bias_field_full_resolution = sitk.Exp(corrector.GetLogBiasFieldAsImage(biased_image_full_resolution))

When calling the Execute method the bias field is estimated and the corrected image has the same resolution as the input, which is often a resampled version of the original biased image.调用Execute方法时,会估计偏置场,校正后的图像与输入具有相同的分辨率,这通常是原始偏置图像的重新采样版本。

If we actually want to correct the image at the original resolution:如果我们真的想以原始分辨率校正图像:

bias_field_full_resolution = sitk.Exp(corrector.GetLogBiasFieldAsImage(biased_image_full_resolution))
corrected_image_full_resolution = biased_image_full_resolution / bias_field_full_resolution

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM