-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:orthanc-team/python-orthanc-api-client
- Loading branch information
Showing
9 changed files
with
187 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,8 @@ | ||
from pydicom.filebase import DicomFileLike | ||
from pydicom import dcmwrite | ||
from io import BytesIO | ||
|
||
|
||
def write_dataset_to_bytes(dataset) -> bytes: | ||
# create a buffer | ||
with BytesIO() as buffer: | ||
# create a DicomFileLike object that has some properties of DataSet | ||
memory_dataset = DicomFileLike(buffer) | ||
# write the dataset to the DicomFileLike object | ||
dcmwrite(memory_dataset, dataset) | ||
# to read from the object, you have to rewind it | ||
memory_dataset.seek(0) | ||
# read the contents as bytes | ||
return memory_dataset.read() | ||
dataset.save_as(buffer) | ||
return buffer.getvalue() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
FROM orthancteam/orthanc:24.2.3 | ||
FROM orthancteam/orthanc:24.10.1 | ||
|
||
RUN pip install pydicom | ||
RUN pip install --break-system-packages pydicom==3.0.1 | ||
|
||
RUN mkdir /scripts | ||
COPY plugin.py /scripts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters