navigate Logo

Getting Started

  • Quick Start Guide
  • Software Installation
  • I Want To…

User Guide

  • Supported Hardware
  • Supported File Formats
  • User Interface Walkthrough
  • Setting Up A Microscope
  • Acquiring Data
  • Case Studies

Development

  • Contributing Guidelines
  • Developer Install
  • Software Architecture
  • Feature Container
  • REST-API
  • Plugin Architecture

Troubleshooting & Known Issues

  • Troubleshooting
  • Known Issues

Plugins

  • navigate Plugin Template
  • navigate Confocal Projection
  • navigate at Scale
  • navigate Constant Velocity Acquisition
  • navigate MMCore
  • navigate ilastik Server
  • navigate Photoactivation

Reference

  • Implemented Microscopes
  • Software API
    • navigate.config
    • navigate.controller
    • navigate.log_files
    • navigate.model
      • navigate.model.analysis
      • navigate.model.concurrency
      • navigate.model.data_sources
      • navigate.model.device_startup_functions
      • navigate.model.devices
      • navigate.model.features
        • navigate.model.features.adaptive_optics
        • navigate.model.features.auto_tile_scan
        • navigate.model.features.autofocus
        • navigate.model.features.common_features
        • navigate.model.features.feature_container
        • navigate.model.features.feature_related_functions
        • navigate.model.features.image_writer
        • navigate.model.features.remove_empty_tiles
        • navigate.model.features.restful_features
        • navigate.model.features.update_setting
        • navigate.model.features.volume_search
      • navigate.model.metadata_sources
      • navigate.model.microscope
      • navigate.model.model
      • navigate.model.plugins_model
      • navigate.model.waveforms
    • navigate.tools
    • navigate.view
navigate
  • Acquiring Data
  • Currently Implemented Features
  • navigate.model.features.remove_empty_tiles
  • navigate.model.features.remove_empty_tiles.detect_tissue
  • View page source

navigate.model.features.remove_empty_tiles.detect_tissue

navigate.model.features.remove_empty_tiles.detect_tissue(image_data, percentage=0.0)

Detect tissue in an image and determine if it exceeds a specified percentage.

This function takes an image in the form of image data and detects tissue within the image. It calculates the percentage of tissue area with respect to the total image area using a sliding window approach.

Parameters:

image_datandarray

A NumPy array representing the image data. The image should be preprocessed and ready for tissue detection.

percentagefloat, optional (default: 0.0)

The minimum required percentage of tissue in the image for it to be considered as containing tissue. If the detected tissue percentage is greater than or equal to this value, the function returns True; otherwise, it returns False.

Returns:

bool

True if the detected tissue percentage is greater than or equal to the specified percentage; False otherwise.

Notes:

  • The function applies a sliding window approach to count tissue squares within the image.

  • It calculates the tissue percentage by dividing the number of tissue squares by the total possible squares in the image.

  • The width of the sliding window is determined by the ‘width’ variable.

Example:

Given an image data array and a percentage threshold of 0.5: ``` image_data = np.array([[0, 0, 1, 1, 1],

[0, 0, 0, 1, 1], [1, 0, 0, 0, 0], [1, 1, 0, 0, 1]])

result = detect_tissue(image_data, 0.5) ```

The function would return True, as the detected tissue percentage in the image (10 out of 20 squares) is greater than or equal to 0.5.

Previous Next

© Copyright 2025, Dean Lab, UT Southwestern Medical Center.