-
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.
BAC-9366: create docs for data-validation + upload
Merge in BAC/icometrix-sdk from data-validation to master Squashed commit of the following: commit 20adebae92077c0c87781e118a02e43b34024868 Author: Jeroen Pinxten <jeroen.pinxten@icometrix.com> Date: Fri Jun 21 11:04:56 2024 +0200 BAC-9366: improve docs commit e45b5cd8a5fdeac31f987c2a08bb7f97a0fb7024 Author: Jeroen Pinxten <jeroen.pinxten@icometrix.com> Date: Fri Jun 21 10:39:07 2024 +0200 BAC-9366: create docs for data-validation + upload commit 173a4140a82ecc2326c76ac5424baf4e421e1168 Merge: c6a462c f855aba Author: Jeroen Pinxten <jeroen.pinxten@icometrix.com> Date: Wed Jun 19 17:33:16 2024 +0200 Merge branch 'master' into data-validation commit f855aba0bdcf1a39c10c81f2dea4626614041d76 Merge: c54ac15 d977dfd Author: Jeroen Pinxten <jeroen.pinxten@icometrix.com> Date: Wed Jun 19 17:32:43 2024 +0200 Merge branch 'master' of https://stash.icometrix.com/scm/bac/icometrix-sdk commit c6a462c296cbd33a0d12a465735983a932ee659e Author: Jeroen Pinxten <jeroen.pinxten@icometrix.com> Date: Wed Jun 19 17:25:50 2024 +0200 BAC-9366: remove unused import commit 1214b4c19cdefb9ff225c876a4892ff706cea59e Author: Jeroen Pinxten <jeroen.pinxten@icometrix.com> Date: Wed Jun 19 17:18:46 2024 +0200 BAC-9366: data validation docs commit c54ac15fb08952bcc8ea949a5f120bea22173308 Author: Jeroen Pinxten <jeroen.pinxten@icometrix.com> Date: Wed Jun 19 16:59:48 2024 +0200 BAC-9366: data validation examples
- Loading branch information
Showing
7 changed files
with
139 additions
and
15 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 |
---|---|---|
|
@@ -6,5 +6,6 @@ Developer Guide | |
paginators | ||
session | ||
models | ||
upload | ||
anonymization | ||
data_validation |
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 |
---|---|---|
@@ -0,0 +1,59 @@ | ||
How to Upload | ||
============= | ||
|
||
Uploading DICOM files using our Python SDK is a straightforward process that involves three main steps: | ||
|
||
1. **starting the upload** | ||
|
||
2. **uploading the files** | ||
|
||
3. **completing the upload**. | ||
|
||
You can choose to upload files one by one or use a higher-level function to upload all files in a directory. | ||
Below, we outline these steps and provide example code to help you get started. | ||
|
||
Upload All Files in a Directory | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
To simplify the process, you can use the :meth:`~icometrix_sdk.resources.uploads.Uploads.upload_all_files_in_dir` method, which will walk through all files and | ||
subdirectories within a specified directory and upload each file. | ||
|
||
.. code-block:: python | ||
import os | ||
from icometrix_sdk import IcometrixApi | ||
from icometrix_sdk.models.upload_entity import StartUploadDto | ||
PROJECT_ID = "uuid" | ||
DICOM_DIR_PATH = "<dir_path>" | ||
if __name__ == '__main__': | ||
os.environ["API_HOST"] = "https://icobrain-{region}.icometrix.com" | ||
# Initialize the icometrix API | ||
ico_api = IcometrixApi() | ||
# Get the project, to make sure it's there (will throw a 404 in case the project is not found) | ||
project = ico_api.projects.get_one_by_id(PROJECT_ID) | ||
# Start an upload | ||
data = StartUploadDto(icobrain_report_type="icobrain_ms") | ||
upload = ico_api.uploads.start_upload(PROJECT_ID, data) | ||
# Will walk through all files/subdirectories and upload all files | ||
ico_api.uploads.upload_all_files_in_dir(upload.uri, DICOM_DIR_PATH) | ||
# Once all files have been uploaded, signal that they are all there and start the import/processing | ||
upload = ico_api.uploads.complete_upload(upload.uri) | ||
Upload Files Individually | ||
^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
If you prefer to upload files one by one, you can use the upload_file method. | ||
This method requires the upload URI and the file path for each file you wish to upload. | ||
|
||
.. code-block:: python | ||
ico_api.uploads.upload_dicom_path(upload.uri, dicom_path) | ||
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