How to use the histomicstk.cli.utils.segment_wsi_foreground_at_low_res function in histomicstk

To help you get started, we’ve selected a few histomicstk examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DigitalSlideArchive / HistomicsTK / histomicstk / cli / NucleiDetection / NucleiDetection.py View on Github external
print(json.dumps(ts_metadata, indent=2))

    is_wsi = ts_metadata['magnification'] is not None

    #
    # Compute tissue/foreground mask at low-res for whole slide images
    #
    if is_wsi and process_whole_image:

        print('\n>> Computing tissue/foreground mask at low-res ...\n')

        start_time = time.time()

        im_fgnd_mask_lres, fgnd_seg_scale = \
            cli_utils.segment_wsi_foreground_at_low_res(ts)

        fgnd_time = time.time() - start_time

        print('low-res foreground mask computation time = {}'.format(
            cli_utils.disp_time_hms(fgnd_time)))

    #
    # Compute foreground fraction of tiles in parallel using Dask
    #
    tile_fgnd_frac_list = [1.0]

    it_kwargs = {
        'tile_size': {'width': args.analysis_tile_size},
        'scale': {'magnification': args.analysis_mag},
    }
github DigitalSlideArchive / HistomicsTK / histomicstk / cli / ComputeNucleiFeatures / ComputeNucleiFeatures.py View on Github external
print(json.dumps(ts_metadata, indent=2))

    is_wsi = ts_metadata['magnification'] is not None

    #
    # Compute tissue/foreground mask at low-res for whole slide images
    #
    if is_wsi and process_whole_image:

        print('\n>> Computing tissue/foreground mask at low-res ...\n')

        start_time = time.time()

        im_fgnd_mask_lres, fgnd_seg_scale = \
            cli_utils.segment_wsi_foreground_at_low_res(ts)

        fgnd_time = time.time() - start_time

        print('low-res foreground mask computation time = {}'.format(
            cli_utils.disp_time_hms(fgnd_time)))

    #
    # Compute foreground fraction of tiles in parallel using Dask
    #
    tile_fgnd_frac_list = [1.0]

    it_kwargs = {
        'tile_size': {'width': args.analysis_tile_size},
        'scale': {'magnification': args.analysis_mag},
    }
github DigitalSlideArchive / HistomicsTK / histomicstk / cli / SuperpixelSegmentation / CreateDataset.py View on Github external
print(json.dumps(ts_metadata, indent=2))

        is_wsi = ts_metadata['magnification'] is not None

        if is_wsi:

            #
            # Compute tissue/foreground mask at low-res for whole slide images
            #
            print('\n>> Computing tissue/foreground mask at low-res ...\n')

            start_time = time.time()

            im_fgnd_mask_lres, fgnd_seg_scale = \
                cli_utils.segment_wsi_foreground_at_low_res(ts)

            fgnd_time = time.time() - start_time

            print('low-res foreground mask computation time = {}'.format(
                cli_utils.disp_time_hms(fgnd_time)))

            it_kwargs = {
                'tile_size': {'width': args.analysis_tile_size},
                'scale': {'magnification': args.analysis_mag},
            }

            #
            # Compute foreground fraction of tiles in parallel using Dask
            #
            print('\n>> Computing foreground fraction of all tiles ...\n')