Skip to content

Commit 42d8c12

Browse files
committed
add RescaleIntensity module to improve visualization of overlays
1 parent 6ed33e4 commit 42d8c12

File tree

3 files changed

+60
-16
lines changed

3 files changed

+60
-16
lines changed

BeginnerSegmentation/bonus_materials/bonus_1_import_masks.cppipe

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
CellProfiler Pipeline: http://www.cellprofiler.org
22
Version:5
3-
DateRevision:426
3+
DateRevision:428
44
GitHash:
5-
ModuleCount:8
5+
ModuleCount:9
66
HasImagePlaneDetails:False
77

88
Images:[module_num:1|svn_version:'Unknown'|variable_revision_number:2|show_window:False|notes:['To begin creating your project, use the Images module to compile a list of files and/or folders that you want to analyze. You can also specify a set of rules to include only the desired files in your selected folders.', '', 'Drag and drop your IMAGES (you can drag and drop the entire "images_Illum-corrected" folder) into the panel just below this one.', '', '<-Drag and drop your "segmentation_start.cppipe" files into the left panel.']|batch_state:array([], dtype=uint8)|enabled:True|wants_pause:False]
@@ -149,7 +149,21 @@ IdentifySecondaryObjects:[module_num:6|svn_version:'Unknown'|variable_revision_n
149149
# of deviations:2
150150
Thresholding method:Otsu
151151

152-
OverlayOutlines:[module_num:7|svn_version:'Unknown'|variable_revision_number:4|show_window:False|notes:['This module produces a comparison of our segmentations so far by overlaying the Nuclei and two sets of Cell segmentations on the Actin image.', 'This is useful both as a sanity check and as a means of showing the results of your analysis to others!', '', 'The output of this module is called CellSegmentationCheck.']|batch_state:array([], dtype=uint8)|enabled:True|wants_pause:False]
152+
RescaleIntensity:[module_num:7|svn_version:'Unknown'|variable_revision_number:3|show_window:False|notes:['Sometimes, the intensity of the image pixels are very dim compared to the bright segmentation outlines that we are going overlay on the next module.', "By rescaling the image, we are modifying the pixel values so that they cover the entire range of intensities and the image doesn't look too dim compared with the outlines.", 'This is for visualization purposes ONLY. You should not make measurements on the rescaled image!']|batch_state:array([], dtype=uint8)|enabled:True|wants_pause:False]
153+
Select the input image:OrigActin_Golgi_Membrane
154+
Name the output image:OrigActin_Golgi_Membrane_RESCALED
155+
Rescaling method:Stretch each image to use the full intensity range
156+
Method to calculate the minimum intensity:Custom
157+
Method to calculate the maximum intensity:Custom
158+
Lower intensity limit for the input image:0.0
159+
Upper intensity limit for the input image:1.0
160+
Intensity range for the input image:0.0,1.0
161+
Intensity range for the output image:0.0,1.0
162+
Select image to match in maximum intensity:None
163+
Divisor value:1.0
164+
Divisor measurement:None
165+
166+
OverlayOutlines:[module_num:8|svn_version:'Unknown'|variable_revision_number:4|show_window:False|notes:['This module produces a comparison of our segmentations so far by overlaying the Nuclei and two sets of Cell segmentations on the Actin image.', 'This is useful both as a sanity check and as a means of showing the results of your analysis to others!', '', 'The output of this module is called CellSegmentationCheck.']|batch_state:array([], dtype=uint8)|enabled:True|wants_pause:False]
153167
Display outlines on a blank image?:No
154168
Select image on which to display outlines:OrigActin_Golgi_Membrane
155169
Name the output image:CellSegmentationCheck
@@ -163,7 +177,7 @@ OverlayOutlines:[module_num:7|svn_version:'Unknown'|variable_revision_number:4|s
163177
Select outline color:#FFFFFF
164178
Select objects to display:CellposeCells
165179

166-
SaveImages:[module_num:8|svn_version:'Unknown'|variable_revision_number:16|show_window:False|notes:['This module saves the CellSegmentationCheck images for future reference. It does so in a sub-folder of the default output folder called "overlay-images".', 'Tha name of the saved file is constructed using the name of the corresponding OrigActin image as a prefix and adding a "_cell_overlay" suffix. ']|batch_state:array([], dtype=uint8)|enabled:True|wants_pause:False]
180+
SaveImages:[module_num:9|svn_version:'Unknown'|variable_revision_number:16|show_window:False|notes:['This module saves the CellSegmentationCheck images for future reference. It does so in a sub-folder of the default output folder called "overlay-images".', 'Tha name of the saved file is constructed using the name of the corresponding OrigActin image as a prefix and adding a "_cell_overlay" suffix. ']|batch_state:array([], dtype=uint8)|enabled:True|wants_pause:True]
167181
Select the type of image to save:Image
168182
Select the image to save:CellSegmentationCheck
169183
Select method for constructing file names:From image filename

BeginnerSegmentation/bonus_materials/bonus_2_ilastik.cppipe

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
CellProfiler Pipeline: http://www.cellprofiler.org
22
Version:5
3-
DateRevision:426
3+
DateRevision:428
44
GitHash:
5-
ModuleCount:15
5+
ModuleCount:16
66
HasImagePlaneDetails:False
77

88
Images:[module_num:1|svn_version:'Unknown'|variable_revision_number:2|show_window:False|notes:['To begin creating your project, use the Images module to compile a list of files and/or folders that you want to analyze. You can also specify a set of rules to include only the desired files in your selected folders.', '', 'Drag and drop your IMAGES (you can drag and drop the entire "images_Illum-corrected" folder) into the panel just below this one.', '', '<-Drag and drop your "segmentation_start.cppipe" files into the left panel.']|batch_state:array([], dtype=uint8)|enabled:True|wants_pause:False]
@@ -215,7 +215,7 @@ Runilastik:[module_num:11|svn_version:'Unknown'|variable_revision_number:1|show_
215215
Project file:
216216
Select the project type:Pixel Classification
217217

218-
ColorToGray:[module_num:12|svn_version:'Unknown'|variable_revision_number:4|show_window:False|notes:['This module is used to split the two channel image created by ilastik (since the original ilastik project file had two channels - if more than 2 channels had been created in ilastik, there might be many channels here!) so that we can get out the probability predictions for the nucleoli specifically. The second channel does not actually NEED to be extracted here, but is done as a demonstration.']|batch_state:array([], dtype=uint8)|enabled:True|wants_pause:False]
218+
ColorToGray:[module_num:12|svn_version:'Unknown'|variable_revision_number:4|show_window:False|notes:['This module is used to split the two channel image created by ilastik (since the original ilastik project file had two channels - if more than 2 channels had been created in ilastik, there might be many channels here!) so that we can get out the probability predictions for the nucleoli specifically. The second channel does not actually NEED to be extracted here, but is done as a demonstration.']|batch_state:array([], dtype=uint8)|enabled:True|wants_pause:True]
219219
Select the input image:Runilastik
220220
Conversion method:Split
221221
Image type:Channels
@@ -279,9 +279,23 @@ IdentifyPrimaryObjects:[module_num:13|svn_version:'Unknown'|variable_revision_nu
279279
# of deviations:2
280280
Thresholding method:Otsu
281281

282-
OverlayOutlines:[module_num:14|svn_version:'Unknown'|variable_revision_number:4|show_window:False|notes:['This module produces a visualization of our segmentations so far by overlaying the Nuclei, Nucleoli, and NucleoliFromIlastik objects outlines onto the OrigRNA image.', 'This is useful both as a sanity check and as a means of showing theresults of your analysis to others!', '', 'The output of this module is called SanityCheck.']|batch_state:array([], dtype=uint8)|enabled:True|wants_pause:False]
282+
RescaleIntensity:[module_num:14|svn_version:'Unknown'|variable_revision_number:3|show_window:False|notes:['Sometimes, the intensity of the image pixels are very dim compared to the bright segmentation outlines that we are going overlay on the next module.', "By rescaling the image, we are modifying the pixel values so that they cover the entire range of intensities and the image doesn't look too dim compared with the outlines.", 'This is for visualization purposes ONLY. You should not make measurements on the rescaled image!']|batch_state:array([], dtype=uint8)|enabled:True|wants_pause:False]
283+
Select the input image:OrigRNA
284+
Name the output image:OrigRNA_RESCALED
285+
Rescaling method:Stretch each image to use the full intensity range
286+
Method to calculate the minimum intensity:Custom
287+
Method to calculate the maximum intensity:Custom
288+
Lower intensity limit for the input image:0.0
289+
Upper intensity limit for the input image:1.0
290+
Intensity range for the input image:0.0,1.0
291+
Intensity range for the output image:0.0,1.0
292+
Select image to match in maximum intensity:None
293+
Divisor value:1.0
294+
Divisor measurement:None
295+
296+
OverlayOutlines:[module_num:15|svn_version:'Unknown'|variable_revision_number:4|show_window:False|notes:['This module produces a visualization of our segmentations so far by overlaying the Nuclei, Nucleoli, and NucleoliFromIlastik objects outlines onto the OrigRNA image.', 'This is useful both as a sanity check and as a means of showing theresults of your analysis to others!', '', 'The output of this module is called SanityCheck.']|batch_state:array([], dtype=uint8)|enabled:True|wants_pause:False]
283297
Display outlines on a blank image?:No
284-
Select image on which to display outlines:OrigRNA
298+
Select image on which to display outlines:OrigRNA_RESCALED
285299
Name the output image:SanityCheck
286300
Outline display mode:Color
287301
Select method to determine brightness of outlines:Max of image
@@ -293,7 +307,7 @@ OverlayOutlines:[module_num:14|svn_version:'Unknown'|variable_revision_number:4|
293307
Select outline color:#FFFFFF
294308
Select objects to display:NucleoliFromilastik
295309

296-
SaveImages:[module_num:15|svn_version:'Unknown'|variable_revision_number:16|show_window:False|notes:['This module saves the SanityCheck images for future reference. It does so in a sub-folder of the default output folder called "overlay-images".', 'Tha name of the saved file is constructed using the name of the corresponding OrigRNA image as a prefix and adding a "_ilastik_overlay" suffix. ']|batch_state:array([], dtype=uint8)|enabled:True|wants_pause:False]
310+
SaveImages:[module_num:16|svn_version:'Unknown'|variable_revision_number:16|show_window:False|notes:['This module saves the SanityCheck images for future reference. It does so in a sub-folder of the default output folder called "overlay-images".', 'Tha name of the saved file is constructed using the name of the corresponding OrigRNA image as a prefix and adding a "_ilastik_overlay" suffix. ']|batch_state:array([], dtype=uint8)|enabled:True|wants_pause:False]
297311
Select the type of image to save:Image
298312
Select the image to save:SanityCheck
299313
Select method for constructing file names:From image filename

BeginnerSegmentation/bonus_materials/bonus_3_cellpose.cppipe

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
CellProfiler Pipeline: http://www.cellprofiler.org
22
Version:5
3-
DateRevision:426
3+
DateRevision:428
44
GitHash:
5-
ModuleCount:8
5+
ModuleCount:9
66
HasImagePlaneDetails:False
77

88
Images:[module_num:1|svn_version:'Unknown'|variable_revision_number:2|show_window:False|notes:['To begin creating your project, use the Images module to compile a list of files and/or folders that you want to analyze. You can also specify a set of rules to include only the desired files in your selected folders.', '', 'Drag and drop your IMAGES (you can drag and drop the entire "images_Illum-corrected" folder) into the panel just below this one.', '', '<-Drag and drop your "segmentation_start.cppipe" files into the left panel.']|batch_state:array([], dtype=uint8)|enabled:True|wants_pause:False]
@@ -77,8 +77,9 @@ Groups:[module_num:4|svn_version:'Unknown'|variable_revision_number:2|show_windo
7777
grouping metadata count:1
7878
Metadata category:None
7979

80-
RunCellpose:[module_num:5|svn_version:'Unknown'|variable_revision_number:4|show_window:False|notes:[]|batch_state:array([], dtype=uint8)|enabled:True|wants_pause:False]
80+
RunCellpose:[module_num:5|svn_version:'Unknown'|variable_revision_number:6|show_window:False|notes:[]|batch_state:array([], dtype=uint8)|enabled:True|wants_pause:False]
8181
Select the input image:OrigDNA
82+
Rescale images before running Cellpose:No
8283
Run CellPose in docker or local python environment:Docker
8384
Select Cellpose docker image:cellprofiler/runcellpose_with_pretrained:0.1
8485
Expected object diameter:30
@@ -101,6 +102,7 @@ RunCellpose:[module_num:5|svn_version:'Unknown'|variable_revision_number:4|show_
101102
Use Omnipose for mask reconstruction:No
102103
Invert images:No
103104
Remove objects that are touching the edge?:Yes
105+
Rescale probability map?:No
104106

105107
IdentifyPrimaryObjects:[module_num:6|svn_version:'Unknown'|variable_revision_number:15|show_window:False|notes:['This module is used to create a group of objects called Nuclei by segmenting the nuclear regions from the OrigDNA image.', 'The settings used here should be good enough for the images used in this tutorial but they depend highly on the image set!', '', 'We encourage you to play around with the settings in order to get a "good enough" segmentation of your own data.', 'REMEMBER: we aim for "good enough" because there is no settings that will give you a PERFECT segmentation every time in every image.']|batch_state:array([], dtype=uint8)|enabled:True|wants_pause:False]
106108
Select the input image:OrigDNA
@@ -138,9 +140,23 @@ IdentifyPrimaryObjects:[module_num:6|svn_version:'Unknown'|variable_revision_num
138140
# of deviations:2
139141
Thresholding method:Otsu
140142

141-
OverlayOutlines:[module_num:7|svn_version:'Unknown'|variable_revision_number:4|show_window:False|notes:['This module produces a visualization of our segmentations so far by overlaying the RunCellpose and Nuclei objects outlines onto the OrigDNA image.', 'This is useful both as a sanity check and as a means of showing the results of your analysis to others!', '', 'The output of this module is called NucleiCheck.']|batch_state:array([], dtype=uint8)|enabled:True|wants_pause:False]
143+
RescaleIntensity:[module_num:7|svn_version:'Unknown'|variable_revision_number:3|show_window:False|notes:['Sometimes, the intensity of the image pixels are very dim compared to the bright segmentation outlines that we are going overlay on the next module.', "By rescaling the image, we are modifying the pixel values so that they cover the entire range of intensities and the image doesn't look too dim compared with the outlines.", 'This is for visualization purposes ONLY. You should not make measurements on the rescaled image!']|batch_state:array([], dtype=uint8)|enabled:True|wants_pause:False]
144+
Select the input image:OrigDNA
145+
Name the output image:OrigDNA_RESCALED
146+
Rescaling method:Stretch each image to use the full intensity range
147+
Method to calculate the minimum intensity:Custom
148+
Method to calculate the maximum intensity:Custom
149+
Lower intensity limit for the input image:0.0
150+
Upper intensity limit for the input image:1.0
151+
Intensity range for the input image:0.0,1.0
152+
Intensity range for the output image:0.0,1.0
153+
Select image to match in maximum intensity:None
154+
Divisor value:1.0
155+
Divisor measurement:None
156+
157+
OverlayOutlines:[module_num:8|svn_version:'Unknown'|variable_revision_number:4|show_window:False|notes:['This module produces a visualization of our segmentations so far by overlaying the RunCellpose and Nuclei objects outlines onto the OrigDNA image.', 'This is useful both as a sanity check and as a means of showing the results of your analysis to others!', '', 'The output of this module is called NucleiCheck.']|batch_state:array([], dtype=uint8)|enabled:True|wants_pause:False]
142158
Display outlines on a blank image?:No
143-
Select image on which to display outlines:OrigDNA
159+
Select image on which to display outlines:OrigDNA_RESCALED
144160
Name the output image:NucleiCheck
145161
Outline display mode:Color
146162
Select method to determine brightness of outlines:Max of image
@@ -150,7 +166,7 @@ OverlayOutlines:[module_num:7|svn_version:'Unknown'|variable_revision_number:4|s
150166
Select outline color:#21FFFF
151167
Select objects to display:RunCellpose
152168

153-
SaveImages:[module_num:8|svn_version:'Unknown'|variable_revision_number:16|show_window:False|notes:['This module saves the NucleiCheck images for future reference. It does so in a sub-folder of the default output folder called "overlay-images".', 'Tha name of the saved file is constructed using the name of the corresponding OrigDNA image as a prefix and adding a "_nuclear_overlay" suffix. ']|batch_state:array([], dtype=uint8)|enabled:True|wants_pause:False]
169+
SaveImages:[module_num:9|svn_version:'Unknown'|variable_revision_number:16|show_window:False|notes:['This module saves the NucleiCheck images for future reference. It does so in a sub-folder of the default output folder called "overlay-images".', 'Tha name of the saved file is constructed using the name of the corresponding OrigDNA image as a prefix and adding a "_nuclear_overlay" suffix. ']|batch_state:array([], dtype=uint8)|enabled:True|wants_pause:False]
154170
Select the type of image to save:Image
155171
Select the image to save:NucleiCheck
156172
Select method for constructing file names:From image filename

0 commit comments

Comments
 (0)