|
@@ -1,6 +1,7 @@
|
|
|
import orthancInterface
|
|
|
import json
|
|
|
import chardet
|
|
|
+import io
|
|
|
|
|
|
def extractJSON(data):
|
|
|
encoding=chardet.detect(data)["encoding"]
|
|
@@ -26,6 +27,12 @@ class orthancDB:
|
|
|
def getSeriesData(self, seriesOrthancId):
|
|
|
return self.getData('series',seriesOrthancId)
|
|
|
|
|
|
+ def getNumpy(self,level,orthancId):
|
|
|
+ url=self.net.getCoreURL()
|
|
|
+ url+='/'+level+'/'+orthancId+'/numpy'
|
|
|
+ response=self.net.get(url,binary=True)
|
|
|
+ return io.BytesIO(response.data)
|
|
|
+
|
|
|
def getData(self, level, orthancId):
|
|
|
url=self.net.getCoreURL()
|
|
|
url+='/'+level+'/'+orthancId
|