Skip to content
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

cell count not working #55

Open
FQU1 opened this issue Dec 22, 2022 · 1 comment
Open

cell count not working #55

FQU1 opened this issue Dec 22, 2022 · 1 comment

Comments

@FQU1
Copy link

FQU1 commented Dec 22, 2022

Describe the bug
I have a DAPI Image (Channel 3, identifier C3) and a cell Image (Channel 1 or 2, identifier C1 or C2). The sequemtnartion is working well, all 18 cells got identified. But the spot detection table contains only 3 cells.
I do not get any error messages while calculating. In other images it´s working well, but sometimes i have this weird spot detection output.

To Reproduce
I used the identifiers C2 and C3 (DAPI), C1 is analysed separately.
clean segmetnation results or remove cells touching the border did not change anything
select channel: C2
Threshold 200
decompose dense regions: xy=200, z=400
define clusters: min=4, max=300

Logs
Loading plugin FISH-QUANT_mzgca1671722181507 (config=[object Object])
ENGINE_URL=http://XXX.0.0.1:XXX
Connected to an existing server: http://XXX.0.0.1:XXX/
Kernel started: be40d1e0-3556-4e98-9898-1f3347da2a20
Installing requirements for kernel be40d1e0-3556-4e98-9898-1f3347da2a20: ["!python -m pip install big-fish==0.6.2"]
plugin FISH-QUANT (id=FISH-QUANT_mzgca1671722181507) initialized.
Plugin connected.
Setting up plugin.
[FISH-QUANT] plugin initialized.
[FISH-QUANT][scan_folder] received data::
{ "files": [], "file_loaded": "", "path_root": "/Users/kg/Downloads/cell recognition issue", "path_sub_acquisition": "acquisition", "path_sub_analysis": "analysis", "z_first": true, "img_ext": "tif", "channels": [ { "name": "C2", "identifier": "C2" }, { "name": "C3", "identifier": "C3" } ], "ch_name": [], "ch_ident": [], "reg_exp": "(?P.)-(?P<file_ident>.)(?P.*).(?P<img_ext>.*)", "current_index": 0, "channel_selected": null, "sigma": [ 1, 0.75 ], "threshold_range": [ 0, 5000, 50 ], "minimum_distance": [ 2, 2 ], "detection_threshold": null, "th_range_min": 0, "th_range_max": 5000, "th_range_nbins": 50, "analyze_clusters": false, "create_plots": true, "show_filtered": true, "show_detection": true, "voxel_size_yx": 100, "voxel_size_z": 300, "psf_size_xy": 200, "psf_size_z": 400, "cluster_alpha": 0.5, "cluster_beta": 2, "foci_radius": 300, "foci_nb_min_spots": 4, "assign_subfolder": "segmentation-results", "assign_subfolder_new": "segmentation-results-matched", "assign_ident_spots": "__spots.csv", "assign_ident_cell": "__mask__cells.png", "assign_ident_nuc": "__mask__nuclei.png", "assign_ch_cell": "cy3", "assign_ch_nuc": "dapi", "assign_ch_spots": "cy3", "remove_cropped_cell": false, "clean_segmentation_enable": false, "plot_individual_cells_enable": false }

[FISH-QUANT][scan_folder] channel dictionary: {'C2': 'C2', 'C3': 'C3'}
Checking file: /Users/kgDownloads/cell recognition issue/acquisition/C1-slide2_SKBR3_well7_.tif
... match against regular expression {'channel': 'C1', 'file_ident': 'slide2_SKBR3', 'fov': 'well7', 'img_ext': 'tif'}
Checking file: /Users/kg/Downloads/cell recognition issue/acquisition/C3-slide2_MCF7_well4_.tif
... match against regular expression {'channel': 'C3', 'file_ident': 'slide2_MCF7', 'fov': 'well4', 'img_ext': 'tif'}
Checking file: /Users/kg/Downloads/cell recognition issue/acquisition/C1-slide2_MCF7_well4_.tif
... match against regular expression {'channel': 'C1', 'file_ident': 'slide2_MCF7', 'fov': 'well4', 'img_ext': 'tif'}
Checking file: /Users/kg/Downloads/cell recognition issue/acquisition/C2-slide2_SKBR3_well7_.tif
... match against regular expression {'channel': 'C2', 'file_ident': 'slide2_SKBR3', 'fov': 'well7', 'img_ext': 'tif'}
Checking file: /Users/kg/Downloads/cell recognition issue/acquisition/C2-slide2_MCF7_well4_.tif
... match against regular expression {'channel': 'C2', 'file_ident': 'slide2_MCF7', 'fov': 'well4', 'img_ext': 'tif'}
Checking file: /Users/kg/Downloads/cell recognition issue/acquisition/C3-slide2_SKBR3_well7_.tif
... match against regular expression {'channel': 'C3', 'file_ident': 'slide2_SKBR3', 'fov': 'well7', 'img_ext': 'tif'}

[FISH-QUANT][scan_folder] scan results: [{'file_ident': 'slide2_SKBR3', 'fov': 'well7', 'img_ext': 'tif', 'C2': 'C2-slide2_SKBR3_well7_.tif', 'C3': 'C3-slide2_SKBR3_well7_.tif'}, {'file_ident': 'slide2_MCF7', 'fov': 'well4', 'img_ext': 'tif', 'C2': 'C2-slide2_MCF7_well4_.tif', 'C3': 'C3-slide2_MCF7_well4_.tif'}]

