Skip to content

Commit

Permalink
Cleanup after conversion and also do not copy source image metadata. …
Browse files Browse the repository at this point in the history
…Dtype breaks masks.
  • Loading branch information
TorecLuik committed Apr 4, 2024
1 parent 1786982 commit d1eb12c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 3 additions & 3 deletions data/SLURM_Get_Results.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}")

Expand All @@ -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
Expand Down
2 changes: 2 additions & 0 deletions workflows/SLURM_Run_Workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d1eb12c

Please sign in to comment.