|
@@ -6,6 +6,8 @@ from slicer.ScriptedLoadableModule import *
|
|
|
import logging
|
|
|
import parseDicom as pd
|
|
|
import vtkInterface as vi
|
|
|
+import fileIO
|
|
|
+import slicer
|
|
|
#
|
|
|
# cardiacSPECT
|
|
|
#
|
|
@@ -43,6 +45,10 @@ class cardiacSPECTWidget(ScriptedLoadableModuleWidget):
|
|
|
def setup(self):
|
|
|
ScriptedLoadableModuleWidget.setup(self)
|
|
|
|
|
|
+ self.selectRemote=fileIO.remoteFileSelector()
|
|
|
+ self.network=slicer.modules.labkeySlicerPythonExtensionWidget.network
|
|
|
+ self.selectRemote.setMaster(self)
|
|
|
+
|
|
|
# Instantiate and connect widgets ...
|
|
|
dataButton = ctk.ctkCollapsibleButton()
|
|
|
dataButton.text = "Data"
|
|
@@ -56,11 +62,22 @@ class cardiacSPECTWidget(ScriptedLoadableModuleWidget):
|
|
|
self.dataPath=qt.QLineEdit(pathGuess)
|
|
|
dataFormLayout.addRow("Data location",self.dataPath)
|
|
|
|
|
|
- browseButton = qt.QPushButton("Browse")
|
|
|
+
|
|
|
+ self.remotePath=qt.QLineEdit();
|
|
|
+ dataFormLayout.addRow('Remote Path', self.remotePath)
|
|
|
+ self.remotePath.textChanged.connect(self.onRemotePathTextChanged)
|
|
|
+
|
|
|
+ browseButton = qt.QPushButton("Browse local")
|
|
|
browseButton.toolTip="Set file location"
|
|
|
- dataFormLayout.addRow("Change data location",browseButton)
|
|
|
+ dataFormLayout.addRow("Select local",browseButton)
|
|
|
browseButton.connect('clicked(bool)',self.onBrowseButtonClicked)
|
|
|
|
|
|
+ browseRemoteButton = qt.QPushButton("Browse remote")
|
|
|
+ browseRemoteButton.toolTip="Set remote location"
|
|
|
+ dataFormLayout.addRow("Select remote",browseRemoteButton)
|
|
|
+ browseRemoteButton.connect('clicked(bool)',self.onRemoteBrowseButtonClicked)
|
|
|
+
|
|
|
+
|
|
|
dataLoadButton = qt.QPushButton("Load")
|
|
|
dataLoadButton.toolTip="Load data from DICOM"
|
|
|
dataFormLayout.addRow("Data",dataLoadButton)
|
|
@@ -198,9 +215,15 @@ class cardiacSPECTWidget(ScriptedLoadableModuleWidget):
|
|
|
|
|
|
self.dataPath.setText("file://"+inputDir)
|
|
|
|
|
|
+ def onRemoteBrowseButtonClicked(self):
|
|
|
+ self.selectRemote.show()
|
|
|
+
|
|
|
def onDataLoadButtonClicked(self):
|
|
|
self.logic.loadData(self)
|
|
|
|
|
|
+ def onRemotePathTextChanged(self,str):
|
|
|
+ self.dataPath.setText('labkey://'+str)
|
|
|
+
|
|
|
def onTimeFrameSelect(self):
|
|
|
it=self.time_frame_select.value
|
|
|
selectionNode = slicer.app.applicationLogic().GetSelectionNode()
|
|
@@ -354,6 +377,7 @@ class cardiacSPECTLogic(ScriptedLoadableModuleLogic):
|
|
|
def addFrames(self):
|
|
|
#convert data from numpy.array to vtkImageData
|
|
|
#use time point it
|
|
|
+ print "NFrames: {}".format(self.frame_data.shape[3])
|
|
|
for it in range(0,self.frame_data.shape[3]):
|
|
|
frame_data=self.frame_data[:,:,:,it];
|
|
|
nodeName='testVolume'+str(it)
|