Found 2 images matching the search criteria.
[FISH-QUANT][load_image] received data::
{ "files": [ { "file_ident": "slide2_SKBR3", "fov": "well7", "img_ext": "tif", "C2": "C2-slide2_SKBR3_well7_.tif", "C3": "C3-slide2_SKBR3_well7_.tif" }, { "file_ident": "slide2_MCF7", "fov": "well4", "img_ext": "tif", "C2": "C2-slide2_MCF7_well4_.tif", "C3": "C3-slide2_MCF7_well4_.tif" } ], "file_loaded": "", "path_root": "/Users/kg/Downloads/cell recognition issue", "path_sub_acquisition": "acquisition", "path_sub_analysis": "analysis", "z_first": true, "img_ext": "tif", "channels": [ { "name": "C2", "identifier": "C2" }, { "name": "C3", "identifier": "C3" } ], "ch_name": [], "ch_ident": [], "reg_exp": "(?P.)-(?P<file_ident>.)(?P.*).(?P<img_ext>.*)", "current_index": 0, "channel_selected": null, "sigma": [ 1, 0.75 ], "threshold_range": [ 0, 5000, 50 ], "minimum_distance": [ 2, 2 ], "detection_threshold": null, "th_range_min": 0, "th_range_max": 5000, "th_range_nbins": 50, "analyze_clusters": false, "create_plots": true, "show_filtered": true, "show_detection": true, "voxel_size_yx": 100, "voxel_size_z": 300, "psf_size_xy": 200, "psf_size_z": 400, "cluster_alpha": 0.5, "cluster_beta": 2, "foci_radius": 300, "foci_nb_min_spots": 4, "assign_subfolder": "segmentation-results", "assign_subfolder_new": "segmentation-results-matched", "assign_ident_spots": "__spots.csv", "assign_ident_cell": "__mask__cells.png", "assign_ident_nuc": "mask__nuclei.png", "assign_ch_cell": "cy3", "assign_ch_nuc": "dapi", "assign_ch_spots": "cy3", "remove_cropped_cell": false, "clean_segmentation_enable": false, "plot_individual_cells_enable": false, "file": { "file_ident": "slide2_SKBR3", "fov": "well7", "img_ext": "tif", "C2": "C2-slide2_SKBR3_well7.tif", "C3": "C3-slide2_SKBR3_well7.tif" }, "create_mips": true, "show_status": true }

[FISH-QUANT][load_image] path for MIPs: /Users/kg/Downloads/cell recognition issue/analysis/imjoy-tmp/mips
[FISH-QUANT][load_image] reading image: /Users/kg/Downloads/cell recognition issue/acquisition/C2-slide2_SKBR3_well7_.tif
[FISH-QUANT][create_mip] mip saved as: /Users/kg/Downloads/cell recognition issue/analysis/imjoy-tmp/mips/img_mip_dum__C2.png
[FISH-QUANT][load_image] reading image: /Users/kg/Downloads/cell recognition issue/acquisition/C3-slide2_SKBR3_well7_.tif
[FISH-QUANT][create_mip] mip saved as: /Users/kg/Downloads/cell recognition issue/analysis/imjoy-tmp/mips/img_mip_dum__C3.png
[FISH-QUANT][load_image] loaded image: shape: (2, 33, 1040, 1392), dtype: uint16
[FISH-QUANT][filter_image] received data::
{ "files": [ { "file_ident": "slide2_SKBR3", "fov": "well7", "img_ext": "tif", "C2": "C2-slide2_SKBR3_well7_.tif", "C3": "C3-slide2_SKBR3_well7_.tif" }, { "file_ident": "slide2_MCF7", "fov": "well4", "img_ext": "tif", "C2": "C2-slide2_MCF7_well4_.tif", "C3": "C3-slide2_MCF7_well4_.tif" } ], "file_loaded": { "file_ident": "slide2_SKBR3", "fov": "well7", "img_ext": "tif", "C2": "C2-slide2_SKBR3_well7_.tif", "C3": "C3-slide2_SKBR3_well7_.tif" }, "path_root": "/Users/kg/Downloads/cell recognition issue", "path_sub_acquisition": "acquisition", "path_sub_analysis": "analysis", "z_first": true, "img_ext": "tif", "channels": [ { "name": "C2", "identifier": "C2" }, { "name": "C3", "identifier": "C3" } ], "ch_name": [], "ch_ident": [], "reg_exp": "(?P.)-(?P<file_ident>.)(?P.*).(?P<img_ext>.*)", "current_index": 1, "channel_selected": "C2", "sigma": [ 1, 0.75 ], "threshold_range": [ 0, 5000, 50 ], "minimum_distance": [ 2, 2 ], "detection_threshold": null, "th_range_min": 0, "th_range_max": 5000, "th_range_nbins": 50, "analyze_clusters": false, "create_plots": true, "show_filtered": true, "show_detection": true, "voxel_size_yx": 100, "voxel_size_z": 300, "psf_size_xy": 200, "psf_size_z": 400, "cluster_alpha": 0.5, "cluster_beta": 2, "foci_radius": 300, "foci_nb_min_spots": 4, "assign_subfolder": "segmentation-results", "assign_subfolder_new": "segmentation-results-matched", "assign_ident_spots": "__spots.csv", "assign_ident_cell": "__mask__cells.png", "assign_ident_nuc": "__mask__nuclei.png", "assign_ch_cell": "cy3", "assign_ch_nuc": "dapi", "assign_ch_spots": "cy3", "remove_cropped_cell": false, "clean_segmentation_enable": false, "plot_individual_cells_enable": false, "create_mips": true, "show_status": true }
[FISH-QUANT][filter_image] filtering channel C2 with index 0

[ 1, 0.75, 0.75 ]

