Skip to content

Commit

Permalink
Map in extra metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
bethac07 committed Nov 20, 2024
1 parent d9dc762 commit 2dc91ba
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/pe2loaddata/transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,14 @@ def write_csv(writer, images, plates, wells, maps, channels, metadata, paths, su
field_id = '%02d-%02d' % (int(image.metadata["FieldID"]), int(image.metadata.get("PlaneID", 1)))

if image.channel_name:
# Older version file, all metadata already attached to the image
channel = image.channel_name
else:
# Newer version file, need to concatenate metadata on
channel = maps[str(image.channel_id)]['ChannelName'].replace(" ","")
for key in sorted(metadata.keys()):
if key not in image.metadata.keys():
image.metadata[key] = maps[str(image.channel_id)][key]

assert channel in channels

Expand Down

0 comments on commit 2dc91ba

Please sign in to comment.