Skip to content

Commit 5e53b28

Browse files
committed
Add readme, requirements, and MIT license
1 parent 6d57ed4 commit 5e53b28

File tree

4 files changed

+61
-0
lines changed

4 files changed

+61
-0
lines changed

LICENSE

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Copyright 2024 Michał Szczepanik
2+
3+
Permission is hereby granted, free of charge, to any person obtaining
4+
a copy of this software and associated documentation files (the
5+
“Software”), to deal in the Software without restriction, including
6+
without limitation the rights to use, copy, modify, merge, publish,
7+
distribute, sublicense, and/or sell copies of the Software, and to
8+
permit persons to whom the Software is furnished to do so, subject to
9+
the following conditions:
10+
11+
The above copyright notice and this permission notice shall be
12+
included in all copies or substantial portions of the Software.
13+
14+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,
15+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# ICF/CCF Orthanc text-based user interface
2+
3+
This app provides a text-based user interface (TUI), based on [Textual](https://textual.textualize.io/), for interacting with [Orthanc](https://orthanc.uclouvain.be/) and CCF/[ICF Utils](https://inm-icf-utilities.readthedocs.io/).
4+
It can be used to query Orthanc for studies from a given date (range), export them, and run the ICF archival workflow.
5+
6+
![screenshot of the TUI](docs/screenshots/tui.webp)
7+
8+
## Configuration
9+
10+
Some values are not provided through the UI, but are read from a configuration file.
11+
Edit the values in `config.toml.example` and place the file in your user / site config directory as `orthanc_textual/config.toml`.
12+
The directories are determined with platformdirs, and will be printed if you run the app without the configuration in place.
13+
For example, on Debian, the config file can be in `~/.config/orthanc_textual/config.toml` (user) or `/etc/xdg/orthanc_textual/config.toml` (site).
14+
User config has precedence over site config.
15+
16+
Values to define:
17+
- `orthanc_base_url` - the URL of the Orthanc instance (used to perform API queries)
18+
- `icf_image` - path to the Singularity image with the ICF utils (used to execute the ICF scripts)
19+
- `store_base_dir` - the base directory of the ICF dicom store (used to put outputs of the ICF workflow)
20+
21+
## Usage
22+
23+
1. Enter the Orthanc Username and Password and click connect. They will be tested, and if they are OK, the button will turn green.
24+
2. Enter the Study Date in the format `yyyymmdd` and hit Enter. The date can can also be an open or closed range in a format accepted by the Orthanc API. Examples: `20240801`, `20240801-20240812`, `20240801-`, `202408-`
25+
3. After hitting Enter, the matching DICOM studies will be shown (using the DICOM PatientID field) in the selection list.
26+
4. Select the ones you want to process and click Export. Wait for the process to finish. Information will be printed in the log window below.
27+
5. To quit the app, hit q or click the circle in the upper-left and select "Quit the application".
28+
29+
## Implementation notes
30+
31+
The study and visit IDs (as defined by the ICF utils) will be derived from the DICOM PatientID field by splitting at the first underscore (`<study ID>_<visit ID>`).
32+
If the PatientID field has no underscore, the study ID will be set to `undefined` and the entire PatientID will be used as the visit ID.
33+
In principle, any of the main DICOM tags stored in Orthanc's database (these typically include StudyDescription, PatientID, PatientName, and more) could be used for the purpose; currently only the PatientID is used.
34+
35+
## Acknowledgements
36+
37+
This app was developed with funding from the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) under grant SFB 1451 ([431549029](https://gepris.dfg.de/gepris/projekt/431549029), INF project).

docs/screenshots/tui.webp

13.9 KB
Binary file not shown.

requirements.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
aiofiles
2+
httpx
3+
platformdirs
4+
textual >= 0.70.0

0 commit comments

Comments
 (0)