George-Wu commented on a change in pull request #12331:
URL: https://github.com/apache/beam/pull/12331#discussion_r463382501
##########
File path: sdks/python/apache_beam/io/gcp/dicomio.py
##########
@@ -114,55 +115,60 @@
class DicomSearch(PTransform):
"""A PTransform used for retrieving DICOM instance metadata from Google
- Cloud DICOM store. It takes a Pcollection of dicts as input and return
- a Pcollection of dict as results:
+ Cloud DICOM store. It takes a PCollection of dicts as input and return
+ a PCollection of dict as results:
INPUT:
The input dict represents DICOM web path parameters, which has the
following
string keys and values:
{
- 'project_id': str,
- 'region': str,
- 'dataset_id': str,
- 'dicom_store_id': str,
- 'search_type': str,
- 'params': dict(str,str) (Optional),
+ 'project_id': str,
+ 'region': str,
+ 'dataset_id': str,
+ 'dicom_store_id': str,
+ 'search_type': str,
+ 'params': dict(str,str) (Optional),
}
+
Key-value pairs:
- project_id: Id of the project in which DICOM store locates. (Required)
+ project_id: Id of the project in which the DICOM store is
+ located. (Required)
region: Region where the DICOM store resides. (Required)
dataset_id: Id of the dataset where DICOM store belongs to. (Required)
dicom_store_id: Id of the dicom store. (Required)
search_type: Which type of search it is, could only be one of the three
- values: 'instances', 'series', or 'studies'. (Required)
+ values: 'instances', 'series', or 'studies'. (Required)
params: A dict of str:str pairs used to refine QIDO search. (Optional)
- Supported tags in three categories:
- 1. Studies:
- StudyInstanceUID
- PatientName
- PatientID
- AccessionNumber
- ReferringPhysicianName
- StudyDate
- 2. Series: all study level search terms and
- SeriesInstanceUID
- Modality
- 3. Instances: all study/series level search terms and
- SOPInstanceUID
- e.g. {"StudyInstanceUID":"1","SeriesInstanceUID":"2"}
+ Supported tags in three categories:
+ 1.Studies:
+ StudyInstanceUID,
+ PatientName,
+ PatientID,
+ AccessionNumber,
+ ReferringPhysicianName,
+ StudyDate,
+ 2.Series: all study level search terms and
+ SeriesInstanceUID,
+ Modality,
+ 3.Instances: all study/series level search terms and
+ SOPInstanceUID,
Review comment:
Fixed
##########
File path: sdks/python/apache_beam/io/gcp/dicomio.py
##########
@@ -324,41 +332,45 @@ def process(self, element):
return [out]
-class DicomStoreInstance(PTransform):
+class WriteToDicomStore(PTransform):
"""A PTransform for storing instances to a DICOM store.
- Takes Pcollection of byte[] as input and return a Pcollection of dict as
+ Takes PCollection of byte[] as input and return a PCollection of dict as
results. The inputs are normally DICOM file in bytes or str filename.
INPUT:
- This PTransform supports two types of input:
- 1. Byte[]: representing dicom file.
- 2. Fileio object: stream file object.
+ This PTransform supports two types of input:
+ 1. Byte[]: representing dicom file.
+ 2. Fileio object: stream file object.
+
OUTPUT:
The output dict encodes status as well as error messages:
{
- 'success': boolean value telling whether the store is successful
- 'input': undeliverable data. Exactly the same as the input,
- only set if the operation is failed.
- 'status': status code from the server, used as error messages.
+ 'success': boolean value telling whether the store is successful.
+ 'input': undeliverable data. Exactly the same as the input,
+ only set if the operation is failed.
+ 'status': status code from the server, used as error messages.
}
+
"""
def __init__(self, destination_dict, input_type, credential=None):
- """Initializes DicomStoreInstance.
+ """Initializes WriteToDicomStore.
Args:
destination_dict: # type: python dict, encodes DICOM endpoint
information:
- {
- 'project_id': str,
- 'region': str,
- 'dataset_id': str,
- 'dicom_store_id': str,
- }
- Key-value pairs:
- project_id: Id of the project in which DICOM store locates.
(Required)
- region: Region where the DICOM store resides. (Required)
- dataset_id: Id of the dataset where DICOM store belongs to.
(Required)
- dicom_store_id: Id of the dicom store. (Required)
+ {
+ 'project_id': str,
+ 'region': str,
+ 'dataset_id': str,
+ 'dicom_store_id': str,
+ }
+
+ Key-value pairs:
+ project_id: Id of the project in which DICOM store locates. (Required)
+ region: Region where the DICOM store resides. (Required)
+ dataset_id: Id of the dataset where DICOM store belongs to. (Required)
+ dicom_store_id: Id of the dicom store. (Required)
Review comment:
Fixed
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]