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

📄 mesh_3shell_script.m

📁 Matlab下的EEG处理程序库
💻 M
字号:

% mesh_3shell_script
% 
% Assumes preprocessing of MRI with 
% FreeSurfer                http://surfer.nmr.mgh.harvard.edu/
% FSL tools (BET & FAST)    http://fmrib.ox.ac.uk/

% $Revision: 1.2 $ $Date: 2003/03/02 03:20:44 $

% 
% Licence:  GNU GPL, no implied or express warranties
% History:  08/2002, Darren.Weber@flinders.edu.au
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

if plot,

	FV = ISkull;
	patch('vertices',FV.vertices,'faces',FV.faces,'FaceColor',[.6 .0 .0],'Edgecolor','none','FaceAlpha',.2); axis tight; hold on
	x = FV.vertices(1,1);
	y = FV.vertices(1,2);
	z = FV.vertices(1,3);
	plot3(x,y,z,'ro')
	
	
	FV = FS.surf;
	patch('vertices',FV.vertices,'faces',FV.faces,'FaceColor',[.0 .6 .0],'Edgecolor',[.8 .8 .8],'FaceAlpha',.4);
	x = FV.vertices(1,1);
	y = FV.vertices(1,2);
	z = FV.vertices(1,3);
	plot3(x,y,z,'bo')
	
    return
end


% Image files to process

% These images were created with the freesurfer mri_convert command, eg:
% mri_convert -oid 1 0 0 -ojd 0 1 0 -okd 0 0 1 orig mri\analyze\c01_orig_axial_ras.img
% These Analyze files were then processed with the FSL tools to find the
% skull.
IMG.path   = '\\POTZII\data\freesurfer\subjects\ptsdpet-c01\mri\analyze\';
IMG.scalp  = 'c01_orig_axial_ras';
IMG.oskull = 'c01_orig_axial_ras_bet_skull';
IMG.iskull = 'c01_orig_axial_ras_bet';

% Freesurfer surface to process
% This freesurfer surface contains the whole brain surface, after
% altering the freesurfer pons/corpus callosum cutting positions.
FS.path   = '\\POTZII\data\freesurfer\subjects\ptsdpet-c01\surf\';
FS.file   = 'rh.white.asc';


% MAIN

cd(IMG.path)

% --- Tesselate Scalp ---
avw = avw_img_read(IMG.scalp);
Scalp = mesh_shrinkwrap(avw.img,[],0,0,0,1, 20,5,200,1,0.2);
FV = Scalp;
patch('vertices',FV.vertices,'faces',FV.faces,'FaceColor',[.6 .0 .0],'Edgecolor',[.8 .8 .8],'FaceAlpha',.2); axis tight; hold on

% Outer skull
avw = avw_img_read(IMG.oskull);
OSkull = mesh_shrinkwrap(avw.img,[],0,0,1,0,100,5,100,1,0.2);
FV = OSkull;
patch('vertices',FV.vertices,'faces',FV.faces,'FaceColor',[.0 .6 .0],'Edgecolor',[.8 .8 .8],'FaceAlpha',.4);

% Inner skull
avw = avw_img_read(IMG.iskull);
ISkull = mesh_shrinkwrap(avw.img,[],0,0,0,1, 20,5,200,1,0.2);
FV = ISkull;
patch('vertices',FV.vertices,'faces',FV.faces,'FaceColor',[.0 .0 .6],'Edgecolor',[.8 .8 .8],'FaceAlpha',.4);

% LOAD FREESURFER CORTEX AND VIEW...
cd(FS.path)
FS.surf = mesh_freesurfer2matlab(FS.file);
if ~isfield(FS.surf,'vertices'),
    FV = FS.surf;
    patch('vertices',FV.vertices,'faces',FV.faces,'FaceColor',[.8 .0 .0],'Edgecolor','none');
end


%x = FV.vertices(1,1);
%y = FV.vertices(1,2);
%z = FV.vertices(1,3);
%plot3(x,y,z,'ro')

⌨️ 快捷键说明

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