1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- import slicer
- import loadDicom
- import re
- import slicerNetwork
- import os
- import subprocess
- fValue=loadDicom.dicomValue
- dicomModify="/afs/f9.ijs.si/home/studen/software/install/"
- dicomModify+="dicomModify/bin/dicomModify"
- class loadPatient(slicer.ScriptedLoadableModule.ScriptedLoadableModule):
- def __init__(self,parent):
- slicer.ScriptedLoadableModule.ScriptedLoadableModule.__init__(self, parent)
- self.className="loadPatient"
- self.parent.title="loadPatient"
- class loadPatientLogic(slicer.ScriptedLoadableModule.ScriptedLoadableModuleLogic):
- def __init__(self,parent):
- slicer.ScriptedLoadableModule.ScriptedLoadableModuleLogic.__init__(self, parent)
- #self.plugin=slicer.modules.dicomPlugins['DicomRtImportExportPlugin']()
- #self.volumePlugin=slicer.modules.dicomPlugins['DICOMScalarVolumePlugin']()
- self.dicomLoader=loadDicom.loadDicomLogic(self)
- #self.rtReader=slicer.vtkSlicerDicomRtReader()
- #start SSL/TLS configuration
- def setURIHandler(self, net):
- self.sNet=net
- def load(self,label):
- #clear previous data
- debug=True
- loadDicom.clearNodes()
-
- containerPath='Matej/studija'
- subFolder=''
- dirUrl=containerPath+"/@files"+subFolder
- dir=os.path.join(dirUrl,label)
- #load segmentations
- rs=dir+"/RS/DICOM";
- self.dicomLoader.load(self.sNet,rs)
- rsMatch='None'
- dataset="ImagingVisitsManaged"
- fSet=self.sNet.filterDataset(containerPath,dataset,'EMBRACE_ID',label)
- fData=fSet['rows']
- for r in fData:
- if r['type']!='RS':
- continue
- row=r
- if row['rsMatch']==None:
- return
- if row['rsMatch']=='NONE':
- return
- dicomDir=dir+'/'+row['rsMatch']+'/DICOM'
- if debug:
- print "Loading {}".format(dicomDir)
- self.dicomLoader.load(self.sNet,dicomDir)
|