【医学图像分割】基于matlab磁共振成像 (MRI) 数值模拟平台【含Matlab源码 826期】

470 阅读2分钟

一、图像分割简介

理论知识参考:【基础教程】基于matlab图像处理图像分割【含Matlab源码 191期】

二、部分源代码


function MRiLab

warning off; % disable warning

[pathstr,name,ext]=fileparts(mfilename('fullpath'));

% Check MEX existence
fpath = [pathstr filesep 'Lib' filesep 'bin'];
if exist([fpath filesep 'DoScanAtCPU.mexw64'], 'file')
    % MEX exist, do nothing
else
    try 
        fileUrl = ['http://mrilab.sourceforge.net/bin/MRiLab1.2Bin.zip'];
        zipFileName = fullfile(fpath,'MRiLab1.2Bin.zip');
        disp('Downloading core MEX files from MRiLab website http://sourceforge.net/projects/mrilab/');
        urlwrite(fileUrl,zipFileName);
        disp('Unzip files ...');
        unzip(zipFileName,fpath);
        rehash;
    catch me
        error_msg{1,1}='Some core MEX files for running MRiLab can not be configured.';
        error_msg{2,1}='Please download MRiLab full version with all MEX configured from';
        error_msg{3,1}='http://sourceforge.net/projects/mrilab/';
        errordlg(error_msg);
        return;
    end
end

% Open MRiLab main panel
addpath(genpath(pathstr));
SimuPanel(pathstr);
clear pathstr name ext

