From d1eb12cf8cf19a1e564d3544ddcc93e087a3efd6 Mon Sep 17 00:00:00 2001 From: Luik Date: Thu, 4 Apr 2024 18:08:35 +0200 Subject: [PATCH] Cleanup after conversion and also do not copy source image metadata. Dtype breaks masks. --- data/SLURM_Get_Results.py | 6 +++--- workflows/SLURM_Run_Workflow.py | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/data/SLURM_Get_Results.py b/data/SLURM_Get_Results.py index 07497dd..a494b4d 100644 --- a/data/SLURM_Get_Results.py +++ b/data/SLURM_Get_Results.py @@ -254,7 +254,7 @@ def saveImagesToOmeroAsDataset(conn, folder, client, dataset_id, new_dataset=Tru source_image_id = images[0].getId() except IndexError: source_image_id = None - logger.debug(img_data.shape, dataset_id, source_image_id) + logger.debug(f"{img_data.shape}, {dataset_id}, {source_image_id}, {img_data.dtype}") logger.debug( f"B4 turning to yxzct -- Number of unique values: {np.unique(img_data)} | shape: {img_data.shape}") @@ -269,12 +269,12 @@ def saveImagesToOmeroAsDataset(conn, folder, client, dataset_id, new_dataset=Tru renamed = name logger.debug( - f"B4 posting to Omero -- Number of unique values: {np.unique(img_data)} | shape: {img_data.shape}") + f"B4 posting to Omero -- Number of unique values: {np.unique(img_data)} | shape: {img_data.shape} | dtype: {img_data.dtype}") img_id = ezomero.post_image(conn, img_data, renamed, dataset_id=dataset_id, dim_order="yxzct", - source_image_id=source_image_id, + # source_image_id=source_image_id, description=f"Result from job {job_id} | analysis {folder}") del img_data diff --git a/workflows/SLURM_Run_Workflow.py b/workflows/SLURM_Run_Workflow.py index 5de2219..d434132 100644 --- a/workflows/SLURM_Run_Workflow.py +++ b/workflows/SLURM_Run_Workflow.py @@ -284,6 +284,8 @@ def runScript(): slurmJob.wait_for_completion(slurmClient, conn) if not slurmJob.completed(): raise Exception(f"Conversion is not completed: {slurmJob}") + else: + slurmJob.cleanup(slurmClient) except Exception as e: UI_messages += f" ERROR WITH CONVERTING DATA: {e}" raise e