mahmoodlab / CLAM

Data-efficient and weakly supervised computational pathology on whole slide images - Nature Biomedical Engineering
http://clam.mahmoodlab.org
GNU General Public License v3.0
1.04k stars 346 forks source link

1 to 1 correspondence between slide (*.svs) and patches/stitches??? #261

Closed qserenali closed 5 days ago

qserenali commented 1 month ago

I am new to pathologyAI. I have 1251 slides, after excluding 4 problematic slides (which threw an error during the first step (automated segmenting the tissue and excluding any holes). I was expecting a 1 to 1 correspondence between slide (*.svs) and patches/stitches because of the following descriptions but got this:

ls -lrt patches/|wc -l 317 ls -lrt masks/|wc -l 1250 ls -lrt stitches/|wc -l 317

The masks folder contains the segmentation results (one image per slide). The patches folder contains arrays of extracted tissue

patches from each slide (one .h5 file per slide, where each entry corresponds to the coordinates of the top-left corner of a patch)

The stitches folder contains downsampled visualizations of stitched tissue patches (one image per slide)

(Optional, not used for downstream tasks) The auto-generated csv file process_list_autogen.csv contains a list of all slides

processed, along with their segmentation/patching parameters used.

Here are the last few lines of the processing log:

progress: 1.00, 1245/1247 processing 070-0003-0253-B0-4_105618.svs Creating patches for: 070-0003-0253-B0-4_105618 ... Total number of contours to process: 0 segmentation took 0.9782519340515137 seconds patching took 0.00010085105895996094 seconds stitching took -1 seconds 100%|████████████████████████████████████████████████████████████████████████████████ ███▉| 1246/1247 [1:16:07<00:03, 3.53s/it]

progress: 1.00, 1246/1247 processing 070-0003-0253-B0-5_105534.svs Creating patches for: 070-0003-0253-B0-5_105534 ... Total number of contours to process: 0 segmentation took 0.6828567981719971 seconds patching took 6.604194641113281e-05 seconds stitching took -1 seconds 100%|████████████████████████████████████████████████████████████████████████████████ ████| 1247/1247 [1:16:09<00:00, 3.66s/it] average segmentation time in s per slide: 1.3448290369849063 average patching time in s per slide: 0.0020023342505778516 average stiching time in s per slide: -0.7449303933306513

Is this behavior expected?

Thanks,

Serena

qserenali commented 1 month ago

I just noticed "Total number of contours to process: 0" and checked the *.jpeg files from masks directory and I think I know why. Thanks!!!