end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% MRiLab auto generated file: DO NOT EDIT!     %
% Generated by MRiLab "DoWriteXML2m" Generator %
% MRiLab Version 1.2                           %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [B1x, B1y, B1z, Pos]=Coil_9ChSurfChest
%====================================
p.Azimuth=pi/2;
p.CoilID=1;
p.CurrentDir=1;
p.Elevation=0;
p.PosX=-0.1;
p.PosY=-0.1;
p.PosZ=-0.1;
p.Radius=0.04;
p.Scale=0.1;
p.Segment=20;
[B1xt, B1yt, B1zt, Post]=CoilCircle(p);
B1x(:,:,:,p.CoilID)=B1xt;
B1y(:,:,:,p.CoilID)=B1yt;
B1z(:,:,:,p.CoilID)=B1zt;
Pos(p.CoilID,:)=Post;
p=[];
%--------------------
p.Azimuth=pi/2;
p.CoilID=2;
p.CurrentDir=1;
p.Elevation=0;
p.PosX=-0.1;
p.PosY=-0.1;
p.PosZ=0;
p.Radius=0.04;
p.Scale=0.1;
p.Segment=20;
[B1xt, B1yt, B1zt, Post]=CoilCircle(p);
B1x(:,:,:,p.CoilID)=B1xt;
B1y(:,:,:,p.CoilID)=B1yt;
B1z(:,:,:,p.CoilID)=B1zt;
Pos(p.CoilID,:)=Post;
p=[];
%--------------------
p.Azimuth=pi/2;
p.CoilID=3;
p.CurrentDir=1;
p.Elevation=0;
p.PosX=-0.1;
p.PosY=-0.1;
p.PosZ=0.1;
p.Radius=0.04;
p.Scale=0.1;
p.Segment=20;
[B1xt, B1yt, B1zt, Post]=CoilCircle(p);
B1x(:,:,:,p.CoilID)=B1xt;
B1y(:,:,:,p.CoilID)=B1yt;
B1z(:,:,:,p.CoilID)=B1zt;
Pos(p.CoilID,:)=Post;
p=[];
%--------------------
p.Azimuth=pi/2;
p.CoilID=4;
p.CurrentDir=1;
p.Elevation=0;
p.PosX=0;
p.PosY=-0.1;
p.PosZ=-0.1;
p.Radius=0.04;
p.Scale=0.1;
p.Segment=20;
[B1xt, B1yt, B1zt, Post]=CoilCircle(p);
B1x(:,:,:,p.CoilID)=B1xt;
B1y(:,:,:,p.CoilID)=B1yt;
B1z(:,:,:,p.CoilID)=B1zt;
Pos(p.CoilID,:)=Post;
p=[];
%--------------------
p.Azimuth=pi/2;
p.CoilID=5;
p.CurrentDir=1;
p.Elevation=0;
p.PosX=0;
p.PosY=-0.1;
p.PosZ=0;
p.Radius=0.04;
p.Scale=0.1;
p.Segment=20;
[B1xt, B1yt, B1zt, Post]=CoilCircle(p);
B1x(:,:,:,p.CoilID)=B1xt;
B1y(:,:,:,p.CoilID)=B1yt;
B1z(:,:,:,p.CoilID)=B1zt;
Pos(p.CoilID,:)=Post;
p=[];
%--------------------
p.Azimuth=pi/2;
p.CoilID=6;
p.CurrentDir=1;
p.Elevation=0;
p.PosX=0;
p.PosY=-0.1;
p.PosZ=0.1;
p.Radius=0.04;
p.Scale=0.1;
p.Segment=20;
[B1xt, B1yt, B1zt, Post]=CoilCircle(p);
B1x(:,:,:,p.CoilID)=B1xt;
B1y(:,:,:,p.CoilID)=B1yt;
B1z(:,:,:,p.CoilID)=B1zt;
Pos(p.CoilID,:)=Post;
p=[];
%--------------------
p.Azimuth=pi/2;
p.CoilID=7;
p.CurrentDir=1;
p.Elevation=0;
p.PosX=0.1;
p.PosY=-0.1;
p.PosZ=-0.1;
p.Radius=0.04;
p.Scale=0.1;
p.Segment=20;
[B1xt, B1yt, B1zt, Post]=CoilCircle(p);
B1x(:,:,:,p.CoilID)=B1xt;
B1y(:,:,:,p.CoilID)=B1yt;
B1z(:,:,:,p.CoilID)=B1zt;
Pos(p.CoilID,:)=Post;
p=[];
%--------------------
p.Azimuth=pi/2;
p.CoilID=8;
p.CurrentDir=1;
p.Elevation=0;
p.PosX=0.1;
p.PosY=-0.1;
p.PosZ=0;
p.Radius=0.04;
p.Scale=0.1;
p.Segment=20;
[B1xt, B1yt, B1zt, Post]=CoilCircle(p);
B1x(:,:,:,p.CoilID)=B1xt;
B1y(:,:,:,p.CoilID)=B1yt;
B1z(:,:,:,p.CoilID)=B1zt;
Pos(p.CoilID,:)=Post;
p=[];
%--------------------
p.Azimuth=pi/2;
p.CoilID=9;
p.CurrentDir=1;
p.Elevation=0;
p.PosX=0.1;
p.PosY=-0.1;
p.PosZ=0.1;
p.Radius=0.04;
p.Scale=0.1;
p.Segment=20;
[B1xt, B1yt, B1zt, Post]=CoilCircle(p);
B1x(:,:,:,p.CoilID)=B1xt;
B1y(:,:,:,p.CoilID)=B1yt;
B1z(:,:,:,p.CoilID)=B1zt;
Pos(p.CoilID,:)=Post;
p=[];
%--------------------
end

三、运行结果

在这里插入图片描述

四、matlab版本及参考文献

1 matlab版本 2014a

2 参考文献 [1] 蔡利梅.MATLAB图像处理——理论、算法与实例分析[M].清华大学出版社,2020. [2]杨丹,赵海滨,龙哲.MATLAB图像处理实例详解[M].清华大学出版社,2013. [3]周品.MATLAB图像处理与图形用户界面设计[M].清华大学出版社,2013. [4]刘成龙.精通MATLAB图像处理[M].清华大学出版社,2015. [5]赵勇,方宗德,庞辉,王侃伟.基于量子粒子群优化算法的最小交叉熵多阈值图像分割[J].计算机应用研究. 2008,(04)