[FISH-QUANT][filter_image] name base C2-slide2_SKBR3_well7_
[FISH-QUANT][create_mip] mip saved as: /Users/kg/Downloads/cell recognition issue/analysis/imjoy-tmp/mips/img_filt_mip_dum_c0.png
[FISH-QUANT][detect_test_thresholds] received data::
{ "files": [ { "file_ident": "slide2_SKBR3", "fov": "well7", "img_ext": "tif", "C2": "C2-slide2_SKBR3_well7_.tif", "C3": "C3-slide2_SKBR3_well7_.tif" }, { "file_ident": "slide2_MCF7", "fov": "well4", "img_ext": "tif", "C2": "C2-slide2_MCF7_well4_.tif", "C3": "C3-slide2_MCF7_well4_.tif" } ], "file_loaded": { "file_ident": "slide2_SKBR3", "fov": "well7", "img_ext": "tif", "C2": "C2-slide2_SKBR3_well7_.tif", "C3": "C3-slide2_SKBR3_well7_.tif" }, "path_root": "/Users/kg/Downloads/cell recognition issue", "path_sub_acquisition": "acquisition", "path_sub_analysis": "analysis", "z_first": true, "img_ext": "tif", "channels": [ { "name": "C2", "identifier": "C2" }, { "name": "C3", "identifier": "C3" } ], "ch_name": [], "ch_ident": [], "reg_exp": "(?P.)-(?P<file_ident>.)(?P.*).(?P<img_ext>.*)", "current_index": 1, "channel_selected": "C2", "sigma": [ 1, 0.75 ], "threshold_range": [ 0, 500, 10 ], "minimum_distance": [ 2, 2 ], "detection_threshold": null, "th_range_min": 0, "th_range_max": 5000, "th_range_nbins": 50, "analyze_clusters": false, "create_plots": true, "show_filtered": true, "show_detection": true, "voxel_size_yx": 100, "voxel_size_z": 300, "psf_size_xy": 200, "psf_size_z": 400, "cluster_alpha": 0.5, "cluster_beta": 2, "foci_radius": 300, "foci_nb_min_spots": 4, "assign_subfolder": "segmentation-results", "assign_subfolder_new": "segmentation-results-matched", "assign_ident_spots": "__spots.csv", "assign_ident_cell": "__mask__cells.png", "assign_ident_nuc": "__mask__nuclei.png", "assign_ch_cell": "cy3", "assign_ch_nuc": "dapi", "assign_ch_spots": "cy3", "remove_cropped_cell": false, "clean_segmentation_enable": false, "plot_individual_cells_enable": false, "show_status": true }

[FISH-QUANT][calc_local_max] received data::

{ "minimum_distance": [ 2, 2 ] }

[FISH-QUANT][detect_test_thresholds] testing threshold 0/10: 0.0 yields 409409 spots.
[FISH-QUANT][detect_test_thresholds] testing threshold 1/10: 56.0 yields 333110 spots.
[FISH-QUANT][detect_test_thresholds] testing threshold 2/10: 111.0 yields 50514 spots.
[FISH-QUANT][detect_test_thresholds] testing threshold 3/10: 167.0 yields 4309 spots.
[FISH-QUANT][detect_test_thresholds] testing threshold 4/10: 222.0 yields 723 spots.
[FISH-QUANT][detect_test_thresholds] testing threshold 5/10: 278.0 yields 259 spots.
[FISH-QUANT][detect_test_thresholds] testing threshold 6/10: 333.0 yields 130 spots.
[FISH-QUANT][detect_test_thresholds] testing threshold 7/10: 389.0 yields 93 spots.
[FISH-QUANT][detect_test_thresholds] testing threshold 8/10: 444.0 yields 66 spots.
[FISH-QUANT][detect_test_thresholds] testing threshold 9/10: 500.0 yields 52 spots.
[FISH-QUANT][detect_apply] received data::

{ "files": [ { "file_ident": "slide2_SKBR3", "fov": "well7", "img_ext": "tif", "C2": "C2-slide2_SKBR3_well7_.tif", "C3": "C3-slide2_SKBR3_well7_.tif" }, { "file_ident": "slide2_MCF7", "fov": "well4", "img_ext": "tif", "C2": "C2-slide2_MCF7_well4_.tif", "C3": "C3-slide2_MCF7_well4_.tif" } ], "file_loaded": { "file_ident": "slide2_SKBR3", "fov": "well7", "img_ext": "tif", "C2": "C2-slide2_SKBR3_well7_.tif", "C3": "C3-slide2_SKBR3_well7_.tif" }, "path_root": "/Users/kg/Downloads/cell recognition issue", "path_sub_acquisition": "acquisition", "path_sub_analysis": "analysis", "z_first": true, "img_ext": "tif", "channels": [ { "name": "C2", "identifier": "C2" }, { "name": "C3", "identifier": "C3" } ], "ch_name": [], "ch_ident": [], "reg_exp": "(?P.)-(?P<file_ident>.)(?P.*).(?P<img_ext>.*)", "current_index": 1, "channel_selected": "C2", "sigma": [ 1, 0.75 ], "threshold_range": [ 0, 500, 10 ], "minimum_distance": [ 2, 2 ], "detection_threshold": 200, "th_range_min": 0, "th_range_max": 5000, "th_range_nbins": 50, "analyze_clusters": false, "create_plots": true, "show_filtered": true, "show_detection": true, "voxel_size_yx": 100, "voxel_size_z": 300, "psf_size_xy": 200, "psf_size_z": 400, "cluster_alpha": 0.5, "cluster_beta": 2, "foci_radius": 300, "foci_nb_min_spots": 4, "assign_subfolder": "segmentation-results", "assign_subfolder_new": "segmentation-results-matched", "assign_ident_spots": "__spots.csv", "assign_ident_cell": "__mask__cells.png", "assign_ident_nuc": "__mask__nuclei.png", "assign_ch_cell": "cy3", "assign_ch_nuc": "dapi", "assign_ch_spots": "cy3", "remove_cropped_cell": false, "clean_segmentation_enable": false, "plot_individual_cells_enable": false, "show_status": true }

