Skip to content

Migration04 rg #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@
* Get the distance of each detection to its parent's edge
*
* @author Olivier Burri
* @date 202211009
* Last tested on QuPath-0.3.2
* @date 20221207
* Last tested on QuPath-0.4 (RG 20221207)
*
* Requires at least 1 annotation and cells in it
*
*/

def annotations = getAnnotationObjects()
Expand Down
4 changes: 3 additions & 1 deletion Analyze/StarDist/Create_training_rectangle.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@
* SHIFT + D to create more and move them across the image.
* @author Olivier Burri
* Date: 2020.09.15
*
* Last tested on QuPath-0.4 (RG 20221207)
*/

// PARAMETERS
def size = 256 // in pixels: the size of the rectangle (width and height) to create.
def size = 1024 // in pixels: the size of the rectangle (width and height) to create.


// Script start
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ respectively. The naming convention was chosen to match the one used for the Sta

Authors: Olivier Burri, Romain Guiet BioImaging and Optics Platform (EPFL BIOP)

Tested on QuPath 0.3.2, 2022.04.13
Tested on QuPath 0.4.0, 2022.12.08 (RG)

Due to the simple nature of this code, no copyright is applicable
*/

// USER SETTINGS
def channel_of_interest = 2 // null to export all the channels
def channel_of_interest = 1 // null to export all the channels
def downsample = 1


Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
import qupath.ext.stardist.StarDist2D
/*
* Tested on QuPath 0.4.0, 2022.12.08 (RG)
/*
* Tested on QuPath 0.4.0, 2022.12.08 (RG)
*/
import qupath.ext.stardist.StarDist2D
clearDetections()

// Specify the model file (you will need to change this!)
var pathModel = 'C:/QuPath_Common_Data_0.3/models/he_heavy_augment.pb'
//var pathModel = 'C:/QuPath_Common_Data_0.3/models/dsb2018_heavy_augment.pb'
var pathModel = 'C:/QuPath_Common_Data_0.4/models/he_heavy_augment.pb'
//var pathModel = 'C:/QuPath_Common_Data_0.4/models/dsb2018_heavy_augment.pb'

// Get current image - assumed to have color deconvolution stains set
var imageData = getCurrentImageData()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@

/*
* Tested on QuPath 0.4.0, 2022.12.08 (RG)
*/

import qupath.ext.stardist.StarDist2D

// Specify the model file (you will need to change this!)
//var pathModel = 'C:/QuPath_Common_Data_0.3/models/he_heavy_augment.pb'
var pathModel = 'C:/QuPath_Common_Data_0.3/models/dsb2018_heavy_augment.pb'
//var pathModel = 'C:/QuPath_Common_Data_0.4/models/he_heavy_augment.pb'
var pathModel = 'C:/QuPath_Common_Data_0.4/models/dsb2018_heavy_augment.pb'

// Get current image - assumed to have color deconvolution stains set
var imageData = getCurrentImageData()
Expand Down
12 changes: 7 additions & 5 deletions Analyze/StarDist/Run_default_StarDist_detection.groovy
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
/*
* Tested on QuPath 0.4.0, 2022.12.08 (RG)
*/


import qupath.tensorflow.stardist.StarDist2D
//import qupath.tensorflow.stardist.StarDist2D
import qupath.ext.stardist.StarDist2D

// Specify the model directory (you will need to change this!)
//def pathModel = 'Z:\\public\\0 - BIOP Data\\StarDist Models\\silvia_rat_brain_deconvolved_usr_augment_r32_p256_g2_e400_se100_b8_aug_challenge'
def pathModel = 'C:\\Users\\oburri\\Desktop\\he_heavy_augment.pb'
def pathModel = 'C:/QuPath_Common_Data_0.4/models/dsb2018_heavy_augment.pb'


