|
| 1 | +# HealthImaging code examples for the SDK for Python |
| 2 | + |
| 3 | +## Overview |
| 4 | + |
| 5 | +Shows how to use the AWS SDK for Python (Boto3) to work with AWS HealthImaging. |
| 6 | + |
| 7 | +<!--custom.overview.start--> |
| 8 | +<!--custom.overview.end--> |
| 9 | + |
| 10 | +_HealthImaging is a HIPAA-eligible service that helps health care providers and their medical imaging ISV partners store, transform, and apply machine learning to medical images._ |
| 11 | + |
| 12 | +## ⚠ Important |
| 13 | + |
| 14 | +* Running this code might result in charges to your AWS account. For more details, see [AWS Pricing](https://aws.amazon.com/pricing/) and [Free Tier](https://aws.amazon.com/free/). |
| 15 | +* Running the tests might result in charges to your AWS account. |
| 16 | +* We recommend that you grant your code least privilege. At most, grant only the minimum permissions required to perform the task. For more information, see [Grant least privilege](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#grant-least-privilege). |
| 17 | +* This code is not tested in every AWS Region. For more information, see [AWS Regional Services](https://aws.amazon.com/about-aws/global-infrastructure/regional-product-services). |
| 18 | + |
| 19 | +<!--custom.important.start--> |
| 20 | +<!--custom.important.end--> |
| 21 | + |
| 22 | +## Code examples |
| 23 | + |
| 24 | +### Prerequisites |
| 25 | + |
| 26 | +For prerequisites, see the [README](../../README.md#Prerequisites) in the `python` folder. |
| 27 | + |
| 28 | +Install the packages required by these examples by running the following in a virtual environment: |
| 29 | + |
| 30 | +``` |
| 31 | +python -m pip install -r requirements.txt |
| 32 | +``` |
| 33 | + |
| 34 | +<!--custom.prerequisites.start--> |
| 35 | +<!--custom.prerequisites.end--> |
| 36 | + |
| 37 | +### Get started |
| 38 | + |
| 39 | +- [Hello HealthImaging](imaging_set_and_frames_workflow/hello.py#L4) (`ListDatastores`) |
| 40 | + |
| 41 | + |
| 42 | +### Single actions |
| 43 | + |
| 44 | +Code excerpts that show you how to call individual service functions. |
| 45 | + |
| 46 | +- [CopyImageSet](health_lake_wrapper.py#L417) |
| 47 | +- [CreateDatastore](health_lake_wrapper.py#L31) |
| 48 | +- [DeleteDatastore](health_lake_wrapper.py#L104) |
| 49 | +- [DeleteImageSet](health_lake_wrapper.py#L489) |
| 50 | +- [GetDICOMImportJob](health_lake_wrapper.py#L158) |
| 51 | +- [GetDatastore](health_lake_wrapper.py#L54) |
| 52 | +- [GetImageFrame](health_lake_wrapper.py#L318) |
| 53 | +- [GetImageSet](health_lake_wrapper.py#L241) |
| 54 | +- [GetImageSetMetadata](health_lake_wrapper.py#L274) |
| 55 | +- [ListDICOMImportJobs](health_lake_wrapper.py#L183) |
| 56 | +- [ListDatastores](health_lake_wrapper.py#L79) |
| 57 | +- [ListImageSetVersions](health_lake_wrapper.py#L350) |
| 58 | +- [ListTagsForResource](health_lake_wrapper.py#L556) |
| 59 | +- [SearchImageSets](health_lake_wrapper.py#L211) |
| 60 | +- [StartDICOMImportJob](health_lake_wrapper.py#L124) |
| 61 | +- [TagResource](health_lake_wrapper.py#L514) |
| 62 | +- [UntagResource](health_lake_wrapper.py#L534) |
| 63 | +- [UpdateImageSetMetadata](health_lake_wrapper.py#L381) |
| 64 | + |
| 65 | +### Scenarios |
| 66 | + |
| 67 | +Code examples that show you how to accomplish a specific task by calling multiple |
| 68 | +functions within the same service. |
| 69 | + |
| 70 | +- [Get started with image sets and image frames](imaging_set_and_frames_workflow/imaging_set_and_frames.py) |
| 71 | +- [Tagging a data store](tagging_data_stores.py) |
| 72 | +- [Tagging an image set](tagging_image_sets.py) |
| 73 | + |
| 74 | + |
| 75 | +<!--custom.examples.start--> |
| 76 | +<!--custom.examples.end--> |
| 77 | + |
| 78 | +## Run the examples |
| 79 | + |
| 80 | +### Instructions |
| 81 | + |
| 82 | + |
| 83 | +<!--custom.instructions.start--> |
| 84 | +<!--custom.instructions.end--> |
| 85 | + |
| 86 | +#### Hello HealthImaging |
| 87 | + |
| 88 | +This example shows you how to get started using HealthImaging. |
| 89 | + |
| 90 | +``` |
| 91 | +python imaging_set_and_frames_workflow/hello.py |
| 92 | +``` |
| 93 | + |
| 94 | + |
| 95 | +#### Get started with image sets and image frames |
| 96 | + |
| 97 | +This example shows you how to import DICOM files and download image frames in HealthImaging.</para> |
| 98 | + <para>The implementation is structured as a workflow command-line |
| 99 | + application. |
| 100 | + |
| 101 | + |
| 102 | +- Set up resources for a DICOM import. |
| 103 | +- Import DICOM files into a data store. |
| 104 | +- Retrieve the image set IDs for the import job. |
| 105 | +- Retrieve the image frame IDs for the image sets. |
| 106 | +- Download, decode and verify the image frames. |
| 107 | +- Clean up resources. |
| 108 | + |
| 109 | +<!--custom.scenario_prereqs.medical-imaging_Scenario_ImageSetsAndFrames.start--> |
| 110 | +<!--custom.scenario_prereqs.medical-imaging_Scenario_ImageSetsAndFrames.end--> |
| 111 | + |
| 112 | +Start the example by running the following at a command prompt: |
| 113 | + |
| 114 | +``` |
| 115 | +python imaging_set_and_frames_workflow/imaging_set_and_frames.py |
| 116 | +``` |
| 117 | + |
| 118 | + |
| 119 | +<!--custom.scenarios.medical-imaging_Scenario_ImageSetsAndFrames.start--> |
| 120 | +<!--custom.scenarios.medical-imaging_Scenario_ImageSetsAndFrames.end--> |
| 121 | + |
| 122 | +#### Tagging a data store |
| 123 | + |
| 124 | +This example shows you how to tag a HealthImaging data store. |
| 125 | + |
| 126 | + |
| 127 | +<!--custom.scenario_prereqs.medical-imaging_Scenario_TaggingDataStores.start--> |
| 128 | +<!--custom.scenario_prereqs.medical-imaging_Scenario_TaggingDataStores.end--> |
| 129 | + |
| 130 | +Start the example by running the following at a command prompt: |
| 131 | + |
| 132 | +``` |
| 133 | +python tagging_data_stores.py |
| 134 | +``` |
| 135 | + |
| 136 | + |
| 137 | +<!--custom.scenarios.medical-imaging_Scenario_TaggingDataStores.start--> |
| 138 | +<!--custom.scenarios.medical-imaging_Scenario_TaggingDataStores.end--> |
| 139 | + |
| 140 | +#### Tagging an image set |
| 141 | + |
| 142 | +This example shows you how to tag a HealthImaging image set. |
| 143 | + |
| 144 | + |
| 145 | +<!--custom.scenario_prereqs.medical-imaging_Scenario_TaggingImageSets.start--> |
| 146 | +<!--custom.scenario_prereqs.medical-imaging_Scenario_TaggingImageSets.end--> |
| 147 | + |
| 148 | +Start the example by running the following at a command prompt: |
| 149 | + |
| 150 | +``` |
| 151 | +python tagging_image_sets.py |
| 152 | +``` |
| 153 | + |
| 154 | + |
| 155 | +<!--custom.scenarios.medical-imaging_Scenario_TaggingImageSets.start--> |
| 156 | +<!--custom.scenarios.medical-imaging_Scenario_TaggingImageSets.end--> |
| 157 | + |
| 158 | +### Tests |
| 159 | + |
| 160 | +⚠ Running tests might result in charges to your AWS account. |
| 161 | + |
| 162 | + |
| 163 | +To find instructions for running these tests, see the [README](../../README.md#Tests) |
| 164 | +in the `python` folder. |
| 165 | + |
| 166 | + |
| 167 | + |
| 168 | +<!--custom.tests.start--> |
| 169 | +<!--custom.tests.end--> |
| 170 | + |
| 171 | +## Additional resources |
| 172 | + |
| 173 | +- [HealthImaging Developer Guide](https://docs.aws.amazon.com/healthimaging/latest/devguide/what-is.html) |
| 174 | +- [HealthImaging API Reference](https://docs.aws.amazon.com/healthimaging/latest/APIReference/Welcome.html) |
| 175 | +- [SDK for Python HealthImaging reference](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/medical-imaging.html) |
| 176 | + |
| 177 | +<!--custom.resources.start--> |
| 178 | +<!--custom.resources.end--> |
| 179 | + |
| 180 | +--- |
| 181 | + |
| 182 | +Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 183 | + |
| 184 | +SPDX-License-Identifier: Apache-2.0 |
0 commit comments