[FISH-QUANT][detect_apply] name base C2-slide2_SKBR3_well7_
[FISH-QUANT][detect_apply] detection with threshold 200 detects 1324 spots.
[FISH-QUANT][show_results] received data::
{ "display_type": "dialog", "data_show": [ [ "img_raw", "C2", "mip", "false" ], [ "img_filt", "C2", "mip", "true" ], [ "spots", "3", "true" ] ] }

Adding new layer with specs: ['img_raw', 'C2', 'mip', 'false']
channel_index: 0; image_type: img_raw; display_dim: mip;
Adding new layer with specs: ['img_filt', 'C2', 'mip', 'true']
channel_index: 0; image_type: img_filt; display_dim: mip;
Adding new layer with specs: ['spots', '3', 'true']
[FISH-QUANT][decompose_dense_regions] received data::

{ "files": [ { "file_ident": "slide2_SKBR3", "fov": "well7", "img_ext": "tif", "C2": "C2-slide2_SKBR3_well7_.tif", "C3": "C3-slide2_SKBR3_well7_.tif" }, { "file_ident": "slide2_MCF7", "fov": "well4", "img_ext": "tif", "C2": "C2-slide2_MCF7_well4_.tif", "C3": "C3-slide2_MCF7_well4_.tif" } ], "file_loaded": { "file_ident": "slide2_SKBR3", "fov": "well7", "img_ext": "tif", "C2": "C2-slide2_SKBR3_well7_.tif", "C3": "C3-slide2_SKBR3_well7_.tif" }, "path_root": "/Users/kg/Downloads/cell recognition issue", "path_sub_acquisition": "acquisition", "path_sub_analysis": "analysis", "z_first": true, "img_ext": "tif", "channels": [ { "name": "C2", "identifier": "C2" }, { "name": "C3", "identifier": "C3" } ], "ch_name": [], "ch_ident": [], "reg_exp": "(?P.)-(?P<file_ident>.)(?P.*).(?P<img_ext>.*)", "current_index": 1, "channel_selected": "C2", "sigma": [ 1, 0.75 ], "threshold_range": [ 0, 500, 10 ], "minimum_distance": [ 2, 2 ], "detection_threshold": 200, "th_range_min": 0, "th_range_max": 5000, "th_range_nbins": 50, "analyze_clusters": true, "create_plots": true, "show_filtered": true, "show_detection": true, "voxel_size_yx": 100, "voxel_size_z": 300, "psf_size_xy": 200, "psf_size_z": 400, "cluster_alpha": 0.5, "cluster_beta": 2, "foci_radius": 300, "foci_nb_min_spots": 4, "assign_subfolder": "segmentation-results", "assign_subfolder_new": "segmentation-results-matched", "assign_ident_spots": "__spots.csv", "assign_ident_cell": "__mask__cells.png", "assign_ident_nuc": "__mask__nuclei.png", "assign_ch_cell": "cy3", "assign_ch_nuc": "dapi", "assign_ch_spots": "cy3", "remove_cropped_cell": false, "clean_segmentation_enable": false, "plot_individual_cells_enable": false, "show_status": true }

[FISH-QUANT][decompose_dense_regions] from 1324 to 2245 spots.
[FISH-QUANT][show_results] received data::
{ "display_type": "dialog", "data_show": [ [ "img_raw", "C2", "mip", "false" ], [ "img_filt", "C2", "mip", "true" ], [ "spots_decompose", "3", "true" ] ] }
Adding nw layer with specs: ['img_raw', 'C2', 'mip', 'false']
channel_index: 0; image_type: img_raw; display_dim: mip;
Adding new layer with specs: ['img_filt', 'C2', 'mip', 'true']
channel_index: 0; image_type: img_filt; display_dim: mip;
Adding new layer with specs: ['spots_decompose', '3', 'true']
[FISH-QUANT][detect_clusters] received data::

{ "files": [ { "file_ident": "slide2_SKBR3", "fov": "well7", "img_ext": "tif", "C2": "C2-slide2_SKBR3_well7_.tif", "C3": "C3-slide2_SKBR3_well7_.tif" }, { "file_ident": "slide2_MCF7", "fov": "well4", "img_ext": "tif", "C2": "C2-slide2_MCF7_well4_.tif", "C3": "C3-slide2_MCF7_well4_.tif" } ], "file_loaded": { "file_ident": "slide2_SKBR3", "fov": "well7", "img_ext": "tif", "C2": "C2-slide2_SKBR3_well7_.tif", "C3": "C3-slide2_SKBR3_well7_.tif" }, "path_root": "/Users/kg/Downloads/cell recognition issue", "path_sub_acquisition": "acquisition", "path_sub_analysis": "analysis", "z_first": true, "img_ext": "tif", "channels": [ { "name": "C2", "identifier": "C2" }, { "name": "C3", "identifier": "C3" } ], "ch_name": [], "ch_ident": [], "reg_exp": "(?P.)-(?P<file_ident>.)(?P.*).(?P<img_ext>.*)", "current_index": 1, "channel_selected": "C2", "sigma": [ 1, 0.75 ], "threshold_range": [ 0, 500, 10 ], "minimum_distance": [ 2, 2 ], "detection_threshold": 200, "th_range_min": 0, "th_range_max": 5000, "th_range_nbins": 50, "analyze_clusters": true, "create_plots": true, "show_filtered": true, "show_detection": true, "voxel_size_yx": 100, "voxel_size_z": 300, "psf_size_xy": 200, "psf_size_z": 400, "cluster_alpha": 0.5, "cluster_beta": 2, "foci_radius": 300, "foci_nb_min_spots": 4, "assign_subfolder": "segmentation-results", "assign_subfolder_new": "segmentation-results-matched", "assign_ident_spots": "__spots.csv", "assign_ident_cell": "__mask__cells.png", "assign_ident_nuc": "__mask__nuclei.png", "assign_ch_cell": "cy3", "assign_ch_nuc": "dapi", "assign_ch_spots": "cy3", "remove_cropped_cell": false, "clean_segmentation_enable": false, "plot_individual_cells_enable": false, "show_status": true, "name_save": "tmp" }

