Skip to content

Commit ba02a59

Browse files
committed
markdown and edit updates, author update
1 parent 7c0e42c commit ba02a59

File tree

3 files changed

+31
-31
lines changed

3 files changed

+31
-31
lines changed

articles/healthcare-apis/dicom/dicomweb-standard-apis-curl.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
---
22
title: Use cURL and DICOMweb Standard APIs in Azure Health Data Services
33
description: Use cURL and DICOMweb Standard APIs to store, retrieve, search, and delete DICOM files in the DICOM service.
4-
author: mmitrik
4+
author: varunbms
55
ms.service: azure-health-data-services
66
ms.subservice: dicom-service
77
ms.topic: tutorial
88
ms.date: 10/18/2023
9-
ms.author: mmitrik
9+
ms.author: varunbms
1010
---
1111

1212
# Use DICOMweb Standard APIs with cURL
@@ -49,11 +49,11 @@ For this code, we access a Public Preview Azure service. It's important that you
4949

5050
The DICOMweb Standard makes heavy use of `multipart/related` HTTP requests combined with DICOM specific accept headers. Developers familiar with other REST-based APIs often find working with the DICOMweb Standard awkward. However, after you get it up and running, it's easy to use. It just takes a little familiarity to get started.
5151

52-
The cURL commands each contain at least one, and sometimes two, variables that must be replaced. To simplify running the commands, search and replace the following variables by replacing them with your specific values:
52+
The cURL commands each contain at least one, and sometimes two, variables that must be replaced. To simplify running the commands, search and replace the following variables your specific values.
5353

5454
* {Service URL} The service URL is the URL to access your DICOM service that you provisioned in the Azure portal, for example, ```https://<workspacename-dicomservicename>.dicom.azurehealthcareapis.com```. Make sure to specify the version as part of the url when making requests. More information can be found in the [API Versioning for DICOM service Documentation](api-versioning-dicom-service.md).
5555
* {path-to-dicoms} - The path to the directory that contains the red-triangle.dcm file, such as `C:/dicom-server/docs/dcms`
56-
* Ensure to use forward slashes as separators and end the directory _without_ a trailing forward slash.
56+
* Ensure using forward slashes as separators and end the directory _without_ a trailing forward slash.
5757

5858

5959
## Upload DICOM instances (STOW)
@@ -76,7 +76,7 @@ _Details:_
7676
* Body:
7777
* Content-Type: application/dicom for each file uploaded, separated by a boundary value
7878

79-
Some programming languages and tools behave differently. For instance, some require you to define your own boundary. For those tools, you might need to use a slightly modified Content-Type header. These tools can be used successfully.
79+
Some programming languages and tools behave differently. For instance, some require you to define your own boundary. For those tools, you might need to use a slightly modified Content-Type header. The following tools can be used successfully.
8080
* Content-Type: multipart/related; type="application/dicom"; boundary=ABCD1234
8181
* Content-Type: multipart/related; boundary=ABCD1234
8282
* Content-Type: multipart/related
@@ -104,7 +104,7 @@ _Details:_
104104
* Body:
105105
* Content-Type: application/dicom for each file uploaded, separated by a boundary value
106106

107-
Some programming languages and tools behave differently. For instance, some require you to define your own boundary. For those languages and tools, you might need to use a slightly modified Content-Type header. These tools can be used successfully.
107+
Some programming languages and tools behave differently. For instance, some require you to define your own boundary. For those languages and tools, you might need to use a slightly modified Content-Type header. The following tools can be used successfully.
108108

109109
* Content-Type: multipart/related; type="application/dicom"; boundary=ABCD1234
110110
* Content-Type: multipart/related; boundary=ABCD1234
@@ -159,7 +159,7 @@ _Details:_
159159
* Body:
160160
* Content-Type: application/dicom for each file uploaded, separated by a boundary value
161161

162-
Some programming languages and tools behave differently. For instance, some require you to define your own boundary. For those tools, you might need to use a slightly modified Content-Type header. These tools can be used successfully:
162+
Some programming languages and tools behave differently. For instance, some require you to define your own boundary. For those tools, you might need to use a slightly modified Content-Type header. The following tools can be used successfully.
163163
* Content-Type: multipart/related; type="application/dicom"; boundary=ABCD1234
164164
* Content-Type: multipart/related; boundary=ABCD1234
165165
* Content-Type: multipart/related
@@ -188,7 +188,7 @@ _Details:_
188188
* Body:
189189
* Content-Type: application/dicom for each file uploaded, separated by a boundary value
190190

