Vamsi Thiriveedhi
commited on
Commit
·
1c4dd7a
1
Parent(s):
bad13a0
enh: update the parquet file, add voxel num col
Browse files- filter_data_app.py +19 -8
- qual-checks-and-quant-values.parquet +2 -2
filter_data_app.py
CHANGED
|
@@ -26,14 +26,15 @@ def load_data(radiomics_feature='Volume from Voxel Summation'):
|
|
| 26 |
'laterality_check',
|
| 27 |
'series_with_vertabra_on_every_slice',
|
| 28 |
'connected_volumes',
|
|
|
|
| 29 |
radiomics_feature # Include the selected radiomics feature column
|
| 30 |
]
|
| 31 |
df = pl.read_parquet(LOCAL_PARQUET_FILE, columns=cols)
|
| 32 |
-
df = df.with_columns([
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
])
|
| 37 |
|
| 38 |
return df
|
| 39 |
|
|
@@ -110,7 +111,8 @@ def main():
|
|
| 110 |
'series_with_vertabra_on_every_slice': None,
|
| 111 |
'connected_volumes': None,
|
| 112 |
'laterality': None,
|
| 113 |
-
'radiomics_feature': 'Volume from Voxel Summation' # Default radiomics feature
|
|
|
|
| 114 |
}
|
| 115 |
|
| 116 |
filters = st.session_state.filters
|
|
@@ -124,6 +126,7 @@ def main():
|
|
| 124 |
'connected_volumes': None,
|
| 125 |
'laterality': None,
|
| 126 |
#'radiomics_feature': 'Volume from Voxel Summation'
|
|
|
|
| 127 |
})
|
| 128 |
st.session_state.filters = filters
|
| 129 |
|
|
@@ -190,6 +193,8 @@ def main():
|
|
| 190 |
series_with_vertabra_on_every_slice_options = [""] + filtered_df['series_with_vertabra_on_every_slice'].unique().to_list()
|
| 191 |
connected_volumes_options = filtered_df['connected_volumes'].unique().to_list()
|
| 192 |
laterality_options = [""] + filtered_df['laterality'].unique().to_list()
|
|
|
|
|
|
|
| 193 |
|
| 194 |
laterality = st.selectbox(
|
| 195 |
"Laterality",
|
|
@@ -232,6 +237,12 @@ def main():
|
|
| 232 |
on_change=lambda: apply_filter('connected_volumes', st.session_state.connected_volumes)
|
| 233 |
)
|
| 234 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 235 |
st.session_state.filters = filters
|
| 236 |
|
| 237 |
if laterality:
|
|
@@ -278,7 +289,7 @@ def main():
|
|
| 278 |
),
|
| 279 |
|
| 280 |
},
|
| 281 |
-
column_order=("PatientID", "Viewer Url", "seriesNumber","bodyPart","laterality", "segmentation_completeness","laterality_check", "series_with_vertabra_on_every_slice","connected_volumes", radiomics_feature),
|
| 282 |
hide_index=True,
|
| 283 |
use_container_width=True
|
| 284 |
)
|
|
@@ -351,7 +362,7 @@ def main():
|
|
| 351 |
SUM(CASE WHEN segmentation_completeness = 'pass' THEN 1 ELSE 0 END) AS pass_count,
|
| 352 |
SUM(CASE WHEN laterality_check = 'pass' THEN 1 ELSE 0 END) AS laterality_pass_count,
|
| 353 |
SUM(CASE WHEN series_with_vertabra_on_every_slice = 'pass' THEN 1 ELSE 0 END) AS vertabra_pass_count,
|
| 354 |
-
SUM(CASE WHEN connected_volumes = '
|
| 355 |
FROM
|
| 356 |
'qual-checks-and-quant-values.parquet'
|
| 357 |
GROUP BY
|
|
|
|
| 26 |
'laterality_check',
|
| 27 |
'series_with_vertabra_on_every_slice',
|
| 28 |
'connected_volumes',
|
| 29 |
+
'voxel_num',
|
| 30 |
radiomics_feature # Include the selected radiomics feature column
|
| 31 |
]
|
| 32 |
df = pl.read_parquet(LOCAL_PARQUET_FILE, columns=cols)
|
| 33 |
+
# df = df.with_columns([
|
| 34 |
+
# pl.when(pl.col('connected_volumes') == 'pass').then(pl.lit(1)).otherwise(
|
| 35 |
+
# pl.col('connected_volumes').cast(pl.Int32, strict=False)
|
| 36 |
+
# ).alias('connected_volumes')
|
| 37 |
+
# ])
|
| 38 |
|
| 39 |
return df
|
| 40 |
|
|
|
|
| 111 |
'series_with_vertabra_on_every_slice': None,
|
| 112 |
'connected_volumes': None,
|
| 113 |
'laterality': None,
|
| 114 |
+
'radiomics_feature': 'Volume from Voxel Summation', # Default radiomics feature
|
| 115 |
+
'voxel_nums': None
|
| 116 |
}
|
| 117 |
|
| 118 |
filters = st.session_state.filters
|
|
|
|
| 126 |
'connected_volumes': None,
|
| 127 |
'laterality': None,
|
| 128 |
#'radiomics_feature': 'Volume from Voxel Summation'
|
| 129 |
+
'voxel_nums':None,
|
| 130 |
})
|
| 131 |
st.session_state.filters = filters
|
| 132 |
|
|
|
|
| 193 |
series_with_vertabra_on_every_slice_options = [""] + filtered_df['series_with_vertabra_on_every_slice'].unique().to_list()
|
| 194 |
connected_volumes_options = filtered_df['connected_volumes'].unique().to_list()
|
| 195 |
laterality_options = [""] + filtered_df['laterality'].unique().to_list()
|
| 196 |
+
voxel_num_options = filtered_df.filter(col('voxel_num').is_not_null()).select('voxel_num').unique().to_pandas().iloc[:, 0].tolist()
|
| 197 |
+
|
| 198 |
|
| 199 |
laterality = st.selectbox(
|
| 200 |
"Laterality",
|
|
|
|
| 237 |
on_change=lambda: apply_filter('connected_volumes', st.session_state.connected_volumes)
|
| 238 |
)
|
| 239 |
|
| 240 |
+
voxel_nums = st.slider("Voxel Number",
|
| 241 |
+
min_value=min(voxel_num_options),
|
| 242 |
+
max_value=max(voxel_num_options),
|
| 243 |
+
key='voxel_num',
|
| 244 |
+
on_change=lambda: apply_filter('voxel_nums', st.session_state.voxel_nums))
|
| 245 |
+
|
| 246 |
st.session_state.filters = filters
|
| 247 |
|
| 248 |
if laterality:
|
|
|
|
| 289 |
),
|
| 290 |
|
| 291 |
},
|
| 292 |
+
column_order=("PatientID", "Viewer Url", "seriesNumber","bodyPart","laterality", "segmentation_completeness","laterality_check", "series_with_vertabra_on_every_slice","connected_volumes","voxel_num", radiomics_feature),
|
| 293 |
hide_index=True,
|
| 294 |
use_container_width=True
|
| 295 |
)
|
|
|
|
| 362 |
SUM(CASE WHEN segmentation_completeness = 'pass' THEN 1 ELSE 0 END) AS pass_count,
|
| 363 |
SUM(CASE WHEN laterality_check = 'pass' THEN 1 ELSE 0 END) AS laterality_pass_count,
|
| 364 |
SUM(CASE WHEN series_with_vertabra_on_every_slice = 'pass' THEN 1 ELSE 0 END) AS vertabra_pass_count,
|
| 365 |
+
SUM(CASE WHEN connected_volumes = '1' THEN 1 ELSE 0 END) AS volumes_pass_count
|
| 366 |
FROM
|
| 367 |
'qual-checks-and-quant-values.parquet'
|
| 368 |
GROUP BY
|
qual-checks-and-quant-values.parquet
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9cdb5ac665c8bedf906f07ba1ba05232cf9ab2eb9045caec7fa1a3343222e9f2
|
| 3 |
+
size 1157730459
|