Class Spotiflow

java.lang.Object
qupath.ext.biop.spotiflow.Spotiflow

public class Spotiflow extends Object
Spot detection based on the following method:
   Albert Dominguez Mantes et al.
     "Spotiflow: accurate and efficient spot detection for fluorescence microscopy with deep stereographic flow regression"
   Cold Spring Harbor Laboratory - bioRxiv, 2024. doi: 10.1101/2024.02.01.578426
 
See the main repo at https://github.com/weigertlab/spotiflow

Very much inspired by qupath-extension-cellpose at https://github.com/BIOP/qupath-extension-cellpose

  • Field Details

    • modelDir

      protected File modelDir
    • pretrainedModelName

      protected String pretrainedModelName
    • doSubpixel

      protected String doSubpixel
    • pathClass

      protected String pathClass
    • probabilityThreshold

      protected double probabilityThreshold
    • minDistance

      protected int minDistance
    • classChannelName

      protected boolean classChannelName
    • clearAllChildObjects

      protected boolean clearAllChildObjects
    • clearChildObjectsBelongingToCurrentChannels

      protected boolean clearChildObjectsBelongingToCurrentChannels
    • spotiflowSetup

      protected SpotiflowSetup spotiflowSetup
    • parameters

      protected LinkedHashMap<String,String> parameters
    • tempDirectory

      protected File tempDirectory
    • channels

      protected Map<String,Integer> channels
    • channelsIdx

      protected String[] channelsIdx
    • cleanTempDir

      protected boolean cleanTempDir
    • disableGPU

      protected boolean disableGPU
    • process3d

      protected boolean process3d
    • nThreads

      protected int nThreads
    • isOmeZarr

      protected boolean isOmeZarr
    • trainingInputDir

      protected File trainingInputDir
    • trainingOutputDir

      protected File trainingOutputDir
    • validationInputDir

      protected File validationInputDir
    • testDir

      protected File testDir
    • nEpochs

      protected int nEpochs
    • doNotApplyDataAugmentation

      protected boolean doNotApplyDataAugmentation
    • modelToFineTune

      protected String modelToFineTune
    • lr

      protected double lr
    • includeNegatives

      protected boolean includeNegatives
    • pointClasses

      protected List<String> pointClasses
    • zStart

      protected int zStart
    • zEnd

      protected int zEnd
    • cleanTrainingDir

      protected boolean cleanTrainingDir
    • creatorFun

      protected Function<qupath.lib.roi.interfaces.ROI,qupath.lib.objects.PathObject> creatorFun
  • Constructor Details

    • Spotiflow

      public Spotiflow()
  • Method Details

    • builder

      public static SpotiflowBuilder builder()
      Create a builder to customize detection parameters.
      Returns:
      this builder
    • builder

      public static SpotiflowBuilder builder(File builderPath)
      Load a previously serialized builder. See SpotiflowBuilder(File) and SpotiflowBuilder.saveBuilder(String)
      Parameters:
      builderPath - path to the builder JSON file.
      Returns:
      this builder
    • helpTrain

      public void helpTrain()
      Prints the help and the available CLI arguments for the training command
    • helpPredict

      public void helpPredict()
      Prints the help and the available CLI arguments for the prediction command
    • detectObjects

      public void detectObjects(qupath.lib.images.ImageData<BufferedImage> imageData, String entryID, Collection<? extends qupath.lib.objects.PathObject> parents)
      Detect cells within one or more parent objects, firing update events upon completion.
      Parameters:
      imageData - the image data containing the object
      entryID - the unique QuPath ID of the current image
      parents - the parent objects; existing child objects will be removed, and replaced by the detected cells
    • train

      public File train()
      Executes the spotiflow training by 1. Saving the images 2. running spotiflow
      Returns:
      a link to the model file, which can be displayed
    • getQCResults

      public ij.measure.ResultsTable getQCResults()
      Get the results table associated with the Quality Control run
      Returns:
      the results table with the QC metrics
    • saveTrainingImages

      public void saveTrainingImages()
      Goes through the current project and saves the images and point coordinates to the training and validation directories
    • setupChannels

      public void setupChannels(qupath.lib.images.ImageData<BufferedImage> imageData, Integer[] channels)
      Get the name of the channels from their index and fill a map<ChannelName, ChannelIndex>
      Parameters:
      imageData - the current imageData
      channels - the channels indices