์ด ํ์ด์ง์์๋ Cloud Healthcare API์ DICOMweb ๊ตฌํ์ ์ฌ์ฉํ์ฌ DICOM ์ด๋ฏธ์ง ๋ฐ์ดํฐ๋ฅผ ์ ์ฅ ๋ฐ ๊ด๋ฆฌํฉ๋๋ค.
Cloud Healthcare API๊ฐ ์ฌ๋ฌ DICOMweb REST ์๋น์ค๋ฅผ ๊ตฌํํ๋ ๋ฐฉ๋ฒ์ ๋ํ ์์ธํ ๋ด์ฉ์ DICOM ์ ํฉ์ฑ ๋ช ์ธ๋ฅผ ์ฐธ์กฐํ์ธ์.
Cloud Healthcare API์ DICOM ์น ๊ตฌํ์ RPC๊ฐ ์๋ REST๋ง ์ง์ํฉ๋๋ค.
Cloud Healthcare API DICOMweb CLI ์ค์น
์ด ํ์ด์ง์ ์ผ๋ถ ์ํ์๋ DICOMweb ์๋ฒ์์ ์ํธ์์ฉ ๋ฐฉ๋ฒ์ ๋จ์ํํ๋ ์คํ์์ค ๋๊ตฌ์ธ Cloud Healthcare API DICOMweb CLI๊ฐ ์ฌ์ฉ๋ฉ๋๋ค. ์ด ๋๊ตฌ๋ DICOM ํ์ผ ์ ์ฅ, ๊ฒ์, ์ญ์ , ๊ฒ์์ ์ํ ๊ธฐ๋ฅ์ ์ ๊ณตํฉ๋๋ค. ์ด ๋๊ตฌ์ GitHub ํ์ด์ง์๋ ์ธ๋ถ ์ค์น ์๊ตฌ์ฌํญ ๋ฐ ๋๊ตฌ ๋ง์ถค์ค์ ๋ฐฉ๋ฒ๊ณผ ๊ฐ์ ์ถ๊ฐ ์ ๋ณด๊ฐ ํฌํจ๋์ด ์์ต๋๋ค.
์ด ๋๊ตฌ๋ Python์ ์ฌ์ฉํ์ฌ ์คํ๋ฉ๋๋ค. Google Cloud์์ Python์ ์ค์ ํ๋ ๋ฐฉ๋ฒ์ ๋ํ ์์ธํ ๋ด์ฉ์ Python ๊ฐ๋ฐ ํ๊ฒฝ ์ค์ ์ ์ฐธ๊ณ ํ์ธ์.
Python์ ์ค์ ํ ํ์๋ PIP๋ฅผ ์ฌ์ฉํด์ ๋๊ตฌ๋ฅผ ์ค์นํ ์ ์์ต๋๋ค.
pip install https://github.com/GoogleCloudPlatform/healthcare-api-dicomweb-cli/archive/v1.0.zip
์ด ๋๊ตฌ๋ฅผ ์ฌ์ฉํ๋ ค๋ฉด Google Cloud ์๋ฒ๋ก ์ธ์ฆํด์ผ ํฉ๋๋ค. ์ด๋ฅผ ์ํด์๋ ๋ค์ ๋ฐฉ๋ฒ ์ค ํ๋๋ฅผ ์ฌ์ฉํ๋ฉด ๋ฉ๋๋ค.
GOOGLE_APPLICATION_CREDENTIALS
ํ๊ฒฝ ๋ณ์ ์ค์ gcloud auth application-default login
๋ฅผ ์ฌ์ฉํ์ฌ Google Cloud CLI๋ฅผ ํตํด ์ธ์ฆ
์ด๋ฌํ ์ต์ ์ ๊ตฌ์ฑํ๋ฉด ๋๊ตฌ๊ฐ ์ฌ์ฉ์ ์ธ์ฆ ์ ๋ณด๋ฅผ ์๋์ผ๋ก ๊ฒ์ํฉ๋๋ค.
DICOM ๋ฐ์ดํฐ ์ ์ฅ
DICOM ๋ฐ์ดํฐ๋ฅผ ์ ์ฅํ๋ ค๋ฉด ๋จผ์ DICOM ์ ์ฅ์๋ฅผ ๋ง๋ค์ด์ผ ํฉ๋๋ค.
Cloud Healthcare API๋ DICOM ๋ฐ์ดํฐ๋ฅผ ์ ์ฅํ ๋ ์ ์ฅ์ ํธ๋์ญ์ RESTful ์น ์๋น์ค๋ฅผ ๊ตฌํํฉ๋๋ค. ์์ธํ ๋ด์ฉ์ Cloud Healthcare API DICOM ์ ํฉ์ฑ ๋ช ์ธ์์ ์ ์ฅ์ ํธ๋์ญ์ ์ ์ฐธ์กฐํ์ธ์.
๋ค์ ๋ฐฉ๋ฒ ์ค ํ๋๋ฅผ ์ฌ์ฉํ์ฌ DICOM ๋ฐ์ดํฐ๋ฅผ ์ ์ฅํฉ๋๋ค. ์์ฒญ์ application/dicom
Accept ํค๋๋ฅผ ํฌํจํฉ๋๋ค.
- DICOM ์ธ์คํด์ค ์ ์ฅ: ์ผ๋ฐ์ ์ผ๋ก
.dcm
ํ์ผ์ ๋๋ค. ์ฌ๋ฌ ๋ถ๋ถ (multipart) ๋ฉ์์ง๋ฅผ ์ฌ์ฉํ์ฌ ์ฌ๋ฌ ํญ๋ชฉ ์ ์ฅ: ๊ฒฝ๊ณ๋ก ๊ตฌ๋ถ๋ ์ฌ๋ฌ ๋ฐ์ดํฐ ๋ถ๋ถ์ผ๋ก ๋ฉํฐํํธ ํ์ผ์ ๊ตฌ์ฑํฉ๋๋ค. ์์ฒญ์์
Content-Type
์multipart/related; type=application/dicom; boundary=BOUNDARY
๋ก ์ค์ ํฉ๋๋ค. ์ฌ๊ธฐ์BOUNDARY
๋ ๋ฉ์์ง์ ์ฌ๋ฌ ๋ถ๋ถ์ ๋ํ๋ด๋ ์ฌ์ฉ์ ์ ์ ๊ฐ์ ๋๋ค. ๋ฉํฐํํธ ๋ฉ์์ง ๋ง๋ค๊ธฐ์ ๊ดํ ์์ธํ ๋ด์ฉ์ RFC 1341์ ์ฐธ๊ณ ํ์ธ์.๋ฉํฐํํธ ๋ฉ์์ง๋ฅผ ์ฌ์ฉํ์ฌ ๋ค์ DICOM ๋ฐ์ดํฐ ์ ํ์ ์ ์ฅํฉ๋๋ค.
- ์ธ์คํด์ค๊ฐ ์ฌ๋ฌ ๊ฐ ํฌํจ๋ DICOM ์ฐ๊ตฌ ๋๋ ์๋ฆฌ์ฆ ๊ฒฝ๊ณ๋ฅผ ์ฌ์ฉํ์ฌ ๊ฐ ์ธ์คํด์ค๋ฅผ ๊ตฌ๋ถํฉ๋๋ค. ์์ธํ ๋ด์ฉ์ ๋ฉํฐํํธ ๋ฉ์์ง๋ฅผ ์ฌ์ฉํ์ฌ DICOM ์ฐ๊ตฌ ๋๋ ์๋ฆฌ์ฆ ์ ์ฅ์ ์ฐธ๊ณ ํ์ธ์.
- JPEG ํ์ผ์ด ํฌํจ๋ DICOM JSON ๋ฉํ๋ฐ์ดํฐ ๊ฒฝ๊ณ๋ฅผ ์ฌ์ฉํ์ฌ ๊ฐ ๋ฐ์ดํฐ ์ธํธ๋ฅผ ๊ตฌ๋ถํฉ๋๋ค. ์์ธํ ๋ด์ฉ์ JSON ๋ฉํ๋ฐ์ดํฐ ๋ฐ JPEG ์ด๋ฏธ์ง์์ DICOM ์ธ์คํด์ค ๋ง๋ค๊ธฐ๋ฅผ ์ฐธ๊ณ ํ์ธ์.
SOP_CLASS_UID
, SOP_INSTANCE_UID
, STUDY_INSTANCE_UID
, SERIES_INSTANCE_UID
๊ฐ์ ์ ๊ณต๋ ๋ฉํ๋ฐ์ดํฐ๋ก๋ถํฐ ์ฑ์์ง๋๋ค. UID๋ ๋ค์ ์๊ตฌ์ฌํญ์ ์ถฉ์กฑํด์ผ ํฉ๋๋ค.
- ๋ง์นจํ๋ก ๊ตฌ๋ถ๋ ์ซ์ ๊ฐ๋ง ํฌํจํฉ๋๋ค.
- ๋ณดํธ ๊ฑด๊ฐ ์ ๋ณด(PHI)๋ฅผ ํฌํจํ์ง ์์ต๋๋ค.
๋ค์ ์ํ์ DICOM ์ ์ฅ์์ ์ธ์คํด์ค๋ฅผ ์ ์ฅํ๋ ๋ฐฉ๋ฒ์ ๋ณด์ฌ์ค๋๋ค. ์์ธํ ๋ด์ฉ์ projects.locations.datasets.dicomStores.storeInstances
๋ฅผ ์ฐธ์กฐํ์ธ์.
DICOM ์ธ์คํด์ค ์ ์ฅ
๋ค์ ์ํ์ DICOM ์ธ์คํด์ค๋ฅผ ์ ์ฅํ๋ ๋ฐฉ๋ฒ์ ๋ณด์ฌ์ค๋๋ค. ์์ธํ ๋ด์ฉ์ projects.locations.datasets.dicomStores.storeInstances
๋ฅผ ์ฐธ์กฐํ์ธ์.
REST
์์ฒญ ๋ฐ์ดํฐ๋ฅผ ์ฌ์ฉํ๊ธฐ ์ ์ ๋ค์์ ๋ฐ๊ฟ๋๋ค.
PROJECT_ID
: Google Cloud ํ๋ก์ ํธ IDLOCATION
: ๋ฐ์ดํฐ ์ธํธ ์์นDATASET_ID
: DICOM ์ ์ฅ์์ ์์ ๋ฐ์ดํฐ ์ธํธDICOM_STORE_ID
: DICOM ์ ์ฅ์ IDDICOM_INSTANCE_FILE
: ๋ก์ปฌ ๋จธ์ ์ ์๋ DICOM ์ธ์คํด์ค ํ์ผ์ ๊ฒฝ๋ก๋ก,.dcm
์ ๋ฏธ์ฌ๋ก ๋๋ฉ๋๋ค.
์์ฒญ์ ๋ณด๋ด๋ ค๋ฉด ๋ค์ ์ต์ ์ค ํ๋๋ฅผ ์ ํํฉ๋๋ค.
curl
๋ค์ ๋ช ๋ น์ด๋ฅผ ์คํํฉ๋๋ค.
curl -X POST \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/dicom" \
--data-binary @DICOM_INSTANCE_FILE \
"https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/dicomStores/DICOM_STORE_ID/dicomWeb/studies"
PowerShell
๋ค์ ๋ช ๋ น์ด๋ฅผ ์คํํฉ๋๋ค.
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }
Invoke-WebRequest `
-Method POST `
-Headers $headers `
-InFile DICOM_INSTANCE_FILE `
-Uri "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/dicomStores/DICOM_STORE_ID/dicomWeb/studies" | Select-Object -Expand Content
Go
Java
Node.js
Python
๋ฉํฐํํธ ๋ฉ์์ง๋ฅผ ์ฌ์ฉํ์ฌ DICOM ์ฐ๊ตฌ ๋๋ ์๋ฆฌ์ฆ ์ ์ฅ
๋ค์ ์ํ์ ๋ฉํฐํํธ ๋ฉ์์ง๋ฅผ ์ฌ์ฉํ์ฌ ์ฌ๋ฌ ์ธ์คํด์ค๋ก ๊ตฌ์ฑ๋ DICOM ์ฐ๊ตฌ ๋๋ ์๋ฆฌ์ฆ๋ฅผ ์ ์ฅํ๋ ๋ฐฉ๋ฒ์ ๋ณด์ฌ์ค๋๋ค.
REST
์์ฒญ ๋ฐ์ดํฐ๋ฅผ ์ฌ์ฉํ๊ธฐ ์ ์ ๋ค์์ ๋ฐ๊ฟ๋๋ค.
PROJECT_ID
: Google Cloud ํ๋ก์ ํธ IDLOCATION
: ๋ฐ์ดํฐ ์ธํธ ์์นDATASET_ID
: DICOM ์ ์ฅ์์ ์์ ๋ฐ์ดํฐ ์ธํธDICOM_STORE_ID
: DICOM ์ ์ฅ์ IDMULTIPART_FILE
: ๋ก์ปฌ ๋จธ์ ์ ์๋ ๋ฉํฐํํธ ํ์ผ์ ๊ฒฝ๋ก์ ๋๋ค. ํ์ผ์ ์ฌ๋ฌ DICOM ์ธ์คํด์ค๊ฐ ํฌํจ๋์ด ์์ผ๋ฉฐ ๊ฐ ์ธ์คํด์ค๋ ๊ฒฝ๊ณ๋ก ๊ตฌ๋ถ๋ฉ๋๋ค.BOUNDARY
: ๋ฉํฐํํธ ํ์ผ์์ DICOM ์ธ์คํด์ค๋ฅผ ๊ตฌ๋ถํ๋ ๋ฐ ์ฌ์ฉ๋๋ ๊ฒฝ๊ณ
์์ฒญ์ ๋ณด๋ด๋ ค๋ฉด ๋ค์ ์ต์ ์ค ํ๋๋ฅผ ์ ํํฉ๋๋ค.
curl
๋ค์ ๋ช ๋ น์ด๋ฅผ ์คํํฉ๋๋ค.
curl -X POST \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: multipart/related; type=application/dicom; boundary=BOUNDARY" \
--data-binary @MULTIPART_FILE \
"https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/dicomStores/DICOM_STORE_ID/dicomWeb/studies"
PowerShell
๋ค์ ๋ช ๋ น์ด๋ฅผ ์คํํฉ๋๋ค.
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }
Invoke-WebRequest `
-Method POST `
-Headers $headers `
-InFile MULTIPART_FILE `
-Uri "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/dicomStores/DICOM_STORE_ID/dicomWeb/studies" | Select-Object -Expand Content
DICOM ์ธ์คํด์ค์ ์คํ ๋ฆฌ์ง ํด๋์ค ์ง์
๊ธฐ๋ณธ์ ์ผ๋ก projects.locations.datasets.dicomStores.storeInstances
๋ฉ์๋๋ Standard Storage ํด๋์ค๋ฅผ ์ฌ์ฉํ์ฌ DICOM ์ธ์คํด์ค๋ฅผ DICOM ์ ์ฅ์์ ์ ์ฅํฉ๋๋ค. ๋ก์ปฌ ๋จธ์ ์์ DICOM ๊ฐ์ฒด๋ฅผ ์ ์ฅํ ๋ ์คํ ๋ฆฌ์ง ํด๋์ค๋ฅผ ์ค์ ํ ์ ์์ต๋๋ค.
์์ธํ ๋ด์ฉ์ DICOM ์คํ ๋ฆฌ์ง ํด๋์ค ๋ณ๊ฒฝ์ ์ฐธ์กฐํ์ธ์.
๋ค์ ์ํ์ ๋ก์ปฌ ๋จธ์ ์์ DICOM ๊ฐ์ฒด๋ฅผ ์ ์ฅํ ๋ ์คํ ๋ฆฌ์ง ํด๋์ค๋ฅผ ์ง์ ํ๋ ๋ฐฉ๋ฒ์ ๋ณด์ฌ์ค๋๋ค.
curl
projects.locations.datasets.dicomStores.storeInstances
๋ฉ์๋๋ฅผ ์ฌ์ฉํฉ๋๋ค.
์์ฒญ ๋ฐ์ดํฐ๋ฅผ ์ฌ์ฉํ๊ธฐ ์ ์ ๋ค์์ ๋ฐ๊ฟ๋๋ค.
PROJECT_ID
: Google Cloud ํ๋ก์ ํธ IDLOCATION
: ๋ฐ์ดํฐ ์ธํธ ์์นDATASET_ID
: DICOM ์ ์ฅ์์ ์์ ๋ฐ์ดํฐ ์ธํธDICOM_STORE_ID
: DICOM ์ ์ฅ์ IDDICOM_INSTANCE_FILE
: ๋ก์ปฌ ๋จธ์ ์ ์๋ DICOM ์ธ์คํด์ค ํ์ผ์ ๊ฒฝ๋ก๋ก,.dcm
์ ๋ฏธ์ฌ๋ก ๋๋ฉ๋๋ค.STORAGE_CLASS
:STANDARD
,NEARLINE
,COLDLINE
,ARCHIVE
์ DICOM ์ ์ฅ์์ ์๋ DICOM ์ธ์คํด์ค์ ์คํ ๋ฆฌ์ง ํด๋์ค์ ๋๋ค.
curl -X POST \ -H "Authorization: Bearer $(gcloud auth application-default print-access-token)" \ -H "Content-Type: application/dicom" \ -H "Storage-Class: STORAGE_CLASS" \ --data-binary @DICOM_INSTANCE_FILE \ "https://healthcare.googleapis.com/v1beta1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/dicomStores/DICOM_STORE_ID/dicomWeb/studies"
์์ฒญ์ด ์ฑ๊ณตํ๋ฉด ์๋ฒ๋ ๋ค์ ์๋ต์ ๋ฐํํฉ๋๋ค.
<NativeDicomModel> <DicomAttribute tag="00081190" vr="UR" keyword="RetrieveURL"> <Value number="1">https://healthcare.googleapis.com/v1beta1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/dicomStores/DICOM_STORE_ID/dicomWeb/studies/STUDY_INSTANCE_UID</Value> </DicomAttribute> <DicomAttribute tag="00081199" vr="SQ" keyword="ReferencedSOPSequence"> <Item number="1"> <DicomAttribute tag="00081150" vr="UI" keyword="ReferencedSOPClassUID"> <Value number="1">SOP_CLASS_UID</Value> </DicomAttribute> <DicomAttribute tag="00081155" vr="UI" keyword="ReferencedSOPInstanceUID"> <Value number="1">SOP_INSTANCE_UID</Value> </DicomAttribute> <DicomAttribute tag="00081190" vr="UR" keyword="RetrieveURL"> <Value number="1">https://healthcare.googleapis.com/v1beta1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/dicomStores/DICOM_STORE_ID/dicomWeb/studies/STUDY_INSTANCE_UID/series/SERIES_INSTANCE_UID/instances/INSTANCE_UID</Value> </DicomAttribute> </Item> </DicomAttribute> </NativeDicomModel>
PowerShell
projects.locations.datasets.dicomStores.storeInstances
๋ฉ์๋๋ฅผ ์ฌ์ฉํฉ๋๋ค.
์์ฒญ ๋ฐ์ดํฐ๋ฅผ ์ฌ์ฉํ๊ธฐ ์ ์ ๋ค์์ ๋ฐ๊ฟ๋๋ค.
PROJECT_ID
: Google Cloud ํ๋ก์ ํธ IDLOCATION
: ๋ฐ์ดํฐ ์ธํธ ์์นDATASET_ID
: DICOM ์ ์ฅ์์ ์์ ๋ฐ์ดํฐ ์ธํธDICOM_STORE_ID
: DICOM ์ ์ฅ์ IDDICOM_INSTANCE_FILE
: ๋ก์ปฌ ๋จธ์ ์ ์๋ DICOM ์ธ์คํด์ค ํ์ผ์ ๊ฒฝ๋ก๋ก,.dcm
์ ๋ฏธ์ฌ๋ก ๋๋ฉ๋๋ค.STORAGE_CLASS
:STANDARD
,NEARLINE
,COLDLINE
,ARCHIVE
์ DICOM ์ ์ฅ์์ ์๋ DICOM ์ธ์คํด์ค์ ์คํ ๋ฆฌ์ง ํด๋์ค์ ๋๋ค.
$cred = gcloud auth application-default print-access-token $headers = @{ "Authorization" = "Bearer $cred"; "Storage-Class" = "STORAGE_CLASS" } Invoke-WebRequest ` -Method Post ` -Headers $headers ` -ContentType: "application/dicom" ` -InFile DCM_FILE.dcm ` -Uri "https://healthcare.googleapis.com/v1beta1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/dicomStores/DICOM_STORE_ID/dicomWeb/studies" | Select-Object -Expand Content
์์ฒญ์ด ์ฑ๊ณตํ๋ฉด ์๋ฒ๊ฐ JSON ํ์์ผ๋ก ์๋ต์ ๋ฐํํฉ๋๋ค.
<NativeDicomModel> <DicomAttribute tag="00081190" vr="UR" keyword="RetrieveURL"> <Value number="1">https://healthcare.googleapis.com/v1beta1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/dicomStores/DICOM_STORE_ID/dicomWeb/studies/STUDY_INSTANCE_UID</Value> </DicomAttribute> <DicomAttribute tag="00081199" vr="SQ" keyword="ReferencedSOPSequence"> <Item number="1"> <DicomAttribute tag="00081150" vr="UI" keyword="ReferencedSOPClassUID"> <Value number="1">SOP_CLASS_UID</Value> </DicomAttribute> <DicomAttribute tag="00081155" vr="UI" keyword="ReferencedSOPInstanceUID"> <Value number="1">SOP_INSTANCE_UID</Value> </DicomAttribute> <DicomAttribute tag="00081190" vr="UR" keyword="RetrieveURL"> <Value number="1">https://healthcare.googleapis.com/v1beta1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/dicomStores/DICOM_STORE_ID/dicomWeb/studies/STUDY_INSTANCE_UID/series/SERIES_INSTANCE_UID/instances/INSTANCE_UID</Value> </DicomAttribute> </Item> </DicomAttribute> </NativeDicomModel>
JSON ๋ฉํ๋ฐ์ดํฐ ๋ฐ JPEG ์ด๋ฏธ์ง์์ DICOM ์ธ์คํด์ค ๋ง๋ค๊ธฐ
Cloud Healthcare API๋ JSON ๋ฉํ๋ฐ์ดํฐ ํ์ผ ๋ฐ JPEG ํ์ผ์ ์ฌ์ฉํ์ฌ DICOM ์ธ์คํด์ค๋ฅผ ๋ง๋ค ์ ์์ต๋๋ค. Cloud Healthcare API๋ก ์ํํ ์ ์์ผ๋ฏ๋ก, DICOM ํ์ฑ ๋ฐ ์ง๋ ฌํ๋ฅผ ์ง์ ์ํํ์ง ์์ผ๋ ค๋ฉด JSON ๋ฉํ๋ฐ์ดํฐ ๋ฐ JPEG ํ์ผ์์ DICOM ์ธ์คํด์ค๋ฅผ ๋ง๋ญ๋๋ค.
์ด ๋ฐ์ดํฐ๋ฅผ ์ ์ฅํ๋ HTTP ์์ฒญ์๋ ์์ฒญ์ Content-Type
์ ๋ค์์ด ํฌํจ๋์ด์ผ ํฉ๋๋ค.
multipart/related
๋ฏธ๋์ด ์ ํ- MIME ์ ํ
application/dicom+json
boundary
๊ตฌ๋ถ ๊ธฐํธ
๋ค์ ์ํ์ JPEG ํ์ผ๋ก JSON ๋ฉํ๋ฐ์ดํฐ ํ์ผ์ ์ ์ฅํ๋ ๋ฐฉ๋ฒ์ ๋ณด์ฌ์ค๋๋ค.
curl
๋ค์ ์ํ์ ๊ธฐ์กด JPEG ์ด๋ฏธ์ง๊ฐ ์๋ค๊ณ ๊ฐ์ ํฉ๋๋ค.
JPEG ์ด๋ฏธ์ง๋ก JSON ๋ฉํ๋ฐ์ดํฐ ํ์ผ์ ์ ์ฅํ๋ ์์ ์ ๋ค์ ์ธ ๊ฐ์ง ๋จ๊ณ๋ก ๊ตฌ์ฑ๋ฉ๋๋ค.
- JPEG ์ด๋ฏธ์ง๊ฐ ํฌํจ๋ DICOM ์ธ์คํด์ค์ JSON ํํ์ด ํฌํจ๋ ํ์ผ์ ๋ง๋ญ๋๋ค. ํ ํ๋ฆฟ ํ์ผ์ ์๋์ ์ ๊ณต๋ฉ๋๋ค.
3๊ฐ์ ๊ฒฝ๊ณ ํ์ผ์ ๋ง๋ญ๋๋ค.
opening.file
: JSON ๋ฉํ๋ฐ์ดํฐ ํ์ผ์ ์์ ๊ฒฝ๊ณ๋ฅผ ํฌํจํฉ๋๋ค.middle.file
: JPEG ์ด๋ฏธ์ง์ ์ค๊ฐ ๊ฒฝ๊ณ๋ฅผ ํฌํจํฉ๋๋ค.closing.file
: ๋ฉ์์ง์ ๋ชจ๋ ๋ถ๋ถ์ ๋ํ ์ข ๋ฃ ๊ฒฝ๊ณ๋ฅผ ํฌํจํฉ๋๋ค.
๊ฒฝ๊ณ ํ์ผ ๋ด์์ JSON ๋ฉํ๋ฐ์ดํฐ ํ์ผ ๋ฐ JPEG ์ด๋ฏธ์ง๋ฅผ ๋ฌถ์ด์
multipart-request.file
์ด๋ผ๋ ํ์ผ์ ๋ง๋ญ๋๋ค.
JSON ๋ฉํ๋ฐ์ดํฐ ํ ํ๋ฆฟ ํ์ผ์ ๊ธฐ๋ณธ์ ์ผ๋ก ์ ๊ณต๋๋ ๋ค์ ๊ฐ์ ํ์ธํฉ๋๋ค.
- ์ ์ก ๊ตฌ๋ฌธ UID(
1.2.840.10008.1.2.4.50
)๋ ์ ์ก ๊ตฌ๋ฌธ์ JPEG ๊ธฐ์ค์ผ๋ก ์ง์ ํฉ๋๋ค. ๋๋ถ๋ถ์ JPEG ์ด๋ฏธ์ง๋ JPEG ๊ธฐ์ค ํ์์ ๋๋ค. ์ฌ์ง ํด์ ๊ฐ(YBR_FULL_422
)์ ์ด๋ฏธ์ง๊ฐ ๊ทธ๋ ์ด ์ค์ผ์ผ์ด ์๋ ์ปฌ๋ฌ๋ผ๋ ๊ฒ์ ๋ํ๋ ๋๋ค. BulkDataUri
๋ ์ด๋ฏธ์ง์ ์์ ์ค๋ช ์์ด๊ณ , ํ ํ๋ฆฟ์์jpeg-image
๋ก ์ค์ ๋ฉ๋๋ค. ์ด ๊ฐ์ ์ด๋ฏธ์ง ๊ฒฝ๊ณ๋ฅผ ๋ง๋ค ๋ ์ฌ์ฉ๋ฉ๋๋ค.
SOP_CLASS_UID, SOP_INSTANCE_UID, STUDY_INSTANCE_UID, SERIES_INSTANCE_UID ๊ฐ์ ๋ง์นจํ๋ก ๊ตฌ๋ถ๋ ์ซ์ ๊ฐ์ผ ์ ์์ต๋๋ค. DICOM์ ์ธ์คํด์ค, ํ์, ์ฐ๊ตฌ, ์๋ฆฌ์ฆ์ ๋ํด ์๋ณ์ ๊ณ์ธต์ ์ฌ์ฉํ๋ฏ๋ก, ์ด๋ฌํ ๋ณ์์ ๋ํด ๋ ผ๋ฆฌ์ ์ธ ์๋ณ์ ์ธํธ๋ฅผ ์ ํํฉ๋๋ค.
SOP Class UID๋ฅผ ์ ์ฅ๋๋ ์ด๋ฏธ์ง ์ ํ์ ์ง์ ํ๋ ํ์ค SOP ํด๋์ค ํ ์ด๋ธ์ ๊ฐ์ผ๋ก ๋ฐ๊ฟ๋๋ค.
Rows๋ฅผ JPEG ์ด๋ฏธ์ง์ ์ธ๋ก ๋์ด(ํฝ์ )๋ก ๋ฐ๊ฟ๋๋ค. Columns๋ฅผ JPEG ์ด๋ฏธ์ง์ ๊ฐ๋ก ๋๋น(ํฝ์ )๋ก ๋ฐ๊ฟ๋๋ค.
๋ค์ ๋จ๊ณ๋ฅผ ์๋ฃํฉ๋๋ค.
๋ค์ ํ ์คํธ๋ฅผ
instance.json
์ด๋ผ๋ ํ์ผ์ ์ ์ฅํ๊ณ , ์ง์ ๋ ๊ฒฝ์ฐ ๋ณ์๋ฅผ ๋ฐ๊ฟ๋๋ค.[{ "00020010":{"vr":"UI","Value":["1.2.840.10008.1.2.4.50"]}, "00080005":{"vr":"CS","Value":["ISO_IR 192"]}, "00080016":{"vr":"UI","Value":["SOP_CLASS_UID"]}, "00080018":{"vr":"UI","Value":["SOP_INSTANCE_UID"]}, "0020000D":{"vr":"UI","Value":["STUDY_INSTANCE_UID"]}, "0020000E":{"vr":"UI","Value":["SERIES_INSTANCE_UID"]}, "00280002":{"vr":"US","Value":[3]}, "00280004":{"vr":"CS","Value":["YBR_FULL_422"]}, "00280006":{"vr":"US","Value":[0]}, "00280008":{"vr":"IS","Value":[1]}, "00280010":{"vr":"US","Value":[Rows]}, "00280011":{"vr":"US","Value":[Columns]}, "00280100":{"vr":"US","Value":[8]}, "00280101":{"vr":"US","Value":[8]}, "00280102":{"vr":"US","Value":[7]}, "00280103":{"vr":"US","Value":[0]}, "7FE00010":{"vr":"OB","BulkDataURI":"jpeg-image"} }]
์์(JSON ๋ฉํ๋ฐ์ดํฐ), ์ค๊ฐ(JPEG ์ด๋ฏธ์ง), ์ข ๋ฃ ๊ฒฝ๊ณ๋ฅผ ๋ง๋ค๊ธฐ ์ํด ๋ค์ ๋ช ๋ น์ด๋ฅผ ์คํํฉ๋๋ค.
echo -ne "--DICOMwebBoundary\r\nContent-Type: application/dicom+json\r\n\r\n" > opening.file echo -ne "\r\n--DICOMwebBoundary\r\nContent-Location: jpeg-image\r\nContent-Type: image/jpeg; transfer-syntax=1.2.840.10008.1.2.4.50\r\n\r\n" > middle.file echo -ne "\r\n--DICOMwebBoundary--" > closing.file
์ค๊ฐ ๋ฐ ์ข ๋ฃ ๊ฒฝ๊ณ ๋ด์์ JPEG ์ด๋ฏธ์ง๋ฅผ ๋ํํฉ๋๋ค. Cloud Healthcare API๋ก ์ ์กํ๋ ์ถ๋ ฅ ํ์ผ์
multipart-request.file
์ด๋ผ๊ณ ๋ถ๋ฆ ๋๋ค.cat opening.file instance.json middle.file image.jpg closing.file > multipart-request.file
POST
์์ฒญ์ ์ํํ๊ณ ๋ค์ ์ ๋ณด๋ฅผ ์ง์ ํฉ๋๋ค.- ์์ ๋ฐ์ดํฐ ์ธํธ์ ์ด๋ฆ
- DICOM ์ ์ฅ์์ ์ด๋ฆ
multipart-request.file
ํ์ผ- ์ก์ธ์ค ํ ํฐ
๋ค์ ์ํ์ curl
์ ์ฌ์ฉํ๋ POST
์์ฒญ์ ๋ณด์ฌ์ค๋๋ค.
curl -X POST \ -H "Content-Type: multipart/related; type=\"application/dicom+json\"; boundary=DICOMwebBoundary" \ -H "Authorization: Bearer $(gcloud auth application-default print-access-token)" \ https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/dicomStores/DICOM_STORE_ID/dicomWeb/studies \ --data-binary @multipart-request.file
์์ฒญ์ด ์ฑ๊ณตํ๋ฉด ์๋ฒ๊ฐ XML ํ์์ผ๋ก ์๋ต์ ๋ฐํํฉ๋๋ค.
<NativeDicomModel> <DicomAttribute tag="00081190" vr="UR" keyword="RetrieveURL"> <Value number="1">https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/dicomStores/DICOM_STORE_ID/dicomWeb/studies/STUDY_INSTANCE_UID</Value> </DicomAttribute> <DicomAttribute tag="00081199" vr="SQ" keyword="ReferencedSOPSequence"> <Item number="1"> <DicomAttribute tag="00081150" vr="UI" keyword="ReferencedSOPClassUID"> <Value number="1">SOP_CLASS_UID</Value> </DicomAttribute> <DicomAttribute tag="00081155" vr="UI" keyword="ReferencedSOPInstanceUID"> <Value number="1">SOP_INSTANCE_UID</Value> </DicomAttribute> <DicomAttribute tag="00081190" vr="UR" keyword="RetrieveURL"> <Value number="1">https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/dicomStores/DICOM_STORE_ID/dicomWeb/studies/STUDY_INSTANCE_UID/series/SERIES_INSTANCE_UID/instances/INSTANCE_UID</Value> </DicomAttribute> </Item> </DicomAttribute> </NativeDicomModel>
DICOMweb CLI ์ฌ์ฉ
๋ค์ ์ํ์ Cloud Healthcare API DICOMweb CLI๋ฅผ ์ฌ์ฉํ์ฌ ํ๋ ์ด์์ DICOM ์ธ์คํด์ค๋ฅผ ์ ์ฅํ๋ ๋ฐฉ๋ฒ์ ๋ณด์ฌ์ค๋๋ค. DICOMweb CLI GitHub ์ ์ฅ์์๋ ์ฌ์ฉ ๊ฐ๋ฅํ ์ํ์ด ๋ ์์ต๋๋ค.
๋จ์ผ DICOM ์ธ์คํด์ค ์ ์ฅ:
dcmweb \ https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/dicomStores/DICOM_STORE_ID/dicomWeb \ store DCM_FILE
์์ฒญ์ด ์ฑ๊ณตํ๋ฉด ์๋ฒ๊ฐ ๋ค์ ์ํ๊ณผ ๋น์ทํ ์๋ต์ ๋ฐํํฉ๋๋ค.
TIMESTAMP -- DCM_FILE.dcm uploaded as https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/dicomStores/DICOM_STORE_ID/dicomWeb/studies/STUDY_INSTANCE_UID/series/SERIES_INSTANCE_UID TIMESTAMP -- INSTANCE_UID TIMESTAMP -- Transferred SIZE in COUNT files
์์ผ๋ ์นด๋๋ฅผ ์ฌ์ฉํ์ฌ ์ฌ๋ฌ ํ์ผ์ ๋ณ๋ ฌ๋ก ์ ์ฅ:
๋ค์ ์ํ์ ํ์ฌ ์๋ ์ค์ธ ๋๋ ํฐ๋ฆฌ์์ ์ฌ๋ฌ DICOM ํ์ผ์ ๋ณ๋ ฌ๋ก ๋ฐ๋ณตํด์ ์ ์ฅํ๋ ๋ฐฉ๋ฒ์ ๋ณด์ฌ์ค๋๋ค. ํ์ผ์ ๋ณ๋ ฌ๋ก ์ ์ฅํ๋ ค๋ฉด -m
ํ๋๊ทธ๋ฅผ ์ถ๊ฐํฉ๋๋ค.
dcmweb -m \ https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/dicomStores/DICOM_STORE_ID/dicomWeb \ store "./**.dcm"
์์ฒญ์ด ์ฑ๊ณตํ๋ฉด ์๋ฒ๊ฐ ๋ค์ ์ํ๊ณผ ๋น์ทํ ์๋ต์ ๋ฐํํฉ๋๋ค.
TIMESTAMP -- DCM_FILE_1.dcm uploaded as https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/dicomStores/DICOM_STORE_ID/dicomWeb/studies/STUDY_INSTANCE_UID/series/SERIES_INSTANCE_UID TIMESTAMP -- INSTANCE_UID TIMESTAMP -- DCM_FILE_2.dcm uploaded as https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/dicomStores/DICOM_STORE_ID/dicomWeb/studies/STUDY_INSTANCE_UID/series/SERIES_INSTANCE_UID TIMESTAMP -- INSTANCE_UID TIMESTAMP -- DCM_FILE_3.dcm uploaded as https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/dicomStores/DICOM_STORE_ID/dicomWeb/studies/STUDY_INSTANCE_UID/series/SERIES_INSTANCE_UID TIMESTAMP -- INSTANCE_UID ... TIMESTAMP -- Transferred SIZE in COUNT files
DICOM ๋ฐ์ดํฐ ๊ฒ์
์ฐ๊ตฌ, ์๋ฆฌ์ฆ, ์ธ์คํด์ค, ํ๋ ์์ ๊ฒ์ํ ์ ์์ต๋๋ค. ๋ค์ ์ํ์ DICOM ์ ์ฅ์์์ ์ธ์คํด์ค๋ฅผ ๊ฒ์ํ๊ธฐ ์ํ ๊ฒ์ ํธ๋์ญ์ ์ ๊ตฌํ์ ๋ณด์ฌ์ค๋๋ค. ์์ธํ ๋ด์ฉ์ Cloud Healthcare API DICOM ์ ํฉ์ฑ ๋ช ์ธ์์ ๊ฒ์ ํธ๋์ญ์ ์ ์ฐธ์กฐํ์ธ์.
๋ค์ ์ํ์ DICOM ์ ์ฅ์์์ ์ธ์คํด์ค ๊ฒ์ ๋ฐฉ๋ฒ์ ๋ณด์ฌ์ค๋๋ค. ์์ธํ ๋ด์ฉ์ projects.locations.datasets.dicomStores.searchForInstances
๋ฅผ ์ฐธ์กฐํ์ธ์.
REST
์์ฒญ ๋ฐ์ดํฐ๋ฅผ ์ฌ์ฉํ๊ธฐ ์ ์ ๋ค์์ ๋ฐ๊ฟ๋๋ค.
PROJECT_ID
: Google Cloud ํ๋ก์ ํธ IDLOCATION
: ๋ฐ์ดํฐ ์ธํธ ์์นDATASET_ID
: DICOM ์ ์ฅ์์ ์์ ๋ฐ์ดํฐ ์ธํธDICOM_STORE_ID
: DICOM ์ ์ฅ์ 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/dicomStores/DICOM_STORE_ID/dicomWeb/instances"
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/dicomStores/DICOM_STORE_ID/dicomWeb/instances" | Select-Object -Expand Content
API ํ์๊ธฐ
๋ฉ์๋ ์ฐธ์กฐ ํ์ด์ง๋ฅผ ์ฝ๋๋ค. ํ์ด์ง ์ค๋ฅธ์ชฝ์ API ํ์๊ธฐ ํจ๋์ด ์ด๋ฆฝ๋๋ค. ์ด ๋๊ตฌ๋ฅผ ์ฌ์ฉํ์ฌ ์์ฒญ์ ๋ณด๋ผ ์ ์์ต๋๋ค. ๋ชจ๋ ํ์ ํ๋๋ฅผ ์ ๋ ฅํ๊ณ ์คํ์ ํด๋ฆญํฉ๋๋ค.
๋ค์๊ณผ ๋น์ทํ JSON ์๋ต์ด ํ์๋ฉ๋๋ค.
Go
Java
Node.js
Python
DICOM ํ๊ทธ๋ฅผ ์ฌ์ฉํ์ฌ ๊ฒ์
์ฟผ๋ฆฌ ๋งค๊ฐ๋ณ์ ํ์์ผ๋ก ์์ฒญ์ DICOM ํ๊ทธ๋ฅผ ์ถ๊ฐํ์ฌ ๊ฒ์์ ๋ฏธ์ธ ์กฐ์ ํ ์ ์์ต๋๋ค. ์๋ฅผ ๋ค์ด ํ์ ์ด๋ฆ์ด ํฌํจ๋ ์ฐ๊ตฌ๋ฅผ ๊ฒ์ํด์ผ ํ ์ ์์ต๋๋ค.
์์ ์ํ์์์ ๊ฐ์ด ๋ค์ ์ํ์ DICOM ์ ์ฅ์์์ ์ฐ๊ตฌ๋ฅผ ๊ฒ์ํ๊ธฐ ์ํ ๊ฒ์ ํธ๋์ญ์ ๊ตฌํ์ ๋ณด์ฌ์ค๋๋ค. ํ์ง๋ง ์ด ์ํ์ ํ์ ์ด๋ฆ์ด 'Sally Zhang'์ธ ์ฐ๊ตฌ๋ฅผ ๊ฒ์ํ๋ ๋ฐฉ๋ฒ์ ๋ณด์ฌ์ค๋๋ค.
๋ค์ ์ํ์ ํ์ ์ด๋ฆ์ด ๋์ด๋ DICOM ์ธ์คํด์ค์ ๋ฉํ๋ฐ์ดํฐ ๋ถ๋ถ์ ๋ณด์ฌ์ค๋๋ค.
...
{
"vr": "PN",
"Value": [
{
"Alphabetic": "Sally Zhang"
}
]
}
...
DICOM ์ ์ฅ์์์ ํ์์ ๊ด๋ จ๋ ์ฐ๊ตฌ๋ฅผ ๊ฒ์ํ๋ ค๋ฉด PatientName
DICOM ํ๊ทธ๋ก ๊ฒ์ํ๋ ์์ฒญ์ ์ฟผ๋ฆฌ ๋งค๊ฐ๋ณ์๋ฅผ ์ถ๊ฐํฉ๋๋ค.
Cloud Healthcare API์์ ์ง์๋๋ ๊ฒ์ ๋งค๊ฐ๋ณ์ ๋ชฉ๋ก์ ๋ณด๋ ค๋ฉด ๊ฒ์ ํธ๋์ญ์
๋ฌธ์๋ฅผ ์ฐธ์กฐํ์ธ์.
REST
์์ฒญ ๋ฐ์ดํฐ๋ฅผ ์ฌ์ฉํ๊ธฐ ์ ์ ๋ค์์ ๋ฐ๊ฟ๋๋ค.
PROJECT_ID
: Google Cloud ํ๋ก์ ํธ IDLOCATION
: ๋ฐ์ดํฐ ์ธํธ ์์นDATASET_ID
: DICOM ์ ์ฅ์์ ์์ ๋ฐ์ดํฐ ์ธํธDICOM_STORE_ID
: DICOM ์ ์ฅ์ 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/dicomStores/DICOM_STORE_ID/dicomWeb/studies?PatientName=Sally%20Zhang"
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/dicomStores/DICOM_STORE_ID/dicomWeb/studies?PatientName=Sally%20Zhang" | Select-Object -Expand Content
API ํ์๊ธฐ
๋ฉ์๋ ์ฐธ์กฐ ํ์ด์ง๋ฅผ ์ฝ๋๋ค. ํ์ด์ง ์ค๋ฅธ์ชฝ์ API ํ์๊ธฐ ํจ๋์ด ์ด๋ฆฝ๋๋ค. ์ด ๋๊ตฌ๋ฅผ ์ฌ์ฉํ์ฌ ์์ฒญ์ ๋ณด๋ผ ์ ์์ต๋๋ค. ๋ชจ๋ ํ์ ํ๋๋ฅผ ์ ๋ ฅํ๊ณ ์คํ์ ํด๋ฆญํฉ๋๋ค.
๋ค์๊ณผ ๋น์ทํ JSON ์๋ต์ด ํ์๋ฉ๋๋ค.
Go
Java
Node.js
Python
DICOMweb CLI ์ฌ์ฉ
๋ค์ ์ํ์ Cloud Healthcare API DICOMweb CLI๋ฅผ ์ฌ์ฉํ์ฌ DICOM ์ ์ฅ์์์ ์ธ์คํด์ค๋ฅผ ๊ฒ์ํ๋ ๋ฐฉ๋ฒ์ ๋ณด์ฌ์ค๋๋ค. ๊ฒ์ ํํฐ๋ง ๋ฐฉ๋ฒ์ ํฌํจํ์ฌ DICOMweb CLI GitHub ์ ์ฅ์์์ ์ฌ์ฉ ๊ฐ๋ฅํ ์ํ์ด ๋ ์์ต๋๋ค.
dcmweb \ https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/dicomStores/DICOM_STORE_ID/dicomWeb \ search instances
์์ฒญ์ด ์ฑ๊ณตํ๋ฉด ์๋ฒ๊ฐ JSON ํ์์ผ๋ก ์๋ต์ ๋ฐํํฉ๋๋ค.
[ { "00080005":{ "vr":"CS", "Value":[ "CODE_STRING" ] }, "00080016":{ "vr":"UI", "Value":[ "UNIQUE_IDENTIFIER" ] }, "00080018":{ "vr":"UI", "Value":[ "UNIQUE_IDENTIFIER" ] }, "00080020":{ "vr":"DA", "Value":[ "DATE_TIME" ] }, "00080030":{ "vr":"TM", "Value":[ "TIME" ] }, "00080060":{ "vr":"CS", "Value":[ "CODE_STRING" ] }, "0008103E":{ "vr":"LO", "Value":[ "LONG_STRING" ] }, "00100010":{ "vr":"PN", "Value":[ { "Alphabetic":"Anonymized" } ] }, }, ... ]
DICOM ๋ฐ์ดํฐ ๊ฒ์
Cloud Healthcare API๋ DICOM ์ ์ฅ์์์ ์ฐ๊ตฌ, ์๋ฆฌ์ฆ, ์ธ์คํด์ค, ํ๋ ์์ ๊ฒ์ํ๊ธฐ ์ํด ๊ฒ์ ํธ๋์ญ์ ์ ๊ตฌํํฉ๋๋ค.
์์ธํ ๋ด์ฉ์ Cloud Healthcare API DICOM ์ ํฉ์ฑ ๋ช ์ธ์์ ๊ฒ์ ํธ๋์ญ์ ์ ์ฐธ์กฐํ์ธ์.
์ฐ๊ตฌ ๊ฒ์
๋ค์ ์ํ์ ์ฐ๊ตฌ๋ฅผ ๊ฒ์ํ๋ ๋ฐฉ๋ฒ์ ๋ณด์ฌ์ค๋๋ค. ์์ธํ ๋ด์ฉ์ Cloud Healthcare API DICOM ์ ํฉ์ฑ ๋ช ์ธ์์ DICOM ์ฐ๊ตฌ/์๋ฆฌ์ฆ/์ธ์คํด์ค๋ฅผ ์ฐธ์กฐํ์ธ์.
์ถ๋ ฅ ํ์ผ์ ์ง์ ํ ๋ .multipart
์ ๊ฐ์ ํ์ฅ์๋ฅผ ์ฌ์ฉํฉ๋๋ค. ๊ทธ๋ฐ ํ ๋ฉํฐํํธ ํ์ผ์ ํ์ฑํ์ฌ ์ฐ๊ตฌ์์ ๊ฐ๋ณ ์๋ฆฌ์ฆ ๋ฐ ์ธ์คํด์ค๋ฅผ ๊ฐ์ ธ์ต๋๋ค.
์์ธํ ๋ด์ฉ์ projects.locations.datasets.dicomStores.studies.retrieveStudy
๋ฅผ ์ฐธ์กฐํ์ธ์.
curl
์ฐ๊ตฌ๋ฅผ ๊ฒ์ํ๋ ค๋ฉด GET
์์ฒญ์ ์ํํ๊ณ ๋ค์ ์ ๋ณด๋ฅผ ์ง์ ํฉ๋๋ค.
- ์์ ๋ฐ์ดํฐ ์ธํธ์ ์ด๋ฆ
- DICOM ์ ์ฅ์์ ์ด๋ฆ
- ์ฐ๊ตฌ ๊ณ ์ ์๋ณ์(UID)
- ์ถ๋ ฅ ํ์ผ
- ์ก์ธ์ค ํ ํฐ
๋ค์ ์ํ์ curl
์ ์ฌ์ฉํ๋ GET
์์ฒญ์ ๋ณด์ฌ์ค๋๋ค.
curl -X GET \ -H "Authorization: Bearer $(gcloud auth application-default print-access-token)" \ -H "Accept: multipart/related; type=application/dicom; transfer-syntax=*" \ "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/dicomStores/DICOM_STORE_ID/dicomWeb/studies/STUDY_INSTANCE_UID" \ --output FILENAME.multipart
์์ฒญ์ด ์ฑ๊ณตํ๋ฉด DICOM ํ์ผ์ด ๋จธ์ ์ ๊ธฐ๋ก๋ฉ๋๋ค.
PowerShell
์ฐ๊ตฌ๋ฅผ ๊ฒ์ํ๋ ค๋ฉด GET
์์ฒญ์ ์ํํ๊ณ ๋ค์ ์ ๋ณด๋ฅผ ์ง์ ํฉ๋๋ค.
- ์์ ๋ฐ์ดํฐ ์ธํธ์ ์ด๋ฆ
- DICOM ์ ์ฅ์์ ์ด๋ฆ
- ์ฐ๊ตฌ ๊ณ ์ ์๋ณ์(UID)
- ์ถ๋ ฅ ํ์ผ
- ์ก์ธ์ค ํ ํฐ
๋ค์ ์ํ์ Windows PowerShell์ ์ฌ์ฉํ GET
์์ฒญ์ ๋ณด์ฌ์ค๋๋ค.
$cred = gcloud auth application-default print-access-token $headers = @{ Authorization = "Bearer $cred"; Accept = "multipart/related; type=application/dicom; transfer-syntax=*" } Invoke-WebRequest ` -Method Get ` -Headers $headers ` -Uri "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/dicomStores/DICOM_STORE_ID/dicomWeb/studies/STUDY_INSTANCE_UID" | Select-Object -Expand Content -OutFile FILENAME.multipart `
์์ฒญ์ด ์ฑ๊ณตํ๋ฉด DICOM ํ์ผ์ด ๋จธ์ ์ ๊ธฐ๋ก๋ฉ๋๋ค.
Go
Java
Node.js
Python
์ธ์คํด์ค ๊ฒ์
๋ค์ ์ํ์ ์ธ์คํด์ค ๊ฒ์ ๋ฐฉ๋ฒ์ ๋ณด์ฌ์ค๋๋ค. ์์ธํ ๋ด์ฉ์ Cloud Healthcare API DICOM ์ ํฉ์ฑ ๋ช ์ธ์์ DICOM ์ธ์คํด์ค๋ฅผ ์ฐธ์กฐํ์ธ์.
์ธ์คํด์ค๋ฅผ ๊ฒ์ํ ๋ Accept: application/dicom
HTTP ํค๋๋ฅผ ์ฌ์ฉํ๋ฉด ๋ฉํฐํํธ ๊ฒฝ๊ณ๋ฅผ ํ์ฑํ ํ์๊ฐ ์์ต๋๋ค. transfer-syntax=*
๋ฅผ ์ถ๊ฐํ๋ฉด ์๋ ์ ์ฅ๋ ํ์์ผ๋ก ํ์ผ์ ๋ฐํํ์ฌ ํธ๋์ค์ฝ๋ฉ์ด ํ์ํ์ง ์์ต๋๋ค.
์์ธํ ๋ด์ฉ์ projects.locations.datasets.dicomStores.studies.series.instances.retrieveInstance
๋ฅผ ์ฐธ์กฐํ์ธ์.
curl
์ธ์คํด์ค๋ฅผ ๊ฒ์ํ๋ ค๋ฉด GET
์์ฒญ์ ์ํํ๊ณ ๋ค์ ์ ๋ณด๋ฅผ ์ง์ ํฉ๋๋ค.
- ์์ ๋ฐ์ดํฐ ์ธํธ์ ์ด๋ฆ
- DICOM ์ ์ฅ์์ ์ด๋ฆ
- ์ฐ๊ตฌ ๊ณ ์ ์๋ณ์(UID)
- ์๋ฆฌ์ฆ UID, ์ธ์คํด์ค UID
- ์ถ๋ ฅ ํ์ผ ์ด๋ฆ
- ์ก์ธ์ค ํ ํฐ
๋ค์ ์ํ์ curl
์ ์ฌ์ฉํ๋ GET
์์ฒญ์ ๋ณด์ฌ์ค๋๋ค.
curl -X GET \ -H "Authorization: Bearer $(gcloud auth application-default print-access-token)" \ -H "Accept: application/dicom; transfer-syntax=*" \ "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/dicomStores/DICOM_STORE_ID/dicomWeb/studies/STUDY_INSTANCE_UID/series/SERIES_INSTANCE_UID/instances/INSTANCE_UID" \ --output FILENAME.dcm
์์ฒญ์ด ์ฑ๊ณตํ๋ฉด DICOM ํ์ผ์ด ๋จธ์ ์ ๊ธฐ๋ก๋ฉ๋๋ค.
PowerShell
์ธ์คํด์ค๋ฅผ ๊ฒ์ํ๋ ค๋ฉด GET
์์ฒญ์ ์ํํ๊ณ ๋ค์ ์ ๋ณด๋ฅผ ์ง์ ํฉ๋๋ค.
- ์์ ๋ฐ์ดํฐ ์ธํธ์ ์ด๋ฆ
- DICOM ์ ์ฅ์์ ์ด๋ฆ
- ์ฐ๊ตฌ ๊ณ ์ ์๋ณ์(UID)
- ์๋ฆฌ์ฆ UID
- ์ธ์คํด์ค UID
- ์ถ๋ ฅ ํ์ผ ์ด๋ฆ
- ์ก์ธ์ค ํ ํฐ
๋ค์ ์ํ์ Windows PowerShell์ ์ฌ์ฉํ GET
์์ฒญ์ ๋ณด์ฌ์ค๋๋ค.
$cred = gcloud auth application-default print-access-token $headers = @{ Authorization = "Bearer $cred"; Accept = "application/dicom; transfer-syntax=*" } Invoke-RestMethod ` -Method Get ` -Headers $headers ` -Uri "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/dicomStores/DICOM_STORE_ID/dicomWeb/studies/STUDY_INSTANCE_UID/series/SERIES_INSTANCE_UID/instances/INSTANCE_UID" -OutFile FILENAME.dcm `
์์ฒญ์ด ์ฑ๊ณตํ๋ฉด DICOM ํ์ผ์ด ๋จธ์ ์ ๊ธฐ๋ก๋ฉ๋๋ค.
Go
Java
Node.js
Python
์๋น์ ์ด๋ฏธ์ง ํ์ ๊ฒ์
๋ค์ ์ํ์ ๋ ๋๋ง๋ ๋ฆฌ์์ค์ ๋ํ Cloud Healthcare API ๊ตฌํ์ ์ฌ์ฉํ์ฌ JPEG ๋๋ PNG์ ๊ฐ์ ์๋น์ ์ด๋ฏธ์ง ํ์์ ๊ฒ์ํ๋ ๋ฐฉ๋ฒ์ ๋ณด์ฌ์ค๋๋ค. ์์ธํ ๋ด์ฉ์ Cloud Healthcare API DICOM ์ ํฉ์ฑ ๋ช ์ธ์์ ๋ ๋๋ง๋ ๋ฆฌ์์ค๋ฅผ ์ฐธ์กฐํ์ธ์.
์์ธํ ๋ด์ฉ์ projects.locations.datasets.dicomStores.studies.series.instances.retrieveRendered
๋ฅผ ์ฐธ์กฐํ์ธ์.
curl
์ด๋ฏธ์ง๋ฅผ ๊ฒ์ํ๋ ค๋ฉด GET
์์ฒญ์ ์ํํ๊ณ ๋ค์ ์ ๋ณด๋ฅผ ์ง์ ํฉ๋๋ค.
- ์์ ๋ฐ์ดํฐ ์ธํธ์ ์ด๋ฆ
- DICOM ์ ์ฅ์์ ์ด๋ฆ
- ์ฐ๊ตฌ ๊ณ ์ ์๋ณ์(UID)
- ์๋ฆฌ์ฆ UID
- ์ธ์คํด์ค UID
- ์ถ๋ ฅ ํ์ผ ์ด๋ฆ
- ์ก์ธ์ค ํ ํฐ
๋ค์ ์ํ์์๋ curl
์ ์ฌ์ฉํ์ฌ GET
์์ฒญ์ผ๋ก PNG ์ด๋ฏธ์ง๋ฅผ ๊ฒ์ํ๋ ๋ฐฉ๋ฒ์ ๋ณด์ฌ์ค๋๋ค.
curl -X GET \ -H "Authorization: Bearer $(gcloud auth application-default print-access-token)" \ -H "Accept: image/png" \ "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/dicomStores/DICOM_STORE_ID/dicomWeb/studies/STUDY_INSTANCE_UID/series/SERIES_INSTANCE_UID/instances/INSTANCE_UID/rendered" \ --output FILENAME.png
์์ฒญ์ด ์ฑ๊ณตํ๋ฉด PNG ํ์ผ์ด ๋จธ์ ์ ๊ธฐ๋ก๋ฉ๋๋ค.
PowerShell
์ด๋ฏธ์ง๋ฅผ ๊ฒ์ํ๋ ค๋ฉด GET
์์ฒญ์ ์ํํ๊ณ ๋ค์ ์ ๋ณด๋ฅผ ์ง์ ํฉ๋๋ค.
- ์์ ๋ฐ์ดํฐ ์ธํธ์ ์ด๋ฆ
- DICOM ์ ์ฅ์์ ์ด๋ฆ
- ์ฐ๊ตฌ ๊ณ ์ ์๋ณ์(UID)
- ์๋ฆฌ์ฆ UID
- ์ธ์คํด์ค UID
- ์ถ๋ ฅ ํ์ผ ์ด๋ฆ
- ์ก์ธ์ค ํ ํฐ
๋ค์ ์ํ์ Windows PowerShell์ ์ฌ์ฉํ์ฌ GET
์์ฒญ์ผ๋ก PNG ์ด๋ฏธ์ง๋ฅผ ๊ฒ์ํ๋ ๋ฐฉ๋ฒ์ ๋ณด์ฌ์ค๋๋ค.
$cred = gcloud auth application-default print-access-token $headers = @{ Authorization = "Bearer $cred"; Accept = "image/png" } Invoke-RestMethod ` -Method Get ` -Headers $headers ` -Uri "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/dicomStores/DICOM_STORE_ID/dicomWeb/studies/STUDY_INSTANCE_UID/series/SERIES_INSTANCE_UID/instances/INSTANCE_UID/rendered" -OutFile FILENAME.png `
์์ฒญ์ด ์ฑ๊ณตํ๋ฉด PNG ํ์ผ์ด ๋จธ์ ์ ๊ธฐ๋ก๋ฉ๋๋ค.
Go
Java
Node.js
Python
๋ฉํ๋ฐ์ดํฐ ๊ฒ์
์ฐ๊ตฌ ๋๋ ์๋ฆฌ์ฆ์์ ๋ชจ๋ ์ธ์คํด์ค์ ๋ํด ๋ฉํ๋ฐ์ดํฐ๋ฅผ ๊ฒ์ํ ์ ์์ต๋๋ค. ๋ค์ ์ํ์ ์ธ์คํด์ค์ ๋ํด ๋ฉํ๋ฐ์ดํฐ๋ฅผ ๊ฒ์ํ๋ ๋ฐฉ๋ฒ์ ๋ณด์ฌ์ค๋๋ค. ์์ธํ ๋ด์ฉ์ Cloud Healthcare API DICOM ์ ํฉ์ฑ ๋ช ์ธ์์ ๋ฉํ๋ฐ์ดํฐ ๋ฆฌ์์ค๋ฅผ ์ฐธ์กฐํ์ธ์.
์์ธํ ๋ด์ฉ์ projects.locations.datasets.dicomStores.studies.series.instances.retrieveMetadata
๋ฅผ ์ฐธ์กฐํ์ธ์.
retrieveMetadata
๋ฅผ ํธ์ถํ๋ฉด includefield=all
์ฟผ๋ฆฌ ๋งค๊ฐ๋ณ์๋ก ์ธ์คํด์ค๋ฅผ ๊ฒ์ํ ๋ ๋ฐํ๋๋ ๊ฒ๊ณผ ๋์ผํ ํ๋ ์งํฉ์ด ๋ฉ์๋๋ก ๋ฐํ๋ฉ๋๋ค. ์ ํ๋ฆฌ์ผ์ด์
์ด ์ง์ฐ ์๊ฐ์ ๋ฏผ๊ฐํ๊ณ ๋ชจ๋ ํ๋ ๋์ ํน์ ํ๋ ์งํฉ์ ๋ํด ๋ฉํ๋ฐ์ดํฐ๋ฅผ ๊ฒ์ํ๋ ค๋ ๊ฒฝ์ฐ์๋ retrieveMetadata
๋ฅผ ํธ์ถํ์ง ๋ง์ธ์. ๋์ searchForInstances
๋ฉ์๋ ์ค ํ๋๋ฅผ ํธ์ถํ๊ณ ํ๋๋ฅผ ์ง์ ํฉ๋๋ค. ๋ ์์ ํ๋ ์งํฉ์ด ์๋ต๋๊ณ ์์ ํ๋ ์งํฉ์ ์ง์ฐ ์๊ฐ์ ๋ฏผ๊ฐํ ์ ํ๋ฆฌ์ผ์ด์
์ ๋์์ด ๋ฉ๋๋ค.
retrieveMetadata
๋ ๊ธฐ๋ณธ์ ์ผ๋ก JSON ์๋ต์ ๋ฐํํฉ๋๋ค. XML ์๋ต์ ๋ฐํํ๋ ค๋ฉด ์์ฒญ์ Accept: multipart/related; type="application/dicom+xml"
HTTP ํค๋๋ฅผ ์ ๋ฌํฉ๋๋ค.
REST
์์ฒญ ๋ฐ์ดํฐ๋ฅผ ์ฌ์ฉํ๊ธฐ ์ ์ ๋ค์์ ๋ฐ๊ฟ๋๋ค.
PROJECT_ID
: Google Cloud ํ๋ก์ ํธ IDLOCATION
: ๋ฐ์ดํฐ ์ธํธ ์์นDATASET_ID
: DICOM ์ ์ฅ์์ ์์ ๋ฐ์ดํฐ ์ธํธDICOM_STORE_ID
: DICOM ์ ์ฅ์ IDSTUDY_INSTANCE_UID
: ์ฐ๊ตฌ ์ธ์คํด์ค ๊ณ ์ ์๋ณ์SERIES_INSTANCE_UID
: ์๋ฆฌ์ฆ ์ธ์คํด์ค ๊ณ ์ ์๋ณ์INSTANCE_UID
: ์ธ์คํด์ค ๊ณ ์ ์๋ณ์
์์ฒญ์ ๋ณด๋ด๋ ค๋ฉด ๋ค์ ์ต์ ์ค ํ๋๋ฅผ ์ ํํฉ๋๋ค.
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/dicomStores/DICOM_STORE_ID/dicomWeb/studies/STUDY_INSTANCE_UID/series/SERIES_INSTANCE_UID/instances/INSTANCE_UID/metadata"
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/dicomStores/DICOM_STORE_ID/dicomWeb/studies/STUDY_INSTANCE_UID/series/SERIES_INSTANCE_UID/instances/INSTANCE_UID/metadata" | Select-Object -Expand Content
API ํ์๊ธฐ
๋ฉ์๋ ์ฐธ์กฐ ํ์ด์ง๋ฅผ ์ฝ๋๋ค. ํ์ด์ง ์ค๋ฅธ์ชฝ์ API ํ์๊ธฐ ํจ๋์ด ์ด๋ฆฝ๋๋ค. ์ด ๋๊ตฌ๋ฅผ ์ฌ์ฉํ์ฌ ์์ฒญ์ ๋ณด๋ผ ์ ์์ต๋๋ค. ๋ชจ๋ ํ์ ํ๋๋ฅผ ์ ๋ ฅํ๊ณ ์คํ์ ํด๋ฆญํฉ๋๋ค.
๋ค์๊ณผ ๋น์ทํ JSON ์๋ต์ด ํ์๋ฉ๋๋ค.
์ผ๊ด ๋ฐ์ดํฐ ๊ฒ์
DICOM ์ธ์คํด์ค๋ ์ฌ๋ฌ ๋ฐ์ดํฐ ์์๋ก ๊ตฌ์ฑ๋ฉ๋๋ค. ๋๋ถ๋ถ์ ๋ฐ์ดํฐ ์์์๋ ํ์ ์ด๋ฆ์ด๋ ์ฐ๊ตฌ ๋ ์ง์ ๊ฐ์ ์์ ๋ฉํ๋ฐ์ดํฐ๊ฐ ํฌํจ๋์ง๋ง ์ผ๋ถ์๋ 'bulkdata'๋ผ๊ณ ๋ ํ๋ ๋ง์ ์์ ๋ฐ์ดํฐ๊ฐ ํฌํจ๋ ์ ์์ต๋๋ค. Cloud Healthcare API์์ '๋๋ ๋ฐ์ดํฐ'๊ฐ ๋ฌด์์ธ์ง ์์๋ณด๋ ค๋ฉด ๋๋ ๋ฐ์ดํฐ ์ ์๋ฅผ ์ฐธ๊ณ ํ์ธ์.
Cloud Healthcare API๋ ์ด๋ฌํ '๋๋ ๋ฐ์ดํฐ' ์์๋ฅผ ๋ณ๋๋ก ์ฒ๋ฆฌํฉ๋๋ค. ์์ ๊ฐ ๋ฐ์ดํธ๋ฅผ ๊ฐ์ ธ์ค๋ ค๋ฉด ๋ค์ ์ต์
์ค ํ๋๋ฅผ ์ฌ์ฉํ์ฌ projects.locations.datasets.dicomStores.studies.series.instances.bulkdata.retrieveBulkdata
๋ฅผ ํธ์ถํฉ๋๋ค.
์ง์ ๊ฒ์: ์ฐ๊ตฌ, ์๋ฆฌ์ฆ, ์ธ์คํด์ค, ๊ฒ์ํ๋ ค๋ ํน์ ํ๊ทธ์ ์๋ณ์๋ฅผ ์๊ณ ์๋ ๊ฒฝ์ฐ ์์ฒญ URL์ ๊ตฌ์ฑํ๊ณ
retrieveBulkdata
๋ฅผ ์ง์ ํธ์ถํ ์ ์์ต๋๋ค. ์ง์ ๊ฒ์์ ๋จ์ผ API ํธ์ถ๋ง ํ์ํ๋ฏ๋ก ๊ฐ์ฅ ํจ์จ์ ์ธ ๋ฐฉ๋ฒ์ ๋๋ค.DICOM ์ธ์คํด์ค ๋ฉํ๋ฐ์ดํฐ๋ฅผ ํตํ ๊ฒ์: ์ธ์คํด์ค์ ๋ฉํ๋ฐ์ดํฐ๋ฅผ ๊ฒ์ํ๋ฉด ์ง์๋๋ ๊ฐ bulkdata ํ๊ทธ์ ๋ํ
BulkDataURI
์ด ์๋ต์ ํฌํจ๋ฉ๋๋ค. ์ด URI๋ฅผ ์ฌ์ฉํ์ฌretrieveBulkdata
์์ฒญ์ ์คํํ ์ ์์ต๋๋ค. ์ด ๋ฉ์๋๋ ๊ฐ์ ธ์ค๊ธฐ ์ ์ ์ธ์คํด์ค์ ์ฌ์ฉํ ์ ์๋ ๋๋ ๋ฐ์ดํฐ ํ๊ทธ๋ฅผ ๊ฒ์ํ๋ ๋ฐ ์ ์ฉํฉ๋๋ค.
๋ค์ ์ํ์ ์ง์ ๊ฒ์์ ์ฌ์ฉํ์ฌ ๋๋ ๋ฐ์ดํฐ๋ฅผ ๊ฒ์ํ๋ ๋ฐฉ๋ฒ์ ๋ณด์ฌ์ค๋๋ค.
REST
์์ฒญ ๋ฐ์ดํฐ๋ฅผ ์ฌ์ฉํ๊ธฐ ์ ์ ๋ค์์ ๋ฐ๊ฟ๋๋ค.
PROJECT_ID
: Google Cloud ํ๋ก์ ํธ IDLOCATION
: ๋ฐ์ดํฐ ์ธํธ ์์นDATASET_ID
: DICOM ์ ์ฅ์์ ์์ ๋ฐ์ดํฐ ์ธํธDICOM_STORE_ID
: DICOM ์ ์ฅ์ IDSTUDY_INSTANCE_UID
: ์ฐ๊ตฌ ์ธ์คํด์ค ๊ณ ์ ์๋ณ์SERIES_INSTANCE_UID
: ์๋ฆฌ์ฆ ์ธ์คํด์ค ๊ณ ์ ์๋ณ์INSTANCE_UID
: ์ธ์คํด์ค ๊ณ ์ ์๋ณ์BULK_DATA_PATH
: ๋๋ ๋ฐ์ดํฐ ํ๊ทธ์ ๋๋ค(์:PixelData
์ ๊ฒฝ์ฐ7FE00010
). ํญ๋ชฉ ์์ธ i์์ ์ํ์ค (BBBB,BBBB) ๋ด์ ํ๊ทธ (AAAA,AAAA)์ ๊ฒฝ์ฐ ๊ฒฝ๋ก๋BBBBBBBB/i/AAAAAAAA
์ ๋๋ค.OUTPUT_FILE_PATH
: DAT ํ์ผ์ ๋๋ ๋ฐ์ดํฐ๊ฐ ์ ์ฅ๋ ๋ก์ปฌ ๋จธ์ ์ ๊ฒฝ๋ก์ ๋๋ค..dat
ํ์ฅ ํ๋ก๊ทธ๋จ์ ์ง์ ํด์ผ ํฉ๋๋ค.
์์ฒญ์ ๋ณด๋ด๋ ค๋ฉด ๋ค์ ์ต์ ์ค ํ๋๋ฅผ ์ ํํฉ๋๋ค.
curl
๋ค์ ๋ช ๋ น์ด๋ฅผ ์คํํฉ๋๋ค.
curl -X GET \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
--output OUTPUT_FILE_PATH \
"https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/dicomStores/DICOM_STORE_ID/dicomWeb/studies/STUDY_INSTANCE_UID/series/SERIES_INSTANCE_UID/instances/INSTANCE_UID/bulkdata/BULK_DATA_PATH"
PowerShell
๋ค์ ๋ช ๋ น์ด๋ฅผ ์คํํฉ๋๋ค.
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }
Invoke-WebRequest `
-Method GET `
-Headers $headers `
-OutFile OUTPUT_FILE_PATH `
-Uri "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/dicomStores/DICOM_STORE_ID/dicomWeb/studies/STUDY_INSTANCE_UID/series/SERIES_INSTANCE_UID/instances/INSTANCE_UID/bulkdata/BULK_DATA_PATH"
DICOMweb CLI ์ฌ์ฉ
๋ค์ ์ํ์์๋ Cloud Healthcare API DICOMweb CLI๋ฅผ ์ฌ์ฉํ์ฌ DICOM ์ ์ฅ์์์ ๋ชจ๋ ์ธ์คํด์ค๋ฅผ ๊ฒ์ํ๊ณ ๋จธ์ ์์ ํ์ฌ ์์ ๋๋ ํฐ๋ฆฌ์ ์ ์ฅํ๋ ๋ฐฉ๋ฒ์ ๋ณด์ฌ์ค๋๋ค. DICOMweb CLI GitHub ์ ์ฅ์์๋ ์ฌ์ฉ ๊ฐ๋ฅํ ์ํ์ด ๋ ์์ต๋๋ค.
dcmweb \ https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/dicomStores/DICOM_STORE_ID/dicomWeb \ retrieve
์์ฒญ์ด ์ฑ๊ณตํ๋ฉด ์๋ฒ๊ฐ ๋ค์๊ณผ ๋น์ทํ ์๋ต์ ๋ฐํํ๊ณ DICOM ํ์ผ์ด ๋จธ์ ์ ๊ธฐ๋ก๋ฉ๋๋ค.
TIMESTAMP -- Saving files into ./ TIMESTAMP -- Transferred SIZE in COUNT files
์ฐ๊ตฌ, ์๋ฆฌ์ฆ ๋๋ ์ธ์คํด์ค ์ญ์
Cloud Healthcare API๋ DICOM ์ฐ๊ตฌ, ์๋ฆฌ์ฆ, ์ธ์คํด์ค๋ฅผ ์ญ์ ํ๊ธฐ ์ํ ๋ ์ ์น ์๋น์ค๋ฅผ ๊ตฌํํฉ๋๋ค. ์ด ์๋น์ค๋ DICOMweb ํ์ค ์๋น์ค์ ์ผ๋ถ๊ฐ ์๋๋๋ค. ์์ธํ ๋ด์ฉ์ Cloud Healthcare API DICOM ์ ํฉ์ฑ ๋ฌธ์ ์ญ์ ์น์ ์ ์ฐธ์กฐํ์ธ์.
์ฐ๊ตฌ ๋ฐ ์๋ฆฌ์ฆ์ ์ญ์ ์์ฒญ์ ์ฅ๊ธฐ ์คํ ์์ ์ ๋ฐํํฉ๋๋ค. ์์ ์ด ์๋ฃ๋๋ฉด ์ฐ๊ตฌ ๋๋ ์๋ฆฌ์ฆ์ ๋ชจ๋ ์ธ์คํด์ค๊ฐ ์ญ์ ๋ฉ๋๋ค.
์ธ์คํด์ค์ ์ญ์ ์์ฒญ์ ์ฅ๊ธฐ ์คํ ์์ ์ ๋ฐํํ์ง ์์ผ๋ฉฐ ๋์ ๋ค์๊ณผ ๊ฐ์ด ๋น ์๋ต ๋ณธ๋ฌธ์ ๋ฐํํฉ๋๋ค.
{}
๋ค์ ์ํ์ DICOM ์ฐ๊ตฌ๋ฅผ ์ญ์ ํ๋ ๋ฐฉ๋ฒ์ ๋ณด์ฌ์ค๋๋ค. ์์ธํ ๋ด์ฉ์ projects.locations.datasets.dicomStores.studies.delete
๋ฅผ ์ฐธ์กฐํ์ธ์.
REST
์ฐ๊ตฌ๋ฅผ ์ญ์ ํฉ๋๋ค.
์์ฒญ ๋ฐ์ดํฐ๋ฅผ ์ฌ์ฉํ๊ธฐ ์ ์ ๋ค์์ ๋ฐ๊ฟ๋๋ค.
PROJECT_ID
: Google Cloud ํ๋ก์ ํธ IDLOCATION
: ๋ฐ์ดํฐ ์ธํธ ์์นDATASET_ID
: DICOM ์ ์ฅ์์ ์์ ๋ฐ์ดํฐ ์ธํธDICOM_STORE_ID
: DICOM ์ ์ฅ์ IDSTUDY_INSTANCE_UID
: ์ฐ๊ตฌ ์ธ์คํด์ค ๊ณ ์ ์๋ณ์
์์ฒญ์ ๋ณด๋ด๋ ค๋ฉด ๋ค์ ์ต์ ์ค ํ๋๋ฅผ ์ ํํฉ๋๋ค.
curl
๋ค์ ๋ช ๋ น์ด๋ฅผ ์คํํฉ๋๋ค.
curl -X DELETE \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
"https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/dicomStores/DICOM_STORE_ID/dicomWeb/studies/STUDY_INSTANCE_UID"PowerShell
๋ค์ ๋ช ๋ น์ด๋ฅผ ์คํํฉ๋๋ค.
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }
Invoke-WebRequest `
-Method DELETE `
-Headers $headers `
-Uri "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/dicomStores/DICOM_STORE_ID/dicomWeb/studies/STUDY_INSTANCE_UID" | Select-Object -Expand ContentAPI ํ์๊ธฐ
๋ฉ์๋ ์ฐธ์กฐ ํ์ด์ง๋ฅผ ์ฝ๋๋ค. ํ์ด์ง ์ค๋ฅธ์ชฝ์ API ํ์๊ธฐ ํจ๋์ด ์ด๋ฆฝ๋๋ค. ์ด ๋๊ตฌ๋ฅผ ์ฌ์ฉํ์ฌ ์์ฒญ์ ๋ณด๋ผ ์ ์์ต๋๋ค. ๋ชจ๋ ํ์ ํ๋๋ฅผ ์ ๋ ฅํ๊ณ ์คํ์ ํด๋ฆญํฉ๋๋ค.
๋ค์๊ณผ ๋น์ทํ JSON ์๋ต์ด ํ์๋ฉ๋๋ค.
์ฅ๊ธฐ ์คํ ์์ ์ํ๋ฅผ ๊ฐ์ ธ์ต๋๋ค.
์์ฒญ ๋ฐ์ดํฐ๋ฅผ ์ฌ์ฉํ๊ธฐ ์ ์ ๋ค์์ ๋ฐ๊ฟ๋๋ค.
PROJECT_ID
: Google Cloud ํ๋ก์ ํธ IDLOCATION
: ๋ฐ์ดํฐ ์ธํธ ์์น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 ContentAPI ํ์๊ธฐ
๋ฉ์๋ ์ฐธ์กฐ ํ์ด์ง๋ฅผ ์ฝ๋๋ค. ํ์ด์ง ์ค๋ฅธ์ชฝ์ API ํ์๊ธฐ ํจ๋์ด ์ด๋ฆฝ๋๋ค. ์ด ๋๊ตฌ๋ฅผ ์ฌ์ฉํ์ฌ ์์ฒญ์ ๋ณด๋ผ ์ ์์ต๋๋ค. ๋ชจ๋ ํ์ ํ๋๋ฅผ ์ ๋ ฅํ๊ณ ์คํ์ ํด๋ฆญํฉ๋๋ค.
๋ค์๊ณผ ๋น์ทํ JSON ์๋ต์ด ํ์๋ฉ๋๋ค.
Go
Java
Node.js
Python
DICOMweb CLI ์ฌ์ฉ
๋ค์ ์ํ์ Cloud Healthcare API DICOMweb CLI๋ฅผ ์ฌ์ฉํ์ฌ ์ฐ๊ตฌ๋ฅผ ์ญ์ ํ๋ ๋ฐฉ๋ฒ์ ๋ณด์ฌ์ค๋๋ค.
dcmweb \ https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/dicomStores/DICOM_STORE_ID/dicomWeb \ delete studies/STUDY_INSTANCE_UID
์์ฒญ์ด ์ฑ๊ณตํ๋ฉด ์๋ฒ๋ ์ญ์ ๋๊ตฌ๊ฐ ์๋ฃ๋ ๋๊น์ง CLI ๋๊ตฌ๊ฐ ํด๋งํ๋ ์์ ์ ๋ฐํํฉ๋๋ค.
์ฐ๊ตฌ, ์๋ฆฌ์ฆ ๋๋ ์ธ์คํด์ค ์ ๋ฐ์ดํธ ๋๋ ํจ์น
DICOMweb ํ์ค์ DICOM ๋ฐ์ดํฐ๋ฅผ ์ ๋ฐ์ดํธํ๋ ๋ฐฉ๋ฒ์ ์ง์ ํ์ง ์์ง๋ง Cloud Healthcare API๋ ์์ง ํ ์ด ๋ฐ์ดํฐ๋ฅผ ์ ๋ฐ์ดํธํ๋ ์ฌ๋ฌ ๋ฐฉ๋ฒ์ ์ ๊ณตํฉ๋๋ค. ์ฌ์ฉ ๊ฐ๋ฅํ ๋ฐฉ๋ฒ๊ณผ ๊ฐ์ด๋๋ DICOM ์ฐ๊ตฌ, ์๋ฆฌ์ฆ, ์ธ์คํด์ค ์ ๋ฐ์ดํธ ๋ฐ ํจ์น๋ฅผ ์ฐธ๊ณ ํ์ธ์.