Kaynağa Gözat

Adding path template for site configuration

Andrej Studen/Merlin 4 yıl önce
ebeveyn
işleme
b986ecdaba
2 değiştirilmiş dosya ile 24 ekleme ve 11 silme
  1. 16 11
      pythonScripts/preprocess.py
  2. 8 0
      setup.json.template

+ 16 - 11
pythonScripts/preprocess.py

@@ -7,12 +7,16 @@ import shutil
 import sys
 
 shome=os.path.expanduser('~nixUser')
-sys.path.insert(1,shome+'/software/src/labkeyInterface')
+fhome=os.path.expanduser('~')
+with open(os.path.join(fhome,".labkey","setup.json"),"w") as f:
+    setup=json.load(f)
+
+sys.path.insert(1,setup["paths"]["labkeyInterface"])
 import labkeyInterface
 import labkeyDatabaseBrowser
 import labkeyFileBrowser
 
-sys.path.insert(1,shome+'/software/src/orthancInterface')
+sys.path.insert(1,setup["paths"]["orthancInterface"])
 import orthancInterface
 import orthancFileBrowser
 
@@ -20,12 +24,15 @@ import orthancFileBrowser
 #import loadDicom
 
 
-fhome=os.path.expanduser('~')
 fconfig=os.path.join(fhome,'.labkey','network.json')
 
-matlab=os.path.join("/","data","software","install","matlab","bin","matlab")
-generalCodes=os.path.join(fhome,"software","src","generalCodes")
-niftiTools=os.path.join(fhome,"software","src","NifTiScripts")
+#matlab=os.path.join("/","data","software","install","matlab","bin","matlab")
+matlab=setup["paths"]["matlab"]
+#os.path.join(fhome,"software","install","matlab","bin","matlab")
+generalCodes=setup["paths"]["generalCodes"]
+#ios.path.join(fhome,"software","src","generalCodes")
+niftiTools=setup["paths"]["niftiTools"]
+#niftiTools=os.path.join(fhome,"software","src","NifTiScripts")
 
 net=labkeyInterface.labkeyInterface()
 net.init(fconfig)
@@ -39,17 +46,15 @@ ofb=orthancFileBrowser.orthancFileBrowser(onet)
 
 hi=0
 project='iPNUMMretro/Study'
-dataset='Imaging1'
-
+dataset='Imaging'
+h
 tempBase=os.path.join(fhome,'temp')
 
 #all images from database
-ds=db.selectRows(project,'study','Imaging1',[])
+ds=db.selectRows(project,'study',dataset,[])
 imageSelector={"CT":"CT","PETWB":"PET"};
 imageResampledField={"CT":"ctResampled","PETWB":"petResampled"}
 
-niftiBase='/data/nifti'
-labkeyBase='/data/labkey'
 #projectNIfTIBase=os.path.join(labkeyBase,'files',project,'@files/nifti')
 #use webdav to transfer file (even though it is localhost)
 

+ 8 - 0
setup.json.template

@@ -0,0 +1,8 @@
+{"paths":
+	{ "matlab":"/home/andrej/software/install/matlab/bin/matlab",
+	"generalCodes":"/home/andrej/software/src/generalCodes",
+	"niftiTools":"/home/andrej/software/src/NifTiScripts",
+	"labkeyInterface":"/home/andrej/software/src/labkeyInterface",
+	"orthancInterface":"/home/andrej/software/src/orthancInterface"}
+}
+