@@ -96,6 +96,43 @@ def test_ome_tiff_converter_group_metadata(tmp_path, filename):
9696 assert shape [level_axes .index ("Y" )] == level_height
9797
9898
99+ @pytest .mark .parametrize (
100+ "filename,num_series" , [("CMU-1-Small-Region.ome.tiff" , 3 ), ("UTM2GTIF.tiff" , 1 )]
101+ )
102+ @pytest .mark .parametrize ("preserve_axes" , [False , True ])
103+ @pytest .mark .parametrize ("chunked,max_workers" , [(False , 0 ), (True , 0 ), (True , 4 )])
104+ @pytest .mark .parametrize (
105+ "compressor" ,
106+ [
107+ tiledb .ZstdFilter (level = 0 ),
108+ tiledb .WebpFilter (WebpInputFormat .WEBP_RGB , lossless = False ),
109+ tiledb .WebpFilter (WebpInputFormat .WEBP_RGB , lossless = True ),
110+ tiledb .WebpFilter (WebpInputFormat .WEBP_NONE , lossless = True ),
111+ ],
112+ )
113+ def test_ome_tiff_converter_exclude_original_metadata (
114+ tmp_path , filename , num_series , preserve_axes , chunked , max_workers , compressor
115+ ):
116+ if isinstance (compressor , tiledb .WebpFilter ) and filename == "UTM2GTIF.tiff" :
117+ pytest .skip (f"WebPFilter cannot be applied to { filename } " )
118+
119+ input_path = get_path (filename )
120+ tiledb_path = tmp_path / "to_tiledb"
121+ OMETiffConverter .to_tiledb (
122+ input_path ,
123+ str (tiledb_path ),
124+ preserve_axes = preserve_axes ,
125+ chunked = chunked ,
126+ max_workers = max_workers ,
127+ compressor = compressor ,
128+ log = False ,
129+ exclude_metadata = True ,
130+ )
131+
132+ with TileDBOpenSlide (str (tiledb_path )) as t :
133+ assert t .properties ["original_metadata" ] == "{}"
134+
135+
99136@pytest .mark .parametrize (
100137 "filename,num_series" , [("CMU-1-Small-Region.ome.tiff" , 3 ), ("UTM2GTIF.tiff" , 1 )]
101138)
0 commit comments