bowang-lab / MedSAM

Segment Anything in Medical Images
https://www.nature.com/articles/s41467-024-44824-z
Apache License 2.0
2.81k stars 379 forks source link

Is there a way to use the Sam automatic mask generator? #236

Closed Lorenzuou closed 5 months ago

JunMa11 commented 5 months ago

Hi @Lorenzuou ,

MedSAM was trained with bounding box prompts while the automatic segmentation in SAM relies on point prompts. Thus, MedSAM didn't support this function.

Actually, we don't think the auto-mask generation has wide usage in medical images. This is because clinicians/radiologists usually focus on specific local regions, which have significant variabilities in segmentation tasks. For example, given a liver cancer CT image, the segmentation task can vary depending on the specific clinical scenario. One clinician might be interested in segmenting the liver tumor, while another might need to segment the entire liver and surrounding organs. We chose bounding boxes as prompts because they provide a more unambiguous spatial context for the region of interest, enabling the algorithm to more precisely discern the target area. This stands in contrast to point-based prompts, which can introduce ambiguity, particularly when proximate structures resemble each other. Moreover, drawing a bounding box is efficient, especially in scenarios involving multi-object segmentation.

Lorenzuou commented 5 months ago

perfect! Thanks for the explanation!