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

📄 mesh_3shell_script.html

📁 mri_toolbox是一个工具用来MRI. 来自于SourceForge, 我上传这个软件,希望能结识对医疗软件感兴趣的兄弟.
💻 HTML
📖 第 1 页 / 共 2 页
字号:
0095 <span class="comment">% mri_convert -oid -1 0 0 -ojd 0 1 0 -okd 0 0 1 orig mri\analyze\morgan_orig_axial_las.img</span>0096 <span class="comment">% These Analyze files were then processed with the FSL tools to find the</span>0097 <span class="comment">% skull.</span>0098 0099 cd(IMG.path)0100 0101 <span class="keyword">if</span> doScalp,0102     0103     <span class="comment">% --- Tesselate Scalp ---</span>0104     fprintf(<span class="string">'\n\n**************************************\nProcessing Scalp\n\n'</span>);0105     Nsurf = 4;0106     intensity = IMG.intensity.scalp;0107     tolerance = IMG.tolerance.scalp;0108     avw = <a href="avw_img_read.html" class="code" title="function [ avw, machine ] = avw_img_read(fileprefix,IMGorient,machine)">avw_img_read</a>(IMG.scalp);0109 <span class="comment">% [FV, Edges] = mesh_shrinkwrap(vol,FV,smooth,vthresh,interpVal,...</span>0110 <span class="comment">%               fitval,fittol,fititer,fitchange,fitvattr)</span>0111 <span class="comment">%    scalp = mesh_shrinkwrap(avw.img,[],0,0,[],intensity,tolerance,50,0.5,0.4);</span>0112     scalp = <a href="avw_shrinkwrap.html" class="code" title="function [FV, Edges] = avw_shrinkwrap(avw,FV,interpVal,fitval,fittol,fititer,fitchange,fitvattr)">avw_shrinkwrap</a>(avw,[],0,0,[],intensity,tolerance,50,0.5,0.4);0113     <span class="keyword">if</span> isfield(scalp,<span class="string">'vertices'</span>),0114         p.mesh.data.meshtype{Nsurf} = <span class="string">'scalp'</span>;0115         p.mesh.data.vertices{Nsurf} = scalp.vertices ./ 1000; <span class="comment">% convert to meters</span>0116         p.mesh.data.faces{Nsurf}    = scalp.faces;0117     <span class="keyword">end</span>0118 <span class="keyword">end</span>0119 0120 0121 <span class="keyword">if</span> doIskull,0122     0123     <span class="comment">% --- Tesselate Inner skull</span>0124     fprintf(<span class="string">'\n\n**************************************\nProcessing &quot;Inner Skull&quot;\n\n'</span>);0125     Nsurf = 2;0126     intensity = IMG.intensity.iskull;0127     tolerance = IMG.tolerance.iskull;0128     avw = <a href="avw_img_read.html" class="code" title="function [ avw, machine ] = avw_img_read(fileprefix,IMGorient,machine)">avw_img_read</a>(IMG.iskull);0129 <span class="comment">% [FV, Edges] = mesh_shrinkwrap(vol,FV,smooth,vthresh,interpVal,...</span>0130 <span class="comment">%               fitval,fittol,fititer,fitchange,fitvattr)</span>0131     ISkull = mesh_shrinkwrap(avw.img,[],0,0,[],intensity,tolerance,50,0.5,0.4);0132     <span class="keyword">if</span> isfield(ISkull,<span class="string">'vertices'</span>),0133         p.mesh.data.meshtype{Nsurf} = <span class="string">'inner_skull'</span>;0134         p.mesh.data.vertices{Nsurf} = ISkull.vertices ./ 1000; <span class="comment">% convert to meters</span>0135         p.mesh.data.faces{Nsurf}    = ISkull.faces;0136     <span class="keyword">end</span>0137 <span class="keyword">end</span>0138 0139 0140 <span class="keyword">if</span> doOskull,0141     0142     <span class="comment">% --- Tesselate Outer skull</span>0143     fprintf(<span class="string">'\n\n**************************************\nProcessing &quot;Outer Skull&quot;\n\n'</span>);0144     Nsurf = 3;0145     intensity = IMG.intensity.oskull;0146     tolerance = IMG.tolerance.oskull;0147     avw = <a href="avw_img_read.html" class="code" title="function [ avw, machine ] = avw_img_read(fileprefix,IMGorient,machine)">avw_img_read</a>(IMG.oskull);0148 <span class="comment">% [FV, Edges] = mesh_shrinkwrap(vol,FV,smooth,vthresh,interpVal,...</span>0149 <span class="comment">%               fitval,fittol,fititer,fitchange,fitvattr)</span>0150     OSkull = <a href="avw_shrinkwrap.html" class="code" title="function [FV, Edges] = avw_shrinkwrap(avw,FV,interpVal,fitval,fittol,fititer,fitchange,fitvattr)">avw_shrinkwrap</a>(avw,[],0,0,0,intensity,tolerance,50,0.05,0.1);0151     <span class="keyword">if</span> isfield(OSkull,<span class="string">'vertices'</span>),0152         p.mesh.data.meshtype{Nsurf} = <span class="string">'outer_skull'</span>;0153         p.mesh.data.vertices{Nsurf} = OSkull.vertices ./ 1000; <span class="comment">% convert to meters</span>0154         p.mesh.data.faces{Nsurf}    = OSkull.faces;0155         <span class="comment">%patch('vertices',OSkull.vertices,'faces',OSkull.faces,...</span>0156         <span class="comment">%      'FaceColor',[.6 .0 .0],'Edgecolor',[.8 .8 .8],...</span>0157         <span class="comment">%      'FaceAlpha',.2); axis tight; hold on</span>0158     <span class="keyword">end</span>0159 <span class="keyword">end</span>0160 0161 <span class="keyword">if</span> doCortex,0162     0163     <span class="comment">% LOAD FREESURFER CORTEX</span>0164     <span class="comment">% Freesurfer surface to process</span>0165     <span class="comment">% This freesurfer surface contains the whole brain surface, after</span>0166     <span class="comment">% altering the freesurfer pons/corpus callosum cutting positions.</span>0167     p.mesh.path   = IMG.meshpath;0168     p.mesh.file   = <span class="string">'rh.pial'</span>;0169     p.mesh.type   = <span class="string">'fs_surf'</span>;0170     0171     p = mesh_open(p);0172     0173 <span class="keyword">end</span>0174 0175 <span class="keyword">if</span> doCorrection,0176     0177     dist.four2three = 6;    <span class="comment">% scalp to outer skull</span>0178     dist.four2two   = 8;    <span class="comment">% scalp to inner skull</span>0179     dist.three2two  = 5;    <span class="comment">% outer skull to inner skull</span>0180     dist.two2one    = 2;    <span class="comment">% inner skull to cortex</span>0181     0182     cortex = 1; <span class="comment">% process cortex (1 = yes, 0 = no)</span>0183     p = mesh_bem_correct(p, [], dist, 1, cortex);0184     0185 <span class="keyword">end</span>0186 0187 0188 <span class="keyword">if</span> doOutputEMSE,0189     mesh_write_emse(p);0190 <span class="keyword">end</span>0191 <span class="keyword">if</span> doOutputBrainStorm,0192     mesh_write_brainstorm(p);0193 <span class="keyword">end</span>0194 0195 0196 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%</span>0197 <span class="comment">% Example FSL script</span>0198 <span class="comment">% Copy this text into a text file and chmod a+x that file.</span>0199 <span class="comment">% Remove the % matlab comments and everything before the next line,</span>0200 <span class="comment">% including these instructions.</span>0201 <span class="comment">% #! /bin/bash</span>0202 <span class="comment">%</span>0203 <span class="comment">%</span>0204 <span class="comment">% imagepath=&quot;.&quot;</span>0205 <span class="comment">% imagetype=&quot;_orig_axial_las&quot;</span>0206 <span class="comment">%</span>0207 <span class="comment">% sub=&quot;subject&quot;;</span>0208 <span class="comment">% img=`echo $sub$imagetype`;</span>0209 <span class="comment">%</span>0210 <span class="comment">% printf &quot;\nprocessing $img\n&quot;;</span>0211 <span class="comment">%</span>0212 <span class="comment">% printf &quot;\n5mm Guassian spatial smoothing: ${img}_smooth.*\n&quot;;</span>0213 <span class="comment">% /usr/local/fsl/bin/ip ${img} ${img}_smooth 0 -s 5</span>0214 <span class="comment">%</span>0215 <span class="comment">% printf &quot;\nUsing BET for brain extraction: ${img}_brain.*\n&quot;;</span>0216 <span class="comment">% bet ${img} ${img}_brain -s</span>0217 <span class="comment">%</span>0218 <span class="comment">% # Binarise the bet skull</span>0219 <span class="comment">% #avwmaths ${img}_brain_skull -bin BETskull</span>0220 <span class="comment">% # Dilate bet skull and add a constant</span>0221 <span class="comment">% #avwmaths_32R BETskull -dil -add 10000 BETskull</span>0222 <span class="comment">%</span>0223 <span class="comment">% printf &quot;\nSkull extraction and 2mm Guassian spatial smoothing: ${img}_skull.*\n&quot;;</span>0224 <span class="comment">% /usr/local/fsl/bin/ip ${img}_brain_skull ${img}_skull 0 -s 2</span>0225 <span class="comment">%</span>0226 <span class="comment">% printf &quot;\nSpatial normalization\n&quot;;</span>0227 <span class="comment">% flirt -in ${img}_brain.hdr -ref /usr/local/fsl/etc/standard/avg152T1_brain.hdr -out ${img}_brain_reg.hdr -omat %{img}_brain_reg.mat -bins 256 -cost corratio -searchrx -180 180 -searchry -180 180 -searchrz -180 180 -dof 12  -interp trilinear</span>0228 <span class="comment">% convert_xfm -matonly -omat ${img}_brain_reginv.mat -inverse ${img}_brain_reg.mat</span>0229 <span class="comment">%</span>0230 <span class="comment">% printf &quot;\nBrain segmentation\n&quot;;</span>0231 <span class="comment">% fast -t 1 -c 3 -op -e -ov -od $img ${img}_brain</span>0232 <span class="comment">%</span>0233 <span class="comment">% exit</span></pre></div><hr><address>Generated on Fri 21-May-2004 12:38:21 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/">m2html</a></strong> &copy; 2003</address></body></html>

⌨️ 快捷键说明

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