Mensen / ept_TFCE-matlab

Advanced EEG Statistics
27 stars 9 forks source link

Calculate source neighbouring matrix #26

Open CorentinWicht opened 4 years ago

CorentinWicht commented 4 years ago

Dear Dr Mensen,

I was wondering whether you have an idea how I could generate a source-space neighbouring matrix to replace the ChN variable generated by ept_ChN2 ?

I am using the Measure Projection Toolbox for EEGLab (https://sccn.ucsd.edu/wiki/MPT) and with the function pr.headGrid(8) %8 being the spacing in mm, I generate a head grid:

      spacing: 8
minGridLocation: [-88 -121 -77]
maxGridLocation: [89 90 99]
          xCube: [27×23×23 double]
          yCube: [27×23×23 double]
          zCube: [27×23×23 double]
insideBrainCube: [27×23×23 logical]
       cubeSize: [27 23 23]

Would you have any input?

Best regards,

Corentin Wicht

CorentinWicht commented 4 years ago

Provided the X,Y,Z locations of the nodes inside the brain template, your function worked wonders:

NodesLoc = 1×3908 struct array with fields: X Y Z [ChN] = ept_ChN2(NodesLoc, 1) returned:

image

Best regards,

Corentin

Mensen commented 4 years ago

Sorry, I've been away a little while.

That looks great! I hope it was also able to produce some meaningful results!