Package qupath.ext.biop.spotiflow
Class Spotiflow
java.lang.Object
qupath.ext.biop.spotiflow.Spotiflow
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 Summary
FieldsModifier and TypeFieldDescriptionprotected String[]protected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected Function<qupath.lib.roi.interfaces.ROI, qupath.lib.objects.PathObject> protected booleanprotected booleanprotected Stringprotected booleanprotected booleanprotected doubleprotected intprotected Fileprotected Stringprotected intprotected intprotected LinkedHashMap<String, String> protected Stringprotected Stringprotected doubleprotected booleanprotected SpotiflowSetupprotected Fileprotected Fileprotected Fileprotected Fileprotected Fileprotected intprotected int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic SpotiflowBuilderbuilder()Create a builder to customize detection parameters.static SpotiflowBuilderLoad a previously serialized builder.voiddetectObjects(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.ij.measure.ResultsTableGet the results table associated with the Quality Control runvoidPrints the help and the available CLI arguments for the prediction commandvoidPrints the help and the available CLI arguments for the training commandvoidGoes through the current project and saves the images and point coordinates to the training and validation directoriesvoidsetupChannels(qupath.lib.images.ImageData<BufferedImage> imageData, Integer[] channels) Get the name of the channels from their index and fill a map<ChannelName, ChannelIndex>train()Executes the spotiflow training by 1.
-
Field Details
-
modelDir
-
pretrainedModelName
-
doSubpixel
-
pathClass
-
probabilityThreshold
protected double probabilityThreshold -
minDistance
protected int minDistance -
classChannelName
protected boolean classChannelName -
clearAllChildObjects
protected boolean clearAllChildObjects -
clearChildObjectsBelongingToCurrentChannels
protected boolean clearChildObjectsBelongingToCurrentChannels -
spotiflowSetup
-
parameters
-
tempDirectory
-
channels
-
channelsIdx
-
cleanTempDir
protected boolean cleanTempDir -
disableGPU
protected boolean disableGPU -
process3d
protected boolean process3d -
nThreads
protected int nThreads -
isOmeZarr
protected boolean isOmeZarr -
trainingInputDir
-
trainingOutputDir
-
validationInputDir
-
testDir
-
nEpochs
protected int nEpochs -
doNotApplyDataAugmentation
protected boolean doNotApplyDataAugmentation -
modelToFineTune
-
lr
protected double lr -
includeNegatives
protected boolean includeNegatives -
pointClasses
-
zStart
protected int zStart -
zEnd
protected int zEnd -
cleanTrainingDir
protected boolean cleanTrainingDir -
creatorFun
-
-
Constructor Details
-
Spotiflow
public Spotiflow()
-
-
Method Details
-
builder
Create a builder to customize detection parameters.- Returns:
- this builder
-
builder
Load a previously serialized builder. SeeSpotiflowBuilder(File)andSpotiflowBuilder.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 objectentryID- the unique QuPath ID of the current imageparents- the parent objects; existing child objects will be removed, and replaced by the detected cells
-
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
Get the name of the channels from their index and fill a map<ChannelName, ChannelIndex>- Parameters:
imageData- the current imageDatachannels- the channels indices
-