资源简介
依赖于MATLAB,可以读取nii格式的文件,写入和操作输入的医学影像数据
使用方法:1.下载压缩包并解压至MATLAB安装路径的toobox文件夹下 2.enjoy it!
代码片段和文件信息
% Using 2D or 3D affine matrix to rotate translate scale reflect and
% shear a 2D image or 3D volume. 2D image is represented by a 2D matrix
% 3D volume is represented by a 3D matrix and data type can be real
% integer or floating-point.
%
% You may notice that MATLAB has a function called ‘imtransform.m‘ for
% 2D spatial transformation. However keep in mind that ‘imtransform.m‘
% assumes y for the 1st dimension and x for the 2nd dimension. They are
% equivalent otherwise.
%
% In addition if you adjust the ‘new_elem_size‘ parameter this ‘affine.m‘
% is equivalent to ‘interp2.m‘ for 2D image and equivalent to ‘interp3.m‘
% for 3D volume.
%
% Usage: [new_img new_M] = ...
% affine(old_img old_M [new_elem_size] [verbose] [bg] [method]);
%
% old_img - original 2D image or 3D volume. We assume x for the 1st
% dimension y for the 2nd dimension and z for the 3rd
% dimension.
%
% old_M - a 3x3 2D affine matrix for 2D image or a 4x4 3D affine
% matrix for 3D volume. We assume x for the 1st dimension
% y for the 2nd dimension and z for the 3rd dimension.
%
% new_elem_size (optional) - size of voxel along x y z direction for
% a transformed 3D volume or size of pixel along x y for
% a transformed 2D image. We assume x for the 1st dimension
% y for the 2nd dimension and z for the 3rd dimension.
% ‘new_elem_size‘ is 1 if it is default or empty.
%
% You can increase its value to decrease the resampling rate
% and make the 2D image or 3D volume more coarse. It works
% just like ‘interp3‘.
%
% verbose (optional) - 1 0
% 1: show transforming progress in percentage
% 2: progress will not be displayed
% ‘verbose‘ is 1 if it is default or empty.
%
% bg (optional) - background voxel intensity in any extra corner that
% is caused by the interpolation. 0 in most cases. If it is
% default or empty ‘bg‘ will be the average of two corner
% voxel intensities in original data.
%
% method (optional) - 1 2 or 3
% 1: for Trilinear interpolation
% 2: for Nearest Neighbor interpolation
% 3: for Fischer‘s Bresenham interpolation
% ‘method‘ is 1 if it is default or empty.
%
% new_img - transformed 2D image or 3D volume
%
% new_M - transformed affine matrix
%
% Example 1 (3D rotation):
% load mri.mat; old_img = double(squeeze(D));
% old_M = [0.88 0.5 3 -90; -0.5 0.88 3 -126; 0 0 2 -72; 0 0 0 1];
% new_img = affine(old_img old_M 2);
% [x y z] = meshgrid(1:1281:1281:27);
% sz = size(new_img);
% [x1 y1 z1] = meshgrid(1:sz(2)1:sz(1)1:sz(3));
% figure; slice(x y z old_img 64 64 13.5);
% shading flat; colormap(map); view(-66 66);
% figure; slice(x1 y1 z1 new_img sz(1)/2 sz(2)/2 sz(3)/2);
% shading flat; colormap(map); view(-66 66);
%
% Example 2 (2D interpolation):
% load mri.mat; old_img=D(::113)‘;
% old_M = [1 0 0; 0 1 0; 0 0 1];
% new_img = affine(old_img old_M [.2 .4]);
% figure; image(old_img); colorma
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 268435456 2015-09-07 18:01 NIfTI_20140122\test\nCT_SALINE_185_20150814_131414_1_IMG.img
目录 0 2015-09-07 23:22 NIfTI_20140122\
文件 206445 2014-01-23 06:26 NIfTI_20140122\FAQ.pdf
文件 61950 2014-01-23 06:26 NIfTI_20140122\NIfTI_tools.pdf
文件 91343 2014-01-23 06:25 NIfTI_20140122\UseANALYZE.pdf
文件 16664 2008-10-24 02:22 NIfTI_20140122\affine.m
文件 2239 2005-05-12 02:27 NIfTI_20140122\bipolar.m
文件 4682 2008-08-22 03:40 NIfTI_20140122\bresenham_line3d.m
文件 3421 2012-10-13 04:35 NIfTI_20140122\clip_nii.m
文件 7038 2013-03-07 06:14 NIfTI_20140122\collapse_nii_scan.m
文件 4513 2015-09-07 18:00 NIfTI_20140122\create_hdr.m
文件 268435808 2015-09-07 17:58 NIfTI_20140122\ct.nii
文件 3929 2011-02-16 08:19 NIfTI_20140122\examples.txt
文件 1381 2013-03-07 06:14 NIfTI_20140122\expand_nii_scan.m
文件 8085 2005-08-15 03:58 NIfTI_20140122\extra_nii_hdr.m
文件 3568 2009-07-04 03:55 NIfTI_20140122\flip_lr.m
文件 4497 2013-03-07 06:14 NIfTI_20140122\get_nii_fr
文件 11291540 2015-09-07 18:01 NIfTI_20140122\img.mat
文件 1310 2014-02-12 14:45 NIfTI_20140122\license.txt
文件 7006 2013-03-07 06:16 NIfTI_20140122\load_nii.m
文件 5544 2013-03-07 06:14 NIfTI_20140122\load_nii_ext.m
文件 10311 2012-10-13 04:34 NIfTI_20140122\load_nii_hdr.m
文件 12720 2011-06-09 23:03 NIfTI_20140122\load_nii_img.m
文件 8293 2008-10-24 03:13 NIfTI_20140122\load_untouch0_nii_hdr.m
文件 7255 2013-03-07 06:15 NIfTI_20140122\load_untouch_header_only.m
文件 6373 2013-03-07 06:15 NIfTI_20140122\load_untouch_nii.m
文件 8739 2008-10-24 03:15 NIfTI_20140122\load_untouch_nii_hdr.m
文件 15224 2011-06-09 23:03 NIfTI_20140122\load_untouch_nii_img.m
文件 5665 2011-06-10 23:57 NIfTI_20140122\make_ana.m
文件 7105 2011-09-01 22:36 NIfTI_20140122\make_nii.m
文件 2691 2008-07-07 22:15 NIfTI_20140122\mat_into_hdr.m
............此处省略72个文件信息
相关资源
- Pattern Recognition and Machine Learning(高清
- MATLAB 编程 第二版 Stephen J. Chapman 著
- 均值滤波和FFT频谱分析Matlab代码
- 《MATLAB扩展编程》代码
- HDB3码、AMI码的MATLAB实现
- 3点GPS定位MATLAB仿真
- MATLAB数字信号处理85个实用案例精讲入
- matlab从入门到精通pdf94795
- 欧拉放大论文及matlab代码
- 跳一跳辅助_matlab版本
- 全面详解LTE MATLAB建模、仿真与实现
- MIMO-OFDM无线通信技术及MATLAB实现_孙锴
- MATLAB Programming for Engineers 4th - Chapman
- matlab 各种谱分析对比
- 分数阶chen混沌matlab程序
- 基于粒子群算法的非合作博弈的matl
- MATLAB车流仿真 包括跟驰、延误
- matlab空间桁架计算程序
- 基于MATLAB的图像特征点匹配和筛选
- DMA-TVP-FAVAR
- GPS信号的码捕获matlab代码.7z
- 一维光子晶体MATLAB仿真代码吸收率折
- newmark法源程序
- 传统关联成像、计算鬼成像matlab
- pri传统分选算法
- 摆动滚子推杆盘形凸轮设计
- 医学图像重建作业matlab源码
- Matlab实现混沌系统的控制
- 检测疲劳驾驶
- Matlab锁相环仿真-Phase Locked Loop.rar
评论
共有 条评论