ZhiGroup / iGWAS

8 stars 5 forks source link

Some issues #1

Open Djoels opened 1 year ago

Djoels commented 1 year ago

Thank you for publishing the code for this study. I stumbled upon some errors when trying to reproduce.

When using the prepare_dataset.py file, I got an error, from the prepare_dataset function in utils.py: ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

https://github.com/ZhiGroup/iGWAS/blob/master/segmentation/utils.py#L120 if im: should probably be if im is not None:? That got it working for me at least

I can not know for sure whether my environment is the same as the environment of the original study. Is there an requirements.txt (for use with pip install -r requirements.txt) or a conda_env.yml (for use with conda env create -f conda_env.yml) that could be provided?

Another issue I stumbled upon is the precomputed.h5 file being referenced in https://github.com/ZhiGroup/iGWAS/blob/master/embedding/train.py#L18 Is it somehow possible to know how this file was created from the DRD dataset?

The comment for the init function of that class doesn't seem to relate to the MyDataset class:

class MyDataset(Dataset):
    def __init__(self, tsfm, h5_file='precomputed.h5', lim=40000):
        '''
        pattern_dict contains "img", "mask" and other data attributes as keys,
        and has correspoinding regular expression pattern and
        processing function as values.
        '''

2 other files mentioned within don't seem to be from the original dataset either: retinopathy_solution.csvand fundus_im_quality.pkl

ZiqianXie commented 1 year ago

Thanks! I have corrected the error. For environment: I don't remember exactly but the environment was kind of messed up because of some dependency issues of opencv2, I may mixed conda and pip install, I will try to do some test and have a requirement file soon. For precomputed.h5: This is derived from the eyepacs dataset, it is either the segmentation mask (for vessel-enriched endophenotype) or just the cropped, resized version (for raw image derived endophenotype). I will try to find the script that generate this and upload it. For comments: I have removed the irrelevant comment, which was copied from the old dataset of training the segmentation model. For fundus_im_quality.pkl: This is the output of quality assessment network on the eyepacs dataset. I will upload this file soon. Again thanks for your interest.

Djoels commented 1 year ago

Thank you very much for the reply and congratulations with the paper, I found it a very interesting read!

Djoels commented 1 year ago

Is there any update on this? thanks again :)

ZiqianXie commented 1 year ago

I added fundus_im_quality.pkl, the quality scores of all eyepacs images and precompute.py, for caching all segmentation masks.