CellProfiling / HPA-Cell-Segmentation

Apache License 2.0
95 stars 26 forks source link

Edited checking er_imgs variable exception message for multi channel … #25

Closed ryanlstevens closed 3 years ago

ryanlstevens commented 3 years ago

I've been using segmentator for single image cell segmentation and received a ValueError:

ValueError : Please speicify the image path(s) for er channels!

This was raised by this line in the cellsegmentator.py file

if self.multi_channel_model:
            if not isinstance(er_imgs, list):
                raise ValueError("Please speicify the image path(s) for er channels!")

This condition does not check if er_imgs exists, which is what the error message implies. I've changed it to the following

if self.multi_channel_model:
            if er_imgs is None:
                raise ValueError("Please speicify the image path(s) for er channels!")

            assert isinstance(er_imgs, list)
cwinsnes commented 3 years ago

Thank you vert much for the PR, and sorry that it has taken time to merge it!