Bladeren bron

Realinging runSegmentationDM to use nixWrapper to load dependencies

Andrej Studen 1 jaar geleden
bovenliggende
commit
c87c6e3cc1
1 gewijzigde bestanden met toevoegingen van 15 en 6 verwijderingen
  1. 15 6
      pythonScripts/runSegmentationDM.py

+ 15 - 6
pythonScripts/runSegmentationDM.py

@@ -141,12 +141,17 @@ def main(parameterFile):
     with open(os.path.join(fhome,".labkey","setup.json")) as f:
         setup=json.load(f)
 
-    sys.path.insert(0,setup["paths"]["labkeyInterface"])
+    sys.path.insert(0,setup["paths"]["nixWrapper"])
+    
+    import nixWrapper
+    
+    nixWrapper.loadLibrary("labkeyInterface")
+
     import labkeyInterface
     import labkeyDatabaseBrowser
     import labkeyFileBrowser
 
-    sys.path.append(setup['paths']['parseConfig'])
+    nixWrapper.loadLibrary("parseConfig")
     import parseConfig
 
     with open(parameterFile) as f:
@@ -170,15 +175,19 @@ def doSegmentation(parameterFile):
     with open(os.path.join(fhome,".labkey","setup.json")) as f:
         setup=json.load(f)
 
-    sys.path.insert(0,setup["paths"]["labkeyInterface"])
+    sys.path.insert(0,setup["paths"]["nixWrapper"])
+    
+    import nixWrapper
+    
+    nixWrapper.loadLibrary("labkeyInterface")
+
     import labkeyInterface
     import labkeyDatabaseBrowser
     import labkeyFileBrowser
 
-    sys.path.append(setup['paths']['parseConfig'])
+    nixWrapper.loadLibrary("parseConfig")
     import parseConfig
 
-
     fconfig=os.path.join(fhome,'.labkey','network.json')
 
     net=labkeyInterface.labkeyInterface()
@@ -240,7 +249,7 @@ def doSegmentation(parameterFile):
             #copy file to file
             #normally I would update the targetQuery, but it contains previously set images
             #copy to labkey
-            #fb.writeFileToFile(segFile,outFile)
+            fb.writeFileToFile(segFile,outFile)