4 - Segmentation#
4.1 - DAPI segmentation with thresholding#
open the DAPI.tif image (drag & drop, or
File > Open
)change
LUT
to GraysImage > Duplicate
(IJ:28.9) (shift + d)Image > Adjust > Threshold
(IJ:28.2.4)understand the function of the
Dark Background
checkbox (inspect pixel values)try setting sliders manually. Can you find a good threshold range?
try different algorithms by selecting them in the left dropdown menu. Can you find one that gives a good result?
NOTE:
Image > Adjust > Auto Threshold
, if you want to see all at the same time
try different display options (
Red
,B&W
,Over/Under
) by selecting them in the right dropdown menu, do you understand what they show?when happy with result, click
Apply
save the resulting binary image:
File > Save As > Tiff
apply watershed to divide touching objects
select the binary image
Process > Binary > Watershed
proceed with
Analyze > Analyze Particles
(IJ:30.2)select
Exclude on Edges
andAdd to Manager
click on
OK
bonus: repeat step 12 but use the
Size
andCircularity
options to try to exclude some particles and theShow
dropdown menu to visualize different outputs.set the parameters you want to measure:
Analyze > Set Measurement
(IJ:30.2)select
Area
,Mean gray value
,Min & max gray value
,Display label
click on
OK
select the original image (open it again as in step 1 if you do not have it)
in the
ROI Manager
, click onDeselect
and then onMeasure
save the
Results
table as .csv: select the table and click onFile > Save As
4.2 - DAPI segmentation with filters and thresholding#
open the DAPI_noise.tif image (drag & drop, or
File > Open
)change LUT to Grays
Image > Duplicate
(IJ:28.9) (shift + d)Image > Adjust > Threshold
(IJ:28.2.4)understand the function of the
Dark Background
checkbox (inspect pixel values)try setting sliders manually. Can you find a good threshold range?
try different algorithms by selecting them in the left dropdown menu. Can you find one that gives a good result?
NOTE:
Image > Adjust > Auto Threshold
, if you want to see all at the same time
apply a filter of your choice (
Mean
,Gaussian Blur
,Median
, …)Process > Filters
check the
Preview
checkboxchange the
Radius
/Sigma
. What happens to the image?when you are happy, click on
OK
repeat steps 3, 7 and 8 until happy with result, then click
Apply
save the resulting binary image:
File > Save As > Tiff
apply watershed to divide touching objects
select the binary image
Process > Binary > Watershed
proceed with
Analyze > Analyze Particles
(IJ:30.2)select
Exclude on Edges
andAdd to Manager
click on
OK
bonus: repeat step 12 but use the
Size
andCircularity
options to try to exclude some particles and theShow
dropdown menu to visualize different outputs.set the parameters you want to measure:
Analyze > Set Measurement
(IJ:30.2)select
Area
,Mean gray value
,Min & max gray value
,Display label
click on
OK
select the original image (open it again as in step 1 if you do not have it)
in the
ROI Manager
, click onDeselect
and then onMeasure
save the
Results
table as .csv: select the table and click onFile > Save As
4.3 - DAPI segmentation with Labkit#
open the hela.tif image (drag & drop, or
File > Open
)change
LUT
to GraysPlugins > Labkit > Open Current Image With Labkit
sidebar, under
Segmentation
: clickLabkit Pixel Classification
topbar: select the pencil tool
sidebar: select
foreground
. Draw a line inside a nucleussidebar: select
background
. Draw a line outside a nucleussidebar: click the play button next to
Labkit Pixelclassification
repeat the last three steps until happy with result
click the drop down menu next to
Labkit Pixel Classifier
. SelectShow Probability Map in ImageJ
inspect the probability maps, do you understand the meaning of the values of the pixels in the different channels?
export the segmentation: click the drop down menu next to
Labkit Pixel Classifier
:Segmentation > Show Segmentation Results in ImageJ
inspect results, do you understand the meaning of the pixel values?
you now have a binary image, but not the kind Fiji likes
to measure, proceed by thresholding (
Image > Adjust > Threshold...
): “set” both threshold values to 1, then Analyze Particles, etcalternatively, multiply all values in the Labkit output image by 255, then apply Binarize, etc
save the resulting image with name “myLabkitHeLa1.tif”:
File > Save As > Tiff
4.4 - DAPI double-segmentation with Labkit#
open the hela.tif image (drag & drop, or
File > Open
)change
LUT
to GraysProcess > Enhance Contrast
. checkEqualize histogram
. Then,OK
Plugins > Labkit > Open Current Image With Labkit
sidebar, under
Segmentation
: clickLabkit Pixel Classification
sidebar, under
Labeling
: clickadd label
rename
Label 1
by doublecklicking. For instance intocytoplasm
. Optional: choose a different label color by clicking onto the color swatch.topbar: select the pencil tool
sidebar: select
foreground
. Draw a line inside a nucleussidebar: select
cytoplasm
. Draw a line inside the cytoplasmsidebar: select
background
. Draw a line where there is no cellsidebar: click the play button next to
Labkit Pixelclassification
repeat the last four steps until happy with result
click the drop down menu next to
Labkit Pixel Classifier
. SelectShow Probability Map in ImageJ
inspect the probability maps, do you understand the meaning of the values of the pixels in the different channels?
export the segmentation: click the drop down menu next to
Labkit Pixel Classifier
:Segmentation > Show Segmentation Results in ImageJ
inspect results, do you understand the meaning of the pixel values?
you now have an image with three values
to measure, proceed by thresholding (
Image > Adjust > Threshold...
) at 0, 1, and 2, to extract each class (use Set and then set both thresholds to 0, 1, or 2)then proceed with Analyze Particles, etc for each of the classes of interest (nuclei and cytoplasm)
Bonus round: play with Settings