Git Product home page Git Product logo

faim-wako-searchfirst's People

Contributors

imagejan avatar pre-commit-ci[bot] avatar

Watchers

 avatar

faim-wako-searchfirst's Issues

Allow specifying bounding box for segmentation

Similar to these parameters in previous ImageJ macros:

// Define box in which for objects should be searched
bBx = 30; //x size of FOV is 2560 (for CV7000), 2000 (for CV8000)
bBy = 30; //y size of the FOV is 2160 (for CV7000), 2000 (for CV8000)
width = 2500;
height = 2100;

... we should implement these config parameters:

bounding-box:
  min_x: 0
  min_y: 0
  max_x: 2000
  max_y: 2000

Parallelize over image files

A simple parallelization of the for loop over all .tif files should go a long way:

with ThreadPoolExecutor(max_workers=num_threads) as executor:
    results = list(tqdm(executor.map(process_tif, tif_files), total=len(tif_files)))

segment: add processing with external command

An optional "pre-processing" step could be processing the list of files with an external command, e.g. a Fiji script called from the command line. This allows running an arbitrary segmentation while still using the filter and sample functionality of this repository.

The best entry point is probably the source folder (as it's a single parameter), but also the list of files would be possible.

Use case:

  • Run Fiji script to call Weka Trainable Segmentation, write output masks to new folder
  • Return the list of files, so we can hand it over to _process_tif, with an option to skip the segment step (i.e. only run label).
  • Process filter and sample as usual.

Implement centered grid sampling for objects of various size.

When acquiring objects that vary a lot in size (e.g., small objects fit in a single field of view, large objects require 3x2 tiles in second pass acquisition), we'd like to have a sampling that records:

  • the object center for objects that fit into a single FOV,
  • the centers of grid tiles (with definable overlap) centered on each object, for objects larger than a single FOV.

@nrepina what should be the behavior if two objects are close to each other? If we just sample per-object, we have the possibility of overlap (and therefore bleaching) between tiles belonging to two different objects.

Full process definition in config file

I would be nice if we can keep the run script general, and have full flexibility in defining the processing via the config file.

steps:
  - segment: cellpose
  - filter:  # all functions should accept 'labels' and change inplace (and an optional other_channel argument?)
    - bounding_box
    - object_size
  - sample: grid

cellpose:
  - model: /path/to/model
  - diameter: 50.0
  - cellprob_threshold: 0.0
  - flow_threshold: 0.4

bounding_box:
  - min_x: 0
  - min_y: 0
  - max_x: 2000
  - max_y: 2000

object_size:
  - min_size: 100

The items in steps should correspond to functions in the faim_wako_searchfirst.segment, faim_wako_searchfirst.filter and faim_wako_searchfirst.sample modules, respectively.

In addition to steps, each function's arguments are listed under the function name. (This entry should be optional if the function requires no additional arguments.)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.