simongraham/hovernet_inference

JSON files contain nuclei from all processed slides

Closed this issue · 0 comments

Hi,
I'm using HoVerNet again on a set of WSI's. The processing seems to proceed as expected in reasonable time and memory requirements, so that's good. But I noticed the output has changed from the previously used .mat format to a .json dict. These nuclei_dict.json files seem to not reset between slides, resulting in successive instances appending to instances from previous slides, and files growing with each successive slide processed. Besides this being unexpected behavior, one consequence is a surface-level difficulty in extracting the predicted nuclei corresponding to any individual slide, as this would require (I think?) reading each previously processed slide to track the correct offset.

I suspect that something like a

self.wsi_inst_info = {}

inside the for loop of InferWSI.process_all_files() would do the trick... I'm going to test that and report back in a few minutes.

Reporting back, yes inserting that dictionary reset line right here

hovernet_inference/run.py

Lines 818 to 819 in b9c4fe6

for filename in self.file_list:
filename = os.path.basename(filename)
seems to have done it.