Skip to content

Cloud Healthcare API alpha DICOM samples and tests. #1798

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 20 commits into from
Nov 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
167 changes: 167 additions & 0 deletions healthcare/api-client/dicom/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
.. This file is automatically generated. Do not edit this file directly.

Cloud Healthcare API Python Samples
===============================================================================

.. image:: https://gstatic.com/cloudssh/images/open-btn.png
:target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=healthcare/api-client/dicom/README.rst


This directory contains samples for Cloud Healthcare API. `Cloud Healthcare API`_ implements healthcare-native protocols and formats to accelerate ingestion, storage, analysis, and integration of healthcare data with cloud-based applications.
- See the `migration guide`_ for information about migrating to Python client library v0.25.1.

.. _migration guide: https://cloud.google.com/vision/docs/python-client-migration




.. _Cloud Healthcare API: https://cloud.google.com/healthcare/docs

Setup
-------------------------------------------------------------------------------


Authentication
++++++++++++++

This sample requires you to have authentication setup. Refer to the
`Authentication Getting Started Guide`_ for instructions on setting up
credentials for applications.

.. _Authentication Getting Started Guide:
https://cloud.google.com/docs/authentication/getting-started

Authentication
++++++++++++++

Authentication for this service is done via an `API Key`_. To obtain an API
Key:

1. Open the `Cloud Platform Console`_
2. Make sure that billing is enabled for your project.
3. From the **Credentials** page, create a new **API Key** or use an existing
one for your project.

.. _API Key:
https://developers.google.com/api-client-library/python/guide/aaa_apikeys
.. _Cloud Console: https://console.cloud.google.com/project?_

Install Dependencies
++++++++++++++++++++

#. Clone python-docs-samples and change directory to the sample directory you want to use.

.. code-block:: bash

$ git clone https://github.com/GoogleCloudPlatform/python-docs-samples.git

#. Install `pip`_ and `virtualenv`_ if you do not already have them. You may want to refer to the `Python Development Environment Setup Guide`_ for Google Cloud Platform for instructions.

.. _Python Development Environment Setup Guide:
https://cloud.google.com/python/setup

#. Create a virtualenv. Samples are compatible with Python 2.7 and 3.4+.

.. code-block:: bash

$ virtualenv env
$ source env/bin/activate

#. Install the dependencies needed to run the samples.

.. code-block:: bash

$ pip install -r requirements.txt

.. _pip: https://pip.pypa.io/
.. _virtualenv: https://virtualenv.pypa.io/

Samples
-------------------------------------------------------------------------------

DICOM stores
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

.. image:: https://gstatic.com/cloudssh/images/open-btn.png
:target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=healthcare/api-client/dicom/dicom_stores.py,healthcare/api-client/dicom/README.rst




To run this sample:

.. code-block:: bash

$ python dicom_stores.py

usage: dicom_stores.py [-h] [--service_account_json SERVICE_ACCOUNT_JSON]
[--api_key API_KEY] [--project_id PROJECT_ID]
[--cloud_region CLOUD_REGION] [--dataset_id DATASET_ID]
[--dicom_store_id DICOM_STORE_ID]
[--pubsub_topic PUBSUB_TOPIC] [--uri_prefix URI_PREFIX]
[--content_uri CONTENT_URI]
[--export_format {FORMAT_UNSPECIFIED,DICOM,JSON_BIGQUERY_IMPORT}]
{create-dicom-store,delete-dicom-store,get-dicom-store,list-dicom-stores,patch-dicom-store,export-dicom-store,import-dicom-store}
...

positional arguments:
{create-dicom-store,delete-dicom-store,get-dicom-store,list-dicom-stores,patch-dicom-store,export-dicom-store,import-dicom-store}
create-dicom-store Creates a new DICOM store within the parent dataset.
delete-dicom-store Deletes the specified DICOM store.
get-dicom-store Gets the specified DICOM store.
list-dicom-stores Lists the DICOM stores in the given dataset.
patch-dicom-store Updates the DICOM store.
export-dicom-store Export data to a Google Cloud Storage bucket by
copying it from the DICOM store.
import-dicom-store Import data into the DICOM store by copying it from
the specified source.

optional arguments:
-h, --help show this help message and exit
--service_account_json SERVICE_ACCOUNT_JSON
Path to service account JSON file.
--api_key API_KEY Your API key
--project_id PROJECT_ID
GCP project name
--cloud_region CLOUD_REGION
GCP region
--dataset_id DATASET_ID
Name of dataset
--dicom_store_id DICOM_STORE_ID
Name of DICOM store
--pubsub_topic PUBSUB_TOPIC
The Cloud Pub/Sub topic that notifications of changes
are published on
--uri_prefix URI_PREFIX
URI for a Google Cloud Storage directory to which
result filesshould be written (e.g., "bucket-
id/path/to/destination/dir").
--content_uri CONTENT_URI
URI for a Google Cloud Storage directory from which
filesshould be imported (e.g., "bucket-
id/path/to/destination/dir").
--export_format {FORMAT_UNSPECIFIED,DICOM,JSON_BIGQUERY_IMPORT}
Specifies the output format. If the format is
unspecified, thedefault functionality is to export to
DICOM.





The client library
-------------------------------------------------------------------------------

This sample uses the `Google Cloud Client Library for Python`_.
You can read the documentation for more details on API usage and use GitHub
to `browse the source`_ and `report issues`_.

.. _Google Cloud Client Library for Python:
https://googlecloudplatform.github.io/google-cloud-python/
.. _browse the source:
https://github.com/GoogleCloudPlatform/google-cloud-python
.. _report issues:
https://github.com/GoogleCloudPlatform/google-cloud-python/issues


.. _Google Cloud SDK: https://cloud.google.com/sdk/
33 changes: 33 additions & 0 deletions healthcare/api-client/dicom/README.rst.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# This file is used to generate README.rst

product:
name: Cloud Healthcare API
short_name: Healthcare API
url: https://cloud.google.com/healthcare/docs
description: >
`Cloud Healthcare API`_ implements healthcare-native protocols and formats
to accelerate ingestion, storage, analysis, and integration of healthcare
data with cloud-based applications.

- See the `migration guide`_ for information about migrating to Python client library v0.25.1.


.. _migration guide: https://cloud.google.com/vision/docs/python-client-migration

setup:
- auth
- auth_api_key
- install_deps

samples:
- name: DICOM stores
file: dicom_stores.py
show_help: True

- name: DICOMweb
file: dicomweb.py
show_help: True

cloud_client_library: true

folder: healthcare/api-client/dicom
Loading