comparison Tests/Toolbox.py @ 59:84378ada15ab

test_decode_brainix_as_jpeg
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 18 Nov 2015 09:56:47 +0100
parents ffa542cce638
children 97acfdf0dbce
comparison
equal deleted inserted replaced
58:b5518378e23b 59:84378ada15ab
169 def ComputeMD5(data): 169 def ComputeMD5(data):
170 m = hashlib.md5() 170 m = hashlib.md5()
171 m.update(data) 171 m.update(data)
172 return m.hexdigest() 172 return m.hexdigest()
173 173
174 def GetImage(orthanc, uri): 174 def GetImage(orthanc, uri, headers = {}):
175 # http://www.pythonware.com/library/pil/handbook/introduction.htm 175 # http://www.pythonware.com/library/pil/handbook/introduction.htm
176 data = DoGet(orthanc, uri) 176 data = DoGet(orthanc, uri, headers = headers)
177 return Image.open(StringIO(data)) 177 return Image.open(StringIO(data))
178 178
179 def GetArchive(orthanc, uri): 179 def GetArchive(orthanc, uri):
180 # http://stackoverflow.com/a/1313868/881731 180 # http://stackoverflow.com/a/1313868/881731
181 s = DoGet(orthanc, uri) 181 s = DoGet(orthanc, uri)