์ด ํ์ด์ง์์๋ DICOM ์ธ์คํด์ค๋ฅผ Cloud Storage๋ก ๋ด๋ณด๋ด๊ณ DICOM ๊ฐ์ฒด๋ฅผ Cloud Storage์์ ๊ฐ์ ธ์ค๋ ๋ฐฉ๋ฒ์ ์ค๋ช ํฉ๋๋ค. DICOM ์ธ์คํด์ค๋ ์ผ๋ฐ์ ์ผ๋ก ์ด๋ฏธ์ง์ด์ง๋ง ๊ตฌ์กฐํ๋ ๋ณด๊ณ ์์ ๊ฐ์ด ๋ค๋ฅธ ์ ํ์ ์๊ตฌ์ ์ธ ๋ฐ์ดํฐ์ผ ์๋ ์์ต๋๋ค. Cloud Storage์ DICOM ๊ฐ์ฒด๋ Cloud Storage์ ์๋ DICOM ์ธ์คํด์ค์ ๋๋ค. ์์ธํ ๋ด์ฉ์ Cloud Storage๋ฅผ ์ฐธ์กฐํ์ธ์.
Cloud Storage ๊ถํ ์ค์
DICOM ๋ฐ์ดํฐ๋ฅผ Cloud Storage๋ก ๋ด๋ณด๋ด๊ณ ๊ฐ์ ธ์ค๊ธฐ ์ ์ Cloud Healthcare ์๋น์ค ์์ด์ ํธ ์๋น์ค ๊ณ์ ์ ์ถ๊ฐ ๊ถํ์ ๋ถ์ฌํด์ผ ํฉ๋๋ค. ์์ธํ ๋ด์ฉ์ DICOM ์ ์ฅ์ Cloud Storage ๊ถํ์ ์ฐธ์กฐํ์ธ์.
DICOM ๊ฐ์ฒด ๊ฐ์ ธ์ค๊ธฐ
์ฌ๋ฌ DICOM ์ธ์คํด์ค ํ์ผ์ DICOM ์ ์ฅ์๋ก ๊ฐ์ ธ์ค๋ ค๋ฉด ๋ค์ ๋ฐฉ๋ฒ ์ค ํ๋๋ฅผ ์ฌ์ฉํ๋ฉด ๋ฉ๋๋ค.
- Cloud Healthcare API์ ๊ตฌํ๋ ๋๋ก Store Transaction RESTful ์น ์๋น์ค๋ฅผ ์ฌ์ฉํ์ฌ ๋ก์ปฌ ๋จธ์ ์์ ํ๋ก๊ทธ๋๋งคํฑ ๋ฐฉ์์ผ๋ก DICOM ์ ์ฅ์์ ์ง์ ๋ฐ์ดํฐ๋ฅผ ์ ์ฅํฉ๋๋ค.
- Cloud Storage ๋ฒํท์ DICOM ๋ฐ์ดํฐ๋ฅผ ์ ๋ก๋ํ ํ ์ด ์น์ ์ ์ค๋ช ๋๋ก ๋จ์ผ ๊ฐ์ ธ์ค๊ธฐ ์์ ์ ์ฌ์ฉํ์ฌ ํ์ผ์ DICOM ์ ์ฅ์๋ก ๊ฐ์ ธ์ต๋๋ค.
๋ค์ ์ํ์ Cloud Storage ๋ฒํท์์ DICOM ๊ฐ์ฒด๋ฅผ ๊ฐ์ ธ์ค๋ ๋ฐฉ๋ฒ์ ๋ณด์ฌ์ค๋๋ค.
์ฝ์
Cloud Storage ๋ฒํท์์ DICOM ๊ฐ์ฒด๋ฅผ ๊ฐ์ ธ์ค๋ ค๋ฉด ๋ค์ ๋จ๊ณ๋ฅผ ์๋ฃํ์ธ์.
- Google Cloud ์ฝ์์์ ๋ฐ์ดํฐ ์ธํธ ํ์ด์ง๋ก ์ด๋ํฉ๋๋ค.
๋ฐ์ดํฐ ์ธํธ๋ก ์ด๋ - DICOM ๊ฐ์ฒด๋ฅผ ๊ฐ์ ธ์ฌ DICOM ์ ์ฅ์๊ฐ ํฌํจ๋ ๋ฐ์ดํฐ ์ธํธ๋ฅผ ํด๋ฆญํฉ๋๋ค.
- ๋ฐ์ดํฐ ์ ์ฅ์ ๋ชฉ๋ก์์ DICOM ์ ์ฅ์์ ์์
๋ชฉ๋ก์์ ๊ฐ์ ธ์ค๊ธฐ๋ฅผ ์ ํํฉ๋๋ค.
DICOM ์ ์ฅ์๋ก ๊ฐ์ ธ์ค๊ธฐ ํ์ด์ง๊ฐ ๋ํ๋ฉ๋๋ค. - ํ๋ก์ ํธ ๋ชฉ๋ก์์ Cloud Storage ํ๋ก์ ํธ๋ฅผ ์ ํํฉ๋๋ค.
- ์์น ๋ชฉ๋ก์์ Cloud Storage ๋ฒํท์ ์ ํํฉ๋๋ค.
- ํ์ผ์ ๊ฐ์ ธ์ฌ ํน์ ์์น๋ฅผ ์ค์ ํ๋ ค๋ฉด ๋ค์์ ์ํํฉ๋๋ค.
- ๊ณ ๊ธ ์ต์ ์ ํผ์นฉ๋๋ค.
- Cloud Storage ๊ฒฝ๋ก ์ฌ์ ์๋ฅผ ์ ํํฉ๋๋ค.
- ํ์ผ์ ๊ฐ์ ธ์ฌ ํน์ ์์ค๋ฅผ ์ค์ ํ๋ ค๋ฉด ์์น ํ
์คํธ ์์์ ๋ค์ ๋ณ์๋ฅผ ์ฌ์ฉํ์ฌ ๊ฒฝ๋ก๋ฅผ ์ ์ํฉ๋๋ค.
*
- ๊ตฌ๋ถ ๊ธฐํธ๊ฐ ์๋ ์ผ์นํ๋ ๋ฌธ์๋ฅผ ์ฐพ์ต๋๋ค.**
- ์ผ์นํ๋ ๋ฌธ์๋ฅผ ์ฐพ์ต๋๋ค(๊ตฌ๋ถ ๊ธฐํธ ํฌํจ). ํ์ผ ์ด๋ฆ ํ์ฅ์์ ํจ๊ป ์ฌ์ฉํ์ฌ ๋์ผํ ์ ํ์ ํ์ผ์ ๋ชจ๋ ์ฐพ์ ์ ์์ต๋๋ค.?
- ์ผ์นํ๋ 1๊ฐ ๋ฌธ์๋ฅผ ์ฐพ์ต๋๋ค.
- ๊ฐ์ ธ์ค๊ธฐ๋ฅผ ํด๋ฆญํ์ฌ ์ ์๋ ์์ค์์ DICOM ๊ฐ์ฒด๋ฅผ ๊ฐ์ ธ์ต๋๋ค.
- ์์
์ํ๋ฅผ ์ถ์ ํ๋ ค๋ฉด ์์
ํญ์ ํด๋ฆญํฉ๋๋ค. ์์
์ด ์๋ฃ๋๋ฉด ๋ค์๊ณผ ๊ฐ์ ํ์๊ฐ ๋ํ๋ฉ๋๋ค.
- ์ฅ๊ธฐ ์คํ ์์ ์ํ ์น์ ์ ํ์ธ ์ ๋ชฉ ์๋์ ๋ น์ ์ฒดํฌํ์๊ฐ ์์ต๋๋ค.
- ๊ฐ์ ์น์ ์ ์์ ID์ ๊ฐ์ ํ์ ๋ น์ ์ฒดํฌํ์์ ํ์ธ ํ์๊ธฐ๊ฐ ์์ต๋๋ค.
gcloud
Cloud Storage ๋ฒํท์์ DICOM ๊ฐ์ฒด๋ฅผ ๊ฐ์ ธ์ค๋ ค๋ฉด gcloud healthcare dicom-stores import gcs
๋ช
๋ น์ด๋ฅผ ์ฌ์ฉํฉ๋๋ค. ์์ ๋ฐ์ดํฐ ์ธํธ์ ์ด๋ฆ, DICOM ์ ์ฅ์์ ์ด๋ฆ, Cloud Storage ๋ฒํท์ ๊ฐ์ฒด ์์น๋ฅผ ์ง์ ํฉ๋๋ค.
- ๋ฒํท ๋ด์ ํ์ผ ์์น๋ ์์์ ์ด๋ฉฐ ๋ค์ ์ํ์ ์ง์ ๋ ํ์์ ์ ํํ๊ฒ ์ค์ํ ํ์๊ฐ ์์ต๋๋ค.
- Cloud Storage์์ DICOM์ ์์น๋ฅผ ์ง์ ํ ๋๋ ์์ผ๋ ์นด๋๋ฅผ ์ฌ์ฉํด์ ํ๋ ์ด์์ ๋๋ ํฐ๋ฆฌ์ ์๋ ์ฌ๋ฌ ํ์ผ์ ๊ฐ์ ธ์ฌ ์ ์์ต๋๋ค.
๋ค์ ์์ผ๋ ์นด๋๊ฐ ์ง์๋ฉ๋๋ค.
- ๊ตฌ๋ถ ๊ธฐํธ๊ฐ ์๋ 0์ ์ด์์ ์ผ์นํ๋ ๋ฌธ์๋ฅผ ์ฐพ์ผ๋ ค๋ฉด
*
๋ฅผ ์ฌ์ฉํฉ๋๋ค. ์๋ฅผ ๋ค์ดgs://BUCKET/DIRECTORY/Example*.dcm
์ ์ฌ์ฉํ๋ฉด DIRECTORY์ ์๋ Example.dcm ๋ฐ Example22.dcm์ด ๊ฒ์๋ฉ๋๋ค. - 0์ ์ด์์ ์ผ์นํ๋ ๋ฌธ์(๊ตฌ๋ถ ๊ธฐํธ ํฌํจ)๋ฅผ ์ฐพ์ผ๋ ค๋ฉด
**
๋ฅผ ์ฌ์ฉํฉ๋๋ค. ๊ฒฝ๋ก์ ๋์ ์ฌ์ฉํด์ผ ํ๋ฉฐ ๊ฒฝ๋ก์ ๋ค๋ฅธ ์์ผ๋ ์นด๋๊ฐ ์์ด์ผ ํฉ๋๋ค. ๋ํ ์ง์ ๋ ๋๋ ํฐ๋ฆฌ ๋ฐ ํ์ ๋๋ ํฐ๋ฆฌ์์ ํ์ผ ์ด๋ฆ ํ์ฅ์๊ฐ ์๋ ๋ชจ๋ ํ์ผ์ ๊ฐ์ ธ์ค๋ ํ์ผ ์ด๋ฆ ํ์ฅ์ (์ : .dcm)์ ํจ๊ป ์ฌ์ฉํ ์ ์์ต๋๋ค. ์๋ฅผ ๋ค์ดgs://BUCKET/DIRECTORY/**.dcm
๋ DIRECTORY ๋ฐ ํ์ ๋๋ ํฐ๋ฆฌ์ ํ์ผ๋ช ํ์ฅ์๊ฐ .dcm์ธ ํ์ผ์ ๋ชจ๋ ๊ฐ์ ธ์ต๋๋ค. - ์ผ์นํ๋ 1๊ฐ ๋ฌธ์๋ฅผ ์ฐพ์ผ๋ ค๋ฉด
?
๋ฅผ ์ฌ์ฉํฉ๋๋ค. ์๋ฅผ ๋ค์ดgs://BUCKET/DIRECTORY/Example?.dcm
์ ์ฌ์ฉํ๋ฉด Example1.dcm์ด ๊ฒ์๋์ง๋ง Example.dcm ๋๋ Example01.dcm์ ๊ฒ์๋์ง ์์ต๋๋ค.
- ๊ตฌ๋ถ ๊ธฐํธ๊ฐ ์๋ 0์ ์ด์์ ์ผ์นํ๋ ๋ฌธ์๋ฅผ ์ฐพ์ผ๋ ค๋ฉด
๋ค์ ์ํ์ Cloud Storage ๋ฒํท์์ DICOM ๊ฐ์ฒด๋ฅผ ๊ฐ์ ธ์ค๋ ๋ฐฉ๋ฒ์ ๋ณด์ฌ์ค๋๋ค.
gcloud healthcare dicom-stores import gcs DICOM_STORE_ID \ --dataset=DATASET_ID \ --location=LOCATION \ --gcs-uri=gs://BUCKET/DIRECTORY/DICOM_INSTANCE.dcm
๋ช ๋ น์ค์ ์์ ID๊ฐ ํ์๋ฉ๋๋ค.
name: projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/operations/OPERATION_ID
์์
์ํ๋ฅผ ๋ณด๋ ค๋ฉด gcloud healthcare operations describe
๋ช
๋ น์ด๋ฅผ ์คํํ๊ณ ์๋ต์์ OPERATION_ID๋ฅผ ์ ๊ณตํฉ๋๋ค.
gcloud healthcare operations describe OPERATION_ID \ --location=LOCATION \ --dataset=DATASET_ID
๋ช
๋ น์ด๊ฐ ์๋ฃ๋๋ฉด ์๋ต์ done: true
๊ฐ ํฌํจ๋ฉ๋๋ค.
done: true metadata: '@type': type.googleapis.com/google.cloud.healthcare.v1.OperationMetadata apiMethodName: google.cloud.healthcare.v1.dicom.DicomService.ImportDicomData counter: success: SUCCESSFUL_INSTANCES failure: FAILED_INSTANCES createTime: "CREATE_TIME" endTime: "END_TIME" name: projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/operations/OPERATION_ID response: '@type': "..."
API
Cloud Storage ๋ฒํท์์ DICOM ๊ฐ์ฒด๋ฅผ ๊ฐ์ ธ์ค๋ ค๋ฉด projects.locations.datasets.dicomStores.import
๋ฉ์๋๋ฅผ ์ฌ์ฉํฉ๋๋ค.
- ๋ฒํท ๋ด์ ํ์ผ ์์น๋ ๋ฌ๋ผ์ง ์ ์์ผ๋ฉฐ ๋ค์ ์ํ์ ์ง์ ๋ ํ์๊ณผ ์ผ์นํ์ง ์์๋ ๋ฉ๋๋ค.
- Cloud Storage์์ DICOM์ ์์น๋ฅผ ์ง์ ํ ๋๋ ์์ผ๋ ์นด๋๋ฅผ ์ฌ์ฉํด์ ํ๋ ์ด์์ ๋๋ ํฐ๋ฆฌ์ ์๋ ์ฌ๋ฌ ํ์ผ์ ๊ฐ์ ธ์ต๋๋ค.
๋ค์ ์์ผ๋ ์นด๋๊ฐ ์ง์๋ฉ๋๋ค.
- ๊ตฌ๋ถ ๊ธฐํธ๊ฐ ์๋ 0์ ์ด์์ ์ผ์นํ๋ ๋ฌธ์๋ฅผ ์ฐพ์ผ๋ ค๋ฉด
*
๋ฅผ ์ฌ์ฉํฉ๋๋ค. ์๋ฅผ ๋ค์ดgs://BUCKET/DIRECTORY/Example*.dcm
์ ์ฌ์ฉํ๋ฉด DIRECTORY์ ์๋ Example.dcm ๋ฐ Example22.dcm์ด ๊ฒ์๋ฉ๋๋ค. - 0์ ์ด์์ ์ผ์นํ๋ ๋ฌธ์(๊ตฌ๋ถ ๊ธฐํธ ํฌํจ)๋ฅผ ์ฐพ์ผ๋ ค๋ฉด
**
๋ฅผ ์ฌ์ฉํฉ๋๋ค. ๊ฒฝ๋ก์ ๋์ ์ฌ์ฉํด์ผ ํ๋ฉฐ ๊ฒฝ๋ก์ ๋ค๋ฅธ ์์ผ๋ ์นด๋๊ฐ ์์ด์ผ ํฉ๋๋ค. ๋ํ ์ง์ ๋ ๋๋ ํฐ๋ฆฌ ๋ฐ ํ์ ๋๋ ํฐ๋ฆฌ์์ ํ์ผ ์ด๋ฆ ํ์ฅ์๊ฐ ์๋ ๋ชจ๋ ํ์ผ์ ๊ฐ์ ธ์ค๋ ํ์ผ ์ด๋ฆ ํ์ฅ์ (์ : .dcm)์ ํจ๊ป ์ฌ์ฉํ ์ ์์ต๋๋ค. ์๋ฅผ ๋ค์ดgs://BUCKET/DIRECTORY/**.dcm
๋ DIRECTORY ๋ฐ ํ์ ๋๋ ํฐ๋ฆฌ์ ํ์ผ๋ช ํ์ฅ์๊ฐ .dcm์ธ ํ์ผ์ ๋ชจ๋ ๊ฐ์ ธ์ต๋๋ค. - ์ผ์นํ๋ 1๊ฐ ๋ฌธ์๋ฅผ ์ฐพ์ผ๋ ค๋ฉด
?
๋ฅผ ์ฌ์ฉํฉ๋๋ค. ์๋ฅผ ๋ค์ดgs://BUCKET/DIRECTORY/Example?.dcm
์ ์ฌ์ฉํ๋ฉด Example1.dcm์ด ๊ฒ์๋์ง๋ง Example.dcm ๋๋ Example01.dcm์ ๊ฒ์๋์ง ์์ต๋๋ค.
- ๊ตฌ๋ถ ๊ธฐํธ๊ฐ ์๋ 0์ ์ด์์ ์ผ์นํ๋ ๋ฌธ์๋ฅผ ์ฐพ์ผ๋ ค๋ฉด
REST
DICOM ๊ฐ์ฒด๋ฅผ ๊ฐ์ ธ์ต๋๋ค.
์์ฒญ ๋ฐ์ดํฐ๋ฅผ ์ฌ์ฉํ๊ธฐ ์ ์ ๋ค์์ ๋ฐ๊ฟ๋๋ค.
PROJECT_ID
: Google Cloud ํ๋ก์ ํธ IDLOCATION
: ๋ฐ์ดํฐ ์ธํธ ์์นDATASET_ID
: DICOM ์ ์ฅ์์ ์์ ๋ฐ์ดํฐ ์ธํธDICOM_STORE_ID
: DICOM ์ ์ฅ์ IDBUCKET/PATH/TO/FILE
: Cloud Storage์ DICOM ๊ฐ์ฒด ๊ฒฝ๋ก
JSON ์์ฒญ ๋ณธ๋ฌธ:
{ "gcsSource": { "uri": "gs://BUCKET/PATH/TO/FILE.dcm" } }
์์ฒญ์ ๋ณด๋ด๋ ค๋ฉด ๋ค์ ์ต์ ์ค ํ๋๋ฅผ ์ ํํฉ๋๋ค.
curl
์์ฒญ ๋ณธ๋ฌธ์
request.json
ํ์ผ์ ์ ์ฅํฉ๋๋ค. ํฐ๋ฏธ๋์์ ๋ค์ ๋ช ๋ น์ด๋ฅผ ์คํํ์ฌ ํ์ฌ ๋๋ ํฐ๋ฆฌ์ ์ด ํ์ผ์ ๋ง๋ค๊ฑฐ๋ ๋ฎ์ด์๋๋ค.cat > request.json << 'EOF' { "gcsSource": { "uri": "gs://BUCKET/PATH/TO/FILE.dcm" } } EOF
๊ทธ๋ฐ ํ ๋ค์ ๋ช ๋ น์ด๋ฅผ ์คํํ์ฌ REST ์์ฒญ์ ์ ์กํฉ๋๋ค.
curl -X POST \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
-d @request.json \
"https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/dicomStores/DICOM_STORE_ID:import"PowerShell
์์ฒญ ๋ณธ๋ฌธ์
request.json
ํ์ผ์ ์ ์ฅํฉ๋๋ค. ํฐ๋ฏธ๋์์ ๋ค์ ๋ช ๋ น์ด๋ฅผ ์คํํ์ฌ ํ์ฌ ๋๋ ํฐ๋ฆฌ์ ์ด ํ์ผ์ ๋ง๋ค๊ฑฐ๋ ๋ฎ์ด์๋๋ค.@' { "gcsSource": { "uri": "gs://BUCKET/PATH/TO/FILE.dcm" } } '@ | Out-File -FilePath request.json -Encoding utf8
๊ทธ๋ฐ ํ ๋ค์ ๋ช ๋ น์ด๋ฅผ ์คํํ์ฌ REST ์์ฒญ์ ์ ์กํฉ๋๋ค.
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }
Invoke-WebRequest `
-Method POST `
-Headers $headers `
-ContentType: "application/json" `
-InFile request.json `
-Uri "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/dicomStores/DICOM_STORE_ID:import" | Select-Object -Expand Content์ฅ๊ธฐ ์คํ ์์ ์ํ๋ฅผ ๊ฐ์ ธ์ต๋๋ค.
์์ฒญ ๋ฐ์ดํฐ๋ฅผ ์ฌ์ฉํ๊ธฐ ์ ์ ๋ค์์ ๋ฐ๊ฟ๋๋ค.
- PROJECT_ID: Google Cloud ํ๋ก์ ํธ ID
- LOCATION: ๋ฐ์ดํฐ ์ธํธ ์์น
- DATASET_ID: DICOM ์ ์ฅ์์ ์์ ๋ฐ์ดํฐ ์ธํธ
- OPERATION_ID: ์ฅ๊ธฐ ์คํ ์์ ์์ ๋ฐํ๋ ID
์์ฒญ์ ๋ณด๋ด๋ ค๋ฉด ๋ค์ ์ต์ ์ค ํ๋๋ฅผ ์ ํํฉ๋๋ค.
curl
๋ค์ ๋ช ๋ น์ด๋ฅผ ์คํํฉ๋๋ค.
curl -X GET \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
"https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/operations/OPERATION_ID"PowerShell
๋ค์ ๋ช ๋ น์ด๋ฅผ ์คํํฉ๋๋ค.
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }
Invoke-WebRequest `
-Method GET `
-Headers $headers `
-Uri "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/operations/OPERATION_ID" | Select-Object -Expand Content
Go
Java
Node.js
Python
DICOM ์ ์ฅ์์์ ๋จ์ผ ์ธ์คํด์ค ๋๋ ์ฐ๊ตฌ๋ฅผ ๊ฒ์ํ๋ ค๋ฉด Cloud Healthcare API์ ๊ตฌํ๋ ๊ฑฐ๋ ๊ฒ์ RESTful ์น ์๋น์ค๋ฅผ ์ฌ์ฉํ์ฌ DICOM ๋ฐ์ดํฐ๋ฅผ ๊ฒ์ํ ์ ์์ต๋๋ค.
DICOM ๊ฐ์ฒด๋ฅผ ๊ฐ์ ธ์ฌ ์คํ ๋ฆฌ์ง ํด๋์ค ์ง์ (๋ฏธ๋ฆฌ๋ณด๊ธฐ)
๊ธฐ๋ณธ์ ์ผ๋ก projects.locations.datasets.dicomStores.import
๋ฉ์๋๋ Standard Storage ํด๋์ค๋ฅผ ์ฌ์ฉํ์ฌ DICOM ๊ฐ์ฒด๋ฅผ DICOM ์ ์ฅ์๋ก ๊ฐ์ ธ์ต๋๋ค. Cloud Storage์์ DICOM ๊ฐ์ฒด๋ฅผ ๊ฐ์ ธ์ฌ ๋ ์คํ ๋ฆฌ์ง ํด๋์ค๋ฅผ ์ค์ ํ ์ ์์ต๋๋ค.
์์ธํ ๋ด์ฉ์ DICOM ์คํ ๋ฆฌ์ง ํด๋์ค ๋ณ๊ฒฝ์ ์ฐธ์กฐํ์ธ์.
๋ค์ ์ํ์ Cloud Storage์์ DICOM ๊ฐ์ฒด๋ฅผ ๊ฐ์ ธ์ฌ ๋ ์คํ ๋ฆฌ์ง ํด๋์ค๋ฅผ ์ง์ ํ๋ ๋ฐฉ๋ฒ์ ๋ณด์ฌ์ค๋๋ค.
REST
projects.locations.datasets.dicomStores.import
๋ฉ์๋๋ฅผ ์ฌ์ฉํฉ๋๋ค.
DICOM ๊ฐ์ฒด๋ฅผ ๊ฐ์ ธ์ต๋๋ค.
์์ฒญ ๋ฐ์ดํฐ๋ฅผ ์ฌ์ฉํ๊ธฐ ์ ์ ๋ค์์ ๋ฐ๊ฟ๋๋ค.
PROJECT_ID
: Google Cloud ํ๋ก์ ํธ IDLOCATION
: ๋ฐ์ดํฐ ์ธํธ ์์นDATASET_ID
: DICOM ์ ์ฅ์์ ์์ ๋ฐ์ดํฐ ์ธํธDICOM_STORE_ID
: DICOM ์ ์ฅ์ IDBUCKET/PATH/TO/FILE
: Cloud Storage์ DICOM ๊ฐ์ฒด ๊ฒฝ๋กSTORAGE_CLASS
:STANDARD
,NEARLINE
,COLDLINE
,ARCHIVE
์ DICOM ์คํ ์ด์ ์๋ DICOM ๊ฐ์ฒด์ ์คํ ๋ฆฌ์ง ํด๋์ค
JSON ์์ฒญ ๋ณธ๋ฌธ:
{ "gcsSource": { "uri": "gs://BUCKET/PATH/TO/FILE.dcm" }, "blob_storage_settings": { "blob_storage_class": "STORAGE_CLASS" } }
์์ฒญ์ ๋ณด๋ด๋ ค๋ฉด ๋ค์ ์ต์ ์ค ํ๋๋ฅผ ์ ํํฉ๋๋ค.
curl
์์ฒญ ๋ณธ๋ฌธ์
request.json
ํ์ผ์ ์ ์ฅํฉ๋๋ค. ํฐ๋ฏธ๋์์ ๋ค์ ๋ช ๋ น์ด๋ฅผ ์คํํ์ฌ ํ์ฌ ๋๋ ํฐ๋ฆฌ์ ์ด ํ์ผ์ ๋ง๋ค๊ฑฐ๋ ๋ฎ์ด์๋๋ค.cat > request.json << 'EOF' { "gcsSource": { "uri": "gs://BUCKET/PATH/TO/FILE.dcm" }, "blob_storage_settings": { "blob_storage_class": "STORAGE_CLASS" } } EOF
๊ทธ๋ฐ ํ ๋ค์ ๋ช ๋ น์ด๋ฅผ ์คํํ์ฌ REST ์์ฒญ์ ์ ์กํฉ๋๋ค.
curl -X POST \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
-d @request.json \
"https://healthcare.googleapis.com/v1beta1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/dicomStores/DICOM_STORE_ID:import"PowerShell
์์ฒญ ๋ณธ๋ฌธ์
request.json
ํ์ผ์ ์ ์ฅํฉ๋๋ค. ํฐ๋ฏธ๋์์ ๋ค์ ๋ช ๋ น์ด๋ฅผ ์คํํ์ฌ ํ์ฌ ๋๋ ํฐ๋ฆฌ์ ์ด ํ์ผ์ ๋ง๋ค๊ฑฐ๋ ๋ฎ์ด์๋๋ค.@' { "gcsSource": { "uri": "gs://BUCKET/PATH/TO/FILE.dcm" }, "blob_storage_settings": { "blob_storage_class": "STORAGE_CLASS" } } '@ | Out-File -FilePath request.json -Encoding utf8
๊ทธ๋ฐ ํ ๋ค์ ๋ช ๋ น์ด๋ฅผ ์คํํ์ฌ REST ์์ฒญ์ ์ ์กํฉ๋๋ค.
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }
Invoke-WebRequest `
-Method POST `
-Headers $headers `
-ContentType: "application/json" `
-InFile request.json `
-Uri "https://healthcare.googleapis.com/v1beta1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/dicomStores/DICOM_STORE_ID:import" | Select-Object -Expand Content์ฅ๊ธฐ ์คํ ์์ ์ํ๋ฅผ ๊ฐ์ ธ์ต๋๋ค.
์์ฒญ ๋ฐ์ดํฐ๋ฅผ ์ฌ์ฉํ๊ธฐ ์ ์ ๋ค์์ ๋ฐ๊ฟ๋๋ค.
- PROJECT_ID: Google Cloud ํ๋ก์ ํธ ID
- LOCATION: ๋ฐ์ดํฐ ์ธํธ ์์น
- DATASET_ID: DICOM ์ ์ฅ์์ ์์ ๋ฐ์ดํฐ ์ธํธ
- OPERATION_ID: ์ฅ๊ธฐ ์คํ ์์ ์์ ๋ฐํ๋ ID
์์ฒญ์ ๋ณด๋ด๋ ค๋ฉด ๋ค์ ์ต์ ์ค ํ๋๋ฅผ ์ ํํฉ๋๋ค.
curl
๋ค์ ๋ช ๋ น์ด๋ฅผ ์คํํฉ๋๋ค.
curl -X GET \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
"https://healthcare.googleapis.com/v1beta1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/operations/OPERATION_ID"PowerShell
๋ค์ ๋ช ๋ น์ด๋ฅผ ์คํํฉ๋๋ค.
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }
Invoke-WebRequest `
-Method GET `
-Headers $headers `
-Uri "https://healthcare.googleapis.com/v1beta1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/operations/OPERATION_ID" | Select-Object -Expand Content
DICOM ๊ฐ์ ธ์ค๊ธฐ ์์ฒญ ๋ฌธ์ ํด๊ฒฐ
DICOM ๊ฐ์ ธ์ค๊ธฐ ์์ฒญ ์ค์ ์ค๋ฅ๊ฐ ๋ฐ์ํ๋ฉด ์ค๋ฅ๊ฐ Cloud Logging์ ๊ธฐ๋ก๋ฉ๋๋ค. ์์ธํ ๋ด์ฉ์ Cloud Logging์์ ์ค๋ฅ ๋ก๊ทธ ๋ณด๊ธฐ๋ฅผ ์ฐธ์กฐํ์ธ์.
DICOM ์ธ์คํด์ค ๋ด๋ณด๋ด๊ธฐ
๋ค์ ์ํ์ DICOM ์ธ์คํด์ค๋ฅผ Cloud Storage ๋ฒํท์ผ๋ก ๋ด๋ณด๋ด๋ ๋ฐฉ๋ฒ์ ๋ณด์ฌ์ค๋๋ค. DICOM ์ ์ฅ์์์ DICOM ์ธ์คํด์ค๋ฅผ ๋ด๋ณด๋ผ ๋๋ ์ ์ฅ์์ ์๋ ๋ชจ๋ ์ธ์คํด์ค๋ฅผ ๋ด๋ณด๋ ๋๋ค.
์ฝ์
DICOM ์ธ์คํด์ค๋ฅผ Cloud Storage๋ก ๋ด๋ณด๋ด๋ ค๋ฉด ๋ค์ ๋จ๊ณ๋ฅผ ์๋ฃํฉ๋๋ค.
- Google Cloud ์ฝ์์์ ๋ฐ์ดํฐ ์ธํธ ํ์ด์ง๋ก ์ด๋ํฉ๋๋ค.
๋ฐ์ดํฐ ์ธํธ๋ก ์ด๋ - DICOM ์ธ์คํด์ค๋ฅผ ๋ด๋ณด๋ผ DICOM ์ ์ฅ์๊ฐ ํฌํจ๋ ๋ฐ์ดํฐ ์ธํธ๋ฅผ ํด๋ฆญํฉ๋๋ค.
- ๋ฐ์ดํฐ ์ ์ฅ์ ๋ชฉ๋ก์ ์๋ DICOM ์ ์ฅ์์ ์์ ๋ชฉ๋ก์์ ๋ด๋ณด๋ด๊ธฐ๋ฅผ ์ ํํฉ๋๋ค.
- ํ์๋๋ DICOM ์ ์ฅ์ ๋ด๋ณด๋ด๊ธฐ ํ์ด์ง์์ Google Cloud Storage ๋ฒํท์ ์ ํํฉ๋๋ค.
- ํ๋ก์ ํธ ๋ชฉ๋ก์์ Cloud Storage ํ๋ก์ ํธ๋ฅผ ์ ํํฉ๋๋ค.
- ์์น ๋ชฉ๋ก์์ Cloud Storage ๋ฒํท์ ์ ํํฉ๋๋ค.
- DICOM ๋ด๋ณด๋ด๊ธฐ ์ค์ ์์ DICOM ์ธ์คํด์ค๋ฅผ ๋ด๋ณด๋ด๊ธฐ ์ํด ์ฌ์ฉ๋๋ ํ์ผ ํ์์ ์ ํํฉ๋๋ค. ์ฌ์ฉํ ์ ์๋ ์ ํ์ ๋ค์๊ณผ ๊ฐ์ต๋๋ค.
- DICOM ํ์ผ(
.dcm
) - octet ์คํธ๋ฆผ
- ์ด๋ฏธ์ง(
.jpg
,.png
)
- DICOM ํ์ผ(
- ์ถ๊ฐ ์ ์ก ๋ฌธ๋ฒ์ ์ ์ํ๋ ค๋ฉด ์ ์ก ๋ฌธ๋ฒ ๋ชฉ๋ก์์ ๋ฌธ๋ฒ์ ์ ํํฉ๋๋ค.
- ๋ด๋ณด๋ด๊ธฐ๋ฅผ ํด๋ฆญํ์ฌ DICOM ์ธ์คํด์ค๋ฅผ Cloud Storage์ ์ ์๋ ์์น๋ก ๋ด๋ณด๋ ๋๋ค.
- ์์
์ํ๋ฅผ ์ถ์ ํ๋ ค๋ฉด ์์
ํญ์ ํด๋ฆญํฉ๋๋ค. ์์
์ด ์๋ฃ๋๋ฉด ๋ค์๊ณผ ๊ฐ์ ํ์๊ฐ ๋ํ๋ฉ๋๋ค.
- ์ฅ๊ธฐ ์คํ ์์ ์ํ ์น์ ์ ํ์ธ ์ ๋ชฉ ์๋์ ๋ น์ ์ฒดํฌํ์๊ฐ ์์ต๋๋ค.
- ๊ฐ์ ์น์ ์ ์์ ID์ ๊ฐ์ ํ์ ๋ น์ ์ฒดํฌํ์์ ํ์ธ ํ์๊ธฐ๊ฐ ์์ต๋๋ค.
gcloud
DICOM ์ธ์คํด์ค๋ฅผ Cloud Storage ๋ฒํท์ผ๋ก ๋ด๋ณด๋ด๋ ค๋ฉด gcloud healthcare dicom-stores export gcs
๋ช
๋ น์ด๋ฅผ ์ฌ์ฉํฉ๋๋ค.
- ์์ ๋ฐ์ดํฐ ์ธํธ์ ์ด๋ฆ, DICOM ์ ์ฅ์์ ์ด๋ฆ, ๋์ Cloud Storage ๋ฒํท์ ์ ๊ณตํฉ๋๋ค.
- Cloud Healthcare API๊ฐ ๊ฐ ๊ฐ์ฒด์ ๋ํด
.dcm
ํ์ผ์ ํ๋ ๋ง๋ค๊ธฐ ๋๋ฌธ์ ๊ฐ์ฒด ๋์ Cloud Storage ๋ฒํท ๋๋ ๋๋ ํฐ๋ฆฌ์ ๊ธฐ๋กํฉ๋๋ค. - ๋ช ๋ น์ด๊ฐ ์กด์ฌํ์ง ์๋ ๋๋ ํฐ๋ฆฌ๋ฅผ ์ง์ ํ๋ฉด ๋๋ ํฐ๋ฆฌ๊ฐ ์์ฑ๋ฉ๋๋ค.
๋ค์ ์ํ์ gcloud healthcare dicom-stores export gcs
๋ช
๋ น์ด๋ฅผ ๋ณด์ฌ์ค๋๋ค.
gcloud healthcare dicom-stores export gcs DICOM_STORE_ID \ --dataset=DATASET_ID \ --location=LOCATION \ --gcs-uri-prefix=gs://BUCKET/DIRECTORY
๋ช ๋ น์ค์ ์์ ID๊ฐ ํ์๋ฉ๋๋ค.
name: projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/operations/OPERATION_ID
์์
์ํ๋ฅผ ๋ณด๋ ค๋ฉด gcloud healthcare operations describe
๋ช
๋ น์ด๋ฅผ ์คํํ๊ณ ์๋ต์์ OPERATION_ID๋ฅผ ์ ๊ณตํฉ๋๋ค.
gcloud healthcare operations describe OPERATION_ID \ --location=LOCATION \ --dataset=DATASET_ID
๋ช
๋ น์ด๊ฐ ์๋ฃ๋๋ฉด ์๋ต์ done: true
๊ฐ ํฌํจ๋ฉ๋๋ค.
done: true metadata: '@type': type.googleapis.com/google.cloud.healthcare.v1.OperationMetadata apiMethodName: google.cloud.healthcare.v1.dicom.DicomService.ExportDicomData counter: success: SUCCESSFUL_INSTANCES failure: FAILED_INSTANCES createTime: "CREATE_TIME" endTime: "END_TIME" name: projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/operations/OPERATION_ID response: '@type': "..."
API
DICOM ์ธ์คํด์ค๋ฅผ Cloud Storage ๋ฒํท์ผ๋ก ๋ด๋ณด๋ด๋ ค๋ฉด projects.locations.datasets.dicomStores.export
๋ฉ์๋๋ฅผ ์ฌ์ฉํฉ๋๋ค.
- Cloud Healthcare API๊ฐ ๊ฐ DICOM ๊ฐ์ฒด์ ๋ํด
.dcm
ํ์ผ์ ํ๋ ๋ง๋ค๊ธฐ ๋๋ฌธ์ ๊ฐ์ฒด ๋์ Cloud Storage ๋ฒํท ๋๋ ๋๋ ํฐ๋ฆฌ์ ๊ธฐ๋กํฉ๋๋ค. - ๋ช ๋ น์ด๊ฐ ์กด์ฌํ์ง ์๋ ๋๋ ํฐ๋ฆฌ๋ฅผ ์ง์ ํ๋ฉด ๋๋ ํฐ๋ฆฌ๊ฐ ์์ฑ๋ฉ๋๋ค.
curl
DICOM ์ธ์คํด์ค๋ฅผ ๋ด๋ณด๋ด๋ ค๋ฉด POST
์์ฒญ์ ์ํํ๊ณ ๋ค์ ์ ๋ณด๋ฅผ ์ ๊ณตํ์ธ์.
- ์์ ๋ฐ์ดํฐ ์ธํธ์ ์ด๋ฆ ๋ฐ ์์น
- DICOM ์ ์ฅ์์ ์ด๋ฆ
- ๋์ Cloud Storage ๋ฒํท์ ๋๋ค.
๋ค์ ์ํ์ curl
์ ์ฌ์ฉํ๋ POST
์์ฒญ์ ๋ณด์ฌ์ค๋๋ค.
curl -X POST \ -H "Authorization: Bearer $(gcloud auth application-default print-access-token)" \ -H "Content-Type: application/json; charset=utf-8" \ --data "{ 'gcsDestination': { 'uriPrefix': 'gs://BUCKET/DIRECTORY' } }" "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/dicomStores/DICOM_STORE_ID:export"
์์ฒญ์ด ์ฑ๊ณตํ๋ฉด ์๋ฒ๊ฐ JSON ํ์์ผ๋ก ์๋ต์ ๋ฐํํฉ๋๋ค.
{ "name": "projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/operations/OPERATION_ID" }
์๋ต์ ์์
์ด๋ฆ์ด ํฌํจ๋ฉ๋๋ค. ์์
์ํ๋ฅผ ์ถ์ ํ๋ ค๋ฉด ์์
get
๋ฉ์๋๋ฅผ ์ฌ์ฉํฉ๋๋ค.
curl -X GET \ -H "Authorization: Bearer $(gcloud auth application-default print-access-token)" \ "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/operations/OPERATION_ID"
์์ฒญ์ด ์ฑ๊ณตํ๋ฉด ์๋ฒ๋ JSON ํ์์ ์์ ์ํ๊ฐ ํฌํจ๋ ์๋ต์ ๋ฐํํฉ๋๋ค.
{ "name": "projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/operations/OPERATION_ID", "metadata": { "@type": "type.googleapis.com/google.cloud.healthcare.v1.OperationMetadata", "apiMethodName": "google.cloud.healthcare.v1.dicom.DicomService.ExportDicomData", "createTime": "CREATE_TIME", "endTime": "END_TIME", "logsUrl": "https://console.cloud.google.com/logs/query/CLOUD_LOGGING_URL", "counter":{ "success": SUCCESSFUL_INSTANCES "failure": FAILED_INSTANCES } }, "done": true, "response": { "@type": "..." } }
PowerShell
DICOM ์ธ์คํด์ค๋ฅผ ๋ด๋ณด๋ด๋ ค๋ฉด POST
์์ฒญ์ ์ํํ๊ณ ๋ค์ ์ ๋ณด๋ฅผ ์ ๊ณตํ์ธ์.
- ์์ ๋ฐ์ดํฐ ์ธํธ์ ์ด๋ฆ ๋ฐ ์์น
- DICOM ์ ์ฅ์์ ์ด๋ฆ
- ๋์ Cloud Storage ๋ฒํท์ ๋๋ค.
๋ค์ ์ํ์ Windows PowerShell์ ์ฌ์ฉํ POST
์์ฒญ์ ๋ณด์ฌ์ค๋๋ค.
$cred = gcloud auth application-default print-access-token $headers = @{ Authorization = "Bearer $cred" } Invoke-WebRequest ` -Method Post ` -Headers $headers ` -ContentType: "application/json; charset=utf-8" ` -Body "{ 'gcsDestination': { 'uriPrefix': 'gs://BUCKET/DIRECTORY' } }" ` -Uri "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/dicomStores/DICOM_STORE_ID:export" | Select-Object -Expand Content
์์ฒญ์ด ์ฑ๊ณตํ๋ฉด ์๋ฒ๊ฐ JSON ํ์์ผ๋ก ์๋ต์ ๋ฐํํฉ๋๋ค.
{ "name": "projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/operations/OPERATION_ID" }
์๋ต์ ์์
์ด๋ฆ์ด ํฌํจ๋ฉ๋๋ค. ์์
์ํ๋ฅผ ์ถ์ ํ๋ ค๋ฉด ์์
get
๋ฉ์๋๋ฅผ ์ฌ์ฉํฉ๋๋ค.
$cred = gcloud auth application-default print-access-token $headers = @{ Authorization = "Bearer $cred" } Invoke-WebRequest ` -Method Get ` -Headers $headers ` -Uri "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/operations/OPERATION_ID" | Select-Object -Expand Content
์์ฒญ์ด ์ฑ๊ณตํ๋ฉด ์๋ฒ๋ JSON ํ์์ ์์ ์ํ๊ฐ ํฌํจ๋ ์๋ต์ ๋ฐํํฉ๋๋ค.
{ "name": "projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/operations/OPERATION_ID", "metadata": { "@type": "type.googleapis.com/google.cloud.healthcare.v1.OperationMetadata", "apiMethodName": "google.cloud.healthcare.v1.dicom.DicomService.ExportDicomData", "createTime": "CREATE_TIME", "endTime": "END_TIME", "logsUrl": "https://console.cloud.google.com/logs/query/CLOUD_LOGGING_URL", "counter":{ "success": SUCCESSFUL_INSTANCES "failure": FAILED_INSTANCES }, }, "done": true, "response": { "@type": "..." } }
Go
Java
Node.js
Python
ํํฐ๋ฅผ ์ฌ์ฉํ์ฌ DICOM ์ธ์คํด์ค ๋ด๋ณด๋ด๊ธฐ
๊ธฐ๋ณธ์ ์ผ๋ก DICOM ํ์ผ์ Cloud Storage๋ก ๋ด๋ณด๋ด๋ฉด DICOM ์ ์ฅ์์ ๋ชจ๋ DICOM ํ์ผ์ด ๋ด๋ณด๋ด์ง๋๋ค. ๋ง์ฐฌ๊ฐ์ง๋ก DICOM ๋ฉํ๋ฐ์ดํฐ๋ฅผ BigQuery๋ก ๋ด๋ณด๋ด๋ฉด DICOM ์ ์ฅ์์ ๋ชจ๋ DICOM ๋ฐ์ดํฐ ๋ฉํ๋ฐ์ดํฐ๊ฐ ๋ด๋ณด๋ด์ง๋๋ค.
ํํฐ ํ์ผ์ ์ฌ์ฉํ์ฌ DICOM ๋ฐ์ดํฐ ๋๋ ๋ฉํ๋ฐ์ดํฐ์ ํ์ ์งํฉ์ ๋ด๋ณด๋ผ ์ ์์ต๋๋ค.
ํํฐ ํ์ผ ๊ตฌ์ฑ
- ํํฐ ํ์ผ์ ๊ฐ ์ค์ ์ฐ๊ตฌ, ์๋ฆฌ์ฆ ๋๋ ์ธ์คํด์ค๋ฅผ ์ ์ํ๊ณ
/studies/STUDY_INSTANCE_UID/series/SERIES_INSTANCE_UID/instances/INSTANCE_UID
ํ์์ ์ฌ์ฉํฉ๋๋ค. - ์ ์ ์๋ผ ํํฐ๊ฐ ์๋ํ๋ ์์ค์ ์ง์ ํ ์ ์์ต๋๋ค.
์๋ฅผ ๋ค์ด
/studies/STUDY_INSTANCE_UID
๋ฅผ ์ง์ ํ์ฌ ์ ์ฒด ์ฐ๊ตฌ๋ฅผ ์ ํํ๊ฑฐ๋/studies/STUDY_INSTANCE_UID/series/SERIES_INSTANCE_UID
๋ฅผ ์ง์ ํ์ฌ ์ ์ฒด ์๋ฆฌ์ฆ๋ฅผ ์ ํํ ์ ์์ต๋๋ค.
๋ค์ ํํฐ ํ์ผ์ ์๋ก ๋ค์ด ๋ด ์๋ค.
/studies/1.123.456.789 /studies/1.666.333.111/series/123.456 /studies/1.666.333.111/series/567.890 /studies/1.888.999.222/series/123.456/instances/111 /studies/1.888.999.222/series/123.456/instances/222 /studies/1.888.999.222/series/123.456/instances/333
์ด ์์ ํํฐ ํ์ผ์ ๋ค์์ ์ ์ฉ๋ฉ๋๋ค.
- ํ์ต ์ธ์คํด์ค UID๊ฐ
1.123.456.789
์ธ ์ ์ฒด ํ์ต - ํ์ต
1.666.333.111
์์ ์๋ฆฌ์ฆ ์ธ์คํด์ค UID๊ฐ123.456
๋ฐ567.890
์ธ ๊ฐ๋ณ ์๋ฆฌ์ฆ 2๊ฐ - ํ์ต
1.888.999.222
๋ฐ ์๋ฆฌ์ฆ123.456
์์ ์ธ์คํด์ค ID๊ฐ111
,222
,333
์ธ ๊ฐ๋ณ ์ธ์คํด์ค 3๊ฐ
BigQuery๋ฅผ ์ฌ์ฉํ์ฌ ํํฐ ํ์ผ ๋ง๋ค๊ธฐ
BigQuery๋ฅผ ์ฌ์ฉํ์ฌ ํํฐ ํ์ผ์ ๋ง๋ค๋ ค๋ฉด ๋จผ์ DICOM ์คํ ์ด์ ๋ฉํ๋ฐ์ดํฐ๋ฅผ BigQuery๋ก ๋ด๋ณด๋ด์ผ ํฉ๋๋ค. ๋ด๋ณด๋ธ ๋ฉํ๋ฐ์ดํฐ์๋ DICOM ์คํ ์ด์ ์๋ DICOM ๋ฐ์ดํฐ์ ํ์ต, ์๋ฆฌ์ฆ, ์ธ์คํด์ค UID๊ฐ ํ์๋ฉ๋๋ค.
๋ฉํ๋ฐ์ดํฐ๋ฅผ ๋ด๋ณด๋ธ ํ ๋ค์ ๋จ๊ณ๋ฅผ ์๋ฃํฉ๋๋ค.
ํํฐ ํ์ผ์ ์ถ๊ฐํ ์ฐ๊ตฌ, ์๋ฆฌ์ฆ, ์ธ์คํด์ค์ UID๋ฅผ ๋ฐํํ๋ ์ฟผ๋ฆฌ๋ฅผ ์คํํฉ๋๋ค.
์๋ฅผ ๋ค์ด ๋ค์ ์ฟผ๋ฆฌ๋ ํํฐ ํ์ผ ํ์ ์๊ตฌ์ฌํญ์ ๋ง๊ฒ ์ฐ๊ตฌ, ์๋ฆฌ์ฆ, ์ธ์คํด์ค UID๋ฅผ ์ฐ๊ฒฐํ๋ ๋ฐฉ๋ฒ์ ๋ณด์ฌ์ค๋๋ค.
SELECT CONCAT ('/studies/', StudyInstanceUID, '/series/', SeriesInstanceUID, '/instances/', SOPInstanceUID) FROM [PROJECT_ID:BIGQUERY_DATASET.BIGQUERY_TABLE]
์ ํ์ฌํญ: ์ฟผ๋ฆฌ๊ฐ ์ต๋ ์๋ต ํฌ๊ธฐ๋ฅผ ์ด๊ณผํ๋ ํฐ ๊ฒฐ๊ณผ ์งํฉ์ ๋ฐํํ๋ ๊ฒฝ์ฐ BigQuery์ ์ ๋์ ํ ์ด๋ธ์ ์ฟผ๋ฆฌ ๊ฒฐ๊ณผ๋ฅผ ์ ์ฅํฉ๋๋ค.
์ฟผ๋ฆฌ ๊ฒฐ๊ณผ๋ฅผ ํ์ผ์ ์ ์ฅํ๊ณ Cloud Storage๋ก ๋ด๋ณด๋ ๋๋ค. 2๋จ๊ณ์์ ์ ๋์ ํ ์ด๋ธ์ ์ฟผ๋ฆฌ ๊ฒฐ๊ณผ๋ฅผ ์ ์ฅํ ๊ฒฝ์ฐ ํ ์ด๋ธ ๋ฐ์ดํฐ ๋ด๋ณด๋ด๊ธฐ๋ฅผ ์ฐธ์กฐํ์ฌ ํ ์ด๋ธ ์ฝํ ์ธ ๋ฅผ Cloud Storage๋ก ๋ด๋ณด๋ ๋๋ค.
๋ด๋ณด๋ธ ํ์ผ์ ํ์์ ๋ฐ๋ผ ์์ ํ ํ ์์ฒญ์ ํฌํจํ์ฌ ์ฌ๋ฌ DICOM ๊ฐ์ฒด์ ์คํ ๋ฆฌ์ง ํด๋์ค๋ฅผ ๋ณ๊ฒฝํฉ๋๋ค.
์๋์ผ๋ก ํํฐ ํ์ผ ๋ง๋ค๊ธฐ
ํํฐ ํ์ผ์ ์๋์ผ๋ก ๋ง๋ค๋ ค๋ฉด ๋ค์ ๋จ๊ณ๋ฅผ ๋ฐ๋ฅด์ธ์.
- ํํฐ๋งํ DICOM ๊ฐ์ฒด๊ฐ ํฌํจ๋ ํํฐ ํ์ผ์ ๋ง๋ญ๋๋ค.
- ํํฐ ํ์ผ์ Cloud Storage์ ์ ๋ก๋ํฉ๋๋ค. ์์ธํ ์๋ด๋ ํ์ผ ์์คํ ์์ ๊ฐ์ฒด ์ ๋ก๋๋ฅผ ์ฐธ๊ณ ํ์ธ์.
ํํฐ ํ์ผ ์ ๋ฌ
ํํฐ ํ์ผ์ ๋ง๋ ํ DICOM ๋ด๋ณด๋ด๊ธฐ ์์ ์ ํธ์ถํ๊ณ REST API๋ฅผ ์ฌ์ฉํ์ฌ ํํฐ ํ์ผ์ ์ ๋ฌํฉ๋๋ค. ๋ค์ ์ํ์ ํํฐ๋ฅผ ์ฌ์ฉํ์ฌ DICOM ๋ฐ์ดํฐ๋ฅผ ๋ด๋ณด๋ด๋ ๋ฐฉ๋ฒ์ ๋ณด์ฌ์ค๋๋ค.
gcloud
ํํฐ๋ฅผ ์ฌ์ฉํ์ฌ DICOM ๋ฉํ๋ฐ์ดํฐ๋ฅผ Cloud Storage๋ก ๋ด๋ณด๋ด๋ ค๋ฉด gcloud beta healthcare dicom-stores export gcs
๋ช
๋ น์ด๋ฅผ ์ฌ์ฉํฉ๋๋ค.
gcloud beta healthcare dicom-stores export gcs DICOM_STORE_ID \ --dataset=DATASET_ID \ --location=LOCATION \ --gcs-uri-prefix=gs://DESTINATION_BUCKET/DIRECTORY \ --filter-config-gcs-uri=gs://BUCKET/DIRECTORY/FILTER_FILE
๋ค์์ ๋ฐ๊ฟ๋๋ค.
- DICOM_STORE_ID: DICOM ์ ์ฅ์์ ์๋ณ์์ ๋๋ค.
- DATASET_ID: DICOM ์ ์ฅ์์ ์์ ๋ฐ์ดํฐ ์ธํธ ์ด๋ฆ์ ๋๋ค.
- LOCATION: DICOM ์ ์ฅ์์ ์์ ๋ฐ์ดํฐ ์ธํธ ์์น์ ๋๋ค.
- DESTINATION_BUCKET/DIRECTORY: ๋์ Cloud Storage ๋ฒํท์ ๋๋ค.
- BUCKET/DIRECTORY/FILTER_FILE: Cloud Storage ๋ฒํท์์ ํํฐ ํ์ผ์ ์์น์ ๋๋ค.
์ถ๋ ฅ์ ๋ค์๊ณผ ๊ฐ์ต๋๋ค.
Request issued for: [DICOM_STORE_ID] Waiting for operation [projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/operations/OPERATION_ID] to complete...done. name: projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/dicomStores/DICOM_STORE_ID
์์
์ํ๋ฅผ ๋ณด๋ ค๋ฉด gcloud healthcare operations describe
๋ช
๋ น์ด๋ฅผ ์คํํ๊ณ ์๋ต์์ OPERATION_ID๋ฅผ ์ ๊ณตํฉ๋๋ค.
gcloud healthcare operations describe OPERATION_ID \ --location=LOCATION \ --dataset=DATASET_ID
๋ค์์ ๋ฐ๊ฟ๋๋ค.
- OPERATION_ID: ์ด์ ์๋ต์์ ๋ฐํ๋ ID ๋ฒํธ์ ๋๋ค.
- DATASET_ID: DICOM ์ ์ฅ์์ ์์ ๋ฐ์ดํฐ ์ธํธ ์ด๋ฆ์ ๋๋ค.
- LOCATION: DICOM ์ ์ฅ์์ ์์ ๋ฐ์ดํฐ ์ธํธ ์์น์ ๋๋ค.
์ถ๋ ฅ์ ๋ค์๊ณผ ๊ฐ์ต๋๋ค.
done: true metadata: '@type': type.googleapis.com/google.cloud.healthcare.v1beta1.OperationMetadata apiMethodName: google.cloud.healthcare.v1beta1.dicom.DicomService.ExportDicomData counter: success: SUCCESSFUL_INSTANCES failure: FAILED_INSTANCES createTime: 'CREATE_TIME' endTime: 'END_TIME' logsUrl: 'https://console.cloud.google.com/logs/query/CLOUD_LOGGING_URL' name: projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/operations/OPERATION_ID response: '@type': '...'
API
ํํฐ๋ฅผ ์ฌ์ฉํ์ฌ DICOM ๋ฐ์ดํฐ๋ฅผ ๋ด๋ณด๋ด๋ ค๋ฉด projects.locations.datasets.dicomStores.export
๋ฉ์๋๋ฅผ ์ฌ์ฉํฉ๋๋ค.
curl
ํํฐ ํ์ผ์ ์ฌ์ฉํ์ฌ DICOM ๋ฐ์ดํฐ๋ฅผ ๋ด๋ณด๋ด๋ ค๋ฉด POST
์์ฒญ์ ์ํํ๊ณ ๋ค์ ์ ๋ณด๋ฅผ ์ ๊ณตํฉ๋๋ค.
- ์์ ๋ฐ์ดํฐ ์ธํธ์ ์ด๋ฆ ๋ฐ ์์น
- DICOM ์ ์ฅ์์ ์ด๋ฆ
- ๋์ Cloud Storage ๋ฒํท์ ๋๋ค.
- Cloud Storage ๋ฒํท์์ ํํฐ ํ์ผ ์์น
๋ค์ ์ํ์ curl
์ ์ฌ์ฉํ๋ POST
์์ฒญ์ ๋ณด์ฌ์ค๋๋ค.
curl -X POST \ -H "Authorization: Bearer $(gcloud auth application-default print-access-token)" \ -H "Content-Type: application/json; charset=utf-8" \ --data "{ 'gcsDestination': { 'uriPrefix': 'gs://BUCKET/DIRECTORY' }, 'filterConfig': { 'resourcePathsGcsUri': 'gs://BUCKET/DIRECTORY/FILTER_FILE' } }" "https://healthcare.googleapis.com/v1beta1/projects/PROJECT_ID/locations/REGION/datasets/DATASET_ID/dicomStores/DICOM_STORE_ID:export"
์์ฒญ์ด ์ฑ๊ณตํ๋ฉด ์๋ฒ๋ ๋ค์๊ณผ ๊ฐ์ JSON ํ์์ ์๋ต์ ๋ฐํํฉ๋๋ค.
{ "name": "projects/PROJECT_ID/locations/REGION/datasets/DATASET_ID/operations/OPERATION_ID" }
์๋ต์ ์์
์ด๋ฆ์ด ํฌํจ๋ฉ๋๋ค. ์์
get
๋ฉ์๋๋ฅผ ์ฌ์ฉํ์ฌ ์์
์ํ๋ฅผ ์ถ์ ํฉ๋๋ค.
curl -X GET \ -H "Authorization: Bearer $(gcloud auth application-default print-access-token)" \ "https://healthcare.googleapis.com/v1beta1/projects/PROJECT_ID/locations/REGION/datasets/DATASET_ID/operations/OPERATION_NAME"
์์ฒญ์ด ์ฑ๊ณตํ๋ฉด ์๋ฒ๋ ๋ค์๊ณผ ๊ฐ์ JSON ํ์์ ์๋ต์ ๋ฐํํฉ๋๋ค.
{ "name": "projects/PROJECT_ID/locations/REGION/datasets/DATASET_ID/operations/OPERATION_ID", "metadata": { "@type": "type.googleapis.com/google.cloud.healthcare.v1beta1.OperationMetadata", "apiMethodName": "google.cloud.healthcare.v1beta1.dicom.DicomService.ExportDicomData", "createTime": "CREATE_TIME", "endTime": "END_TIME" }, "done": true, "response": { "@type": "..." } }
PowerShell
ํํฐ ํ์ผ์ ์ฌ์ฉํ์ฌ DICOM ๋ฐ์ดํฐ๋ฅผ ๋ด๋ณด๋ด๋ ค๋ฉด POST
์์ฒญ์ ์ํํ๊ณ ๋ค์ ์ ๋ณด๋ฅผ ์ ๊ณตํฉ๋๋ค.
- ์์ ๋ฐ์ดํฐ ์ธํธ์ ์ด๋ฆ ๋ฐ ์์น
- DICOM ์ ์ฅ์์ ์ด๋ฆ
- ๋์ Cloud Storage ๋ฒํท์ ๋๋ค.
- Cloud Storage ๋ฒํท์์ ํํฐ ํ์ผ ์์น
๋ค์ ์ํ์ Windows PowerShell์ ์ฌ์ฉํ POST
์์ฒญ์ ๋ณด์ฌ์ค๋๋ค.
$cred = gcloud auth application-default print-access-token $headers = @{ Authorization = "Bearer $cred" } Invoke-WebRequest ` -Method Post ` -Headers $headers ` -ContentType: "application/json; charset=utf-8" ` -Body "{ 'gcsDestination': { 'uriPrefix': 'gs://BUCKET/DIRECTORY' }, 'filterConfig': { 'resourcePathsGcsUri': 'gs://BUCKET/DIRECTORY/FILTER_FILE' }" ` -Uri "https://healthcare.googleapis.com/v1beta1/projects/PROJECT_ID/locations/REGION/datasets/DATASET_ID/dicomStores/DICOM_STORE_ID:export" | Select-Object -Expand Content
์์ฒญ์ด ์ฑ๊ณตํ๋ฉด ์๋ฒ๋ ๋ค์๊ณผ ๊ฐ์ JSON ํ์์ ์๋ต์ ๋ฐํํฉ๋๋ค.
{ "name": "projects/PROJECT_ID/locations/REGION/datasets/DATASET_ID/operations/OPERATION_ID" }
์๋ต์ ์์
์ด๋ฆ์ด ํฌํจ๋ฉ๋๋ค. ์์
get
๋ฉ์๋๋ฅผ ์ฌ์ฉํ์ฌ ์์
์ํ๋ฅผ ์ถ์ ํฉ๋๋ค.
$cred = gcloud auth application-default print-access-token $headers = @{ Authorization = "Bearer $cred" } Invoke-WebRequest ` -Method Get ` -Headers $headers ` -Uri "https://healthcare.googleapis.com/v1beta1/projects/PROJECT_ID/locations/REGION/datasets/DATASET_ID/operations/OPERATION_NAME" | Select-Object -Expand Content
์์ฒญ์ด ์ฑ๊ณตํ๋ฉด ์๋ฒ๋ JSON ํ์์ ์์ ์ํ๊ฐ ํฌํจ๋ ๋ค์ ์๋ต์ ๋ฐํํฉ๋๋ค.
{ "name": "projects/PROJECT_ID/locations/REGION/datasets/DATASET_ID/operations/OPERATION_ID", "metadata": { "@type": "type.googleapis.com/google.cloud.healthcare.v1beta1.OperationMetadata", "apiMethodName": "google.cloud.healthcare.v1beta1.dicom.DicomService.ExportDicomData", "createTime": "CREATE_TIME", "endTime": "END_TIME" }, "done": true, "response": { "@type": "..." } }
DICOM ๋ด๋ณด๋ด๊ธฐ ์์ฒญ ๋ฌธ์ ํด๊ฒฐ
DICOM ๋ด๋ณด๋ด๊ธฐ ์์ฒญ ์ค์ ์ค๋ฅ๊ฐ ๋ฐ์ํ๋ฉด ์ค๋ฅ๊ฐ Cloud Logging์ ๊ธฐ๋ก๋ฉ๋๋ค. ์์ธํ ๋ด์ฉ์ Cloud Logging์์ ์ค๋ฅ ๋ก๊ทธ ๋ณด๊ธฐ๋ฅผ ์ฐธ์กฐํ์ธ์.
์ ์ฒด ์์ ์ด ์ค๋ฅ๋ฅผ ๋ฐํํ๋ ๊ฒฝ์ฐ ์ฅ๊ธฐ ์คํ ์์ ๋ฌธ์ ํด๊ฒฐ์ ์ฐธ์กฐํ์ธ์.