Skip to content

Commit ed57b64

Browse files
authored
Dicom tutorial plus tags (#1502)
* some_dicom_tutoril_modif_by_Wael * Créé avec Colaboratory by Wael Signed-off-by: ZWael <[email protected]>
1 parent 647664f commit ed57b64

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed

docs/tutorials/dicom.ipynb

+55
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,61 @@
200200
"axes[1].set_title('lossy image');"
201201
]
202202
},
203+
{
204+
"cell_type": "markdown",
205+
"metadata": {
206+
"id": "VbkKcNZunw3N"
207+
},
208+
"source": [
209+
"### Decode DICOM Metadata and working with Tags"
210+
]
211+
},
212+
{
213+
"cell_type": "markdown",
214+
"metadata": {
215+
"id": "D7tuwYksn8e7"
216+
},
217+
"source": [
218+
"`decode_dicom_data` decodes tag information. `dicom_tags` contains useful information as the patient's age and sex, so you can use DICOM tags such as `dicom_tags.PatientsAge` and `dicom_tags.PatientsSex`. tensorflow_io borrow the same tag notation from the pydicom dicom package."
219+
]
220+
},
221+
{
222+
"cell_type": "code",
223+
"execution_count": null,
224+
"metadata": {
225+
"id": "OqHkXwF0oI3L"
226+
},
227+
"outputs": [],
228+
"source": [
229+
"tag_id = tfio.image.dicom_tags.PatientsAge\n",
230+
"tag_value = tfio.image.decode_dicom_data(image_bytes,tag_id)\n",
231+
"print(tag_value)"
232+
]
233+
},
234+
{
235+
"cell_type": "code",
236+
"execution_count": null,
237+
"metadata": {
238+
"id": "J2wZ-7OcoPPs"
239+
},
240+
"outputs": [],
241+
"source": [
242+
"print(f\"PatientsAge : {tag_value.numpy().decode('UTF-8')}\")"
243+
]
244+
},
245+
{
246+
"cell_type": "code",
247+
"execution_count": null,
248+
"metadata": {
249+
"id": "Ce6ymbskoTOe"
250+
},
251+
"outputs": [],
252+
"source": [
253+
"tag_id = tfio.image.dicom_tags.PatientsSex\n",
254+
"tag_value = tfio.image.decode_dicom_data(image_bytes,tag_id)\n",
255+
"print(f\"PatientsSex : {tag_value.numpy().decode('UTF-8')}\")"
256+
]
257+
},
203258
{
204259
"cell_type": "markdown",
205260
"metadata": {

0 commit comments

Comments
 (0)