diff --git a/src/imcflibs/imagej/bdv.py b/src/imcflibs/imagej/bdv.py index dfe4994a..d18b2b3d 100644 --- a/src/imcflibs/imagej/bdv.py +++ b/src/imcflibs/imagej/bdv.py @@ -1374,7 +1374,7 @@ def interest_points_registration( def duplicate_transformations( project_path, transformation_type="channel", - channel_source=None, + channel_source=0, tile_source=None, transformation_to_use="[Replace all transformations]", ): @@ -1413,7 +1413,10 @@ def duplicate_transformations( if transformation_type == "channel": apply = "[One channel to other channels]" target = "[All Channels]" - source = str(channel_source - 1) + if channel_source > 0: + source = str(channel_source - 1) + else: + source = "0" if tile_source: tile_apply = "apply_to_tile=[Single tile (Select from List)] " tile_process = "processing_tile=[tile " + str(tile_source) + "] " @@ -1423,13 +1426,13 @@ def duplicate_transformations( apply = "[One tile to other tiles]" target = "[All Tiles]" source = str(tile_source) - if channel_source: + if channel_source > 0: ch_apply = "apply_to_channel=[Single channel (Select from List)] " ch_process = "processing_channel=[channel " + str(channel_source - 1) + "] " else: ch_apply = "apply_to_channel=[All channels] " else: - sys.exit("Issue with transformation duplication") + raise ValueError("Invalid transformation type: %s" % transformation_type) options = ( "apply="