191-
Some programming languages and tools behave differently. For instance, some require you to define your own boundary. For those languages and tools, you might need to use a slightly modified Content-Type header. These tools can be used successfully:
191+
Some programming languages and tools behave differently. For instance, some require you to define your own boundary. For those languages and tools, you might need to use a slightly modified Content-Type header. The following tools can be used successfully.
192192

193193
* Content-Type: multipart/related; type="application/dicom"; boundary=ABCD1234
194194
* Content-Type: multipart/related; boundary=ABCD1234
@@ -205,9 +205,9 @@ curl --request PUT "{Service URL}/v{version}/studies/1.2.826.0.1.3680043.8.498.1
205205
### Upsert single instance
206206

207207
> [!NOTE]
208-
> This is a non-standard API that allows the upsert of a single DICOM files.
208+
> This is a non-standard API that allows the upsert of a single DICOM file.
209209
210-
Use this method to upload a single DICOM file:
210+
Use this method to upload a single DICOM file.
211211

212212
_Details:_
213213
* Path: ../studies
@@ -342,7 +342,7 @@ curl --request GET "{Service URL}/v{version}/studies/1.2.826.0.1.3680043.8.498.1
342342

343343
### Retrieve one or more frames from a single instance
344344

345-
This request retrieves one or more frames from a single instance, and returns them as a collection of multipart/related bytes. Multiple frames can be retrieved by passing a comma-separated list of frame numbers. All DICOM instances with images have at minimum one frame, which is often just the image associated with the instance itself.
345+
This request retrieves one or more frames from a single instance, and returns them as a collection of multipart/related bytes. Multiple frames can be retrieved by passing a comma-separated list of frame numbers. All DICOM instances with images have at minimum one frame, which is often simply the image associated with the instance itself.
346346

347347
_Details:_
348348
* Path: ../studies/{study}/series{series}/instances/{instance}/frames/1,2,3

articles/healthcare-apis/dicom/dicomweb-standard-apis-python.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
22
title: Use Python and DICOMweb Standard APIs in Azure Health Data Services
33
description: Use Python and DICOMweb Standard APIs to store, retrieve, search, and delete DICOM files in the DICOM service.
4-
author: mmitrik
4+
author: varunbms
55
ms.service: azure-health-data-services
66
ms.subservice: dicom-service
77
ms.custom: devx-track-python
88
ms.topic: tutorial
99
ms.date: 02/15/2022
10-
ms.author: mmitrik
10+
ms.author: varunbms
1111
---
1212

1313
# Use DICOMweb Standard APIs with Python
@@ -30,7 +30,7 @@ The filename, studyUID, seriesUID, and instanceUID of the sample DICOM files are
3030
|blue-circle.dcm|1.2.826.0.1.3680043.8.498.13230779778012324449356534479549187420|1.2.826.0.1.3680043.8.498.77033797676425927098669402985243398207|1.2.826.0.1.3680043.8.498.13273713909719068980354078852867170114|
3131

3232
> [!NOTE]
33-
> Each of these files represents a single instance and is part of the same study. Also,the green-square and red-triangle are part of the same series, while the blue-circle is in a separate series.
33+
> Each of these files represents a single instance and is part of the same study. Also, the green-square and red-triangle are part of the same series, while the blue-circle is in a separate series.
3434
3535
## Prerequisites
3636

@@ -82,10 +82,10 @@ instance_uid = "1.2.826.0.1.3680043.8.498.47359123102728459884412887463296905395
8282

8383
### Authenticate to Azure and get a token
8484

85-
`DefaultAzureCredential` allows us to use various ways to get tokens to log into the service. In this example, use the `AzureCliCredential` to get a token to log into the service. There are other credential providers such as `ManagedIdentityCredential` and `EnvironmentCredential` that are also possible to use. To use the AzureCliCredential, you need to sign in to Azure from the CLI before running this code. For more information, see [Get access token for the DICOM service using Azure CLI](dicom-get-access-token-azure-cli.md). Alternatively, copy and paste the token retrieved while signing in from the CLI.
85+
`DefaultAzureCredential` allows us to use various ways to get tokens to log into the service. In this example, use the `AzureCliCredential` to get a token to log into the service. There are other credential providers such as `ManagedIdentityCredential` and `EnvironmentCredential` that you may use. To use the AzureCliCredential, you need to sign in to Azure from the CLI before running this code. For more information, see [Get access token for the DICOM service using Azure CLI](dicom-get-access-token-azure-cli.md). Alternatively, copy and paste the token retrieved while signing in from the CLI.
8686

