@@ -29,7 +29,7 @@ def test_seg_values(self):
29
29
{"image" : "spleen_19.nii.gz" , "label" : "spleen_19.nii.gz" },
30
30
{"image" : "spleen_31.nii.gz" , "label" : "spleen_31.nii.gz" },
31
31
],
32
- "test" : [" spleen_15.nii.gz", " spleen_23.nii.gz" ],
32
+ "test" : [{ "image" : " spleen_15.nii.gz"}, { "image" : " spleen_23.nii.gz"} ],
33
33
}
34
34
json_str = json .dumps (test_data )
35
35
file_path = os .path .join (tempdir , "test_data.json" )
@@ -38,6 +38,8 @@ def test_seg_values(self):
38
38
result = load_decathlon_datalist (file_path , True , "training" , tempdir )
39
39
self .assertEqual (result [0 ]["image" ], os .path .join (tempdir , "spleen_19.nii.gz" ))
40
40
self .assertEqual (result [0 ]["label" ], os .path .join (tempdir , "spleen_19.nii.gz" ))
41
+ result = load_decathlon_datalist (file_path , True , "test" , None )
42
+ self .assertEqual (result [0 ]["image" ], os .path .join (tempdir , "spleen_15.nii.gz" ))
41
43
42
44
def test_cls_values (self ):
43
45
with tempfile .TemporaryDirectory () as tempdir :
@@ -81,6 +83,8 @@ def test_seg_no_basedir(self):
81
83
result = load_decathlon_datalist (file_path , True , "training" , None )
82
84
self .assertEqual (result [0 ]["image" ], os .path .join (tempdir , "spleen_19.nii.gz" ))
83
85
self .assertEqual (result [0 ]["label" ], os .path .join (tempdir , "spleen_19.nii.gz" ))
86
+ result = load_decathlon_datalist (file_path , True , "test" , None )
87
+ self .assertEqual (result [0 ]["image" ], os .path .join (tempdir , "spleen_15.nii.gz" ))
84
88
85
89
def test_seg_no_labels (self ):
86
90
with tempfile .TemporaryDirectory () as tempdir :
0 commit comments