Browse Source

Python binder fix for reading in files

master
Trevor Irons 5 years ago
parent
commit
cfc324368a
2 changed files with 9 additions and 1 deletions
  1. 8
    1
      include/KernelV0.h
  2. 1
    0
      python/pyMerlin.cpp

+ 8
- 1
include/KernelV0.h View File

@@ -134,7 +134,7 @@ namespace Lemma {
134 134
          *   used in Python wrapping
135 135
          */
136 136
         static std::shared_ptr<KernelV0> DeSerialize( const std::string& node ) {
137
-            return KernelV0::DeSerialize(YAML::Load(node));
137
+            return KernelV0::DeSerialize(YAML::LoadFile(node));
138 138
         }
139 139
 
140 140
         // ====================  OPERATORS     =======================
@@ -161,6 +161,13 @@ namespace Lemma {
161 161
         void AlignWithAkvoDataset( const YAML::Node& node ) ;
162 162
 
163 163
         /**
164
+         *  Aligns the kernel pulse settings with an Akvo Processed dataset.
165
+         */
166
+        void AlignWithAkvoDataset( const std::string& file ) {
167
+            AlignWithAkvoDataset( YAML::LoadFile(file) );
168
+        }
169
+
170
+        /**
164 171
          *   Assign transmiter coils
165 172
          */
166 173
         inline void PushCoil( const std::string& label, std::shared_ptr<PolygonalWireAntenna> ant ) {

+ 1
- 0
python/pyMerlin.cpp View File

@@ -70,6 +70,7 @@ PYBIND11_MODULE(Merlin, m) {
70 70
             .def("CalculateK0", &Lemma::KernelV0::CalculateK0, "Calculates an intial amplitude kernel")
71 71
 
72 72
             //.def("AlignWithAkvoDataset", &Lemma::KernelV0::AlignWithAkvoDataset, "Aligns the kernel parameters with a dataset")
73
+            .def("AlignWithAkvoDataset", py::overload_cast< const std::string& >(&Lemma::KernelV0::AlignWithAkvoDataset), "Aligns Kernel pulse with specified dataset file")
73 74
 
74 75
 
75 76
 

Loading…
Cancel
Save