[FISH-QUANT][detect_clusters] found 56 foci for 2245 spots

[FISH-QUANT][detect_clusters] saving cluster detection results as /Users/kg/Downloads/cell recognition issue/analysis/imjoy-tmp/C2-slide2_SKBR3_well7___cluster_calling.png
[FISH-QUANT][detection_file] received data::
Detection plot present, but removed for display

{ "files": [ { "file_ident": "slide2_SKBR3", "fov": "well7", "img_ext": "tif", "C2": "C2-slide2_SKBR3_well7_.tif", "C3": "C3-slide2_SKBR3_well7_.tif" }, { "file_ident": "slide2_MCF7", "fov": "well4", "img_ext": "tif", "C2": "C2-slide2_MCF7_well4_.tif", "C3": "C3-slide2_MCF7_well4_.tif" } ], "file_loaded": { "file_ident": "slide2_SKBR3", "fov": "well7", "img_ext": "tif", "C2": "C2-slide2_SKBR3_well7_.tif", "C3": "C3-slide2_SKBR3_well7_.tif" }, "path_root": "/Users/kg/Downloads/cell recognition issue", "path_sub_acquisition": "acquisition", "path_sub_analysis": "analysis", "z_first": true, "img_ext": "tif", "channels": [ { "name": "C2", "identifier": "C2" }, { "name": "C3", "identifier": "C3" } ], "ch_name": [], "ch_ident": [], "reg_exp": "(?P.)-(?P<file_ident>.)(?P.*).(?P<img_ext>.*)", "current_index": 1, "channel_selected": "C2", "sigma": [ 1, 0.75 ], "threshold_range": [ 0, 500, 10 ], "minimum_distance": [ 2, 2 ], "detection_threshold": 200, "th_range_min": 0, "th_range_max": 5000, "th_range_nbins": 50, "analyze_clusters": true, "create_plots": true, "show_filtered": true, "show_detection": true, "voxel_size_yx": 100, "voxel_size_z": 300, "psf_size_xy": 200, "psf_size_z": 400, "cluster_alpha": 0.5, "cluster_beta": 2, "foci_radius": 300, "foci_nb_min_spots": 4, "assign_subfolder": "segmentation-results", "assign_subfolder_new": "segmentation-results-matched", "assign_ident_spots": "__spots.csv", "assign_ident_cell": "__mask__cells.png", "assign_ident_nuc": "__mask__nuclei.png", "assign_ch_cell": "cy3", "assign_ch_nuc": "dapi", "assign_ch_spots": "cy3", "remove_cropped_cell": false, "clean_segmentation_enable": false, "plot_individual_cells_enable": false, "batch_analysis": false }

[FISH-QUANT][detect_apply] received data::

{ "files": [ { "file_ident": "slide2_SKBR3", "fov": "well7", "img_ext": "tif", "C2": "C2-slide2_SKBR3_well7_.tif", "C3": "C3-slide2_SKBR3_well7_.tif" }, { "file_ident": "slide2_MCF7", "fov": "well4", "img_ext": "tif", "C2": "C2-slide2_MCF7_well4_.tif", "C3": "C3-slide2_MCF7_well4_.tif" } ], "file_loaded": { "file_ident": "slide2_SKBR3", "fov": "well7", "img_ext": "tif", "C2": "C2-slide2_SKBR3_well7_.tif", "C3": "C3-slide2_SKBR3_well7_.tif" }, "path_root": "/Users/kg/Downloads/cell recognition issue", "path_sub_acquisition": "acquisition", "path_sub_analysis": "analysis", "z_first": true, "img_ext": "tif", "channels": [ { "name": "C2", "identifier": "C2" }, { "name": "C3", "identifier": "C3" } ], "ch_name": [], "ch_ident": [], "reg_exp": "(?P.)-(?P<file_ident>.)(?P.*).(?P<img_ext>.*)", "current_index": 1, "channel_selected": "C2", "sigma": [ 1, 0.75 ], "threshold_range": [ 0, 500, 10 ], "minimum_distance": [ 2, 2 ], "detection_threshold": 200, "th_range_min": 0, "th_range_max": 5000, "th_range_nbins": 50, "analyze_clusters": true, "create_plots": true, "show_filtered": true, "show_detection": true, "voxel_size_yx": 100, "voxel_size_z": 300, "psf_size_xy": 200, "psf_size_z": 400, "cluster_alpha": 0.5, "cluster_beta": 2, "foci_radius": 300, "foci_nb_min_spots": 4, "assign_subfolder": "segmentation-results", "assign_subfolder_new": "segmentation-results-matched", "assign_ident_spots": "__spots.csv", "assign_ident_cell": "__mask__cells.png", "assign_ident_nuc": "__mask__nuclei.png", "assign_ch_cell": "cy3", "assign_ch_nuc": "dapi", "assign_ch_spots": "cy3", "remove_cropped_cell": false, "clean_segmentation_enable": false, "plot_individual_cells_enable": false, "batch_analysis": false, "create_mips": false, "show_status": false, "analysis_region": [], "name_save": "/Users/kg/Downloads/cell recognition issue/analysis/spot_detection/plots_detection/C2-slide2_SKBR3_well7___detection" }

