# EEG parametric leadfield computation - On equidistant elements¶

It is also possible to compute the parametric solution for a subset of the elements of the region of interest. Compared to the single solution, here, the elements must be precomputed to avoid computing it at each iteration.

The solution is thus to compute a reference single solution and provide the resulting elements. In this example, we use the subset of elements generated for the single solution of a previous example.

[ ]:

from shamo import FEM


[ ]:

from shamo.eeg import ProbParamEEGLeadfield


[ ]:

from shamo import DistUniform

problem.sigmas.set("scalp", DistUniform(0.137, 2.1))
problem.sigmas.set("gm", DistUniform(0.06, 2.47))
problem.sigmas.set("wm", DistUniform(0.0646, 0.81))

[ ]:

problem.reference.add("IZ")

[ ]:

problem.markers.adds(["NZ", "LeftEar", "RightEar"])

[ ]:

problem.rois.add("gm")


First, we load the solution that serves as a reference.

[ ]:

from shamo.eeg import SolEEGLeadfield


[ ]:

problem.elems_path.set(ref_solution.source_sp_path)

[ ]:

solution = problem.solve("parametric_ssp-dist", "../../derivatives/eeg_leadfield", model, n_evals=4, method="multiprocessing", n_proc=4)