Exemplo n.º 1
0
        print(json.dumps({'initializing': args.slidepath}))

        start = time.time()

        tile_processor_pool = TileProcessorPool(workers=PROCESSOR_WORKERS)
        tile_processor_pool.start()

        tiler = Tiler(slidepath=args.slidepath,
                      basename=TMP_DIR,
                      format=FORMAT,
                      tile_size=TILE_SIZE,
                      overlap=OVERLAP,
                      limit_bounds=True,
                      workers=TILER_WORKERS,
                      tile_processor_queue=tile_processor_pool.get_queue())
        tiler.run()

        results = tile_processor_pool.gather_results()

        print(json.dumps({'tilingComplete': args.slidepath}))

        total_points_found, hpf_centers, hpf_points = find_hpfs(results)
        hpfs = list(zip(hpf_centers, hpf_points))

        basename = os.path.basename(args.slidepath)
        with OpenSlide(args.slidepath) as slide:
            hpf_data = visualize(slide,
                                 hpf_centers,
                                 hpf_points,
                                 dir='.',
                                 basename=basename)