openCARP
Doxygen code documentation for the open cardiac electrophysiology simulator openCARP
leadfield.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) NumeriCor GmbH
2 // SPDX-License-Identifier: Apache-2.0
3 
12 #ifndef _LEADFIELD_H
13 #define _LEADFIELD_H
14 
15 #include <string>
16 #include <vector>
17 
18 #include "fem.h"
19 #include "stimulate.h"
20 
21 namespace opencarp {
22 
23 class Electrics;
24 
25 class Leadfield
26 {
27  public:
28  Leadfield();
29  ~Leadfield();
30 
32  int run(Electrics & elec);
33 
34  private:
35  std::vector<std::string> lead_names;
36  std::vector<std::vector<float>> trace_data;
37  std::vector<sf_vec*> Z;
38  sf_vec* Im = nullptr;
39  std::string vm_file;
40  float ecg_timedt = 0.0f;
41  std::string lf_dir;
42 
43  void construct(Electrics & elec);
44  void load(Electrics & elec);
45  void apply(sf_mat & Ki, sf_vec & vm);
46  void apply_unit_curr_lead(const std::string & lead, Electrics & elec);
47  void write_leadfield_igb(const std::string & lead_name, sf_vec * phie_i);
48  void collect_lead_names(const SF::vector<stimulus> & stimuli);
49 };
50 
51 } // namespace opencarp
52 
53 #endif
A vector storing arbitrary data.
Definition: SF_vector.h:28
int run(Electrics &elec)
Full pipeline: construct or load Z, stream vm.igb, write ECG_*.dat.
Definition: leadfield.cc:262
Top-level header of FEM module.
Electrical stimulation functions.