... | ... | @@ -3,6 +3,7 @@ The MEEG-Driver is the main user interface of DUNEuro. Once it is constructed, i |
|
|
General
|
|
|
- [`makeDomainFunction`](#makedomainfunction)
|
|
|
- [`write`](#writesolution-config)
|
|
|
- [`printcitations`](#printcitations)
|
|
|
|
|
|
EEG
|
|
|
- [`setElectrodes`](#setelectrodeselectrodes-config)
|
... | ... | @@ -26,7 +27,7 @@ The main purpose of the domain function is to store the solution of a single EEG |
|
|
|
|
|
### returns:
|
|
|
- **function**
|
|
|
an object that is basically a FEM function represented by its DOF vector. However, as the exact storage of the DOF vector might differ between different FEM methods (e.g. CG-FEM uses one DOF per node, while DG-FEM uses DOFs per element that are blocked element-wise), the entries are hidden and there is currently no way to access them via this interface
|
|
|
An object that is basically a FEM function represented by its DOF vector. However, as the exact storage of the DOF vector might differ between different FEM methods (e.g. CG-FEM uses one DOF per node, while DG-FEM uses DOFs per element that are blocked element-wise), the entries are hidden and there is currently no way to access them via this interface
|
|
|
|
|
|
----
|
|
|
## `write(config)`
|
... | ... | @@ -35,20 +36,23 @@ Write out the volume conductor to a file. The output will include the mesh as we |
|
|
|
|
|
### parameters:
|
|
|
- **config**
|
|
|
Configuration of the write process
|
|
|
Configuration of the write process, including the following options:
|
|
|
|
|
|
For the different solver methods there are different options for the configuration. For fitted methods (e.g. CG and DG):
|
|
|
- **'format' : 'vtk'**
|
|
|
File format of the output. Currently only vtk is supported.
|
|
|
|
|
|
For the vtk output, there are additional options:
|
|
|
- **'filename' : string**
|
|
|
name of the output file without the file extension
|
|
|
Name of the output file without the file extension
|
|
|
|
|
|
For fitted methods (CG and DG):
|
|
|
- **'subsampling' : int (default: 0)**
|
|
|
number times the mesh should be subsampled for output. This is especially useful for hexahedral meshes, as we might have multilinear instead of linear basis functions and some tools (e.g. Paraview) do not properly visualize multilinear data.
|
|
|
Number times the mesh should be subsampled for output. This is especially useful for hexahedral meshes, as we might have multilinear instead of linear basis functions and some tools (e.g., ParaView) do not properly visualize multilinear data.
|
|
|
- **'anisotropy.enable' : bool (default: false)**
|
|
|
usually, the conductivity is exported as the $\infty$-norm of the conductivity tensor. When this parameter is set, we additionally export the eigenvectors of the tensors, scaled by their corresponding eigenvalues. Note that this requires the *Eigen* library.
|
|
|
Usually, the conductivity is exported as the $`\infty`$-norm of the conductivity tensor. When this parameter is set, we additionally export the eigenvectors of the tensors, scaled by their corresponding eigenvalues. Note that this requires the *Eigen* library.
|
|
|
|
|
|
For unfitted methods (UDG):
|
|
|
- **'mode' : 'boundary'**
|
|
|
In case of unfitted volume conductors the surfaces of the tissues are represented
|
|
|
### returns: -
|
|
|
|
|
|
----
|
... | ... | @@ -56,21 +60,9 @@ Write out the volume conductor to a file. The output will include the mesh as we |
|
|
Write out the volume conductor, the potential and its gradient to a file. The output will include the mesh as well as the different conductivities. If meg was set in the constructor, the flux will be written to the file as well. Depending on the solver type, it might include additional information.
|
|
|
### parameters:
|
|
|
- **solution**
|
|
|
Solution of the EEG forward problem
|
|
|
Solution of the EEG forward problem, see solveEEGForward
|
|
|
- **config**
|
|
|
Configuration of the write process
|
|
|
|
|
|
For the different solver methods there are different options for the configuration. For fitted methods (e.g. CG and DG):
|
|
|
- **'format' : 'vtk'**
|
|
|
File format of the output. Currently only vtk is supported.
|
|
|
|
|
|
For the vtk output, there are additional options:
|
|
|
- **'filename' : string**
|
|
|
see above
|
|
|
- **'subsampling' : int (default: 0)**
|
|
|
see above
|
|
|
- **'anisotropy.enable' : bool (default: false)**
|
|
|
see above
|
|
|
Configuration of the write process, identical to the one in the previous write function with the following additional parameters:
|
|
|
- **'potential.type' : {'vertex','cell'} (default: 'vertex')**
|
|
|
Whether the potential should be written out as vertex or as cell data.
|
|
|
- **'gradient.type' : {'vertex','cell'} (default: 'vertex')**
|
... | ... | @@ -78,20 +70,24 @@ Write out the volume conductor, the potential and its gradient to a file. The ou |
|
|
|
|
|
### returns: -
|
|
|
|
|
|
----
|
|
|
## `print_citations()`
|
|
|
Write out information about relevant papers that provide more information on the software itself pointing to papers about DUNEuro and DUNE, as well as papers related to the FEM discretizations and the source models that were applied.
|
|
|
### parameters: -
|
|
|
### returns: -
|
|
|
|
|
|
----
|
|
|
# EEG
|
|
|
----
|
|
|
## `setElectrodes(electrodes, config)`
|
|
|
The electrode positions are passed and projected to the mesh.
|
|
|
### parameters:
|
|
|
- **electrodes**
|
|
|
Positions of EEG sensors
|
|
|
- **electrodes : double (#electrodes x 3)**
|
|
|
Positions of EEG sensors
|
|
|
- **config**
|
|
|
Configuration specifying how to set the electrode positions
|
|
|
|
|
|
There are different options for the configuration:
|
|
|
Configuration specifying how to set the electrode positions, there are different options:
|
|
|
- **'type' : {'normal', 'closest_subentity_center'}**
|
|
|
This option specifies whether the electrode positions should be moved to the mesh by projecting them orthogonally to the surface or to set them to the closest subentity.
|
|
|
This option specifies whether the electrode positions should be moved to the mesh by projecting them orthogonally to the surface or to set them to the closest subentity which might be inside the mesh.
|
|
|
|
|
|
For the closest_subentity_center option, there are additional options:
|
|
|
- **'codims' : int**
|
... | ... | @@ -101,21 +97,19 @@ The electrode positions are passed and projected to the mesh. |
|
|
|
|
|
----
|
|
|
## `solveEEGForward(dipole, solution, config)`
|
|
|
This function can be used to directly solve the linear system in order to compute the EEG forward solution, as opposed to using the transfer matrix approach. This is typically useful for a small number of dipoles, e.g., for visualization purposes.
|
|
|
This function can be used to directly solve the linear system in order to compute the EEG forward solution in every DOF, as opposed to using the transfer matrix approach.
|
|
|
### parameters:
|
|
|
- **dipole**
|
|
|
Dipole for which the EEG forward solution should be computed.
|
|
|
- **dipole : double (1 x 6)**
|
|
|
Dipole defined by their position (1 x 3) and moments (1 x 3) concatenated.
|
|
|
- **solution**
|
|
|
A function created using makeDomainFunction that will store the forward solution after this method is called.
|
|
|
- **config**
|
|
|
Configuration specifying how to set the electrode positions.
|
|
|
|
|
|
There are different options for the configuration:
|
|
|
- **'post_process' : bool**
|
|
|
Configuration specifying how to set the electrode positions with these options:
|
|
|
- **'post_process' : bool**
|
|
|
This parameter specifies if the solution is post-processed. For the subtraction source model, this means that the analytical contribution to the solution is added.
|
|
|
- **'subtract_mean' : bool**
|
|
|
- **'subtract_mean' : bool**
|
|
|
In case of fitted methods, the direct solution of the EEG forward problem is average-referenced if this parameter is set true.
|
|
|
- **'source_model' : configuration**
|
|
|
- **'source_model'**
|
|
|
This is a nested configuration that contains further parameters that specify the source model in a tree structure. A more detailed description of the parameters can be found [here](https://gitlab.dune-project.org/duneuro/duneuro/-/wikis/source-model-parameters).
|
|
|
|
|
|
### returns: -
|
... | ... | @@ -138,10 +132,10 @@ The transfer matrix is computed, which is especially useful if the number of sou |
|
|
Configuration specifying different options for the numerical computation.
|
|
|
|
|
|
These options are:
|
|
|
- **reduction: double**
|
|
|
The relative reduction of the solver
|
|
|
- **compartment: int**
|
|
|
the index of the compartment for the sensors needs to be passed in case UDG is used.
|
|
|
- **'reduction': double**
|
|
|
The relative reduction of the solver, e.g., '1e-10'.
|
|
|
- **'compartment': int**
|
|
|
The index of the compartment for the sensors needs to be passed in case UDG is used.
|
|
|
|
|
|
### returns:
|
|
|
- **transferMatrix**
|
... | ... | @@ -153,14 +147,14 @@ After computing the transfer matrix (computeEEGTransferMatrix), it is multiplied |
|
|
### parameters:
|
|
|
- **transferMatrix**
|
|
|
The transfer matrix computed using computeEEGTransferMatrix.
|
|
|
- **dipoles**
|
|
|
A function created using makeDomainFunction that will store the forward solution after this method is called.
|
|
|
- **dipoles : double (#dipoles x 6)**
|
|
|
Dipoles defined by their position (#dipoles x 3) and moments (#dipoles x 3) concatenated.
|
|
|
- **config**
|
|
|
Configuration specifying the source model options, which is identical to the one passed in solveEEGForward (see above).
|
|
|
|
|
|
### returns:
|
|
|
- **leadfield**
|
|
|
EEG leadfield: The potential at the electrodes is computed.
|
|
|
The potential at the electrodes for each dipole.
|
|
|
|
|
|
----
|
|
|
# MEG
|
... | ... | |