Skip to content

Commit f6b9257

Browse files
authored
fix path in readme and preprocessing (#927)
Signed-off-by: Can Zhao <canz@nvidia.com> Signed-off-by: Can Zhao <canz@nvidia.com>
1 parent 1d4b0ce commit f6b9257

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

multimodal/openi_multilabel_classification_transchex/README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,8 @@ completed, the dataset can be readily used for the tutorial.
1414

1515
### Preprocessing Steps
1616
1) Create a new folder named 'monai_data' for downloading the raw data and preprocessing.
17-
2) Download the chest X-ray images in PNG format from this [link](https://openi.nlm.nih.gov/imgs/collections/NLMCXR_png.tgz). Copy the downloaded file (NLMCXR_png.tgz)
18-
to 'monai_data' directory and extract it.
19-
3) Download the reports in XML format from this [link](https://openi.nlm.nih.gov/imgs/collections/NLMCXR_reports.tgz). Copy the downloaded file (NLMCXR_reports.tgz)
20-
to 'monai_data' directory and extract it.
17+
2) Download the chest X-ray images in PNG format from this [link](https://openi.nlm.nih.gov/imgs/collections/NLMCXR_png.tgz). Copy the downloaded file (NLMCXR_png.tgz) to 'monai_data' directory and extract it to 'monai_data/dataset_orig/NLMCXR_png/'.
18+
3) Download the reports in XML format from this [link](https://openi.nlm.nih.gov/imgs/collections/NLMCXR_reports.tgz). Copy the downloaded file (NLMCXR_reports.tgz) to 'monai_data' directory and extract it to 'monai_data/dataset_orig/NLMCXR_reports/'.
2119
4) Download the splits of train, validation and test datasets from this [link](https://drive.google.com/u/1/uc?id=1jvT0jVl9mgtWy4cS7LYbF43bQE4mrXAY&export=download). Copy the downloaded file (TransChex_openi.zip)
22-
to 'monai_data' directory and extract it.
20+
to 'monai_data' directory and extract it here.
2321
5) Run 'preprocess_openi.py' to process the images and reports.

multimodal/openi_multilabel_classification_transchex/preprocess_openi.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ def create_report(img_names_list_, report_list_, gt_list_, save_add):
2828

2929
report_file_add= './monai_data/dataset_orig/NLMCXR_reports/ecgen-radiology'
3030
img_file_add= './monai_data/dataset_orig/NLMCXR_png'
31+
npy_add= './monai_data/TransChex_openi/'
32+
3133
img_save_add = './monai_data/dataset_proc/images'
3234
report_train_save_add = './monai_data/dataset_proc/train.csv'
3335
report_val_save_add = './monai_data/dataset_proc/validation.csv'
@@ -37,15 +39,15 @@ def create_report(img_names_list_, report_list_, gt_list_, save_add):
3739
os.makedirs(img_save_add)
3840
report_files = [f for f in listdir(report_file_add) if isfile(join(report_file_add, f))]
3941

40-
train_data = np.load('./train.npy', allow_pickle=True).item()
42+
train_data = np.load(npy_add+'train.npy', allow_pickle=True).item()
4143
train_data_id = train_data['id_GT']
4244
train_data_gt = train_data['label_GT']
4345

44-
val_data = np.load('./validation.npy', allow_pickle=True).item()
46+
val_data = np.load(npy_add+'validation.npy', allow_pickle=True).item()
4547
val_data_id = val_data['id_GT']
4648
val_data_gt = val_data['label_GT']
4749

48-
test_data = np.load('./test.npy', allow_pickle=True).item()
50+
test_data = np.load(npy_add+'test.npy', allow_pickle=True).item()
4951
test_data_id = test_data['id_GT']
5052
test_data_gt = test_data['label_GT']
5153

0 commit comments

Comments
 (0)