MrGiovanni / DiffTumor

[CVPR 2024] Generalizable Tumor Synthesis - Realistic Synthetic Tumors in Liver, Pancreas, and Kidney
https://www.cs.jhu.edu/~alanlab/Pubs24/chen2024towards.pdf
Other
139 stars 10 forks source link

Random select location for tumors #9

Open Devil-Ideal opened 5 months ago

Devil-Ideal commented 5 months ago

Hi ! Thank you for your work ! When I run the code, an error occurs. I think this is due to random cropping, which may cause the cropped patch not to contain the target organ, resulting in ValueError: zero-size array to reduction operation minimum which has no identity (Step3/tumorgeneration/utils.py/line 18). How do you avoid this problem? image

Devil-Ideal commented 5 months ago

I am not sure whether ‘’organ_label‘’ represents healthy data or tumor data, because in Step3/main.py these data are saved in img_real not img_healthy, but in monai_trainer.py these data are used to synthesize tumors image image

qic999 commented 5 months ago

@Devil-Ideal Thank you for your attention to our work. I don't fully understand your ValueError yet. Could you provide a specific screenshot of the error? Besides, we select the healthy data to synthesize tumors in monai_trainer.py line 229 and main.py line 142.

Devil-Ideal commented 5 months ago

ValueError: zero-size array to reduction operation minimum which has no identity

thank you for prompt reply. 'ValueError: zero-size array to reduction operation minimum which has no identity' occurs when the array is empty which indicates mask_scan is all zeros and this patch is all background. That is the reason why I think this is due to random cropping, which may cause the cropped patch not to contain the target organ. Is that what I thought?