mist-medical / MIST

MIST: A simple, scalable, and end-to-end framework for 3D medical imaging segmentation.
Apache License 2.0
29 stars 11 forks source link

Crash occurs during analysis if dataset has a patient with invalid label set on most recent version #37

Closed evanmlim closed 3 weeks ago

evanmlim commented 1 month ago

Describe the bug Patients with an invalid label set should be excluded from the final dataset during analysis. To test, I purposely added an extra patient to the CHAOS dataset with a labels [0, 2] instead of [0, 1] when the defined labels are [0, 1]. However, the analysis crashed instead of excluding the erroneous patient. I presume it's any invalid patient, not just patients with an invalid label set.

To Reproduce Run mist_analyze on any dataset with at least 1 patient with a set of labels that isn't a subset of the labels described in the --data .json file.

Screenshots The crash log is as follows: image

aecelaya commented 1 month ago

Thanks for finding that bug!

I know that the exclusion of bad cases works. Try running it on the raw LiTS dataset, and you'll see that it excludes two cases for header mismatches. I think this specific corner case might cause a crash somewhere.

aecelaya commented 3 weeks ago

This bug was fixed in the latest release (v0.1.2-beta). We forgot to reset the index in the paths dataframe when we dropped rows that corresponded to bad data.

BTW this was why your total seg cluster 0 job was failing.