Skip to content

Commit 87e503c

Browse files
adapted query to use ann_index
1 parent c9b1524 commit 87e503c

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

notebooks/pathomics/microscopy_dicom_ann_intro.ipynb

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@
140140
},
141141
"source": [
142142
"## Accessing DICOM ANNs from the IDC\n",
143-
"To access and download the ANNs files, we utilize the Python package [idc-index](https://github.com/ImagingDataCommons/idc-index) that facilitates querying metadata and downloading DICOM files from the IDC. Since all available ANN documents in the IDC have a combined size of 1.82 TB - for the demonstration in this tutorial we will use only a single ANN from the TCGA-BRCA collection as an example."
143+
"To access and download the ANNs files, we utilize the Python package [idc-index](https://github.com/ImagingDataCommons/idc-index) that facilitates querying metadata and downloading DICOM files from the IDC. Since all available ANN objects in the IDC have a combined size of 1.82 TB - for the demonstration in this tutorial we will use only a single ANN from the TCGA-BRCA collection as an example."
144144
]
145145
},
146146
{
@@ -152,7 +152,8 @@
152152
"outputs": [],
153153
"source": [
154154
"idc_client = index.IDCClient() # set-up idc_client\n",
155-
"idc_client.fetch_index('sm_instance_index')"
155+
"idc_client.fetch_index('sm_instance_index') # fetch additional sm_instance_index containing all slide microscopy (SM) instances available in the IDC\n",
156+
"idc_client.fetch_index('ann_index') # fetch additional ann_index containing all ANN series available in the IDC"
156157
]
157158
},
158159
{
@@ -163,24 +164,24 @@
163164
},
164165
"outputs": [],
165166
"source": [
166-
"query_sr = '''\n",
167+
"query_ann = '''\n",
167168
"SELECT\n",
168-
" SeriesInstanceUID,\n",
169+
" index.SeriesInstanceUID,\n",
169170
" StudyInstanceUID,\n",
170171
" PatientID,\n",
171172
" collection_id\n",
172173
"FROM\n",
173174
" index\n",
174-
"WHERE\n",
175+
"JOIN \n",
176+
" ann_index ON ann_index.SeriesInstanceUID = index.SeriesInstanceUID\n",
177+
"WHERE \n",
175178
" analysis_result_id = 'Pan-Cancer-Nuclei-Seg-DICOM' \n",
176-
" # Microscopy Bulk Simple Annotations SOP Class UID - more reliable than Modality = \"ANN\"\n",
177-
" AND SOPClassUID = \"1.2.840.10008.5.1.4.1.1.91.1\"\n",
178179
" AND collection_id = 'tcga_luad'\n",
179180
"ORDER BY\n",
180181
" crdc_series_uuid\n",
181182
"LIMIT 1\n",
182183
"'''\n",
183-
"pan_ann = idc_client.sql_query(query_sr)"
184+
"pan_ann = idc_client.sql_query(query_ann)"
184185
]
185186
},
186187
{

0 commit comments

Comments
 (0)