STOmics / SAW

GNU General Public License v3.0
138 stars 34 forks source link

Filtering out small cells in cellcut #160

Open renli1024 opened 3 hours ago

renli1024 commented 3 hours ago

Hi,

I’m using SAW 7.1 version, and is there a way in cellcut step to filter out cells based on their size/area? I notice there’s an “area” field in output gef file, but I think it’s better to do filtering during cellcut, so the remaining cells could still be adjusted by cell correct. Thank you so much!

renli1024 commented 3 hours ago

Also, is there any unit for the "area" field values in the gef file? Thank you!

Clouate commented 2 hours ago

Hi, We regret that no such parameter is currently available, as this threshold is difficult to determine based on different tissue types and staining types. You could use the python package cv2.connectedComponentsWithStats to process 03.register/mask.tif to detect the area of ​​each cell to filter out unwanted cells and output as a new mask file. Then import the new mask to cellcut/cellcorrect step through the -m parameter of singularity saw.sif cellCut cgef and cellCorrect. For the area field in the gef file, the unit is pixel, corresponding to the image pixel unit in register.tif or mask.tif in 03.register directory. When the image registration is accurate, 1 pixel = 1 DNB = 500 nm