基于matlab對比度和結構提取的多模態(tài)解剖圖像融合實現
更新時間:2021年11月29日 16:37:37 作者:紫極神光
這篇文章主要介紹了多模態(tài)醫(yī)學圖像配準與融合的概念、方法及意義,最后簡單介紹了小波變換分析方法。感興趣的小伙伴可以跟隨小編一起學習一下
一、圖像融合簡介
應用多模態(tài)圖像的配準與融合技術,可以把不同狀態(tài)的醫(yī)學圖像有機地結合起來,為臨床診斷和治療提供更豐富的信息。介紹了多模態(tài)醫(yī)學圖像配準與融合的概念、方法及意義。最后簡單介紹了小波變換分析方法。
二、部分源代碼
clear; close all; clc; warning off
%% A Novel Multi-Modality Anatomical Image FusionMethod Based on Contrast and Structure Extraction
% F = fuseImage(I,scale)
%Inputs:
%I - a mulyi-modal anatomical image sequence
%scale - scale factor of dense SIFT, the default value is 16
%% load images from the folder that contain multi-modal image to be fused
%I=load_images('./Dataset\CT-MRI\Pair 1');
I=load_images('./Dataset\MR-T1-MR-T2\Pair 1');
%I=load_images('./Dataset\MR-Gad-MR-T1\Pair 1');
% Show source input images
figure;
no_of_images = size(I,4);
for i = 1:no_of_images
subplot(2,1,i); imshow(I(:,:,:,i));
end
suptitle('Source Images');
%%
F=fuseImage(I,16);
%% Output: F - the fused image
F=rgb2gray(F);
figure;
imshow(F);
function [ F ] = fuseImage(I,scale)
addpath('Pyramid_Decomposition');
addpath('Guided_Filter');
addpath('Dense_SIFT');
tic
%%
[H, W, C, N]=size(I);
imgs=im2double(I);
IA=zeros(H,W,C,N);
for i=1:N
IA(:,:,:,i)=enhnc(imgs(:,:,:,i));
end
%%
imgs_gray=zeros(H,W,N);
for i=1:N
imgs_gray(:,:,i)=rgb2gray(IA(:,:,:,i));
end
%
% %dense sift calculation
dsifts=zeros(H,W,32,N, 'single');
for i=1:N
img=imgs_gray(:,:,i);
ext_img=img_extend(img,scale/2-1);
[dsifts(:,:,:,i)] = DenseSIFT(ext_img, scale, 1);
end
%%
%local contrast
contrast_map=zeros(H,W,N);
for i=1:N
contrast_map(:,:,i)=sum(dsifts(:,:,:,i),3);
end
%winner-take-all weighted average strategy for local contrast
[x, labels]=max(contrast_map,[],3);
clear x;
for i=1:N
mono=zeros(H,W);
mono(labels==i)=1;
contrast_map(:,:,i)=mono;
end
%% Structure
h = [1 -1];
structure_map=zeros(H,W,N);
for i=1:N
structure_map(:,:,i) = abs(conv2(imgs_gray(:,:,i),h,'same')) + abs(conv2(imgs_gray(:,:,i),h','same')); %EQ 13
end
%winner-take-all weighted average strategy for structure
[a, label]=max(structure_map,[],3);
clear x;
for i=1:N
monoo=zeros(H,W);
monoo(label==i)=1;
structure_map(:,:,i)=monoo;
end
%%
weight_map=structure_map.*contrast_map;
%weight map refinement using Guided Filter
for i=1:N
weight_map(:,:,i) = fastGF(weight_map(:,:,i),12,0.25,2.5);
end
% normalizing weight maps
%
weight_map = weight_map + 10^-25; %avoids division by zero
weight_map = weight_map./repmat(sum(weight_map,3),[1 1 N]);
%% Pyramid Decomposition
% create empty pyramid
pyr = gaussian_pyramid(zeros(H,W,3));
nlev = length(pyr);
% multiresolution blending
for i = 1:N
% construct pyramid from each input image
% blend
for b = 1:nlev
w = repmat(pyrW,[1 1 3]);
pyr = pyr + w .*pyrI;
end
end
% reconstruct
F = reconstruct_laplacian_pyramid(pyr);
toc
end
三、運行結果


四、matlab版本
matlab版本
2014a
以上就是基于matlab對比度和結構提取的多模態(tài)解剖圖像融合實現的詳細內容,更多關于matlab? 多模態(tài)解剖圖像融合的資料請關注腳本之家其它相關文章!
相關文章
C語言中pthread_create函數實現向線程函數傳遞參數
本文主要介紹了C語言中pthread_create函數實現向線程函數傳遞參數,文中通過示例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友們下面隨著小編來一起學習學習吧2023-05-05

