Dear all,
I am carrying out region simulations and trying to obtain MEG output. I computed a forward model for a surface mesh of 15.000 vertex approx.
I tried with the whole lead field matrix [310 channels x ~15.000 vertex] as input:
pr = projections.ProjectionSurfaceMEG.from_file("projection_surface_15k_MEG306.txt")
rm = region_mapping.RegionMapping.from_file("region_mapping_N35_AAL2red.txt")
ss = sensors.SensorsMEG.from_file(LCCN_folder+"sensors_MEG306.txt")
mon = (monitors.Raw(), monitors.MEG(projection=pr, sensors=ss, region_mapping=rm, period=1))
But, I got this error message:
"""
self._state += self.gain.dot(state[self.voi].sum(axis=-1).T)
ValueError: shapes (306,14779) and (92,4) not aligned: 14779 (dim 1) != 92 (dim 0)
"""
So, I thought that for my region simulation I had to do the gain matrix for each of my ROIs, as a gain matrix of [306 channels x 92 ROIs]. If I use this, my matrix is somehow modified to [306 channels x 102 ROIS]:
"""
>> sim.configure()
INFO Projection configured gain shape (306, 102)
>> sim.run()
self._state += self.gain.dot(state[self.voi].sum(axis=-1).T)
ValueError: shapes (306,102) and (92,4) not aligned: 102 (dim 1) != 92 (dim 0)
"""
So, I went to the breakpoint: line 522,
"""
def sample(self, step, state):
"Record state, returning sample at sampling frequency / period." 522 self._state += self.gain.dot(state[self.voi].sum(axis=-1).T)
if step % self._period_in_steps == 0:
time = (step - self._period_in_steps / 2.0) * self.dt
sample = self._state.copy() / self._period_in_steps
"""
I added before this line:
# self.gain=self.projection.projection_data
To set my gain matrix to what I computed and avoid the error, but I guess this is not the best method to fix the problem.
Could you help me?
Jesús Cabrera-Álvarez