@@ -122,6 +122,7 @@ def extract_(
122122 cache_dir : Path | None ,
123123 cache_tiles_ext : ImageExtension ,
124124 extractor : ExtractorName | Extractor ,
125+ tile_extractor : ExtractorName ,
125126 tile_size_px : TilePixels ,
126127 tile_size_um : Microns ,
127128 max_workers : int ,
@@ -222,6 +223,11 @@ def extract_(
222223
223224 extractor = plip ()
224225
226+ case ExtractorName .TICON :
227+ from stamp .preprocessing .extractor .ticon import ticon
228+
229+ extractor = ticon (tile_extractor = tile_extractor )
230+
225231 case ExtractorName .EMPTY :
226232 from stamp .preprocessing .extractor .empty import empty
227233
@@ -238,7 +244,8 @@ def extract_(
238244 code_hash = get_processing_code_hash (Path (__file__ ))[:8 ]
239245
240246 extractor_id = extractor .identifier
241-
247+ if extractor_id == ExtractorName .TICON and tile_extractor is not None :
248+ extractor_id = f"{ extractor_id } -{ tile_extractor } "
242249 _logger .info (f"Using extractor { extractor .identifier } " )
243250
244251 if cache_dir :
@@ -330,6 +337,8 @@ def extract_(
330337
331338 h5_fp .attrs ["stamp_version" ] = stamp .__version__
332339 h5_fp .attrs ["extractor" ] = str (extractor .identifier )
340+ if tile_extractor is not None :
341+ h5_fp .attrs ["tile_extractor" ] = str (tile_extractor )
333342 h5_fp .attrs ["unit" ] = "um"
334343 h5_fp .attrs ["tile_size_um" ] = tile_size_um # changed in v2.1.0
335344 h5_fp .attrs ["tile_size_px" ] = tile_size_px
0 commit comments