[FISH-QUANT][detect_apply] name base C2-slide2_SKBR3_well7_
[FISH-QUANT][detect_apply] save plots with detection results: /Users/kg/Downloads/cell recognition issue/analysis/spot_detection/plots_detection/C2-slide2_SKBR3_well7___detection.
[FISH-QUANT][detect_apply] detection with threshold 200 detects 1324 spots.
[FISH-QUANT][save_spots] results (ZYX saved as: /Users/kg/Downloads/cell recognition issue/analysis/spot_detection/C2-slide2_SKBR3_well7___spots.csv
[FISH-QUANT][decompose_dense_regions] received data::

{ "files": [ { "file_ident": "slide2_SKBR3", "fov": "well7", "img_ext": "tif", "C2": "C2-slide2_SKBR3_well7_.tif", "C3": "C3-slide2_SKBR3_well7_.tif" }, { "file_ident": "slide2_MCF7", "fov": "well4", "img_ext": "tif", "C2": "C2-slide2_MCF7_well4_.tif", "C3": "C3-slide2_MCF7_well4_.tif" } ], "file_loaded": { "file_ident": "slide2_SKBR3", "fov": "well7", "img_ext": "tif", "C2": "C2-slide2_SKBR3_well7_.tif", "C3": "C3-slide2_SKBR3_well7_.tif" }, "path_root": "/Users/kg/Downloads/cell recognition issue", "path_sub_acquisition": "acquisition", "path_sub_analysis": "analysis", "z_first": true, "img_ext": "tif", "channels": [ { "name": "C2", "identifier": "C2" }, { "name": "C3", "identifier": "C3" } ], "ch_name": [], "ch_ident": [], "reg_exp": "(?P.)-(?P<file_ident>.)(?P.*).(?P<img_ext>.*)", "current_index": 1, "channel_selected": "C2", "sigma": [ 1, 0.75 ], "threshold_range": [ 0, 500, 10 ], "minimum_distance": [ 2, 2 ], "detection_threshold": 200, "th_range_min": 0, "th_range_max": 5000, "th_range_nbins": 50, "analyze_clusters": true, "create_plots": true, "show_filtered": true, "show_detection": true, "voxel_size_yx": 100, "voxel_size_z": 300, "psf_size_xy": 200, "psf_size_z": 400, "cluster_alpha": 0.5, "cluster_beta": 2, "foci_radius": 300, "foci_nb_min_spots": 4, "assign_subfolder": "segmentation-results", "assign_subfolder_new": "segmentation-results-matched", "assign_ident_spots": "__spots.csv", "assign_ident_cell": "__mask__cells.png", "assign_ident_nuc": "__mask__nuclei.png", "assign_ch_cell": "cy3", "assign_ch_nuc": "dapi", "assign_ch_spots": "cy3", "remove_cropped_cell": false, "clean_segmentation_enable": false, "plot_individual_cells_enable": false, "batch_analysis": false, "create_mips": false, "show_status": false, "analysis_region": [], "name_save": "/Users/kg/Downloads/cell recognition issue/analysis/spot_detection/plots_detection/C2-slide2_SKBR3_well7___detection" }

[FISH-QUANT][decompose_dense_regions] from 1324 to 2245 spots.

[FISH-QUANT][detect_clusters] received data::

{ "files": [ { "file_ident": "slide2_SKBR3", "fov": "well7", "img_ext": "tif", "C2": "C2-slide2_SKBR3_well7_.tif", "C3": "C3-slide2_SKBR3_well7_.tif" }, { "file_ident": "slide2_MCF7", "fov": "well4", "img_ext": "tif", "C2": "C2-slide2_MCF7_well4_.tif", "C3": "C3-slide2_MCF7_well4_.tif" } ], "file_loaded": { "file_ident": "slide2_SKBR3", "fov": "well7", "img_ext": "tif", "C2": "C2-slide2_SKBR3_well7_.tif", "C3": "C3-slide2_SKBR3_well7_.tif" }, "path_root": "/Users/kg/Downloads/cell recognition issue", "path_sub_acquisition": "acquisition", "path_sub_analysis": "analysis", "z_first": true, "img_ext": "tif", "channels": [ { "name": "C2", "identifier": "C2" }, { "name": "C3", "identifier": "C3" } ], "ch_name": [], "ch_ident": [], "reg_exp": "(?P.)-(?P<file_ident>.)(?P.*).(?P<img_ext>.*)", "current_index": 1, "channel_selected": "C2", "sigma": [ 1, 0.75 ], "threshold_range": [ 0, 500, 10 ], "minimum_distance": [ 2, 2 ], "detection_threshold": 200, "th_range_min": 0, "th_range_max": 5000, "th_range_nbins": 50, "analyze_clusters": true, "create_plots": true, "show_filtered": true, "show_detection": true, "voxel_size_yx": 100, "voxel_size_z": 300, "psf_size_xy": 200, "psf_size_z": 400, "cluster_alpha": 0.5, "cluster_beta": 2, "foci_radius": 300, "foci_nb_min_spots": 4, "assign_subfolder": "segmentation-results", "assign_subfolder_new": "segmentation-results-matched", "assign_ident_spots": "__spots.csv", "assign_ident_cell": "__mask__cells.png", "assign_ident_nuc": "__mask__nuclei.png", "assign_ch_cell": "cy3", "assign_ch_nuc": "dapi", "assign_ch_spots": "cy3", "remove_cropped_cell": false, "clean_segmentation_enable": false, "plot_individual_cells_enable": false, "batch_analysis": false, "create_mips": false, "show_status": false, "analysis_region": [], "name_save": "/Users/kg/Downloads/cell recognition issue/analysis/spot_detection/plots_foci/C2-slide2_SKBR3_well7___foci_calling" }

[FISH-QUANT][detect_clusters] found 56 foci for 2245 spots

[FISH-QUANT][detect_clusters] saving cluster detection results as /Users/kg/Downloads/cell recognition issue/analysis/spot_detection/plots_foci/C2-slide2_SKBR3_well7___foci_calling.png

[FISH-QUANT][save_spots] results (ZYXF saved as: /Users/kg/Downloads/cell recognition issue/analysis/spot_detection/C2-slide2_SKBR3_well7___spots_foci.csv

[FISH-QUANT][save_foci] results (<class 'type'> saved as: /Users/kg/Downloads/cell recognition issue/analysis/spot_detection/C2-slide2_SKBR3_well7___foci.csv

[FISH-QUANT][save_analysis_details]

[FISH-QUANT][save_analysis_details] saved as /Users/kg/Downloads/cell recognition issue/analysis/spot_detection/C2-slide2_SKBR3_well7___analysis_details.json

[FISH-QUANT][clean_segmentation] received data::

{ "files": [ { "file_ident": "slide2_SKBR3", "fov": "well7", "img_ext": "tif", "C2": "C2-slide2_SKBR3_well7_.tif", "C3": "C3-slide2_SKBR3_well7_.tif" }, { "file_ident": "slide2_MCF7", "fov": "well4", "img_ext": "tif", "C2": "C2-slide2_MCF7_well4_.tif", "C3": "C3-slide2_MCF7_well4_.tif" } ], "file_loaded": { "file_ident": "slide2_SKBR3", "fov": "well7", "img_ext": "tif", "C2": "C2-slide2_SKBR3_well7_.tif", "C3": "C3-slide2_SKBR3_well7_.tif" }, "path_root": "/Users/kg/Downloads/cell recognition issue", "path_sub_acquisition": "acquisition", "path_sub_analysis": "analysis", "z_first": true, "img_ext": "tif", "channels": [ { "name": "C2", "identifier": "C2" }, { "name": "C3", "identifier": "C3" } ], "ch_name": [], "ch_ident": [], "reg_exp": "(?P.)-(?P<file_ident>.)(?P.*).(?P<img_ext>.*)", "current_index": 1, "channel_selected": "C2", "sigma": [ 1, 0.75 ], "threshold_range": [ 0, 500, 10 ], "minimum_distance": [ 2, 2 ], "detection_threshold": 200, "th_range_min": 0, "th_range_max": 5000, "th_range_nbins": 50, "analyze_clusters": true, "create_plots": true, "show_filtered": true, "show_detection": true, "voxel_size_yx": 100, "voxel_size_z": 300, "psf_size_xy": 200, "psf_size_z": 400, "cluster_alpha": 0.5, "cluster_beta": 2, "foci_radius": 300, "foci_nb_min_spots": 4, "assign_subfolder": "segmentation-results", "assign_subfolder_new": "segmentation-results-matched", "assign_ident_spots": "__spots.csv", "assign_ident_cell": "__mask__cells.png", "assign_ident_nuc": "__mask__nuclei.png", "assign_ch_cell": "C2", "assign_ch_nuc": "C3", "assign_ch_spots": "C2", "remove_cropped_cell": false, "clean_segmentation_enable": true, "plot_individual_cells_enable": false }

Analyzing segmentation result for: /Users/kg/Downloads/cell recognition issue/analysis/segmentation-results/C2-slide2_MCF7_well4___mask__cells.png

Created path to save new segmentation masks: /Users/kg/Downloads/cell recognition issue/analysis/segmentation-results-matched

Analyzing segmentation result for: /Users/kg/Downloads/cell recognition issue/analysis/segmentation-results/C2-slide2_SKBR3_well7___mask__cells.png

[FISH-QUANT][assign_rnas_cells] received data::

{ "files": [ { "file_ident": "slide2_SKBR3", "fov": "well7", "img_ext": "tif", "C2": "C2-slide2_SKBR3_well7_.tif", "C3": "C3-slide2_SKBR3_well7_.tif" }, { "file_ident": "slide2_MCF7", "fov": "well4", "img_ext": "tif", "C2": "C2-slide2_MCF7_well4_.tif", "C3": "C3-slide2_MCF7_well4_.tif" } ], "file_loaded": { "file_ident": "slide2_SKBR3", "fov": "well7", "img_ext": "tif", "C2": "C2-slide2_SKBR3_well7_.tif", "C3": "C3-slide2_SKBR3_well7_.tif" }, "path_root": "/Users/kg/Downloads/cell recognition issue", "path_sub_acquisition": "acquisition", "path_sub_analysis": "analysis", "z_first": true, "img_ext": "tif", "channels": [ { "name": "C2", "identifier": "C2" }, { "name": "C3", "identifier": "C3" } ], "ch_name": [], "ch_ident": [], "reg_exp": "(?P.)-(?P<file_ident>.)(?P.*).(?P<img_ext>.*)", "current_index": 1, "channel_selected": "C2", "sigma": [ 1, 0.75 ], "threshold_range": [ 0, 500, 10 ], "minimum_distance": [ 2, 2 ], "detection_threshold": 200, "th_range_min": 0, "th_range_max": 5000, "th_range_nbins": 50, "analyze_clusters": true, "create_plots": true, "show_filtered": true, "show_detection": true, "voxel_size_yx": 100, "voxel_size_z": 300, "psf_size_xy": 200, "psf_size_z": 400, "cluster_alpha": 0.5, "cluster_beta": 2, "foci_radius": 300, "foci_nb_min_spots": 4, "assign_subfolder": "segmentation-results", "assign_subfolder_new": "segmentation-results", "assign_ident_spots": "__spots.csv", "assign_ident_cell": "__mask__cells.png", "assign_ident_nuc": "__mask__nuclei.png", "assign_ch_cell": "C2", "assign_ch_nuc": "C3", "assign_ch_spots": "C2", "remove_cropped_cell": false, "clean_segmentation_enable": true, "plot_individual_cells_enable": true }

Analyzing spots detection file /Users/kg/Downloads/cell recognition issue/analysis/spot_detection/C2-slide2_MCF7_well4___spots.csv

Loading image: /Users/kg/Downloads/cell recognition issue/acquisition/C2-slide2_MCF7_well4_.tif

Image dimension: 3

Spots (total/cyto/nucleus): 9037/4524/4513

number of cells identified: 1

[ { "cell_id": 10, "bbox": [ 348, 804, 800, 1138 ], "cell_coord": { "_rtype": "ndarray", "_rshape": [ 104, 2 ], "_rdtype": "int64", "_rvalue": {} }, "cell_mask": { "_rtype": "ndarray", "_rshape": [ 452, 334 ], "_rdtype": "bool", "_rvalue": {} }, "nuc_coord": { "_rtype": "ndarray", "_rshape": [ 698, 2 ], "_rdtype": "int64", "_rvalue": {} }, "nuc_mask": { "_rtype": "ndarray", "_rshape": [ 452, 334 ], "_rdtype": "bool", "_rvalue": {} }, "rna_coord": { "_rtype": "ndarray", "_rshape": [ 901, 3 ], "_rdtype": "int64", "_rvalue": {} }, "image": { "_rtype": "ndarray", "_rshape": [ 452, 334 ], "_rdtype": "uint16", "_rvalue": {} } } ]

Results will be saved as /Users/kg/Downloads/cell recognition issue/analysis/spot_detection/results_per_fov/C2-slide2_MCF7_well4__SPOTS_SUMMARY.csv

Analyzing spots detection file /Users/kg/Downloads/cell recognition issue/analysis/spot_detection/C2-slide2_SKBR3_well7___spots.csv

Loading image: /Users/kg/Downloads/cell recognition issue/acquisition/C2-slide2_SKBR3_well7_.tif

Image dimension: 3

Spots (total/cyto/nucleus): 1324/748/576

number of cells identified: 3

[ { "cell_id": 3, "bbox": [ 0, 830, 320, 1192 ], "cell_coord": { "_rtype": "ndarray", "_rshape": [ 1450, 2 ], "_rdtype": "int64", "_rvalue": {} }, "cell_mask": { "_rtype": "ndarray", "_rshape": [ 320, 362 ], "_rdtype": "bool", "_rvalue": {} }, "nuc_coord": { "_rtype": "ndarray", "_rshape": [ 790, 2 ], "_rdtype": "int64", "_rvalue": {} }, "nuc_mask": { "_rtype": "ndarray", "_rshape": [ 320, 362 ], "_rdtype": "bool", "_rvalue": {} }, "rna_coord": { "_rtype": "ndarray", "_rshape": [ 108, 3 ], "_rdtype": "int64", "_rvalue": {} }, "image": { "_rtype": "ndarray", "_rshape": [ 320, 362 ], "_rdtype": "uint16", "_rvalue": {} } }, { "cell_id": 4, "bbox": [ 14, 524, 320, 818 ], "cell_coord": { "_rtype": "ndarray", "_rshape": [ 1268, 2 ], "_rdtype": "int64", "_rvalue": {} }, "cell_mask": { "_rtype": "ndarray", "_rshape": [ 306, 294 ], "_rdtype": "bool", "_rvalue": {} }, "nuc_coord": { "_rtype": "ndarray", "_rshape": [ 736, 2 ], "_rdtype": "int64", "_rvalue": {} }, "nuc_mask": { "_rtype": "ndarray", "_rshape": [ 306, 294 ], "_rdtype": "bool", "_rvalue": {} }, "rna_coord": { "_rtype": "ndarray", "_rshape": [ 65, 3 ], "_rdtype": "int64", "_rvalue": {} }, "image": { "_rtype": "ndarray", "_rshape": [ 306, 294 ], "_rdtype": "uint16", "_rvalue": {} } }, { "cell_id": 5, "bbox": [ 80, 1126, 400, 1392 ], "cell_coord": { "_rtype": "ndarray", "_rshape": [ 1282, 2 ], "_rdtype": "int64", "_rvalue": {} }, "cell_mask": { "_rtype": "ndarray", "_rshape": [ 320, 266 ], "_rdtype": "bool", "_rvalue": {} }, "nuc_coord": { "_rtype": "ndarray", "_rshape": [ 370, 2 ], "_rdtype": "int64", "_rvalue": {} }, "nuc_mask": { "_rtype": "ndarray", "_rshape": [ 320, 266 ], "_rdtype": "bool", "_rvalue": {} }, "rna_coord": { "_rtype": "ndarray", "_rshape": [ 88, 3 ], "_rdtype": "int64", "_rvalue": {} }, "image": { "_rtype": "ndarray", "_rshape": [ 320, 266 ], "_rdtype": "uint16", "_rvalue": {} } } ]

Results will be saved as /Users/kg/Downloads/cell recognition issue/analysis/spot_detection/results_per_fov/C2-slide2_SKBR3_well7__SPOTS_SUMMARY.csv

Screenshots
Bildschirm­foto 2022-12-22 um 15 54 13
ebc-a1ef-95e40b95bdd1.png)

cell_id cell_area nuc_area nb_rna nb_rna_in_nuc nb_rna_out_nuc
3 85112 28424 5550 1913 3637
4 60432 25160 3157 1321 1836
5 58644 4588 5062 470 4592

Versions:
macOS Ventura Version 13.0.1
Chrome Version 108.0.5359.124

Additional context
Thank yout for this software!
The data i used:
https://drive.google.com/drive/folders/1xbkvPNF23Rl7e_d8QSPay4v8s20ozQj8

@4symmetry19
Copy link

I have previously raised an issue on this as well (last year - sorry for no follow-up). I have the same issues as FQU1 writing above. Regardless of whether I tick the "Remove cells touching the border" checkbox, the cell count sometimes isn't right. The cells look like they're recognized in the segmentation pics, but the counts per cell only analyzes a dismal subset of the cells identified in segmentation. If I tick the check box, in fact, even fewer cells are recognized. E.g. 10 cells on image, 10 cells recognized by segmentation, 3 cells in analysis csv with checkbox unticked, 1 cell in analysis csv with checkbox ticked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants