Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue in finding a csv file. #8

Open
Asaad-Pak opened this issue Feb 27, 2024 · 0 comments
Open

Issue in finding a csv file. #8

Asaad-Pak opened this issue Feb 27, 2024 · 0 comments

Comments

@Asaad-Pak
Copy link

I am implementing code of XREM paper in which one file uses the "CXR-Report-Metric" whose code look like this below:
"
import pandas as pd
import argparse

#CXR-Metric computes the scores based on 2,192 samples from the mimic-cxr test set that consists of 3,678
#This function selects the respective 2,192 reports
def main(fpath, opath):
df = pd.read_csv(fpath)
test = pd.read_csv('../data/mimic_test_impressions.csv')
gt = pd.read_csv('../data/cxr2_generated_appa.csv')[['dicom_id', 'study_id']] #contains the dicom ids of the 2,192 imgs
gt['report'] = [None] * len(gt)
pred = df['filtered']
pred = pd.concat([test[['dicom_id']], pred], axis = 1)
pred = pred.set_index('dicom_id')
for idx, row in gt.iterrows():
dicom_id, study_id, _ = row
gt['report'][idx] = pred['filtered'][dicom_id]
gt.to_csv(opath, index = False)

if name == 'main':
parser = argparse.ArgumentParser()
parser.add_argument('--fpath', default='../ifcc/example_m2trans_nli.csv')
parser.add_argument('--opath', default='pred.csv')
args = parser.parse_args()
main(args.fpath, args.opath)

I am not sure here what file to pass here in 'gt' variable. Is it ground truth files with labels? If yes then it doesn't contain study_id and dicom_id. Can you explain this what gt files look like any sample of gt file. @KathyFeiyang any lead will be highly appreciated.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant