|
@@ -728,14 +728,7 @@ class cardiacSPECTLogic(ScriptedLoadableModuleLogic):
|
|
|
return segNode.GetSegmentation().GetSegment(segNode.GetSegmentation().GetNthSegmentID(i)).GetName()
|
|
|
|
|
|
def storeNodeRemote(self,relativePath,nodeName):
|
|
|
- labkeyPath=self.pd.net.GetLabkeyPathFromRelativePath(relativePath)
|
|
|
- print ("Remote: {}").format(labkeyPath)
|
|
|
- #checks if exists
|
|
|
- self.pd.net.mkdir(labkeyPath)
|
|
|
-
|
|
|
- localPath=self.pd.net.GetLocalPathFromRelativePath(relativePath)
|
|
|
- localPath.replace('/',os.path.sep)
|
|
|
-
|
|
|
+
|
|
|
node=slicer.mrmlScene.GetFirstNodeByName(nodeName)
|
|
|
if node==None:
|
|
|
print("Node {} not found").format(nodeName)
|
|
@@ -748,20 +741,32 @@ class cardiacSPECTLogic(ScriptedLoadableModuleLogic):
|
|
|
node.__class__.__name__=="vtkMRMLGridTransformNode"):
|
|
|
suffix=".h5"
|
|
|
|
|
|
- #fileName=re.sub(r'_RS$',r'',nodeName)+suffix
|
|
|
fileName=nodeName+suffix
|
|
|
|
|
|
+ localPath=self.getLocalPath(relativePath)
|
|
|
if not os.path.isdir(localPath):
|
|
|
os.mkdir(localPath)
|
|
|
|
|
|
file=os.path.join(localPath,fileName)
|
|
|
slicer.util.saveNode(node,file)
|
|
|
print("Stored to: {}").format(file)
|
|
|
- f=open(file,"rb")
|
|
|
- remoteFile=labkeyPath+'/'+fileName
|
|
|
- self.pd.net.put(remoteFile,f.read())
|
|
|
-
|
|
|
-
|
|
|
+ if self.cfg["remote"]:
|
|
|
+ labkeyPath=self.pd.net.GetLabkeyPathFromRelativePath(relativePath)
|
|
|
+ print ("Remote: {}").format(labkeyPath)
|
|
|
+ #checks if exists
|
|
|
+ self.pd.net.mkdir(labkeyPath)
|
|
|
+ remoteFile=labkeyPath+'/'+fileName
|
|
|
+ f=open(file,"rb")
|
|
|
+ self.pd.net.put(remoteFile,f.read())
|
|
|
+
|
|
|
+ def getLocalPath(self,relativePath):
|
|
|
+ if self.cfg["remote"]:
|
|
|
+ localPath=self.pd.net.GetLocalPathFromRelativePath(relativePath)
|
|
|
+ localPath.replace('/',os.path.sep)
|
|
|
+ return localPath
|
|
|
+
|
|
|
+ localPath=os.path.join(self.cfg["labkeyBase"],relativePath)
|
|
|
+ return localPath
|
|
|
|
|
|
|
|
|
def storeVolumeNodes(self,patientId,n1,n2):
|