Skip to content

Commit

Permalink
[LOG] add center calculation to log file
Browse files Browse the repository at this point in the history
  • Loading branch information
sophiamaedler committed Feb 10, 2025
1 parent e256354 commit 99db0d3
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/scportrait/pipeline/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -915,6 +915,11 @@ def load_input_from_sdata(
# check coordinate system of input image
### PLACEHOLDER

# check channel names
self.log(
f"Found the following channel names in the input image and saving in the spatialdata object: {channel_names}"
)

self.filehandler._write_image_sdata(image, self.DEFAULT_INPUT_IMAGE_NAME, channel_names=channel_names)

# check if a nucleus segmentation exists and if so add it to the sdata object
Expand All @@ -938,6 +943,9 @@ def load_input_from_sdata(
self._check_chunk_size(mask, chunk_size=self.DEFAULT_CHUNK_SIZE_2D) # ensure chunking is correct

self.filehandler._write_segmentation_object_sdata(mask, self.nuc_seg_name)
self.log(
f"Calculating centers for nucleus segmentation mask {self.nuc_seg_name} and adding to spatialdata object."
)
self.filehandler._add_centers(segmentation_label=self.nuc_seg_name)

# check if a cytosol segmentation exists and if so add it to the sdata object
Expand All @@ -961,6 +969,9 @@ def load_input_from_sdata(
self._check_chunk_size(mask, chunk_size=self.DEFAULT_CHUNK_SIZE_2D) # ensure chunking is correct

self.filehandler._write_segmentation_object_sdata(mask, self.cyto_seg_name)
self.log(
f"Calculating centers for cytosol segmentation mask {self.nuc_seg_name} and adding to spatialdata object."
)
self.filehandler._add_centers(segmentation_label=self.cyto_seg_name)

self.get_project_status()
Expand Down

0 comments on commit 99db0d3

Please sign in to comment.