⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rri_make_coords.m

📁 绝对经典,老外制作的功能强大的matlab实现PLS_TOOBOX
💻 M
字号:
function coords = rri_make_coords(dataset,thresh_factor)
%
%  Usage: coords = rri_make_coords(dataset,threshold)
%
%	This script determine index brain voxels from the dataset by 
%	thresholding.  Brain voxel is defined as a voxel that has 
%	scanned values higher than the threshold for all scans.
%
%	dataset:  a 2D matrix represents all voxels (column) in the
%		  volume across different scans (row)
%
%       thresh_factor:  (optional) the factor of threshold to define
%		  the brain voxels.  The threshold, which different 
%		  for each scan, is defined as
%                     (1 / thresh_factor) * max(dataset(i,:))
%		  DEFAULT: thresh_factor = 7
%
%	coords:   the index of dataset corresponding the brain voxels
%
%  Example:  dataset = gen_dataset('I_*.img');
%            coords = make_coords(dataset);
%            datamat = dataset(:,coords);
%            clear dataset;
%            n_datamat = norm_datamat(datamat);
%

if ~exist('thresh_factor','var')
  thresh_factor = 7;
end


[num_scans num_voxels] = size(dataset); 
nonbrain_coords = zeros(1,num_voxels);
for i=1:num_scans,
   scan_threshold = max(dataset(i,:)) / thresh_factor;

   idx = find(dataset(i,:) <= scan_threshold);
   nonbrain_coords(idx) = 1; 
end
coords = find(nonbrain_coords == 0);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -