Skip to content
Snippets Groups Projects
Commit 314001f3 authored by Pierre Tocquin's avatar Pierre Tocquin
Browse files

refactor(process_pipeline): use filename without extension for TIFF output

This change extracts the base file name without its extension when creating TIFF output files. Previously, the full file path with an extension was used, which could lead to redundant extensions in output filenames. This update ensures clearer and more concise naming conventions for generated files.
parent 3d2fbba1
No related branches found
No related tags found
No related merge requests found
......@@ -78,6 +78,9 @@ def process_czi_file(file_path, config):
x_idx = dims.index('X')
y_idx = dims.index('Y')
# Extract the file name without the extension
input_filename = os.path.splitext(os.path.basename(file_path))[0]
num_series = len(czi.get_dims_shape())
print(f"Number of detected series (S): {num_series}")
......@@ -128,7 +131,7 @@ def process_czi_file(file_path, config):
mosaic_image[pos_y:pos_y + height, pos_x:pos_x + width] = tile[0, 0, 0, 0, :, :, 1]
# Save the assembled mosaic as a TIFF with a series suffix
output_filename = os.path.join(config['output_dir'], f"{os.path.basename(file_path)}_series_{s}.tif")
output_filename = os.path.join(config['output_dir'], f"{input_filename}_series_{s}.tif")
tiff.imwrite(output_filename, mosaic_image, compression=config['compression'])
print(f"Generated TIFF for series {s}: {output_filename}")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment