前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Matlab的图像处理相关-MRI图像和图像类型转换

Matlab的图像处理相关-MRI图像和图像类型转换

作者头像
用户9925864
发布2022-07-27 09:23:59
6110
发布2022-07-27 09:23:59
举报
文章被收录于专栏:算法工程师的学习日志

1、MRI图像

代码语言:javascript
复制
load mri
D = squeeze(D);
h0=figure('toolbar','none',...
    'position',[198 56 450 468],...
    'name','实例81');
h1=axes('parent',h0,...
    'position',[0.3 0.45 0.5 0.5],...
    'visible','off');
image_num = 8;
image(D(:,:,image_num))
axis image
colormap(map)
x
 = xlim;
y = ylim;
b1=uicontrol('parent',h0,...
    'units','points',...
    'tag','b1',...
    'style','pushbutton',...
    'backgroundcolor',[0.75 0.75 0.75],...
    'position',[50 100 60 20],...
    'string','二维图',...
    'callback',[...
        'cla,',...
        'contourslice(D,[],[],image_num),',...
        'axis ij,',...
        'xlim(x),',...
        'ylim(y),',...
        'daspect([1,1,1]),',...
        'colormap(''default'')']);
b2=uicontrol('parent',h0,...
    'units','points',...
    'tag','b2',...
    'style','pushbutton',...
    'backgroundcolor',[0.75 0.75 0.75],...
    'position',[250 100 60 20],...
    'string','三维图',...
    'callback',[...
        'cla,',...
        'phandles = contourslice(D,[],[],[1,12,19,27],8);,',...
        'view(3);,',...
        'axis tight,',...
        'set(phandles,''LineWidth'',2)']);
b3=uicontrol('parent',h0,...
    'units','points',...
    'tag','b3',...
    'style','pushbutton',...
    'backgroundcolor',[0.75 0.75 0.75],...
    'position',[50 50 60 20],...
    'string','立体图',...
    'callback',[...
        'cla,',...
        'Ds = smooth3(D);,',...
        'hiso = patch(isosurface(Ds,5),''FaceColor'',[1,.75,.65],''EdgeColor'',''none'');,',...
        'hcap = patch(isocaps(D,5),''FaceColor'',''interp'',''EdgeColor'',''none'');,',...
        'colormap(map),',...
        'view(45,30),',...
        'axis tight,',...
        'daspect([1,1,.4]),',...
        'lightangle(45,30),',...
        'lighting phong,',...
        'isonormals(Ds,hiso),',...
        'set(hcap,''AmbientStrength'',.6),',...
        'set(hiso,''SpecularColorReflectance'',0,''SpecularExponent'',50)']);
b4=uicontrol('parent',h0,...
    'units','points',...
    'tag','b4',...
    'style','pushbutton',...
    'backgroundcolor',[0.75 0.75 0.75],...
    'position',[250 50 60 20],...
    'string','关闭',...
    'callback','close');

2、图像类型转换

代码语言:javascript
复制
h0=figure('toolbar','none',...
    'position',[198 56 350 468],...
    'name','实例82');
h1=axes('parent',h0,...
    'position',[0.2 0.45 0.5 0.5],...
    'visible','off');
load earth
clims = [10 60];
b1=uicontrol('parent',h0,...
    'units','points',...
    'tag','b1',...
    'style','pushbutton',...
    'string','强度图像',...
    'position',[30 120 50 20],...
    'callback',[...
        'cla,',...
        'imagesc(X,clims),',...
        'colormap(gray)']);
b2=uicontrol('parent',h0,...
    'units','points',...
    'tag','b2',...
    'style','pushbutton',...
    'string','索引图像',...
    'position',[100 120 50 20],...
    'callback',[...
        'cla,',...
        'image(X),',...
        'colormap(map),',...
        'axis image']);
b3=uicontrol('parent',h0,...
    'units','points',...
    'tag','b3',...
    'style','pushbutton',...
    'string','真彩图像',...
    'position',[170 120 50 20],...
    'callback',[...
        'cla,',...
        'image(X),',...
        'axis image']);
b4=uicontrol('parent',h0,...
    'units','points',...
    'tag','b4',...
    'style','pushbutton',...
    'string','关闭',...
    'position',[100 50 50 20],...
    'callback','close');
本文参与 腾讯云自媒体同步曝光计划,分享自微信公众号。
原始发表:2021-10-13,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 算法工程师的学习日志 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
相关产品与服务
图像处理
图像处理基于腾讯云深度学习等人工智能技术,提供综合性的图像优化处理服务,包括图像质量评估、图像清晰度增强、图像智能裁剪等。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档