Halaman ini menjelaskan cara membuat, melihat, mencantumkan, dan menghapus data anotasi. Contoh data anotasi mencakup label dan tag untuk teks, gambar, dan audio kesehatan. Untuk ringkasan penyimpanan anotasi dan data anotasi, lihat Anotasi.
Membuat catatan anotasi
Sebelum dapat membuat data anotasi, Anda harus membuat penyimpanan anotasi.
Contoh berikut menunjukkan cara membuat data anotasi. Untuk mengetahui informasi selengkapnya,
lihat projects.locations.datasets.annotationStores.annotations.create
.
curl
Untuk membuat data anotasi, buat permintaan POST
dan berikan
informasi berikut:
- Nama set data induk
- Nama penyimpanan anotasi induk
- Sumber data anotasi
- Jenis data anotasi
- Token akses
Contoh berikut menunjukkan permintaan POST
menggunakan curl
yang membuat
data anotasi untuk gambar DICOM. Anotasi menggunakan kotak pembatas untuk menandai
dimensi bagian gambar dan memberi label pada area yang dibatasi dengan
nama "bounding-box". Contoh ini mengasumsikan bahwa Anda telah
menyimpan instance DICOM
di penyimpanan DICOM. Instance DICOM ini direferensikan di kolom name
dari
cloudHealthcareSource
.
curl -X POST \ -H "Authorization: Bearer $(gcloud auth application-default print-access-token)" \ -H "Content-Type: application/json; charset=utf-8" \ --data "{ 'annotationSource': { 'cloudHealthcareSource': { 'name': 'projects/PROJECT_ID/locations/REGION/datasets/DATASET_ID/dicomStores/DICOM_STORE_ID/dicomWeb/studies/STUDY_UID' } }, 'imageAnnotation': { 'boundingPolys': [ { 'vertices': [ { 'x': 100, 'y': 100 }, { 'x': 100, 'y': 400 }, { 'x': 400, 'y': 100 }, { 'x': 400, 'y': 400 } ], 'label': 'bounding-box' } ] } }" \ "https://healthcare.googleapis.com/v1beta1/projects/PROJECT_ID/locations/REGION/datasets/DATASET_ID/annotationStores/ANNOTATION_STORE_ID/annotations"
Jika permintaan berhasil, server akan menampilkan respons dalam format JSON:
{ "name": "projects/PROJECT_ID/locations/REGION/datasets/DATASET_ID/annotationStores/ANNOTATION_STORE_ID/annotations/ANNOTATION_ID", "annotationSource": { "cloudHealthcareSource": { "name": "projects/PROJECT_ID/locations/REGION/datasets/DATASET_ID/dicomStores/DICOM_STORE_ID/dicomWeb/studies/STUDY_UID" } }, "imageAnnotation": { "boundingPolys": [ { "vertices": [ { "x": 100, "y": 100 }, { "x": 100, "y": 400 }, { "x": 400, "y": 100 }, { "x": 400, "y": 400 } ], "label": "bounding-box" } ] } }
PowerShell
Untuk membuat data anotasi, buat permintaan POST
dan berikan
informasi berikut:
- Nama set data induk
- Nama penyimpanan anotasi induk
- Sumber data anotasi
- Jenis data anotasi
- Token akses
Contoh berikut menunjukkan permintaan POST
menggunakan Windows PowerShell yang membuat
data anotasi untuk gambar DICOM. Anotasi menggunakan kotak pembatas untuk menandai
dimensi bagian gambar dan memberi label pada area yang dibatasi dengan
nama "bounding-box". Contoh ini mengasumsikan bahwa Anda telah
menyimpan instance DICOM
di penyimpanan DICOM. Instance DICOM ini direferensikan di kolom name
dari
cloudHealthcareSource
.
$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 "{ 'annotationSource': { 'cloudHealthcareSource': { 'name': 'projects/PROJECT_ID/locations/REGION/datasets/DATASET_ID/dicomStores/DICOM_STORE_ID/dicomWeb/studies/STUDY_UID' } }, 'imageAnnotation': { 'boundingPolys': [ { 'vertices': [ { 'x': 100, 'y': 100 }, { 'x': 100, 'y': 400 }, { 'x': 400, 'y': 100 }, { 'x': 400, 'y': 400 } ], 'label': 'bounding-box' } ] } }" ` -Uri "https://healthcare.googleapis.com/v1beta1/projects/PROJECT_ID/locations/REGION/datasets/DATASET_ID/annotationStores/ANNOTATION_STORE_ID/annotations" | Select-Object -Expand Content
Jika permintaan berhasil, server akan menampilkan respons dalam format JSON:
{ "name": "projects/PROJECT_ID/locations/REGION/datasets/DATASET_ID/annotationStores/ANNOTATION_STORE_ID/annotations/ANNOTATION_ID", "annotationSource": { "cloudHealthcareSource": { "name": "projects/PROJECT_ID/locations/REGION/datasets/DATASET_ID/dicomStores/DICOM_STORE_ID/dicomWeb/studies/STUDY_UID" } }, "imageAnnotation": { "boundingPolys": [ { "vertices": [ { "x": 100, "y": 100 }, { "x": 100, "y": 400 }, { "x": 400, "y": 100 }, { "x": 400, "y": 400 } ], "label": "bounding-box" } ] } }
Mengedit data anotasi
Contoh berikut menunjukkan cara mengedit data anotasi dari
Membuat data anotasi sehingga memiliki label jenis
resource. Untuk informasi selengkapnya, lihat projects.locations.datasets.annotationStores.annotations.patch
.
curl
Untuk mengedit data anotasi, buat permintaan PATCH
dan berikan informasi
berikut:
- Nama set data induk
- Nama penyimpanan anotasi induk
- ID kumpulan data anotasi
- Data yang akan diperbarui
- Mask update
- Token akses
Contoh berikut menunjukkan permintaan PATCH
yang menggunakan curl
pada data anotasi untuk instance DICOM.
curl -X PATCH \ -H "Authorization: Bearer $(gcloud auth application-default print-access-token)" \ -H "Content-Type: application/json; charset=utf-8" \ --data "{ 'resourceAnnotation': { 'label': 'VALUE' } }" \ "https://healthcare.googleapis.com/v1beta1/projects/PROJECT_ID/locations/REGION/datasets/DATASET_ID/annotationStores/ANNOTATION_STORE_ID/annotations/ANNOTATION_ID?updateMask=resourceAnnotation"
Jika permintaan berhasil, server akan menampilkan respons dalam format JSON:
{ "name": "projects/PROJECT_ID/locations/REGION/datasets/DATASET_ID/annotationStores/ANNOTATION_STORE_ID/annotations/ANNOTATION_ID", "annotationSource": { "cloudHealthcareSource": { "name": "projects/PROJECT_ID/locations/REGION/datasets/DATASET_ID/dicomStores/DICOM_STORE_ID/dicomWeb/studies/STUDY_UID" } }, "resourceAnnotation": { "label": "VALUE" } }
PowerShell
Untuk mengedit data anotasi, buat permintaan PATCH
dan berikan informasi
berikut:
- Nama set data induk
- Nama penyimpanan anotasi induk
- ID kumpulan data anotasi
- Data yang akan diperbarui
- Mask update
- Token akses
Contoh berikut menunjukkan permintaan PATCH
menggunakan Windows PowerShell
pada data anotasi untuk instance DICOM.
$cred = gcloud auth application-default print-access-token $headers = @{ Authorization = "Bearer $cred" } Invoke-WebRequest ` -Method Patch ` -Headers $headers ` -ContentType: "application/json; charset=utf-8" ` -Body "{ 'resourceAnnotation': { 'label': 'VALUE' } }" ` -Uri "https://healthcare.googleapis.com/v1beta1/projects/PROJECT_ID/locations/REGION/datasets/DATASET_ID/annotationStores/ANNOTATION_STORE_ID/annotations/ANNOTATION_ID?updateMask=resourceAnnotation" | Select-Object -Expand Content
Jika permintaan berhasil, server akan menampilkan respons dalam format JSON:
{ "name": "projects/PROJECT_ID/locations/REGION/datasets/DATASET_ID/annotationStores/ANNOTATION_STORE_ID/annotations/ANNOTATION_ID", "annotationSource": { "cloudHealthcareSource": { "name": "projects/PROJECT_ID/locations/REGION/datasets/DATASET_ID/dicomStores/DICOM_STORE_ID/dicomWeb/studies/STUDY_UID" } }, "resourceAnnotation": { "label": "VALUE" } }
Mendapatkan detail data anotasi
Contoh berikut menunjukkan cara mendapatkan detail tentang data anotasi. Untuk mengetahui informasi selengkapnya, lihat projects.locations.datasets.annotationStores.annotations.get
.
curl
Untuk mendapatkan detail tentang data anotasi, buat permintaan GET
dan berikan
informasi berikut:
- Nama set data induk
- Nama penyimpanan anotasi induk
- ID kumpulan data anotasi
- Token akses
Contoh berikut menunjukkan permintaan GET
yang menggunakan curl
untuk melihat
data anotasi untuk instance DICOM.
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/annotationStores/ANNOTATION_STORE_ID/annotations/ANNOTATION_ID"
Jika permintaan berhasil, server akan menampilkan respons dalam format JSON:
{ "name": "projects/PROJECT_ID/locations/REGION/datasets/DATASET_ID/annotationStores/ANNOTATION_STORE_ID/annotations/ANNOTATION_ID", "annotationSource": { "cloudHealthcareSource": { "name": "projects/PROJECT_ID/locations/REGION/datasets/DATASET_ID/dicomStores/DICOM_STORE_ID/dicomWeb/studies/STUDY_UID" } } }
Jika Anda mengonfigurasi kolom apa pun di resource Annotation
, kolom tersebut juga akan muncul dalam respons.
PowerShell
Untuk mendapatkan detail tentang data anotasi, buat permintaan GET
dan berikan
informasi berikut:
- Nama set data induk
- Nama penyimpanan anotasi induk
- ID kumpulan data anotasi
- Token akses
Contoh berikut menunjukkan permintaan GET
menggunakan Windows PowerShell untuk melihat
data anotasi untuk instance DICOM.
$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/annotationStores/ANNOTATION_STORE_ID/annotations/ANNOTATION_ID" | Select-Object -Expand Content
Jika permintaan berhasil, server akan menampilkan respons dalam format JSON:
{ "name": "projects/PROJECT_ID/locations/REGION/datasets/DATASET_ID/annotationStores/ANNOTATION_STORE_ID/annotations/ANNOTATION_ID", "annotationSource": { "cloudHealthcareSource": { "name": "projects/PROJECT_ID/locations/REGION/datasets/DATASET_ID/dicomStores/DICOM_STORE_ID/dicomWeb/studies/STUDY_UID" } } }
Jika Anda mengonfigurasi kolom apa pun di resource Annotation
, kolom tersebut juga akan muncul dalam respons.
Mencantumkan data anotasi di penyimpanan anotasi
Contoh berikut menunjukkan cara mencantumkan data anotasi di penyimpanan anotasi.
Untuk informasi selengkapnya, lihat projects.locations.datasets.annotationStores.annotations.list
.
curl
Untuk mencantumkan data anotasi di penyimpanan anotasi, buat permintaan GET
dan berikan informasi berikut:
- Nama set data induk
- Nama penyimpanan anotasi
- Token akses
Contoh berikut menunjukkan permintaan GET
menggunakan curl
di penyimpanan
anotasi yang berisi data anotasi untuk instance DICOM.
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/annotationStores/ANNOTATION_STORE_ID/annotations"
Jika permintaan berhasil, server akan menampilkan respons dalam format JSON:
{ "annotations": [ { "name": "projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/annotationStores/ANNOTATION_STORE_ID/annotations/ANNOTATION_ID", "annotationSource": { "cloudHealthcareSource": { "name": "projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/dicomStores/DICOM_STORE_ID/dicomWeb/studies/STUDY_UID" } } } ] }
Jika Anda mengonfigurasi kolom apa pun di resource Annotation
, kolom tersebut juga akan muncul dalam respons.
PowerShell
Untuk mencantumkan data anotasi di penyimpanan anotasi, buat permintaan GET
dan berikan informasi berikut:
- Nama set data induk
- Nama penyimpanan anotasi
- Token akses
Contoh berikut menunjukkan permintaan GET
menggunakan Windows PowerShell di penyimpanan
anotasi yang berisi data anotasi untuk instance DICOM.
$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/annotationStores/ANNOTATION_STORE_ID/annotations" | Select-Object -Expand Content
Jika permintaan berhasil, server akan menampilkan respons dalam format JSON:
{ "annotations": [ { "name": "projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/annotationStores/ANNOTATION_STORE_ID/annotations/ANNOTATION_ID", "annotationSource": { "cloudHealthcareSource": { "name": "projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/dicomStores/DICOM_STORE_ID/dicomWeb/studies/STUDY_UID" } } } ] }
Jika Anda mengonfigurasi kolom apa pun di resource Annotation
, kolom tersebut juga akan muncul dalam respons.
Menghapus data anotasi
Contoh berikut menunjukkan cara menghapus data anotasi. Untuk mengetahui
informasi selengkapnya, lihat projects.locations.datasets.annotationStores.annotations.delete
.
curl
Untuk menghapus data anotasi, buat permintaan DELETE
dan berikan
informasi berikut:
- Nama set data induk
- Nama penyimpanan anotasi induk
- ID kumpulan data anotasi
- Token akses
Contoh berikut menunjukkan permintaan DELETE
yang menggunakan curl
.
curl -X DELETE \ -H "Authorization: Bearer $(gcloud auth application-default print-access-token)" \ "https://healthcare.googleapis.com/v1beta1/projects/PROJECT_ID/locations/REGION/datasets/DATASET_ID/annotationStores/ANNOTATION_STORE_ID/annotations/ANNOTATION_ID"
Jika permintaan berhasil, server akan menampilkan isi respons kosong dalam format JSON:
{}
PowerShell
Untuk menghapus data anotasi, buat permintaan DELETE
dan berikan
informasi berikut:
- Nama set data induk
- Nama penyimpanan anotasi induk
- ID kumpulan data anotasi
- Token akses
Contoh berikut menunjukkan permintaan DELETE
menggunakan Windows PowerShell.
$cred = gcloud auth application-default print-access-token $headers = @{ Authorization = "Bearer $cred" } Invoke-WebRequest ` -Method Delete ` -Uri "https://healthcare.googleapis.com/v1beta1/projects/PROJECT_ID/locations/REGION/datasets/DATASET_ID/annotationStores/ANNOTATION_STORE_ID/annotations/ANNOTATION_ID" | Select-Object -Expand Content
Jika permintaan berhasil, server akan menampilkan isi respons kosong dalam format JSON:
{}