Re: [Freesurfer] Reading mris_smooth output using Matlab
Hi Nick, The Freesurfer version I use has build stamp freesurfer-Darwin-tiger-i686-stable-pub-v4.0.1 After conversion, read_asc.m doesn't work - seemingly due to a dimension problem. In the code I see that 5 elements are expected for faces and indicies, whereas only 4 elements are provided in the .asc file. I changed lines 45-46 into f = fscanf(fp, '%d', S(3)*4); f = reshape(f, [4 S(3)])'; Using patch in Matlab with v(:,1:3) as vertices and f(:,[1 3 2]) as faces, I get an image of the hippocampus surface. The surface looks good(!) but is a bit rough and 'spiky'. Is this because the segmentation procedure does not employ a smoothness constraint? The aim of all this is to prepare hippocampal volumes for deformation analysis (two groups, two time points). Is the following line of processing appropriate: Topology correction: mri_topologycorrection -label "hippocampus" subject/mri/norm.mgz subject/mri/aseg.mgz aseg_corrected Tesselate surface: mri_tessellate Smooth surface: mris_smooth Convert to ascii for use with Matlab: mris_convert Cheers! Kim. 2007/11/16, Nick Schmansky <[EMAIL PROTECTED]>: > Kim, > > Which version of freesurfer is being used? > > An alternative approach is to convert the surface to ascii: > > mris_convert surface_file surface_file.asc > > where the .asc extension is an output ascii file listing the vertices > and faces. > > Nick > > On Thu, 2007-11-15 at 16:18 +0100, Kim Mouridsen wrote: > > Hi, > > > > We have segmented hippocampus using Freesurfer, and want to generate a > > surface which can be read into matlab. > > > > We use mri_tesselate and mris_smooth. However, the resulting file can > > not be read into matlab using read_surf. The error we get is > > > > ??? Undefined function or variable "vertex_coords". > > > > Error in ==> read_surf at 77 > > vertex_coords = reshape(vertex_coords, 3, vnum)' ; > > > > It seems the 'magic' number is 16777213, whereas only 16777214 and > > 16777215 are supported in read_surf.m > > > > How can we read the result of mris_smooth into matlab? > > > > Thanks! > > > > Kim. > > ___ > > Freesurfer mailing list > > Freesurfer@nmr.mgh.harvard.edu > > https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer > > > > > > ___ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
[Freesurfer] xtra advice: /usr/local/freesurfer/fsl
I'm considering downloading and installing fsl_v402 (centos4, 64 bit) I currently have a stable freesurfer_v401 and MNE _v252 on the same workstation. Should the destination directory of the fsl package overwrite the existing directory: /usr/local/freesurfer/fsl Or should I maintain separate environments and install fsl in the fmrib's recommended destination directory: /usr/local/fsl Any advice is greatly appreciated... Jenifer ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ___ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
Re: [Freesurfer] xtra advice: /usr/local/freesurfer/fsl
Jenifer, You can use the newer fsl with freesurfer. In fact, the fsl included with freesurfer is a subset of the whole fsl package, so it can be deleted. That is, do this: cd $FREESURFER_HOME rm -Rf fsl (or mv it) ln -s /usr/local/fsl fsl and then freesurfer will use your new fsl installation. Nick On Fri, 2007-11-16 at 10:37 -0600, Juranek, Jenifer wrote: > I’m considering downloading and installing fsl_v402 (centos4, 64 bit) > > I currently have a stable freesurfer_v401 and MNE _v252 on the same > workstation. > > > > Should the destination directory of the fsl package overwrite the > existing directory: /usr/local/freesurfer/fsl > > Or should I maintain separate environments and install fsl in the > fmrib’s recommended destination directory: /usr/local/fsl > > > > Any advice is greatly appreciated… > > > > Jenifer > > > > ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ > > > ___ > Freesurfer mailing list > Freesurfer@nmr.mgh.harvard.edu > https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer ___ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
Re: [Freesurfer] Reading mris_smooth output using Matlab
Hi Bruce, Thanks, that would be perfect! I tried increasing the number of smoothing iterations in mris_smooth, and this improves the result, but this is probably not the best way to do it. We would be very happy if you could send us a beta version of your smoothing tools. Cheers, Kim. 2007/11/16, Bruce Fischl <[EMAIL PROTECTED]>: > Hi Kim, > > we do have some tools for smoothing the hippocampal surfaces, but we > haven't distributed them. I could try to get you a beta version if you > like. > > cheers, > Bruce > On Fri, 16 Nov 2007, Kim Mouridsen wrote: > > > Hi Nick, > > > > The Freesurfer version I use has build stamp > > freesurfer-Darwin-tiger-i686-stable-pub-v4.0.1 > > > > After conversion, read_asc.m doesn't work - seemingly due to a > > dimension problem. In the code I see that 5 elements are expected for > > faces and indicies, whereas only 4 elements are provided in the .asc > > file. I changed lines 45-46 into > > > > f = fscanf(fp, '%d', S(3)*4); > > f = reshape(f, [4 S(3)])'; > > > > Using patch in Matlab with v(:,1:3) as vertices and f(:,[1 3 2]) as > > faces, I get an image of the hippocampus surface. > > > > The surface looks good(!) but is a bit rough and 'spiky'. Is this > > because the segmentation procedure does not employ a smoothness > > constraint? > > > > The aim of all this is to prepare hippocampal volumes for deformation > > analysis (two groups, two time points). Is the following line of > > processing appropriate: > > > > Topology correction: > > mri_topologycorrection -label "hippocampus" subject/mri/norm.mgz > > subject/mri/aseg.mgz aseg_corrected > > > > Tesselate surface: > > mri_tessellate > > > > Smooth surface: > > mris_smooth > > > > Convert to ascii for use with Matlab: > > mris_convert > > > > Cheers! > > Kim. > > > > > > > > 2007/11/16, Nick Schmansky <[EMAIL PROTECTED]>: > >> Kim, > >> > >> Which version of freesurfer is being used? > >> > >> An alternative approach is to convert the surface to ascii: > >> > >> mris_convert surface_file surface_file.asc > >> > >> where the .asc extension is an output ascii file listing the vertices > >> and faces. > >> > >> Nick > >> > >> On Thu, 2007-11-15 at 16:18 +0100, Kim Mouridsen wrote: > >>> Hi, > >>> > >>> We have segmented hippocampus using Freesurfer, and want to generate a > >>> surface which can be read into matlab. > >>> > >>> We use mri_tesselate and mris_smooth. However, the resulting file can > >>> not be read into matlab using read_surf. The error we get is > >>> > >>> ??? Undefined function or variable "vertex_coords". > >>> > >>> Error in ==> read_surf at 77 > >>> vertex_coords = reshape(vertex_coords, 3, vnum)' ; > >>> > >>> It seems the 'magic' number is 16777213, whereas only 16777214 and > >>> 16777215 are supported in read_surf.m > >>> > >>> How can we read the result of mris_smooth into matlab? > >>> > >>> Thanks! > >>> > >>> Kim. > >>> ___ > >>> Freesurfer mailing list > >>> Freesurfer@nmr.mgh.harvard.edu > >>> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer > >>> > >>> > >> > >> > > ___ > > Freesurfer mailing list > > Freesurfer@nmr.mgh.harvard.edu > > https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer > > > > > > > ___ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
[Freesurfer] selxavg3 issue
Hi all, I'm running into some problems using the selxavg3-sess command. Previously I ran into a memory issue with matlab while running this command. However, when I run the selxavg-sess command, the analysis completes successfully. This wasn't an issue until I started averaging subjects. It appears that selxavg-sess doesn't create the dof and mask and other files needed for the isxconcat-sess command. Any suggestions? Thanks. Below is my code for selxavg3-sess and selxavg-sess. Best, Corey SELXAVG3 dgow:jsegawa[134] selxavg3-sess -sf sessid03 -df sesspar -analysis simple_v_complex -overwrite -- selxavg3-sess logfile is /autofs/space/multnomah_003/users/gow/PROZ06/StudyDir/log/selxavg3-sess-bold-sim ple_v_complex-071116113229.log -- --- /autofs/space/multnomah_003/users/gow/PROZ06/MRI/PROZ06003 Fri Nov 16 11:32:29 EST 2007 anadir = /autofs/space/multnomah_003/users/gow/PROZ06/MRI/PROZ06003/bold/simple_v_complex analysis simple_v_complex alread exists for PROZ06003 ... reanalyzing (deleting old analysis) -- --- matlab output Warning: Unable to open display iconic, MATLAB is starting without a display. You will not be able to display graphics on the screen. Warning: MATLAB is starting without a display, using internal event queue. You will not be able to display graphics on the screen. < M A T L A B > Copyright 1984-2005 The MathWorks, Inc. Version 7.1.0.183 (R14) Service Pack 3 August 02, 2005 To get started, type one of these: helpwin, helpdesk, or demo. For product information, visit www.mathworks.com. Adding MNE Toolbox... >> >> >> >> >> >> >> /usr/local/freesurfer/stable4/fsfast/toolbox/fast_selxavg3.m >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> $Id: fast_selxavg3.m,v 1.55.2.1 2007/09/27 15:25:58 greve Exp $ outtop = /autofs/space/multnomah_003/users/gow/PROZ06/MRI Extension format = nii UseFloat = 0 INFO: acfbins is not set, setting to 10 INFO: mask is not set, setting to brain 1 allvres.mat 2 omnibus.mat 3 zallvres.mat 4 zomnibus.mat Loaded /autofs/space/multnomah_003/users/gow/PROZ06/MRI/PROZ06003/bold/010/parfile1.par as a par2 file.Ignoring duration for FIR model Ignoring duration for FIR model nruns = 3 autostimdur = outanadir = /autofs/space/multnomah_003/users/gow/PROZ06/MRI/PROZ06003/bold/simple_v_complex Found 41527/110592 (37.5) voxels in mask Creating Design Matrix Loaded /autofs/space/multnomah_003/users/gow/PROZ06/MRI/PROZ06003/bold/010/parfile1.par as a par2 file.Ignoring duration for FIR model Ignoring duration for FIR model Loaded /autofs/space/multnomah_003/users/gow/PROZ06/MRI/PROZ06003/bold/011/parfile1.par as a par2 file.Ignoring duration for FIR model Ignoring duration for FIR model Loaded /autofs/space/multnomah_003/users/gow/PROZ06/MRI/PROZ06003/bold/012/parfile1.par as a par2 file.Ignoring duration for FIR model Ignoring duration for FIR model ntptot = 1242, nX = 24, DOF = 1218 XCond = 56.8839 (normalized) Computing compensation for resdual AR1 bias 1 -0.5 -0.493483(t=16.1468) 2 -0.25 -0.248851(t=46.0564) 3 0 -0.00487321(t=48.3458) 4 0.25 0.237796(t=78.3629) 5 0.5 0.477198(t=94.7002) AR1 Correction M: 0.00663368 1.02963 Computing contrast matrices Loaded /autofs/space/multnomah_003/users/gow/PROZ06/MRI/PROZ06003/bold/010/parfile1.par as a par2 file.Ignoring duration for FIR model Ignoring duration for FIR model Loaded /autofs/space/multnomah_003/users/gow/PROZ06/MRI/PROZ06003/bold/010/parfile1.par as a par2 file.Ignoring duration for FIR model Ignoring duration for FIR model Loaded /autofs/space/multnomah_003/users/gow/PROZ06/MRI/PROZ06003/bold/010/parfile1.par as a par2 file.Ignoring duration for FIR model Ignoring duration for FIR model 1 allvresJ= 9 eff =7.7 vrf = 69.6671 vrfffx = 69.2443 r = 1.01 Loaded /autofs/space/multnomah_003/users/gow/PROZ06/MRI/PROZ06003/bold/010/parfile1.par as a par2 file.Ignoring duration for FIR model Ignoring duration for FIR model Loaded /autofs/space/multnomah_003/users/gow/PROZ06/MRI/PROZ06003/bold/010/parfile1.par as a par2 file.Ignoring duration for FIR model Ignoring duration for FIR model Loaded /autofs/space/multnomah_003/users/gow/PROZ06/MRI/PROZ06003/bold/010/parfile1.par as a par2 file.Ignoring duration for FIR model Ignoring duration for FIR model 2 omnibusJ=18 eff = 11.1 vrf = 200.1014 vrfffx = 198.7246 r = 1.01 Loaded /autofs/space/multnomah_003/users/gow/PROZ06/MRI/PROZ06003/bold/010/parfile1.par as a par2 file.Ignoring duration for FIR model Ignoring duration for FIR model Loaded /autofs/space/multnomah_003/users/gow/PROZ06/MRI/PROZ06003/bold/010/parfile1.par as a par2 file.Ignoring duration for FIR model Ignori
Re: [Freesurfer] selxavg3 issue
Hi Corey, I just ran selxav3, Check my log and output dir (both dof and mask.nii are created), it looks fine. pratap [galen:bold] (nmr-std-env) cd VvI_MK_Analysis/ [galen:VvI_MK_Analysis] (nmr-std-env) LS acfsegLUT.txt allvfix doffsnr.nii fwhm.sum h.nii mask.nii omnibus rho1.nii rvar.nii acfseg.nii beta.nii fsnr2.nii fwhm.dat h.dat h-offset.nii meanfunc.nii rho1mn.nii rstd.nii X.mat [galen:VvI_MK_Analysis] (nmr-std-env) more dof 86 Log: [galen:S4_HR_LR18VvI] (nmr-std-env) selxavg3-sess -s rfa0413 -analysis VvI_MK_Analysis/ -overwrite -- selxavg3-sess logfile is /autofs/space/galen_002/users/carl/S4_HR_LR18/S4_HR_LR18VvI/log/selxavg3-sess-bold-VvI_MK_Analysis-071116130312.log -- --- /autofs/space/galen_002/users/carl/S4_HR_LR18/S4_HR_LR18VvI/rfa0413 Fri Nov 16 13:03:13 EST 2007 anadir = /autofs/space/galen_002/users/carl/S4_HR_LR18/S4_HR_LR18VvI/rfa0413/bold/VvI_MK_Analysis -- --- matlab output Warning: Unable to open display iconic, MATLAB is starting without a display. You will not be able to display graphics on the screen. Warning: MATLAB is starting without a display, using internal event queue. You will not be able to display graphics on the screen. < M A T L A B > Copyright 1984-2005 The MathWorks, Inc. Version 7.1.0.183 (R14) Service Pack 3 August 02, 2005 To get started, type one of these: helpwin, helpdesk, or demo. For product information, visit www.mathworks.com. >> >> >> >> >> >> >> /usr/local/freesurfer/stable4/fsfast/toolbox/fast_selxavg3.m >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> $Id: fast_selxavg3.m,v 1.55.2.1 2007/09/27 15:25:58 greve Exp $ outtop = /autofs/space/galen_002/users/carl/S4_HR_LR18/S4_HR_LR18VvI Extension format = nii UseFloat = 0 INFO: acfbins is not set, setting to 10 INFO: mask is not set, setting to brain Loaded /autofs/space/galen_002/users/carl/S4_HR_LR18/S4_HR_LR18VvI/rfa0413/bold/014/VvI8.para as a par2 file. nruns = 1 autostimdur = 1 outanadir = /autofs/space/galen_002/users/carl/S4_HR_LR18/S4_HR_LR18VvI/rfa0413/bold/VvI_MK_Analysis Found 56169/143360 (39.2) voxels in mask Creating Design Matrix Loaded /autofs/space/galen_002/users/carl/S4_HR_LR18/S4_HR_LR18VvI/rfa0413/bold/014/VvI8.para as a par2 file. ntptot = 100, nX = 14, DOF = 86 XCond = 226.263 (normalized) Computing compensation for resdual AR1 bias 1 -0.5 -0.532209(t=0.017135) 2 -0.25 -0.318684(t=0.02182) 3 0 -0.120952(t=0.02537) 4 0.25 0.0508019(t=0.028981) 5 0.5 0.176664(t=0.03252) AR1 Correction M: 0.20632 1.38585 Computing contrast matrices Loaded /autofs/space/galen_002/users/carl/S4_HR_LR18/S4_HR_LR18VvI/rfa0413/bold/014/VvI8.para as a par2 file. 1 omnibusJ= 8 eff =1.4 vrf = 10.9642 vrfffx = 10.9642 r = 1.00 Loaded /autofs/space/galen_002/users/carl/S4_HR_LR18/S4_HR_LR18VvI/rfa0413/bold/014/VvI8.para as a par2 file. 2 allvfixJ= 1 eff =0.8 vrf = 0.7544 vrfffx = 0.7544 r = 1.00 OLS Beta Pass run 1t= 0.0 Loaded /autofs/space/galen_002/users/carl/S4_HR_LR18/S4_HR_LR18VvI/rfa0413/bold/014/VvI8.para as a par2 file. Global In-Mask Mean = 691.858 Rescale Target = 100 RescaleFactor = 0.144538 OLS Residual Pass run 1t= 0.0 Loaded /autofs/space/galen_002/users/carl/S4_HR_LR18/S4_HR_LR18VvI/rfa0413/bold/014/VvI8.para as a par2 file. Whitening Computing whitening matrices seg 1 5617 nrho1 = -0.031 (t= 0.0) seg 2 5617 nrho1 = 0.105 (t= 0.1) seg 3 5617 nrho1 = 0.186 (t= 0.1) seg 4 5617 nrho1 = 0.254 (t= 0.1) seg 5 5617 nrho1 = 0.318 (t= 0.1) seg 6 5617 nrho1 = 0.382 (t= 0.2) seg 7 5617 nrho1 = 0.451 (t= 0.2) seg 8 5617 nrho1 = 0.529 (t= 0.2) seg 9 5617 nrho1 = 0.625 (t= 0.2) seg 10 5616 nrho1 = 0.794 (t= 0.2) GLS Beta Pass run 1t= 0.0 Loaded /autofs/space/galen_002/users/carl/S4_HR_LR18/S4_HR_LR18VvI/rfa0413/bold/014/VvI8.para as a par2 file. GLS Residual Pass run 1t= 0.0 Loaded /autofs/space/galen_002/users/carl/S4_HR_LR18/S4_HR_LR18VvI/rfa0413/bold/014/VvI8.para as a par2 file. Found 0 zero-valued voxels Computing contrasts Starting contrasts omnibus J=8 - Computing CES Magnitude allvfix J=1 - Saving h.dat to /autofs/space/galen_002/users/carl/S4_HR_LR18/S4_HR_LR18VvI/rfa0413/bold/VvI_MK_Analysis/h.dat >> >> >> >> -- --- Computing FWHM --- /autofs/space/galen_002/users/carl/S4_HR_LR18/S4_HR_LR18VvI/rfa0413 Fri Nov 16 13:03:45 EST 2007 /autofs/space/galen_002/users/carl/S4_HR_LR18/S4_HR_LR18VvI mri_concat /autofs/space/galen_002/u
Re: [Freesurfer] Reading mris_smooth output using Matlab
Hi Kim, we do have some tools for smoothing the hippocampal surfaces, but we haven't distributed them. I could try to get you a beta version if you like. cheers, Bruce On Fri, 16 Nov 2007, Kim Mouridsen wrote: Hi Nick, The Freesurfer version I use has build stamp freesurfer-Darwin-tiger-i686-stable-pub-v4.0.1 After conversion, read_asc.m doesn't work - seemingly due to a dimension problem. In the code I see that 5 elements are expected for faces and indicies, whereas only 4 elements are provided in the .asc file. I changed lines 45-46 into f = fscanf(fp, '%d', S(3)*4); f = reshape(f, [4 S(3)])'; Using patch in Matlab with v(:,1:3) as vertices and f(:,[1 3 2]) as faces, I get an image of the hippocampus surface. The surface looks good(!) but is a bit rough and 'spiky'. Is this because the segmentation procedure does not employ a smoothness constraint? The aim of all this is to prepare hippocampal volumes for deformation analysis (two groups, two time points). Is the following line of processing appropriate: Topology correction: mri_topologycorrection -label "hippocampus" subject/mri/norm.mgz subject/mri/aseg.mgz aseg_corrected Tesselate surface: mri_tessellate Smooth surface: mris_smooth Convert to ascii for use with Matlab: mris_convert Cheers! Kim. 2007/11/16, Nick Schmansky <[EMAIL PROTECTED]>: Kim, Which version of freesurfer is being used? An alternative approach is to convert the surface to ascii: mris_convert surface_file surface_file.asc where the .asc extension is an output ascii file listing the vertices and faces. Nick On Thu, 2007-11-15 at 16:18 +0100, Kim Mouridsen wrote: Hi, We have segmented hippocampus using Freesurfer, and want to generate a surface which can be read into matlab. We use mri_tesselate and mris_smooth. However, the resulting file can not be read into matlab using read_surf. The error we get is ??? Undefined function or variable "vertex_coords". Error in ==> read_surf at 77 vertex_coords = reshape(vertex_coords, 3, vnum)' ; It seems the 'magic' number is 16777213, whereas only 16777214 and 16777215 are supported in read_surf.m How can we read the result of mris_smooth into matlab? Thanks! Kim. ___ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer ___ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer ___ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
[Freesurfer] Folding Index question
Folks: We're wondering about how FS's "folding index" corresponds to Van Essen's calculation (J Neurosci, 1997 Sept 15). In particular, do the FI values for each region factor out the area of the region or not. When we plot them the FI values look extremely correlated to area, but that doesn't make sense for an index. Ultimately we're wanting to know how to aggregate FIs for individual parcellations into larger regions. Thanks, Graham ___ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer