Mercurial > repos > goeckslab > rename_tiff_channels
diff rename_tiff_channels.xml @ 6:4763362914f4 draft default tip
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/mti-utils commit 5c324d06ad54dca76aa2b4c8118df5654f49da66
author | goeckslab |
---|---|
date | Mon, 15 Jul 2024 21:37:39 +0000 |
parents | 61fd94c7ce42 |
children |
line wrap: on
line diff
--- a/rename_tiff_channels.xml Thu Jul 11 22:41:10 2024 +0000 +++ b/rename_tiff_channels.xml Mon Jul 15 21:37:39 2024 +0000 @@ -59,7 +59,7 @@ channels_df = pd.read_csv(os.path.join(cwd, 'channels.csv')) original_ome_xml = tiffcomment(os.path.join(cwd, 'renamed_image.ome.tiff')) -working_ome = ome_types.from_xml(original_ome_xml, parser = 'lxml') +working_ome = ome_types.from_xml(original_ome_xml) for l_idx, level in enumerate(working_ome.images): @@ -73,7 +73,7 @@ print(f"Channel {c_idx} renamed to {new_name}") -updated_ome_xml = working_ome.to_xml() +updated_ome_xml = working_ome.to_xml().encode() tiffcomment(os.path.join(cwd, 'renamed_image.ome.tiff'), updated_ome_xml) print("Updated OME-TIFF metadata:") @@ -93,12 +93,13 @@ <param name="channel_csv" value="rename_channels.csv" /> <output name="renamed_image" ftype="ome.tiff"> <assert_contents> - <has_size value="899000" delta="50000" /> + <has_size value="900000" delta="50000" /> </assert_contents> </output> <assert_stdout> - <has_text text="Channel 0 renamed to DNA_6" /> + <has_text text="Channel 0 renamed to Hematoxylin" /> <has_text text="Updated OME-TIFF metadata" /> + <has_text text="µm" /> </assert_stdout> </test> </tests>