Dear colleagues
I am currently working with the StarDist cell detection within QuPath which is basically doing a great job so far!
I am working with brightfield H-DAB immunohistochemistry images, thus the pretrained H&E model is obviously not perfectly trained to detect the nuclei in such images (but still doing surprisingly well…).
So I thought it would be ideal if I could apply the Fluorescence-trained model and apply it on the Hematoxylin channel in Brightfield. However I did not yet manage to get the (prewritten) code the right way to do so for the line (bold) :
import qupath.tensorflow.stardist.StarDist2D
// Specify the model directory (you will need to change this!)
def pathModel = ‘path to my model’
double originalPixelSize = getCurrentImageData().getServer().getPixelCalibration().getAveragedPixelSizeMicrons();def stardist = StarDist2D.builder(pathModel)
.threshold(0.5) // Probability (detection) threshold
.channels(0) // Select detection channel
.normalizePercentiles(1, 99) // Percentile normalization
.pixelSize(originalPixelSize) // Resolution for detection
.cellExpansion(3.0) // Approximate cells based upon nucleus expansion
.cellConstrainScale(1.5) // Constrain cell expansion using nucleus size
.measureShape() // Add shape measurements
.measureIntensity() // Add cell measurements (in all compartments)
.includeProbability(true) // Add probability as a measurement (enables later filtering)
.build()// Run detection for the selected objects
def imageData = getCurrentImageData()
def pathObjects = getSelectedObjects()
if (pathObjects.isEmpty()) {
Dialogs.showErrorMessage(“StarDist”, “Please select a parent object!”)
return
}
stardist.detectObjects(imageData, pathObjects)
println ‘Done!’
I highly appreciate any help!
Best regards,
Luke