|
17 | 17 | from .xml_to_mask_minmax import write_minmax_to_xml |
18 | 18 | import lxml.etree as ET |
19 | 19 |
|
20 | | -MPP = {'V42D20-364_XY01_2235505.svs':0.25, |
21 | | - 'V42D20-364_XY04_2240610.svs':0.25, |
22 | | - 'V42N07-339_XY04_F44.svs':0.25, |
23 | | - 'V42N07-395_XY01_235142.svs':0.25, |
24 | | - 'V42N07-395_XY04_235582.svs':0.25, |
25 | | - 'V42N07-399_XY01_3723.svs':0.25, |
26 | | - 'XY01_IU-21-015F.svs':0.50, |
27 | | - 'XY02_IU-21-016F.svs':0.50, |
28 | | - 'XY03_IU-21-019F.svs':0.50, |
29 | | - 'XY04_IU-21-020F.svs':0.50} |
30 | | - |
31 | 20 |
|
32 | 21 | def get_image_meta(i,args): |
33 | 22 | image_annotation_info={} |
34 | 23 | image_annotation_info['slide_loc']=i[0] |
35 | 24 | slide=TiffSlide(image_annotation_info['slide_loc']) |
36 | | - magx=MPP[image_annotation_info['slide_loc'].split('/')[-1]]#np.round(float(slide.properties['tiffslide.mpp-x']),2) |
37 | | - magy=MPP[image_annotation_info['slide_loc'].split('/')[-1]]#np.round(float(slide.properties['tiffslide.mpp-y']),2) |
| 25 | + magx=np.round(float(slide.properties['tiffslide.mpp-x']),2) |
| 26 | + magy=np.round(float(slide.properties['tiffslide.mpp-y']),2) |
38 | 27 |
|
39 | 28 | assert magx == magy |
40 | 29 | if magx ==0.25: |
@@ -116,8 +105,8 @@ def get_slide_data(args, wsi_directory=None): |
116 | 105 | slide =TiffSlide(slide_loc) |
117 | 106 | chop_array=get_choppable_regions(slide,args,slideID,slideExt,mask_out_loc) |
118 | 107 |
|
119 | | - mag_x=MPP[slideID+slideExt]#np.round(float(slide.properties['tiffslide.mpp-x']),2) |
120 | | - mag_y=MPP[slideID+slideExt]#np.round(float(slide.properties['tiffslide.mpp-y']),2) |
| 108 | + mag_x=np.round(float(slide.properties['tiffslide.mpp-x']),2) |
| 109 | + mag_y=np.round(float(slide.properties['tiffslide.mpp-y']),2) |
121 | 110 | slide.close() |
122 | 111 | tree = ET.parse(xmlpath) |
123 | 112 | root = tree.getroot() |
|
0 commit comments