Proceed to surfstat

Deal all,
I am trying to run more complex statistics using surfstat.
However the result of SPHARM-PDM or SlicerSALT ( *ellalign.meta and *ellalign.coef) seems different from
the structures of data used in existing tutorial.

Anybody has some experience on modify the data to be used in surfstat?

Hi June, Indeed the coefficients themselves are not ready for surfstat, but you can use the vtk files to do the local shape analysis in surfstat. If you look at Moo’s amygdala page, before running surfstat he calls his tool SPHARMrepresent2, which maps the coefficients to a sampled/triangulated surface/mesh. The vtk files from our tool is such a triangulated mesh that you can use in surfstat. You just need to first convert it into either obj or MGH-Freesurfer format.

Hi, June.

If you have vtk surfaces, first of all, you have to convert the surface format from vtk to freesurfer surface format. you can use “mris_convert”. And also, you can check your surfaces have same vertex number (after surface registration) which means all surfaces have correspondence point.

Thanks, Martin,
I checked SPHARMrepresent2.
However, it requires data format like below.
x: [43x85 double]
y: [43x85 double]
z: [43x85 double]

Since vtk data is just x,y,z coordinate, I think more data transfer or additional step is needed.

Actually I transferred it to MNI obj format.
freesurfer surface is better to process?

You mean using mris_convert, convert vtk to mgz, right?
Should I use ellaign.vtk or already aligned procalign.vtk?

Sorry, that I was not clear. The vtk surfaces created by SALT would be similar to the surfaces created by SPHARMrepresent2. I.e. instead of using SPHARMrepresent2, you would be loading our surfaces.

I think obj or freesurfer are equally good. I don’t think mris_convert converts from vtk, but rather only to vtk (I tried it on my local install, which is not the newest, and it did not work).

So, I would use your conversion from vtk to obj and then load those obj files into surfstat. For that purpose use the procalign.vtk surfaces.


Let me know if your vtk to obj tool does not work, as I was told by SunHyung that he has such a tool that we can give to you.

I also created python code using VTK, and it successfully converted vtk to obj.

However, I am stucked in below step. Brain, Age, Group is covariate. avsurf is average one.

slm0 = SurfStatLinMod( disp, Brain + Age + Group, avsurf);

When I load the obj transformed from vtk file, it looks like below.
A =
tri: [2880x3 int32]
coord: [3x1442 double]

Making average surface from As are possible, but
How should I calculate disp from them?

When I use surfstat, should I ignore ellalign.coef or should I use it in somewhere above?

Hi, June

I am not sure what you are analyzing for your measurement. What is your dependent variable? “disp” , as you wrote, is a dependent variable that means you obtained any features from surface (e.g. surface area, cortical thickness, and any your interesting value). But the dimension of your disp has to same the number of vertex (e.g. 1442 in your case).
Could you explain the “ellalign.coef”? Is it your interesting dependent variable? If so, is the dimension matching to the number of vertex?

I am conducting shape analysis using SPHARM-PDM.
disp is just difference from average shape in Moo K.s tutorial. (and same as me).
Since I used different SPHARM method from Moo K., (He used matlab scripts to run SPHARM, and I used SPHARM-PDM made by Beatriz Paniagua.)

ellalign.coef is the result of SPHARM-PDM, and possibly coeffient values from comparision to standard sphere (r=1).

Hi, June

If I understood correctly, you want to make “disp” from the average surface and each individual surfaces. And then you will put the “disp” as a dependent variable into glm. Did you obtain each surface that is generated by SPHARM-PDM? If so, I thought it is quite simple to get the “disp”. you can calculate the distance between two points ( e.g. between coord from individual and coord from average).

Yes, that’s correct. I generate all surface by SPHARM-PDM, and use disp as dependent variable into glm.

21 PM

Thanks Sun Hyung and Martin.
I am almost done.

I think something wrong in the last visualization part, and looking on it.


Hi, June

Great works. But I guess you are missing the surface smoothing. or when you visualized your values, the figure seems to use the vector information.

Sun Hyung

1 Like

Dear all,

I’m trying to import procalign.vtk files generated by Slicer into Surfstat, but I’m struggling with the conversion from vtk to MNI obj. Is the tool that Martin mentioned earlier still available?

you can use vtk library or here is simple c++ code:

Sun Hyung

1 Like