@@ -187,23 +187,27 @@ def set_external_info(
187187 else :
188188 path = _get_path (conn , img .id )
189189 if path .endswith ("OME/METADATA.ome.xml" ):
190- if well :
191- match = WELL_POS_RE .match (well )
192- if match :
193- col = match .group ("col" )
194- row = match .group ("row" )
195- path = path .replace ("OME/METADATA.ome.xml" , f"{ row } " )
196- path = f"/{ path } /{ col } /{ idx } "
197- else :
198- raise ValueError (f"Couldn't parse well position: { well } " )
199- else :
200- series = img .getSeries ()._val
201- path = path .replace ("OME/METADATA.ome.xml" , f"{ series } " )
202- path = f"/{ path } "
190+ spec = "OME/METADATA.ome.xml"
191+ elif path .endswith (".fake" ):
192+ spec = path [path .rindex ('/' ) + 1 :]
203193 else :
204194 raise ValueError (
205195 f"Doesn't seem to be an ome.zarr: { path } "
206196 )
197+ if well :
198+ match = WELL_POS_RE .match (well )
199+ if match :
200+ col = match .group ("col" )
201+ row = match .group ("row" )
202+ path = path .replace (spec , f"{ row } " )
203+ path = f"/{ path } /{ col } /{ idx } "
204+ else :
205+ raise ValueError (f"Couldn't parse well position: { well } " )
206+ else :
207+ series = img .getSeries ()._val
208+ path = path .replace (spec , f"{ series } " )
209+ path = f"/{ path } "
210+
207211
208212 info = ExternalInfoI ()
209213 info .entityType = rstring (entityType )
0 commit comments