jaeho3690 / LIDC-IDRI-Preprocessing

This is the preprocessing step of the LIDC-IDRI dataset
160 stars 43 forks source link

AttributeError: 'NoneType' object has no attribute 'cluster_annotations' #13

Closed rsameera99 closed 3 years ago

rsameera99 commented 3 years ago

Hi Jaeho! First of all thanks for the detailed explanation for the preprocess. I can follow so far for my first project try on this data.

I encounter a problem after running the code. Can I ask for a help to solve this issue? Thank you very much

AttributeError Traceback (most recent call last)

in 155 156 test= MakeDataSet(LIDC_IDRI_list,IMAGE_DIR,MASK_DIR,CLEAN_DIR_IMAGE,CLEAN_DIR_MASK,META_DIR,mask_threshold,padding,confidence_level) --> 157 test.prepare_dataset() in prepare_dataset(self) 81 pid = patient #LIDC-IDRI-0001~ 82 scan = pl.query(pl.Scan).filter(pl.Scan.patient_id == pid).first() ---> 83 nodules_annotation = scan.cluster_annotations() 84 vol = scan.to_volume() 85 print("Patient ID: {} Dicom Shape: {} Number of Annotated Nodules: {}".format(pid,vol.shape,len(nodules_annotation))) AttributeError: 'NoneType' object has no attribute 'cluster_annotations'
jaeho3690 commented 3 years ago

Hi, glad to hear that someone is finding this repository helpful!

Which version of the pylidc library are you using? The error seems to be coming from the pylidc library

rsameera99 commented 3 years ago

Thank you for the fast response. I think I'm using the latest version which is pylidc 0.2.2 I just install via pip install before running the prepare_dataset.

jaeho3690 commented 3 years ago

Please try installing pylidc 0.2.1. Btw, did you make any modifications to the code?

rsameera99 commented 3 years ago

I will install that version. I only modify when there was the error for saving clean dataset, the modification I followed was the one issue from the resolved issue for this project. and the path for pylidc.conf. other than that, I didn't made any modification

rsameera99 commented 3 years ago

I installed the 0.2.1 version. Do I have to run the code again from the start whenever there's an error occured after npy. file is generated?

jaeho3690 commented 3 years ago

is the original problem solved? I am not sure why there is an error occurring after an npy file is generated

rsameera99 commented 3 years ago

I just finish running the code again, and the attribute error is still unsolved. the same error as before. The npy files are generated and in the folders already but the same problem of attribute error 'NoneType' still occur

rsameera99 commented 3 years ago

Hi, I have another question, can the .npy files and csv files be used for training and validation? How can I use it?

rsameera99 commented 3 years ago

Hi, sorry for disturbing your time. I still haven't successfully solve the issue of attribute error 'NoneType'. Can you help me with this matter, I am so grateful. thank you

jaeho3690 commented 3 years ago

@macwolfz In my case, I somehow changed the folder names, and thus the pylidc was not working. Please make sure that the pid (or patient) in the following line is in the specified format (LIDC-IDRI-xxxx) https://github.com/jaeho3690/LIDC-IDRI-Preprocessing/blob/fe5012cee158e8c8070dbaab6f24a1c157ab2bc4/prepare_dataset.py#L97

jaeho3690 commented 3 years ago

please check out the above issue, the problem seems to be the same with you

jaeho3690 commented 3 years ago

https://github.com/jaeho3690/LIDC-IDRI-Preprocessing/issues/5#issue-735773696

rsameera99 commented 3 years ago

Sorry to bother you again, I've check on that particular line and it appears as per the original code. Is there anything I need to change on that line?

jaeho3690 commented 3 years ago

I honestly have no idea why its not working :(

KafuiEA commented 3 years ago

Hi, I had the same issue. I solved it by removing all the other files in the LIDC-IDRI folders of the datasets. I have removed the file named "LICENSE" inside the folder "LIDC-IDRI-Preprocessing-master/LIDC-IDRI/" and kept only the folders with the name "LIDC-IDRI-xxxx". Hope it can help.