8787
> [!NOTE]
88-
> `DefaultAzureCredential` returns several different Credential objects. We reference the `AzureCliCredential` as the 5th item in the returned collection. This may not be consistent. If so, uncomment the `print(credential.credential)` line. This will list all the items. Find the correct index, recalling that Python uses zero-based indexing.
88+
> `DefaultAzureCredential` returns several different Credential objects. We reference the `AzureCliCredential` as the 5th item in the returned collection. This may not always be the case. If not, uncomment the `print(credential.credential)` line. This will list all the items. Find the correct index, recalling that Python uses zero-based indexing.
8989
9090
> [!NOTE]
9191
> If you have not logged into Azure using the CLI, this will fail. You must be logged into Azure from the CLI for this to work.
@@ -103,7 +103,7 @@ bearer_token = f'Bearer {token.token}'
103103

104104
The `Requests` libraries (and most Python libraries) don't work with `multipart\related` in a way that supports DICOMweb. Because of these libraries, we must add a few methods to support working with DICOM files.
105105

106-
`encode_multipart_related` takes a set of fields (in the DICOM case, these libraries are generally Part 10 dam files) and an optional user-defined boundary. It returns both the full body, along with the content_type, which it can be used.
106+
`encode_multipart_related` takes a set of fields (in the DICOM case, these libraries are generally Part 10 dam files) and an optional user-defined boundary. It returns both the full body, along with the content_type, which can be used.
107107

108108
```python
109109
def encode_multipart_related(fields, boundary=None):
@@ -144,7 +144,7 @@ The following examples highlight persisting DICOM files.
144144

145145
### Store instances using `multipart/related`
146146

147-
This example demonstrates how to upload a single DICOM file, and it uses a bit of a Python to preload the DICOM file (as bytes) into memory. When an array of files is passed to the fields parameter of `encode_multipart_related`, multiple files can be uploaded in a single POST. It's sometimes used to upload several instances inside a complete series or study.
147+
This example demonstrates how to upload a single DICOM file, and it uses Python to preload the DICOM file into memory as bytes. When an array of files is passed to the fields parameter `encode_multipart_related`, multiple files can be uploaded in a single POST. It's sometimes used to upload several instances inside a complete series or study.
148148

149149
_Details:_
150150

@@ -183,9 +183,9 @@ response = client.post(url, body, headers=headers, verify=False)
183183

184184
### Store instances for a specific study
185185

186-
This example demonstrates how to upload multiple DICOM files into the specified study. It uses a bit of a Python to preload the DICOM file (as bytes) into memory.
186+
This example demonstrates how to upload multiple DICOM files into the specified study. It uses Python to preload the DICOM file into memory as bytes.
187187

188-
When an array of files is passed to the fields parameter of `encode_multipart_related`, multiple files can be uploaded in a single POST. It's sometimes used to upload a complete series or study.
188+
When an array of files is passed to the fields parameter `encode_multipart_related`, multiple files can be uploaded in a single POST. It's sometimes used to upload a complete series or study.
189189

190190
_Details:_
191191
* Path: ../studies/{study}
@@ -264,7 +264,7 @@ _Details:_
264264
* Accept: multipart/related; type="application/dicom"; transfer-syntax=*
265265
* Authorization: Bearer $token"
266266

267-
All three of the dcm files that we uploaded previously are part of the same study so the response should return all three instances. Validate that the response has a status code of OK and that all three instances are returned.
267+
All three of the dcm files that we uploaded previously are part of the same study, so the response should return all three instances. Validate that the response has a status code of OK and that all three instances are returned.
268268

269269
```python
270270
url = f'{base_url}/studies/{study_uid}'
@@ -275,7 +275,7 @@ response = client.get(url, headers=headers) #, verify=False)
275275

276276
### Use the retrieved instances
277277

278-
The instances are retrieved as binary bytes. You can loop through the returned items and convert the bytes into a file that `pydicom` can read.
278+
The instances are retrieved as binary bytes. You can loop through the returned items and convert the bytes into a file that `pydicom` can read as follows.
279279

280280

281281
```python
@@ -345,7 +345,7 @@ _Details:_
345345
* Accept: application/dicom+json
346346
* Authorization: Bearer $token"
347347

348-
This series has two instances (green-square and red-triangle), so the response should return for both instances. Validate that the response has a status code of OK and that both instances metadata are returned.
348+
This series has two instances (green-square and red-triangle), so the response should return for both instances. Validate that the response has a status code of OK and that the metadata of both instances are returned.
349349

350350
```python
351351
url = f'{base_url}/studies/{study_uid}/series/{series_uid}/metadata'
@@ -420,7 +420,7 @@ response = client.get(url, headers=headers) #, verify=False)
420420

421421
In the following examples, we search for items using their unique identifiers. You can also search for other attributes, such as PatientName.
422422

