yuqiyuqitan / SPACEc

Other
15 stars 3 forks source link

sp.hf.downscale_tissue does not recognize the tissue pieces #55

Closed dtejadam closed 1 week ago

dtejadam commented 1 week ago

Hi,

Following the pipeline for the Tissue extractor with one of the qptiff files (~44 GB) the Loaded nuclear image of dimension (Y,X) = (61200, 31680) is showing just in blue (see Screenshot_1), although the Marker expression level histogram had some signal. Following this, I tried to check if the tissueframe would recognize the pieces and it didn't.

Next, I went to Qpath and save just one of the pieces in tiff (dimension (Y,X) = (19890, 12322), see Screenshot_2) however I got the same results.

ScreenShot_1

ScreenShot_2

Please let me know any thoughts , thanks

TKempchen commented 1 week ago

Hi, thank you for your request and interest in SPACEc! I think the issue is the intensity range of your image. If you inspect the image closely (see my zoomed screenshot), you can see that it is not completely blue, but the signal is just very dim. You can solve this issue in two ways: either you rescale the intensities before loading the image into the pipeline (e.g. with ImageJ) or you simply adjust the thresholds to match your low intensity. Both strategies should solve your issue. You could test the strategy by cropping a small part of your image, adjusting the intensity range in ImageJ and testing if the problem remains. I hope this solves your issue and helps with your analysis. Bildschirmfoto 2024-09-18 um 21 01 36

dtejadam commented 1 week ago

Thanks ! Yes, the signal is very dim. However, if the intensity range is very variable, for example: I removed one small portion that had very strong DAPI signal and rescale the intensities with ImageJ and loaded again (see screenshot) I can start to see part of the tissue, however, the program still unable to identify tissue pieces.

If this variation in intensities are not considered and I need to select a specific region per slide, then the step of "Segment individual tissue pieces" would not be necessary anymore ? This step was very interesting because it applied the gaussian model to remove outliers and then it applies the Watershed segmentation to detect the pieces for downstream analysis.

Screen Shot 2024-09-18 at 3 22 19 PM

TKempchen commented 1 day ago

Hi, could you show me the output of the sp.tl.label_tissue function? This is where you threshold the tissue pieces. What you show here is just the downscaling which is not identifying anything but just decreasing the input image size for faster processing. If your intensity range is difficult to display, this might lead to a difficult to visualize preview, but that doesn't mean you can't identify pieces by selecting the right threshold in the following function. I hope this helps you with your analysis.