소스 검색

Adding getNumpy to orthancInterface

Andrej Studen @ VBOX 1 년 전
부모
커밋
88c02cf73a
1개의 변경된 파일7개의 추가작업 그리고 0개의 파일을 삭제
  1. 7 0
      orthancDatabaseBrowser.py

+ 7 - 0
orthancDatabaseBrowser.py

@@ -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