423-
Refer to the [DICOM Conformance Statement](dicom-services-conformance-statement-v2.md#supported-search-parameters) document for supported DICOM attributes.
423+
Refer to the [DICOM Conformance Statement](dicom-services-conformance-statement-v2.md#supported-search-parameters) for supported DICOM attributes.
424424

425425
### Search for studies
426426

@@ -553,7 +553,7 @@ response = client.get(url, headers=headers, params=params) #, verify=False)
553553
> [!NOTE]
554554
> Delete is not part of the DICOM standard, but it has been added for convenience.
555555
556-
A 204 response code is returned when the deletion is successful. A 404 response code is returned if the item(s) never existed or are already deleted.
556+
A 204 response code is returned when the deletion is successful. A 404 response code is returned if the items never existed or are already deleted.
557557

558558
### Delete a specific instance within a study and series
559559

@@ -565,7 +565,7 @@ _Details:_
565565
* Headers:
566566
* Authorization: Bearer $token
567567

568-
This request deletes the red-triangle instance from the server. If it's successful, the response status code contains no content.
568+
This request deletes the red-triangle instance from the server. If successful, the response status code contains no content.
569569

570570
```python
571571
headers = {"Authorization":bearer_token}
@@ -583,7 +583,7 @@ _Details:_
583583
* Headers:
584584
* Authorization: Bearer $token
585585

586-
This code example deletes the green-square instance (it's the only element left in the series) from the server. If it's successful, the response status code doesn't delete content.
586+
This code example deletes the green-square instance from the server (it's the only element left in the series). If successful, the response status code doesn't delete content.
587587

588588
```python
589589
headers = {"Authorization":bearer_token}

articles/healthcare-apis/dicom/dicomweb-standard-apis-with-dicom-services.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
---
22
title: Access DICOMweb APIs to manage DICOM data in Azure Health Data Services
33
description: Learn how to use DICOMweb APIs to store, review, search, and delete DICOM objects. Learn how to use custom APIs to track changes and assign unique tags to DICOM data.
4-
author: mmitrik
4+
author: varunbms
55
ms.service: azure-health-data-services
66
ms.subservice: dicom-service
77
ms.topic: tutorial
88
ms.date: 05/29/2024
9-
ms.author: mmitrik
9+
ms.author: varunbms
1010
---
1111

1212
# Access DICOMweb APIs to manage DICOM data
@@ -39,7 +39,7 @@ In addition to the subset of DICOMweb APIs, the DICOM service supports these cus
3939

4040
The DICOM service provides a web-based interface that follows REST (representational state transfer) principles. The REST API allows different applications or systems to communicate with each other using standard methods like GET, POST, PUT, and DELETE. To interact with the DICOM service, use any programming language that supports HTTP requests and responses.
4141

42-
Refer to the language-specific examples. You can view Postman collection examples in several languages including:
42+
Refer to the language-specific examples. You can view Postman collection examples in several languages including the following.
4343

4444
- Go
4545
- Java
@@ -73,7 +73,7 @@ For more information about how to use Python with the DICOM service, see [Using
7373

7474
Postman is an excellent tool for designing, building, and testing REST APIs. [Download Postman](https://www.postman.com/downloads/) to get started. For more information, see [Postman learning site](https://learning.postman.com/).
7575

76-
One important caveat with Postman and the DICOMweb standard is that Postman only supports uploading DICOM files by using the single-part payload defined in the DICOM standard. This caveat is because Postman can't support custom separators in a multipart/related POST request. For more information, see [Multipart POST not working for me # 576](https://github.com/postmanlabs/postman-app-support/issues/576). All examples in the Postman collection for uploading DICOM documents by using a multipart request are prefixed with **[won't work - see description]**. The examples for uploading by using a single-part request are included in the collection and are prefixed with **Store-Single-Instance**.
76+
One important caution with Postman and the DICOMweb standard is that Postman only supports uploading DICOM files by using the single-part payload defined in the DICOM standard. This is because Postman can't support custom separators in a multipart/related POST request. For more information, see [Multipart POST not working for me # 576](https://github.com/postmanlabs/postman-app-support/issues/576). All examples in the Postman collection for uploading DICOM documents by using a multipart request are prefixed with **[won't work - see description]**. The examples for uploading by using a single-part request are included in the collection and are prefixed with **Store-Single-Instance**.
7777

7878
To use the Postman collection, download it locally and then import the collection through Postman. To access the collection, see [Postman Collection Examples](https://github.com/microsoft/dicom-server/blob/main/docs/resources/Conformance-as-Postman.postman_collection.json).
7979

0 commit comments

Comments
 (0)