|
16 | 16 | AnnDataWrapper, |
17 | 17 | CsvWrapper, |
18 | 18 | MultivecZarrWrapper, |
| 19 | + ImageOmeTiffWrapper, |
| 20 | + ObsSegmentationsOmeTiffWrapper, |
| 21 | + ImageOmeZarrWrapper, |
| 22 | + ObsSegmentationsOmeZarrWrapper, |
19 | 23 | ) |
20 | 24 |
|
21 | 25 | from vitessce.wrappers import file_path_to_url_path |
@@ -139,6 +143,70 @@ def test_ome_zarr_with_base_dir(self): |
139 | 143 | 'url': 'http://localhost:8000/test.ome.zarr' |
140 | 144 | }) |
141 | 145 |
|
| 146 | + def test_image_ome_tiff(self): |
| 147 | + w = ImageOmeTiffWrapper(img_path=data_path / 'test.ome.tif') |
| 148 | + w.local_img_uid = 'test.ome.tif' |
| 149 | + w.local_offsets_uid = 'test.offsets.json' |
| 150 | + |
| 151 | + file_def_creator = w.make_raster_file_def_creator( |
| 152 | + "A", |
| 153 | + "0" |
| 154 | + ) |
| 155 | + file_def = file_def_creator('http://localhost:8000') |
| 156 | + self.assertEqual(file_def, { |
| 157 | + 'fileType': 'image.ome-tiff', |
| 158 | + 'url': 'http://localhost:8000/A/0/test.ome.tif', |
| 159 | + 'options': { |
| 160 | + 'offsetsUrl': 'http://localhost:8000/A/0/test.offsets.json' |
| 161 | + } |
| 162 | + }) |
| 163 | + |
| 164 | + def test_image_ome_zarr(self): |
| 165 | + w = ImageOmeZarrWrapper(img_path=data_path / 'test.ome.zarr') |
| 166 | + w.local_dir_uid = 'test.ome.zarr' |
| 167 | + |
| 168 | + file_def_creator = w.make_image_file_def_creator( |
| 169 | + "A", |
| 170 | + "0" |
| 171 | + ) |
| 172 | + file_def = file_def_creator('http://localhost:8000') |
| 173 | + self.assertEqual(file_def, { |
| 174 | + 'fileType': 'image.ome-zarr', |
| 175 | + 'url': 'http://localhost:8000/A/0/test.ome.zarr' |
| 176 | + }) |
| 177 | + |
| 178 | + def test_obs_segmentations_ome_tiff(self): |
| 179 | + w = ObsSegmentationsOmeTiffWrapper(img_path=data_path / 'test.ome.tif') |
| 180 | + w.local_img_uid = 'test.ome.tif' |
| 181 | + w.local_offsets_uid = 'test.offsets.json' |
| 182 | + |
| 183 | + file_def_creator = w.make_raster_file_def_creator( |
| 184 | + "A", |
| 185 | + "0" |
| 186 | + ) |
| 187 | + file_def = file_def_creator('http://localhost:8000') |
| 188 | + self.assertEqual(file_def, { |
| 189 | + 'fileType': 'obsSegmentations.ome-tiff', |
| 190 | + 'url': 'http://localhost:8000/A/0/test.ome.tif', |
| 191 | + 'options': { |
| 192 | + 'offsetsUrl': 'http://localhost:8000/A/0/test.offsets.json' |
| 193 | + } |
| 194 | + }) |
| 195 | + |
| 196 | + def test_obs_segmentations_ome_zarr(self): |
| 197 | + w = ObsSegmentationsOmeZarrWrapper(img_path=data_path / 'test.ome.zarr') |
| 198 | + w.local_dir_uid = 'test.ome.zarr' |
| 199 | + |
| 200 | + file_def_creator = w.make_image_file_def_creator( |
| 201 | + "A", |
| 202 | + "0" |
| 203 | + ) |
| 204 | + file_def = file_def_creator('http://localhost:8000') |
| 205 | + self.assertEqual(file_def, { |
| 206 | + 'fileType': 'obsSegmentations.ome-zarr', |
| 207 | + 'url': 'http://localhost:8000/A/0/test.ome.zarr' |
| 208 | + }) |
| 209 | + |
142 | 210 | def test_anndata(self): |
143 | 211 | adata_path = data_path / 'test.h5ad.zarr' |
144 | 212 | w = AnnDataWrapper(adata_path, |
|
0 commit comments