dsa
Build DSA annotation json from stardist geojson classification results
Parameters:
Name | Type | Description | Default |
---|---|---|---|
slide_manifest |
DataFrame[SlideSchema]
|
slide manifest from slide_etl |
required |
output_urlpath |
string
|
URL/path prefix to save annotations |
required |
annotation_name |
string
|
name of the annotation to be displayed in DSA |
required |
line_colors |
dict
|
user-provided line color map with {feature name:rgb values} |
None
|
fill_colors |
dict
|
user-provided fill color map with {feature name:rgba values} |
None
|
storage_options |
dict
|
storage options to pass to read functions |
{}
|
output_storage_options |
dict
|
storage options to pass to write functions |
{}
|
annotation_column |
string
|
column containing url to stardist polygon geojson |
''
|
output_column |
string
|
column with result url to add to slide_manifest |
''
|
Returns:
Type | Description |
---|---|
DataFrame[SlideSchema]: slide manifest |
Source code in src/luna/pathology/cli/dsa_viz.py
Build DSA annotation json from TSV classification data generated by stardist
Processes a cell classification data generated by Qupath/stardist and adds the center coordinates of the cells as annotation elements.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
input_urlpath |
string
|
URL/path to TSV classification data generated by stardist |
required |
output_urlpath |
string
|
URL/path prefix for saving dsa annotation json |
required |
annotation_name |
string
|
name of the annotation to be displayed in DSA |
required |
line_colors |
dict
|
line color map with {feature name:rgb values} |
None
|
fill_colors |
dict
|
fill color map with {feature name:rgba values} |
None
|
storage_options |
dict
|
storage options to pass to read functions |
{}
|
output_storage_options |
dict
|
storage options to pass to write functions |
{}
|
annotation_column |
string
|
column containing url to stardist polygon geojson |
''
|
output_column_suffix |
string
|
column suffix with result url to add to slide_manifest |
required |
Returns:
Type | Description |
---|---|
DataFrame[SlideSchema]: slide manifest |
Source code in src/luna/pathology/cli/dsa_viz.py
Build DSA annotation json from regional annotation geojson
Parameters:
Name | Type | Description | Default |
---|---|---|---|
slide_manifest |
DataFrame[SlideSchema]
|
slide manifest |
required |
output_urlpath |
string
|
URL/path prefix for saving dsa annotation json |
required |
annotation_name |
string
|
name of the annotation to be displayed in DSA |
required |
line_colors |
dict
|
line color map with {feature name:rgb values} |
None
|
fill_colors |
dict
|
fill color map with {feature name:rgba values} |
None
|
storage_options |
dict
|
storage options to pass to read functions |
{}
|
output_storage_options |
dict
|
storage options to pass to write functions |
{}
|
annotation_column |
string
|
column containing url to regional geojson |
''
|
output_column_suffix |
string
|
column suffix with result url to add to slide_manifest |
required |
Returns:
Type | Description |
---|---|
DataFrame[SlideSchema]: slide schema |
Source code in src/luna/pathology/cli/dsa_viz.py
Build DSA annotation json from Qupath polygon geojson
Parameters:
Name | Type | Description | Default |
---|---|---|---|
slide_manifest |
DataFrame[SlideSchema]
|
slide manifest from slide_etl |
required |
output_urlpath |
string
|
URL/path prefix for saving the DSA compatible annotation |
required |
image_filename |
string
|
name of the image file in DSA e.g. 123.svs |
required |
annotation_name |
string
|
name of the annotation to be displayed in DSA |
required |
classes_to_include |
list
|
list of classification labels to visualize |
required |
line_colors |
dict
|
line color map with {feature name:rgb values} |
None
|
fill_colors |
dict
|
fill color map with {feature name:rgba values} |
None
|
storage_options |
dict
|
storage options to pass to read functions |
{}
|
output_storage_options |
dict
|
storage options to pass to write functions |
{}
|
annotation_column |
string
|
column containing url to qupath geojson |
''
|
output_column_suffix |
string
|
column suffix with result url to add to slide_manifest |
required |
Returns:
Type | Description |
---|---|
DataFrame[SlideSchema]: slide manifest |
Source code in src/luna/pathology/cli/dsa_viz.py
Build DSA annotation json from bitmask PNGs
Vectorizes and simplifies contours from the bitmask.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
input |
map
|
map of {label:urlpath_to_bitmask_png} |
required |
annotation_name |
string
|
name of the annotation to be displayed in DSA |
required |
line_colors |
dict
|
line color map with {feature name:rgb values} |
None
|
fill_colors |
dict
|
fill color map with {feature name:rgba values} |
None
|
scale_factor |
int
|
scale to match the image on DSA. |
1
|
storage_options |
dict
|
storage options to pass to read/write functions |
{}
|
Returns:
Name | Type | Description |
---|---|---|
dict |
DSA annotation |
Source code in src/luna/pathology/cli/dsa_viz.py
1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 |
|
Generate heatmap based on the tile scores
Creates a heatmap for the given column, using the color palette viridis
to set a fill value
- the color ranges from purple to yellow, for scores from 0 to 1.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
slide_manifest |
DataFrame[SlideSchema]
|
slide manifest from slide_etl |
required |
output_urlpath |
string
|
URL/path prefix to save the DSA compatible annotation |
required |
annotation_name |
string
|
name of the annotation to be displayed in DSA |
required |
column |
string
|
column to visualize e.g. tile_score |
required |
tile_size |
int
|
size of tiles |
required |
scale_factor |
int
|
scale to match the image on DSA. |
None
|
line_colors |
dict
|
line color map with {feature name:rgb values} |
None
|
fill_colors |
dict
|
fill color map with {feature name:rgba values} |
None
|
storage_options |
dict
|
storage options to pass to read functions |
{}
|
output_storage_options |
dict
|
storage options to pass to write functions |
{}
|
Returns:
Name | Type | Description |
---|---|---|
dict |
annotation file path. None if error in writing the file. |
Source code in src/luna/pathology/cli/dsa_viz.py
1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 |
|
Build DSA annotation json from a BMP with multiple labels.
Vectorizes and simplifies contours per label.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
slide_manifest |
DataFrame[SlideSchema]
|
slide manifest from slide_etl |
required |
output_urlpath |
string
|
url/path prefix to save the DSA compatible annotation |
required |
label_map |
dict[int, str]
|
map of label number to label name |
required |
annotation_name |
string
|
name of the annotation to be displayed in DSA |
required |
line_colors |
dict[str, str]
|
line color map with {feature name:rgb values} |
None
|
fill_colors |
dict[str, str]
|
fill color map with {feature name:rgba values} |
None
|
scale_factor |
int
|
scale to match image DSA. |
1
|
storage_options |
dict
|
storage options to pass to read functions |
{}
|
output_storage_options |
dict
|
storage options to pass to write functions |
{}
|
annotation_column |
string
|
column containing url to BMP polygon |
'bmp_polygon_url'
|
output_column_suffix |
string
|
column suffix with result url to add to slide_manifest |
required |
Returns:
Name | Type | Description |
---|---|---|
dict |
annotation file path |