Browse Source

Python binder fix for reading in files

master
Trevor Irons 4 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
          *   used in Python wrapping
134
          *   used in Python wrapping
135
          */
135
          */
136
         static std::shared_ptr<KernelV0> DeSerialize( const std::string& node ) {
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
         // ====================  OPERATORS     =======================
140
         // ====================  OPERATORS     =======================
161
         void AlignWithAkvoDataset( const YAML::Node& node ) ;
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
          *   Assign transmiter coils
171
          *   Assign transmiter coils
165
          */
172
          */
166
         inline void PushCoil( const std::string& label, std::shared_ptr<PolygonalWireAntenna> ant ) {
173
         inline void PushCoil( const std::string& label, std::shared_ptr<PolygonalWireAntenna> ant ) {

+ 1
- 0
python/pyMerlin.cpp View File

70
             .def("CalculateK0", &Lemma::KernelV0::CalculateK0, "Calculates an intial amplitude kernel")
70
             .def("CalculateK0", &Lemma::KernelV0::CalculateK0, "Calculates an intial amplitude kernel")
71
 
71
 
72
             //.def("AlignWithAkvoDataset", &Lemma::KernelV0::AlignWithAkvoDataset, "Aligns the kernel parameters with a dataset")
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