neurodec.mdt.ForwardSolution#

class neurodec.mdt.ForwardSolution(dictionary: dict)#

A forward solution

property id: int#

Returns the ID of the object

classmethod new(conductor: Conductor, electrodes: Collection[Electrode], force_computation: bool = False) ForwardSolution#

Create a new forward solution

Creates a new forward solution from a volume conductor and electrodes. This will initiate a call to the Neurodec Myoelectric Digital Twin (MDT) API that will build the forward solution and return its metadata.

Parameters
  • conductor – The conductor for which we compute the forward solution.

  • electrodes – The electrodes used to record EMGs.

  • force_computation – Boolean flag that allows to bypass a status check. Normally, the API would check if an object with the requested parameters was already present in the database. If this was the case, the API would not request its computation and would simply return its identifier. By setting this flag to True, the user can bypass this logic and force the computation of the resource even if it existed already. The main reason is to allow starting a calculation again in case of unexpected errors.

Returns

The metadata of the new forward solution. If another forward solution with the same parameters already exits, that one will be returned instead of building a new one.

property status: Status#

Returns the up-to-date status of the object, by performing an API request.

wait()#

Wait for the object to be ready