Mercurial > hg > orthanc-book
comparison Sphinx/source/plugins/python/pil-conversions.py @ 977:caf69d2ee070
fix Sphinx/source/plugins/python/pil-conversions.py
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 30 Aug 2023 14:30:40 +0200 |
parents | 92ca063536ed |
children | 1316bc62b5d5 |
comparison
equal
deleted
inserted
replaced
976:600da1bb6acd | 977:caf69d2ee070 |
---|---|
34 draw.line((0, image.size[1], image.size[0], 0), fill=(255,0,0), width=10) | 34 draw.line((0, image.size[1], image.size[0], 0), fill=(255,0,0), width=10) |
35 | 35 |
36 # (4) Convert back the modified PIL image to an Orthanc image | 36 # (4) Convert back the modified PIL image to an Orthanc image |
37 buf = image.tobytes() | 37 buf = image.tobytes() |
38 a = orthanc.CreateImageFromBuffer(frame.GetImagePixelFormat(), image.size[0], image.size[1], | 38 a = orthanc.CreateImageFromBuffer(frame.GetImagePixelFormat(), image.size[0], image.size[1], |
39 len(buf) / image.size[1], buf) | 39 len(buf) // image.size[1], buf) |
40 | 40 |
41 # (5) Create and upload a new DICOM instance with the modified frame | 41 # (5) Create and upload a new DICOM instance with the modified frame |
42 tags = { | 42 tags = { |
43 'SOPClassUID' : '1.2.840.10008.5.1.4.1.1.1', | 43 'SOPClassUID' : '1.2.840.10008.5.1.4.1.1.1', |
44 'PatientID' : 'HELLO', | 44 'PatientID' : 'HELLO', |