-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplot_annotation_masks.py
More file actions
31 lines (21 loc) · 1.43 KB
/
plot_annotation_masks.py
File metadata and controls
31 lines (21 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# conda activate /Users/whitebr/opt/anaconda3/envs/histoqc-new
from hne_image_utils.mask_utils import create_tissue_resident_annotation_polygons, plot_polygons
import pandas as pd
import matplotlib.pyplot as plt
all_imgs = ['10256', '10415', '10416', '10779', '11155', '11170', '11547', '12459', '7705', '8197', '8202', '8500', '8501', '9155', '9296', '9468', '9894']
# all_imgs = ['10256']
all_imgs = ['11170']
pdmr_img_dict = {}
for img_name in all_imgs:
print(img_name)
image_wsi_file = '/Users/whitebr/work/jax/pdxnet/svs/pdmr/' + img_name + '.svs'
annotation_geojson_file = '/Users/whitebr/Box/Brian files/' + img_name + '.geojson'
annotation_geojson_file = '/Users/whitebr/Library/CloudStorage/Box-Box/Brian files/' + img_name + '.geojson'
tissue_mask_file = '/Users/whitebr/work/jax/HistoQC/old-histoqcs/histoqc_output_pdmr_v2.1-no-blur-no-fat/' + img_name + '.svs/' + img_name + '.svs_mask_use.png'
annos = create_tissue_resident_annotation_polygons(image_wsi_file, annotation_geojson_file, tissue_mask_file)
plot_polygons(annos)
plt.savefig("regional-annos-" + img_name + ".png", bbox_inches="tight")
plt.savefig("regional-annos-" + img_name + ".pdf", bbox_inches="tight")
plot_polygons(annos, show_legend = False)
plt.savefig("regional-annos-" + img_name + "-no-legend.png", bbox_inches="tight")
plt.savefig("regional-annos-" + img_name + "-no-legend.pdf", bbox_inches="tight")