Nifti程序包用于写入读取和处理医学影像适用于MATLAB


依赖于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 est
CT_SALINE_185_20150814_131414_1_IMG.img
     目录           0  2015-09-07 23:22  NIfTI_20140122
     文件      206445  2014-01-23 06:26  NIfTI_20140122FAQ.pdf
     文件       61950  2014-01-23 06:26  NIfTI_20140122NIfTI_tools.pdf
     文件       91343  2014-01-23 06:25  NIfTI_20140122UseANALYZE.pdf
     文件       16664  2008-10-24 02:22  NIfTI_20140122affine.m
     文件        2239  2005-05-12 02:27  NIfTI_20140122ipolar.m
     文件        4682  2008-08-22 03:40  NIfTI_20140122resenham_line3d.m
     文件        3421  2012-10-13 04:35  NIfTI_20140122clip_nii.m
     文件        7038  2013-03-07 06:14  NIfTI_20140122collapse_nii_scan.m
     文件        4513  2015-09-07 18:00  NIfTI_20140122create_hdr.m
     文件   268435808  2015-09-07 17:58  NIfTI_20140122ct.nii
     文件        3929  2011-02-16 08:19  NIfTI_20140122examples.txt
     文件        1381  2013-03-07 06:14  NIfTI_20140122expand_nii_scan.m
     文件        8085  2005-08-15 03:58  NIfTI_20140122extra_nii_hdr.m
     文件        3568  2009-07-04 03:55  NIfTI_20140122flip_lr.m
     文件        4497  2013-03-07 06:14  NIfTI_20140122get_nii_frame.m
     文件    11291540  2015-09-07 18:01  NIfTI_20140122img.mat
     文件        1310  2014-02-12 14:45  NIfTI_20140122license.txt
     文件        7006  2013-03-07 06:16  NIfTI_20140122load_nii.m
     文件        5544  2013-03-07 06:14  NIfTI_20140122load_nii_ext.m
     文件       10311  2012-10-13 04:34  NIfTI_20140122load_nii_hdr.m
     文件       12720  2011-06-09 23:03  NIfTI_20140122load_nii_img.m
     文件        8293  2008-10-24 03:13  NIfTI_20140122load_untouch0_nii_hdr.m
     文件        7255  2013-03-07 06:15  NIfTI_20140122load_untouch_header_only.m
     文件        6373  2013-03-07 06:15  NIfTI_20140122load_untouch_nii.m
     文件        8739  2008-10-24 03:15  NIfTI_20140122load_untouch_nii_hdr.m
     文件       15224  2011-06-09 23:03  NIfTI_20140122load_untouch_nii_img.m
     文件        5665  2011-06-10 23:57  NIfTI_20140122make_ana.m
     文件        7105  2011-09-01 22:36  NIfTI_20140122make_nii.m
     文件        2691  2008-07-07 22:15  NIfTI_20140122mat_into_hdr.m
............此处省略72个文件信息

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。

发表评论

评论列表(条)