def stardist = StarDist2D.builder(pathModel)
.threshold(0.4) // Probability (detection) threshold
.channels('Original') // Select detection channel
.channels('DAPI') // Select detection channel
.normalizePercentiles(1, 99.8) // Percentile normalization
.pixelSize(0.5) // Resolution for detection
// .tileSize(2048) // Specify width & height of the tile used for prediction
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import qupath.ext.stardist.StarDist2D
/*
* Tested on QuPath 0.4.0, 2022.12.08 (RG)
*/
import qupath.ext.stardist.StarDist2D

// Specify the model file (you will need to change this!)
//var pathModel = 'C:/QuPath_Common_Data_0.3/models/he_heavy_augment.pb'
var pathModel = 'C:/QuPath_Common_Data_0.3/models/dsb2018_heavy_augment.pb'
//var pathModel = 'C:/QuPath_Common_Data_0.4/models/he_heavy_augment.pb'
var pathModel = 'C:/QuPath_Common_Data_0.4/models/dsb2018_heavy_augment.pb'

// Get current image - assumed to have color deconvolution stains set
var imageData = getCurrentImageData()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
*
* @author Olivier Burri
* Date: 2020.09.15
*
*
* Tested on QuPath 0.4.0, 2022.12.08 (RG)
*
*
*/

clearDetections()
Expand All @@ -16,8 +21,7 @@ def toDelete = getAllObjects().findAll{ !(it.getROI() instanceof RectangleROI )
removeObjects( toDelete, false )

// Put the cell detection script between the accolades {}
cellDetection = { runPlugin('qupath.imagej.detect.cells.WatershedCellDetection', '{"detectionImage": "DAPI", "requestedPixelSizeMicrons": 0.1302, "backgroundRadiusMicrons": 5.0, "medianRadiusMicrons": 0.0, "sigmaMicrons": 2.4, "minAreaMicrons": 40.0, "maxAreaMicrons": 1000.0, "threshold": 1600.0, "watershedPostProcess": true, "cellExpansionMicrons": 1.1, "includeNuclei": true, "smoothBoundaries": true, "makeMeasurements": true}'); }

cellDetection = { runPlugin('qupath.imagej.detect.cells.WatershedCellDetection', '{"detectionImage":"DAPI","requestedPixelSizeMicrons":0.5,"backgroundRadiusMicrons":8.0,"backgroundByReconstruction":true,"medianRadiusMicrons":0.0,"sigmaMicrons":1.5,"minAreaMicrons":10.0,"maxAreaMicrons":400.0,"threshold":25.0,"watershedPostProcess":true,"cellExpansionMicrons":1.0,"includeNuclei":true,"smoothBoundaries":true,"makeMeasurements":true}') }
// Script starts below

// Select all annotations, ideally
Expand Down
15 changes: 9 additions & 6 deletions View/Set_fluorescent_channel_names_ranges_and_colors.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,31 @@
*
* @author Olivier Burri
* @date 20221103
* Last tested on QuPath-0.3.2
*
* Tested on QuPath 0.4.0, 2022.12.08 (RG)
*
*/

setImageType('FLUORESCENCE')

// You can replace the names with your stainings if you want

// Channel names in order
def names = ['DAPI', 'FITC', 'CY3', 'CY5']
def names = ['DAPI', 'FITC', 'CY3', 'CY5',"CY7"]

// Channel minimum display values, in order
def mins = [ 0, 0, 0, 0 ]
def mins = [ 0, 0, 0, 0 , 0]

// Channel maximum display values, in order
def maxs = [ 8000, 7500, 6000, 820 ]
def maxs = [ 255, 255, 255, 255,255 ]

// Channel colors: Make sure that the number of colors in this list
// matches the number of channels
def colors = [ getColorRGB( 0, 128, 255 ),
getColorRGB( 0, 255, 128 ),
getColorRGB( 128, 255, 0 ),
getColorRGB( 255, 0, 128 )
getColorRGB( 255, 128, 0 ),
getColorRGB( 255, 0, 128 ),
getColorRGB( 128, 0, 255 )
]


Expand Down