基于B样条和水平集方法的医学图像联合分割与配准 下载: 808次
ing at the problems that non-rigid registration of layered B-spline exists local extremum and the level set segmentation method is not suitable for noisy image segmentation, a joint segmentation and registration of medical image based on locally updated hierarchical B-spline bidirectional transformation and level set method is proposed. The proposed method adds a registration transformation to the segmentation algorithm, and the structure information of image segmentation is incorporated into the registration. The B-spline level set function is used to smooth the transformed and segmented image, and a two-way transformation is introduced in the registration to improve the accuracy and smoothness of the registration. Based on the level set method, the bi-directional layered B-spline transform is introduced to construct the joint energy functional of segmentation and registration, and the gradient descent method is used to minimize the energy functional to optimize the objective function. Experimental results show that the Dice metric is always above 99% and the mean square error is reduced by 30% compared with the single image segmentation method. The proposed method improves the registration accuracy and has better robustness in noise image segmentation.
1 引言
图像配准和图像分割作为医学图像处理领域的关键技术,对临床诊断和手术定位有重要意义。传统方法都是将分割与配准独立进行,但随着医学图像处理的要求日益严格,独立使用分割[1]和配准方法[2]的局限性逐渐突出。
医学图像的配准方法可分为刚性配准和非刚性配准两大类,对未发生形变的图像使用刚性配准,相反图像间存在较大形变时就要使用非刚性配准。非刚性配准方法主要有基于样条和基于物理模型的方法[3],常用的样条方法有薄板样条法、B样条法等。B样条法因具有良好的局部变换能力,成为国内外应用最广泛的样条方法。Gu等[4]使用B样条法对形变较大的图像进行配准;Xie等[5]将B样条控制网格逐层细化提出了分层B样条(HBS)配准方法;Pawar等[6]为去除HBS中重叠的部分提出了截断分层B样条(THBS)配准方法;刘晨等[7]提出了一种将尺度不变特征转换(SIFT)和分层B样条相结合的配准方法。虽然分层B样条能有效提高图像的配准精度[8],但配准形变复杂的医学图像时,局部极值问题很突出。图像分割方法主要有基于阈值的分割方法[9]、基于区域的活动轮廓分割方法[10]、基于边缘[11]的活动轮廓分割方法,在活动轮廓模型中,水平集方法应用较为广泛。Li等[12]提出了一种基于区域的水平集图像分割方法用于医学图像分割; Chan等[11]提出了一种基于Mumford-Shah函数和水平集的活动轮廓分割模型,对图像中的复杂结构进行分割;韩哲等[13]提出了一种基于改进遗传模糊聚类和水平集方法的图像分割算法,提高了对目标边缘的分割精度,但对有噪声图像的分割效果欠佳。
为解决分层B样条配准的局部极值和水平集分割算法鲁棒性差的问题,引入了联合分割与配准方法,目前对于联合分割与配准方法的研究较少。Droske[14]和Vemuri[15]等提出了联合分割与配准的理论,Swierczynski等[16]提出了一种将水平集方法和密集位移场相结合的联合分割与配准方法,提高了肺部电子计算机断层扫描(CT)图像的配准精度,证明了联合方法的可行性。本文结合了基于分层B样条的图像配准方法和基于水平集的分割方法,并在局部更新的分层B样条配准中引入双向变换,提出了一种基于局部更新分层B样条双向变换和水平集方法的医学图像联合分割与配准方法。先从待配准图像中分割出其水平集轮廓,然后使用局部更新的分层B样条变换模型将其变形并与参考图像进行匹配,从而实现对参考图像的分割;使用局部更新分层B样条变换进行配准的同时,利用分割得到的目标边界信息对图像特征进行精确变形,并引入双向变换提高配准的精度和平滑性;在水平集方法的基础上引入了双向分层B样条变换构造了分割与配准的联合能量泛函,实现联合分割与配准;结合梯度下降法将能量泛函最小化以优化目标函数,得到最终的分割与配准结果。
2 分割与配准模型
2.1 B样条变换
设二维图像中控制点的位置为φi,j,控制网格的间距为δx×δy,则图像上任意一点(x,y)的B样条变换可表示为
式中,φi+k,j+n为邻近控制点的坐标位置,
2.2 局部更新的分层B样条变换
分层B样条配准是通过逐层增加控制网格的密度直到某一网格下的配准误差小于设定的阈值,可以提高配准精度,但计算量大,因此将控制网格局部细化对提高配准效率有重要作用。Bornemann等[17]提出了一种针对分层B样条控制网格局部细化的更新策略,其原理如
局部更新分层B样条不是在每一个细化级别均匀的细化网格,而是只细化图像中变化较大的区域。首先在待配准图像上构造一个4×4的控制网格,然后通过调整控制点的位置实现图像的变形,对于图像变化复杂的区域,其控制网格会在局部进行细化和调整,从而完善图像局部的变形。局部更新分层B样条中,细化级别l上的B样条基函数都可以由细化级别l+1上的子B样条基函数的线性组合表示为
式中,cm,i为通过节点插入算法确定的控制网格细分系数,
2.3 水平集方法
水平集方法的基本原理是通过零水平集在三维连续函数曲面中嵌入二维平面闭合曲线,根据二维平面闭合曲线的方程演化出水平集函数方程,以此对图像目标轮廓进行分割。设二维平面的曲线方程α=β(r),三维连续函数的曲面方程μ(r,s)=α-β(r),则μ(r,s)=0就隐式表达了二维平面闭合曲线,即用曲面方程中与平面曲线具有相同函数值的曲线隐式表示平面曲线,通过不断更新水平集函数,演化隐含在水平集函数中的闭合曲线,即使闭合曲线的拓扑结构发生了改变,水平集函数依然有效。
3 本文方法
3.1 配准中引入双向变换
使用的联合方法在局部更新的分层B样条配准过程中引入双向变换以增加图像配准的精确性和对称性。首先给定待配准图像F(X)和参考图像R(X),F(X)和R(X)之间的空间变换函数为T(X),通过迭代最小化能量泛函再求出最优T(X)。由当前迭代的Tn(X)和下一次迭代的变形场Vn+1可得到下一迭代的Tn+1(X)
前向配准中,将F(X)通过变换函数f(X)变形为R(X),后向配准中,将R(X)通过变换函数b(X)变形为F(X)。在双向变换过程中,利用更新的控制点位置可计算出更新的前向变形场Vf(X)和后向变形场Vb(X)
式中,
3.2 图像的平滑
采用B样条水平集函数对变换和分割后的图像进行C2平滑表示,平滑表示不仅能减少噪声的影响,还能提高数值计算的精度和收敛性。B样条水平集函数S(X)可表示为
式中n1,n2分别为每个方向上单变量基函数的数量,
式中,g(x,y)为图像的强度值,Ω为图像域。
通过滤波的方法将图像进行平滑表示,将(2)式中的B样条基函数离散化得到离散B样条基函数B'(x)
将B'(x)作为数字滤波器,通过卷积运算对图像进行平滑表示。则在图像X的坐标(x,y)处的平滑表示为
式中,m1=[x-2],m2=[y-2]。因此(4)式可改写为
式中,
3.3 联合分割与配准
在水平集方法的基础上引入双向分层B样条变换构造分割与配准的联合能量泛函,从而实现联合分割与配准。通过L2梯度下降法最小化能量泛函以优化目标函数,从而更新控制点位置、变形场和变换等。联合方法的能量泛函由两部分组成,可表示为
用来平衡配准和分割的部分Efid
式中,θ1和θ2为加权参数,用于平衡分割和配准,
与θ1相乘的部分表示待配准图像的水平集轮廓变形后对参考图像进行水平集轮廓分割。
与θ2相乘的部分为最小化的两幅图像灰度值强度的误差平方和,gf(X)和gb(X)分别用于减少图像边界的配准,可表示为
式中,γ是为了防止分母变为0而加入的自定义参数,此处设为10-11~10-12。
用L2梯度下降法将Efid
式中,
式中,Ñ为梯度。能量泛函中第二部分Ereg
式中,
使用L2梯度下降法将Ereg
式中,
式中,
3.4 算法流程
基于局部更新分层B样条双向变换和水平集方法的医学图像联合分割与配准算法的流程如
主要步骤:
1) 输入分辨率相同的两幅医学图像,分别记为待配准图像F(X)和参考图像R(X)。
2) 初始化分层B样条模型参数、迭代次数以及最小误差等参数。
3) 分割出待配准图像的水平集轮廓。
4) 用B样条水平集函数平滑表示初步变换图像和分割图像。
5) 构造分割与配准的联合能量泛函。
6) 计算分割精度的Dice相似度(DS)和待配准图像之间的相似性测度均方误差(MSE)。
7) 判断参数是否达到最优,若是则退出迭代,否则返回步骤5)。通过梯度下降法最小化能量泛函更新参数,首先使用L2梯度下降法最小化Efid
8) 输出配准结果和分割结果。
4 实验结果与分析
4.1 联合分割与配准结果
实验环境:CPU为Intel Core i7-7700,内存为8 GB,操作系统为Windows10版本,软件平台为Matlab2016a。由于实验使用的联合分割与配准方法计算量较大,因此通过Matlab中的并行计算工具箱提高计算速度,计算量特别大的部分将MEX函数转换为C++函数,从而提高了计算效率。
对一组脑部核磁共振图像(MRI)和一组肺部CT图像使用本方法进行分割和配准的结果如
图 3. 脑部MRI和肺部CT图像的分割与配准结果。(a)待配准图像;(b)参考图像;(c)初始图像差;(d)分割的轮廓;(e)~(g)控制网格;(h)前向变形网格;(i)后向变形网格;(j)分割结果;(k)配准结果;(l)配准后图像差
Fig. 3. Segmentation and registration results of brain MRI and lung CT images. (a) Image to be registered; (b) image of target; (c) initial image difference; (d) segmented contours; (e)-(g) control grid; (h) forward deformed mesh; (i) backward deformed mesh; (j) result of segmentation; (k) result of registration; (l) image difference after registration
4.2 分割和配准的评价标准
为客观评价分割和配准的效果,用MSE评估配准性能,用DS评估分割结果。MSE可表示为
式中,R(x,y)和F(x,y)分别为图像R和F在(x,y)处的像素灰度,M×N为图像的分辨率,MSE值越小表明配准效果越好。
DS可表示为
式中,NC为待配准图像和参考图像共同区域的特定标签的像素数量,NR和NF分别为参考图像和待配准图像的像素数量。DS值越接近100%,表明分割的准确度越高。
4.3 配准和分割结果分析
两组不同形状图像的分割结果对比图如
对比
图 4. 分割结果。(a)无噪声参考图像;(b)待配准图像;(c)待配准图像的分割结果;(d)~(f)噪声强度为0.02、0.05、0.1的参考图像;(g)~(i)水平集方法对图(d)~图(f)的分割结果;(j)~(l)本方法对图(d)~图(f)的分割结果
Fig. 4. Results of segmentation. (a) Target images without noise-free; (b) images to be registered; (c) segmentation result of images to be registered; (d)-(f) target images with noise intensities of 0.02, 0.05, and 0.1; (g)-(i) segmentation results of Fig. (d)-Fig. (f) by level set method; (j)-(l) segmentation results of Fig. (d)-Fig. (f) by proposed method
为了验证双向变换对配准的影响,选取三组医学图像将分层B样条方法和加入了双向变换的分层B样条方法(DHBS)进行对比实验,两种方法的配准结果如
表 1. 两种分割方法的DS值
Table 1. DS value of two segmentation methods
|
图 5. 两种方法配准结果。(a)待配准图像;(b)参考图像;(c)分层B样条方法配准结果;(d)分层B样条方法配准后图像差;(e)分层B样条双向变换方法配准结果;(f)分层B样条双向变换方法配准后图像差
Fig. 5. Registration results of two methods. (a) Images to be registered; (b) images of target; (c) registration results of HBS; (d) final image differences of HBS; (e) registration results of DHBS; (f) final image differences of DHBS
表 2. 两种配准方法下MSE和配准时间
Table 2. MSE and registration time of two registration methods
|
为了验证本方法在图像配准方面的精确性,选取四组不同的医学图像将本方法、分层B样条方法以及文献[
16]中的联合分割与配准方法进行对比实验,配准结果如
表 3. 三种配准结果的MSE和配准时间
Table 3. MSE and registration time of three registration methods
|
从
为了检验本方法在配准时的抗噪性,将加入不同强度椒盐噪声的脑部图像作为待配准图像,分别使用本方法和文献[
16]中的方法进行配准,结果如
图 6. 配准结果。(a)待配准图像;(b)参考图像;(c)分层B样条方法配准结果;(d)联合方法配准结果;(e)本方法配准结果;(f)分层B样条方法配准后图像差;(g)联合方法配准后图像差;(h)本方法配准后图像差
Fig. 6. Results of registration. (a) Images to be registered; (b) images of target; (c) registration results of HBS; (d) registration results of joint method; (e) registration results of proposed method; (f) final image differences of HBS; (g) final image differences of joint method; (h) final image differences of proposed method
图 7. 噪声实验对比图。(a)待配准图像;(b)参考图像;(c)联合方法配准结果;(d)本方法配准结果;(e)联合方法配准后图像差;(f)本方法配准后图像差
Fig. 7. Noise experiment comparison chart. (a) Images to be registered; (b) images of target; (c) registration results of joint method; (d) registration results of proposed method; (e) final image differences of joint method; (f) final image differences of proposed method
表 4. 不同噪声强度下MSE和配准时间
Table 4. MSE and registration time under different noise intensities
|
由
5 结论
提出了一种基于局部更新分层B样条双向变换和水平集方法的医学图像联合分割与配准的方法,减少了噪声对图像分割的影响和局部极值对配准精度的影响。实验结果表明,本方法能够提高图像配准的精度,并在分割噪声图像时具有较好的鲁棒性,但由于该方法将分割和配准联合起来,所以相比单独的图像分割或图像配准方法所需时间更长,因此提高联合方法的配准和分割效率是接下来的研究重点。
[1] 姚红兵, 卞锦文, 丛嘉伟, 等. 基于局部稀疏形状表示的医学图像分割模型[J]. 激光与光电子学进展, 2018, 55(5): 051011.
[2] Cazoulat G, Owen D, Matuszak M M, et al. Biomechanical deformable image registration of longitudinal lung CT images using vessel information[J]. Physics in Medicine & Biology, 2016, 61(13): 4826-4839.
[3] 刘加林, 王慧琴, 王可, 等. 基于快速稳健特征最大子矩阵的光谱图像配准方法[J]. 激光与光电子学进展, 2019, 56(6): 063002.
[4] Gu S C, Meng X, Sciurba F C, et al. Bidirectional elastic image registration using B-spline affine transformation[J]. Computerized Medical Imaging and Graphics, 2014, 38(4): 306-314.
[5] Xie Z Y, Farin G E. Image registration using hierarchical b-splines[J]. IEEE Transactions on Visualization and Computer Graphics, 2004, 10(1): 85-94.
[6] Pawar A, Zhang Y J, Jia Y, et al. Adaptive FEM-based nonrigid image registration using truncated hierarchical B-splines[J]. Computers & Mathematics with Applications, 2016, 72(8): 2028-2040.
[7] 刘晨, 张龙波, 王雷, 等. 基于超像素重建的多尺度B样条医学图像配准[J]. 智能计算机与应用, 2019, 9(1): 24-27.
Liu C, Zhang L B, Wang L, et al. Multi-scale B-spline medical image registration based on pixel reconstruction[J]. Intelligent Computer and Applications, 2019, 9(1): 24-27.
[8] Pawar A, Zhang Y J, Anitescu C, et al. DTHB3D_Reg: dynamic truncated hierarchical B-spline based 3D nonrigid image registration[J]. Communications in Computational Physics, 2018, 23(3): 877-898.
[9] 周莉莉, 姜枫. 图像分割方法综述研究[J]. 计算机应用研究, 2017, 34(7): 1921-1928.
Zhou L L, Jiang F. Survey on image segmentation methods[J]. Application Research of Computers, 2017, 34(7): 1921-1928.
[10] 谭光鸿, 侯进, 韩雁鹏, 等. 基于卷积神经网络的低参数量实时图像分割算法[J]. 激光与光电子学进展, 2019, 56(9): 091003.
[11] Chan T F, Sandberg B, Vese L A. Active contours without edges for vector-valued images[J]. Journal of Visual Communication and Image Representation, 2000, 11(2): 130-141.
[12] Li C M, Huang R, Ding Z H, et al. A level set method for image segmentation in the presence of intensity inhomogeneities with application to MRI[J]. IEEE Transactions on Image Processing, 2011, 20(7): 2007-2016.
[13] 韩哲, 李灯熬, 赵菊敏, 等. 基于改进遗传模糊聚类和水平集的图像分割算法[J]. 计算机工程与设计, 2019, 40(5): 1390-1393, 1412.
Han Z, Li D A, Zhao J M, et al. Image segmentation algorithm based on improved genetic fuzzy clustering and level set[J]. Computer Engineering and Design, 2019, 40(5): 1390-1393, 1412.
[14] Droske M, Rumpf M. Multiscale joint segmentation and registration of image morphology[J]. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2007, 29(12): 2181-2194.
[15] VemuriB, Chen YM. Joint image registration and segmentation[M] ∥Geometric Level Set Methods in Imaging, Vision, and Graphics. New York: Springer-Verlag, 2003: 251- 269.
[16] Swierczynski P. Papie z· B W, Schnabel J A, et al. A level-set approach to joint image segmentation and registration with application to CT lung imaging[J]. Computerized Medical Imaging and Graphics, 2018, 65: 58-68.
[17] Bornemann P B, Cirak F. A subdivision-based implementation of the hierarchical b-spline finite element method[J]. Computer Methods in Applied Mechanics and Engineering, 2013, 253: 584-598.
Article Outline
吕凯, 吴军. 基于B样条和水平集方法的医学图像联合分割与配准[J]. 激光与光电子学进展, 2020, 57(10): 101007. Kai Lü, Jun Wu. Joint Segmentation and Registration of Medical Image Based on B-Spline and Level Set Method[J]. Laser & Optoelectronics Progress, 2020, 57(10): 101007.