Spaces:
Runtime error
Runtime error
Vamsi Thiriveedhi
commited on
Commit
·
f85770b
1
Parent(s):
cfdbb51
enh: provide download instructions, show series and seg uids
Browse files- download_instructions.md +45 -0
- filter_data_app.py +10 -4
download_instructions.md
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
### Downloading data
|
2 |
+
|
3 |
+
We aim to show a very quick overview on how you can download data with `idc_index` a python package developed by the IDC team to help with basic operations on IDC data.
|
4 |
+
|
5 |
+
Learn more @ https://github.com/ImagingDataCommons/idc-idc_index
|
6 |
+
|
7 |
+
Detailed Tutorial @ https://github.com/ImagingDataCommons/IDC-Tutorials/blob/master/notebooks/getting_started/part2_searching_basics.ipynb
|
8 |
+
|
9 |
+
#### Download idc-index package
|
10 |
+
```
|
11 |
+
pip install --upgrade idc-index
|
12 |
+
```
|
13 |
+
|
14 |
+
#### Import module and initialize client
|
15 |
+
```
|
16 |
+
from idc_index import index
|
17 |
+
client = index.IDCClient()
|
18 |
+
```
|
19 |
+
|
20 |
+
#### Download data
|
21 |
+
```
|
22 |
+
client.download_from_selection(
|
23 |
+
seriesInstanceUID='<enter your seriesInstanceUID or list of seriesInstanceUIDs>',
|
24 |
+
downloadDir= '<Download destination folder>' )
|
25 |
+
|
26 |
+
```
|
27 |
+
Below are a couple of examples:
|
28 |
+
|
29 |
+
Example 1:
|
30 |
+
```
|
31 |
+
client.download_from_selection(
|
32 |
+
seriesInstanceUID='1.2.276.0.7230010.3.1.3.313263360.15851.1706325185.577017',
|
33 |
+
downloadDir= 'idc_data' )
|
34 |
+
|
35 |
+
```
|
36 |
+
|
37 |
+
Example 2:
|
38 |
+
```
|
39 |
+
client.download_from_selection(
|
40 |
+
seriesInstanceUID=['1.2.276.0.7230010.3.1.3.313263360.15851.1706325185.577017',
|
41 |
+
'1.2.840.113654.2.55.257926562693607663865369179341285235858'
|
42 |
+
],
|
43 |
+
downloadDir= 'idc_data' )
|
44 |
+
|
45 |
+
```
|
filter_data_app.py
CHANGED
@@ -122,6 +122,11 @@ def main():
|
|
122 |
instructions = response.text
|
123 |
st.write(instructions)
|
124 |
|
|
|
|
|
|
|
|
|
|
|
125 |
with st.sidebar:
|
126 |
st.title("Filters")
|
127 |
|
@@ -328,12 +333,13 @@ def main():
|
|
328 |
st.data_editor(
|
329 |
paginated_df,
|
330 |
column_config={
|
331 |
-
"Viewer Url":st.column_config.LinkColumn("
|
332 |
-
display_text=r"https:\/\/viewer\.imaging\.datacommons\.cancer\.gov\/v3\/viewer\/\?\StudyInstanceUIDs=(.*)&"
|
|
|
333 |
),
|
334 |
|
335 |
},
|
336 |
-
column_order=("PatientID", "Viewer Url", "
|
337 |
hide_index=True,
|
338 |
use_container_width=True
|
339 |
)
|
@@ -438,7 +444,7 @@ def main():
|
|
438 |
response = requests.get(url)
|
439 |
instructions = response.text
|
440 |
st.write(instructions)
|
441 |
-
|
442 |
# Execute the SQL to get summary statistics
|
443 |
summary_df = duckdb.query("""
|
444 |
WITH Checks AS (
|
|
|
122 |
instructions = response.text
|
123 |
st.write(instructions)
|
124 |
|
125 |
+
with st.expander("Download instructions using idc-index"):
|
126 |
+
with open("download_instructions.md", "r") as file:
|
127 |
+
instructions = file.read()
|
128 |
+
st.write(instructions)
|
129 |
+
|
130 |
with st.sidebar:
|
131 |
st.title("Filters")
|
132 |
|
|
|
333 |
st.data_editor(
|
334 |
paginated_df,
|
335 |
column_config={
|
336 |
+
"Viewer Url":st.column_config.LinkColumn("Viewer Url",
|
337 |
+
#display_text=r"https:\/\/viewer\.imaging\.datacommons\.cancer\.gov\/v3\/viewer\/\?\StudyInstanceUIDs=(.*)&"
|
338 |
+
display_text='viewerUrl'
|
339 |
),
|
340 |
|
341 |
},
|
342 |
+
column_order=("PatientID", "Viewer Url", "CT_SeriesInstanceUID","seg_seriesInstanceUID", "bodyPart","laterality", "segmentation_completeness","laterality_check", "volume_from_voxel_summation_check","connected_components","voxel_num", radiomics_feature),
|
343 |
hide_index=True,
|
344 |
use_container_width=True
|
345 |
)
|
|
|
444 |
response = requests.get(url)
|
445 |
instructions = response.text
|
446 |
st.write(instructions)
|
447 |
+
|
448 |
# Execute the SQL to get summary statistics
|
449 |
summary_df = duckdb.query("""
|
450 |
WITH Checks AS (
|