Package qupath.ext.biop.spotiflow
Class SpotiflowBuilder
java.lang.Object
qupath.ext.biop.spotiflow.SpotiflowBuilder
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.578426See the main repo at https://github.com/weigertlab/spotiflow
Very much inspired by qupath-extension-cellpose at https://github.com/BIOP/qupath-extension-cellpose
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddParameter
(String flagName) Generic means of adding a spotiflow parameteraddParameter
(String flagName, String flagValue) Generic means of adding a spotiflow parameterbuild()
Create aSpotiflow
, all ready for detection.channels
(int... channels) Specify channels.Specify channels by name.clear all files in the temRemove all child objects (i.e.Remove child objects (i.e.Forces using CPU instead of GPUdoSubpixel
(boolean doSubpixel) Allows to go subpixel resolutionnThreads
(int nThreads) Specify the number of threads to use for processing.Allows to process all slices of 3D stack.process3d
(boolean process3d) Deprecated.saveBuilder
(String name) Save this builder as a JSON file in order to be able to reuse it in placesavePredictionImages
(boolean savePredictionImages) Deprecated.usecleanTempDir()
insteadTrue to save images in the temp folder as OME-Zarr files.Allows to go subpixel resolutionAllows to go subpixel resolutionsetMinDistance
(double minDistance) Set minimum distance between spots for NMSsetModelDir
(File modelDir) Set model directory to use for predictionsetPretrainedModelName
(String modelName) Set pre-trained model to use for predictionsetProbabilityThreshold
(double probabilityThreshold) Set probability threshold for peak detectionsetTrainingInputDir
(File inputDir) Set input folder to train a new modelsetTrainingOutputDir
(File outputDir) Set output folder to save a new modeltempDirectory
(File inputDir) Set input folder to predict spots
-
Constructor Details
-
SpotiflowBuilder
protected SpotiflowBuilder()Build a spotiflow model
-
-
Method Details
-
tempDirectory
Set input folder to predict spots- Parameters:
inputDir
- path to prediction input dir- Returns:
- this builder
-
savePredictionImages
Deprecated.usecleanTempDir()
insteadSet input folder to predict spots- Parameters:
savePredictionImages
- overwrite variable- Returns:
- this builder
-
cleanTempDir
clear all files in the tem- Returns:
- this builder
-
setPretrainedModelName
Set pre-trained model to use for prediction- Parameters:
modelName
- name of the pre-trained model- Returns:
- this builder
-
setProbabilityThreshold
Set probability threshold for peak detection- Parameters:
probabilityThreshold
-- Returns:
- this builder
-
setMinDistance
Set minimum distance between spots for NMS- Parameters:
minDistance
-- Returns:
- this builder
-
setModelDir
Set model directory to use for prediction- Parameters:
modelDir
- path to the custom model- Returns:
- this builder
-
channels
Specify channels. Useful for detecting nuclei for one channel within a multi-channel image, or potentially for trained models that support multi-channel input.- Parameters:
channels
- 0-based indices of the channels to use- Returns:
- this builder
-
channels
Specify channels by name. Useful for detecting nuclei for one channel within a multichannel image, or potentially for trained models that support multichannel input.- Parameters:
channels
- channels names to use- Returns:
- this builder
-
setTrainingInputDir
Set input folder to train a new model- Parameters:
inputDir
- path to the training input dir- Returns:
- this builder
-
setTrainingOutputDir
Set output folder to save a new model- Parameters:
outputDir
- path to the training input dir- Returns:
- this builder
-
disableGPU
Forces using CPU instead of GPU- Returns:
- this builder
-
process3d
Deprecated.useprocess3d()
insteadAllows to process all slices- Parameters:
process3d
- override process3d- Returns:
- this builder
-
process3d
Allows to process all slices of 3D stack. Has to be used together with a 3D-model (custom or pre-trained)- Returns:
- this builder
-
doSubpixel
Allows to go subpixel resolution- Parameters:
doSubpixel
- override doSubpixel- Returns:
- this builder
-
setClassChannelName
Allows to go subpixel resolution- Returns:
- this builder
-
nThreads
Specify the number of threads to use for processing. If you encounter problems, setting this to 1 may help to resolve them by preventing multithreading.- Parameters:
nThreads
- the number of threads to use- Returns:
- this builder
-
setClass
Allows to go subpixel resolution- Returns:
- this builder
-
saveBuilder
Save this builder as a JSON file in order to be able to reuse it in place- Parameters:
name
- A name to append to the JSON file. Keep it meaningful for your needs- Returns:
- this builder
-
saveTempImagesAsOmeZarr
True to save images in the temp folder as OME-Zarr files. Otherwise, saved as OME-TIFF WARNING : OME-Zarr option is only available from spotiflow >= 0.5.8- Returns:
- this builder
-
clearAllChildObjects
Remove all child objects (i.e. previous points) from the parent shapes- Returns:
- this builder
-
clearChildObjectsBelongingToCurrentChannels
Remove child objects (i.e. previous points) from the parent shapes which belongs to the current selected channel(s) i.e. which have the same class as the channel name. Should be used together withsetClassChannelName()
to have the desired effect.- Returns:
- this builder
-
addParameter
Generic means of adding a spotiflow parameter- Parameters:
flagName
- the name of the flag, e.g. "save_every"flagValue
- the value that is linked to the flag, e.g. "20". Can be an empty string or null if it is not needed- Returns:
- this builder
-
addParameter
Generic means of adding a spotiflow parameter- Parameters:
flagName
- the name of the flag, e.g. "save_every"- Returns:
- this builder
-
build
Create aSpotiflow
, all ready for detection.- Returns:
- a new
Spotiflow
instance
-
process3d()
instead