forked from gacou54/pyorthanc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'gacou54:main' into main
- Loading branch information
Showing
50 changed files
with
3,060 additions
and
218 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,6 @@ | |
|
||
!README.md | ||
!docker-compose.yaml | ||
!pytest.Dockerfile | ||
|
||
!.github/ | ||
!.github/** | ||
|
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,15 +1,20 @@ | ||
version: '3.3' | ||
services: | ||
orthanc1: | ||
image: jodogne/orthanc:1.12.1 | ||
build: | ||
dockerfile: tests/orthanc/orthanc-for-test.Dockerfile | ||
context: . | ||
environment: | ||
PYTHON_PLUGIN_ENABLE: "true" | ||
ORTHANC__PYTHON_SCRIPT: "/python/script.py" | ||
depends_on: | ||
- orthanc2 | ||
orthanc2: | ||
image: jodogne/orthanc:1.12.1 | ||
test: | ||
build: | ||
context: . | ||
dockerfile: pytest.Dockerfile | ||
dockerfile: tests/orthanc/pytest.Dockerfile | ||
depends_on: | ||
- orthanc1 | ||
- orthanc2 | ||
- orthanc2 |
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,3 +1,7 @@ | ||
::: pyorthanc._filtering | ||
::: pyorthanc.find | ||
:docstring: | ||
:members: | ||
|
||
::: pyorthanc.trim_patients | ||
:docstring: | ||
:members: |
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,3 +1,21 @@ | ||
::: pyorthanc._find | ||
::: pyorthanc.find_patients | ||
:docstring: | ||
:members: | ||
:members: | ||
|
||
::: pyorthanc.find_studies | ||
:docstring: | ||
:members: | ||
|
||
::: pyorthanc.find_series | ||
:docstring: | ||
:members: | ||
|
||
::: pyorthanc.find_instances | ||
:docstring: | ||
:members: | ||
|
||
::: pyorthanc.query_orthanc | ||
:docstring: | ||
:members: | ||
|
||
::: pyorthanc._find.DEFAULT_RESOURCES_LIMIT |
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
::: pyorthanc.Job | ||
options: | ||
members: True | ||
:docstring: | ||
:members: | ||
|
||
|
||
::: pyorthanc.jobs.State | ||
:docstring: | ||
:members: | ||
|
||
::: pyorthanc.jobs.ErrorCode | ||
:docstring: | ||
:members: |
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
::: pyorthanc.Modality | ||
options: | ||
members: true | ||
:docstring: | ||
:members: | ||
|
||
## RemoteModality | ||
RemoteModality is an alias for Modality | ||
```python | ||
RemoteModality = Modality | ||
``` |
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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Orthanc SDK | ||
|
||
The `orthanc_sdk` is useful when developing with the Orthanc's Python Plugin, | ||
it exposes `orthanc` module when available (i.e. used as an Orthanc script), | ||
or expose the functions/classes signatures when not for linting and autocomplete. | ||
|
||
Use it the same way you would use the Python Plugin: | ||
|
||
```python | ||
from pyorthanc import orthanc_sdk | ||
|
||
def on_get(output: orthanc_sdk.RestOutput, *_, **__): | ||
output.AnswerBuffer('ok', 'text/plain') | ||
|
||
orthanc_sdk.RegisterRestCallback('/test', on_get) | ||
``` | ||
|
||
|
||
## How it works | ||
When developing importing the Orthanc Python Plugin with `import orthanc` will raise a `ModuleNotFoundError`. | ||
This where the `orthanc_sdk` submodule is interesting. When `orthanc` is available, it uses it. | ||
When not, `orthanc_sdk` expose mock functions/classes of everything available from `orthanc`, however, these functions/classes does nothing. | ||
|
||
```python | ||
try: | ||
from orthanc import * | ||
|
||
except ModuleNotFoundError: | ||
"""Orthanc SDK methods wrapped in python (plugin version 4.0)""" | ||
... | ||
``` | ||
|
||
|
||
## Reference | ||
|
||
::: pyorthanc.orthanc_sdk | ||
options: | ||
members: true | ||
:docstring: | ||
:members: |
This file was deleted.
Oops, something went wrong.
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,3 +1,5 @@ | ||
::: pyorthanc.Instance | ||
options: | ||
members: true | ||
:docstring: | ||
:members: |
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,3 +1,5 @@ | ||
::: pyorthanc.Patient | ||
options: | ||
members: true | ||
:docstring: | ||
:members: |
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,3 +1,5 @@ | ||
::: pyorthanc._resources.Resource | ||
options: | ||
members: true | ||
:docstring: | ||
:members: |
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,3 +1,5 @@ | ||
::: pyorthanc.Series | ||
options: | ||
members: true | ||
:docstring: | ||
:members: |
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,3 +1,5 @@ | ||
::: pyorthanc.Study | ||
options: | ||
members: true | ||
:docstring: | ||
:members: |
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 was deleted.
Oops, something went wrong.
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
Oops, something went wrong.