Hey.
The invidual Freesurfer surface and thickness file can be loaded into surfstat correctly. But the number of vertex varied a bit among subjects in Freesurfer. So when performing the surfstat analysis, I always met the error as follows. I am very curious how to fix it? Thank you in advance.
avsurf = SurfStatAvSurf( filesboth ); 36 x 2 files to read, % remaining: 100 ??? Error using ==> plus Matrix dimensions must agree.
Error in ==> SurfStatAvSurf at 36 surf.coord=fun(surf.coord,double(s.coord));
SurfStatReadSurf(filesboth(1,:))
ans = tri: [598010x3 int32] coord: [3x299009 double]
SurfStatReadSurf(filesboth(2,:))
ans = tri: [621056x3 int32] coord: [3x310532 double]
SurfStatReadSurf(filesboth(3,:))
ans = tri: [518412x3 int32] coord: [3x259210 double]
Best wishes,
Hi Meng,
you need to use mri_surf2surf to map all your subjects into a common (same # of vertices!) space first. We typically use fsaverage for this as the target.
cheers, Bruce
On Mon, 4 Jan 2010, leemon albert wrote:
Hey.
The invidual Freesurfer surface and thickness file can be loaded into surfstat correctly. But the number of vertex varied a bit among subjects in Freesurfer. So when performing the surfstat analysis, I always met the error as follows. I am very curious how to fix it? Thank you in advance.
avsurf = SurfStatAvSurf( filesboth ); 36 x 2 files to read, % remaining: 100 ??? Error using ==> plus Matrix dimensions must agree.
Error in ==> SurfStatAvSurf at 36 surf.coord=fun(surf.coord,double(s.coord));
SurfStatReadSurf(filesboth(1,:))
ans = tri: [598010x3 int32] coord: [3x299009 double]
SurfStatReadSurf(filesboth(2,:))
ans = tri: [621056x3 int32] coord: [3x310532 double]
SurfStatReadSurf(filesboth(3,:))
ans = tri: [518412x3 int32] coord: [3x259210 double]
Best wishes,
Hey, bruce.Thanks for your help. According to your suggestion, I use the following command to map each subject to default fsaverage successfully. for lh.pial mri_surf2surf --s chenlingfeng_64 --hemi lh --sval-xyz pial --tval 3D_chenlingfeng_64_to_avg_lh.pial --tval-xyz --trgsubject fsaverage for lh.thickness mri_surf2surf --srcsubject chenlingfeng_64 --hemi lh --srcsurfval thickness --src_type curv --trgsubject avgsubject_3D --trgsurfval 3D_chenlingfeng_64toavg_lh.thickness --trg_type curv
However, the output of SurfStatMaskCut in surfstat seem a bit weird, which excludes too much non-inter-hemispheric region (see the attached figure 1) . So I use make_average_surface to create the customer average of our dataset. Then to obtain the mask form it again. The problem happens again (see the attached figure 2).
The SurfStatMaskCut in surfstat said as follows. Usage: mask = SurfStatMaskCut( surf ); surf.coord = 3 x v matrix of surface coordinates, v=#vertices. mask = 1 x v vector, 1=inside, 0=outside, v=#vertices. It looks in -50<y<50 and -20<z<40, and mask vertices where |x|>thresh, where thresh = 1.5 x arg max of a histogram of |x|.
If is it caused by using different coordinate systems between freesurfer and surfstat. Or it's not a good idea to perform the statistical analysis of freesurfer surface data using surfstat? Any suggestion is appreciated.
Regards,
Hi Meng,
sorry, we don't have much experience with SurfStat. I don't think you can mask just using coordinates like that to remove non-cortical regions. You could instead use the ?h.cortex.label that we generate.
cheers Bruce On Wed, 6 Jan 2010, leemon albert wrote:
Hey, bruce.Thanks for your help. According to your suggestion, I use the following command to map each subject to default fsaverage successfully. for lh.pial mri_surf2surf --s chenlingfeng_64 --hemi lh --sval-xyz pial --tval 3D_chenlingfeng_64_to_avg_lh.pial --tval-xyz --trgsubject fsaverage for lh.thickness mri_surf2surf --srcsubject chenlingfeng_64 --hemi lh --srcsurfval thickness --src_type curv --trgsubject avgsubject_3D --trgsurfval 3D_chenlingfeng_64toavg_lh.thickness --trg_type curv
However, the output of SurfStatMaskCut in surfstat seem a bit weird, which excludes too much non-inter-hemispheric region (see the attached figure 1) . So I use make_average_surface to create the customer average of our dataset. Then to obtain the mask form it again. The problem happens again (see the attached figure 2).
The SurfStatMaskCut in surfstat said as follows. Usage: mask = SurfStatMaskCut( surf ); surf.coord = 3 x v matrix of surface coordinates, v=#vertices. mask = 1 x v vector, 1=inside, 0=outside, v=#vertices. It looks in -50<y<50 and -20<z<40, and mask vertices where |x|>thresh, where thresh = 1.5 x arg max of a histogram of |x|.
If is it caused by using different coordinate systems between freesurfer and surfstat. Or it's not a good idea to perform the statistical analysis of freesurfer surface data using surfstat? Any suggestion is appreciated.
Regards,
freesurfer@nmr.mgh.harvard.edu