TissueImageAnalytics / tiatoolbox

Computational Pathology Toolbox developed by TIA Centre, University of Warwick.
https://warwick.ac.uk/tia
Other
340 stars 71 forks source link

I can't find the label ‘PATIENT’ and 'HER2FinalStatus' in the slidegraph.ipynb #747

Closed Czzh1 closed 7 months ago

Czzh1 commented 7 months ago

Description

no_labels I want to run your code,but the dataset I downloaded from the TCGA-BRCA missed the label ‘PATIENT’ and 'HER2FinalStatus'

What I Did

Anyone Can tell me what should I do?

Czzh1 commented 7 months ago

How I can get the right dataset of TCGA-BRCA which is samed as yours?

shaneahmed commented 7 months ago

Which Jupyter notebook are you using?

shaneahmed commented 7 months ago

As this is training code, the notebook assumes you have the data for training.

Closing this issue. If you have any further questions, please feel free to reopen again.

wangbo00129 commented 4 months ago

I'm trying to reproduce the results in tiatoolbox/examples/full-pipelines/slide-graph.ipynb and also need the exact CLINICAL_FILE mentioned in the notebook. Did you find it?

Czzh1 commented 4 months ago

yes,I found it. So I hope you can provide the CLINICAL_FILE.I will thank you very much! 

@.***

 

------------------ 原始邮件 ------------------ 发件人: @.>; 发送时间: 2024年2月27日(星期二) 下午2:12 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [TissueImageAnalytics/tiatoolbox] I can't find the label ‘PATIENT’ and 'HER2FinalStatus' in the slidegraph.ipynb (Issue #747)

I'm trying to reproduce the results in tiatoolbox/examples/full-pipelines/slide-graph.ipynb and also need the exact CLINICAL_FILE mentioned in the notebook. Did you find it?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

wangbo00129 commented 4 months ago

I think I found the labels. There is a y in the graph jsons which is 1 or 0. I think these ys are the labels.

from glob import glob
import json
import os

def getLabelFromJson(path_json):
    print(path_json)
    label = json.load(open(path_json))
    return label

df_labels_from_json = pd.DataFrame()

for path_json in glob('graphs/*json'):
    name = os.path.basename(path_json).replace('.json', '')
    label = getLabelFromJson(path_json)['y']
    if isinstance(label, list) and len(label) == 1:
        label = label[0]
        df_labels_from_json.loc[name, 'label'] = label
    else:
        raise Exception(label)