/cellposeForNaparm

a little utility to generate cellpose rois for use with naparm

Primary LanguagePython

Cellpose For Naparm

a little utility to generate cellpose rois for use with naparm

Usage

  • drag and drop images into the window
    • multiple images corresponding to seperate z-plane can be dragged at once. multi-page tiffs can also be used.
  • adjust settings (optimise using the cellpose gui)
  • click run
  • load the generated '*_CELLPOSE.mat' file into naparm

Screenshots

The GUI:

image

The output MAT file:

image

Loaded into Naparm:

image

Output format

_CELLPOSE.m has the following fields:

  • 'software' - flag to know genreated by cellpose
  • 'img' - the images loaded into cellpose
  • 'files' - the filepaths of the images
  • 'model' cellpose parameter - the type of model
  • 'cellsize' - cellpose paramter - roi size in pixels
  • 'threshold' - cellpose paramter - threhsold
  • 'masks' - cellpose output - array size of images with pixel coloured accoring to roi number

Make MATLAB ROIs

Load the *_CELLPOSE.m file into makeCellposeRois.m to generate ROI and halo masks to extract time-series data from movie (with extractTraces.m from 'simplePipeline')

filepath = 'C:\Users\User\Desktop\20200119_RN191_t-001_onlineREG_Plane1_CorrImg_CELLPOSE.mat';
watershed_width = 2;
halo_multiplier = 2;
show_plot = 1;
[roi, halo] = makeCellposeRois(filepath, watershed_width, halo_multiplier, show_plot);

image

Dependencies

  • cellpose
  • pyqt5
  • skimage

Improvements

  • figure out how to load cellpose.npy into matlab (readNPY.m does not work out the box)
  • modify cellpose to save MAT files, but also need to modify to allow multiple images at once
  • show output masks in this gui to allow for optimisation
  • add in image manipulation (blur, denoise, bg-removal etc) to improve results
  • or, run cellpose direct from matlab
    • Python Error: MXNetError: Error in operator cpnet4_downsample0_resdown0_hybridsequential5_conv0_fwd: Shape inconsistent, Provided = [32,2,1,1], inferred shape=(32,3,1,1)