Skip to content

Commit 5c64bd5

Browse files
committed
filter points at label image border in pciseq
1 parent 796f573 commit 5c64bd5

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

  • src/methods_transcript_assignment/pciseq

src/methods_transcript_assignment/pciseq/script.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,12 @@ def eta_update_no_assert(self):
121121
else:
122122
label_image = sdata_segm["segmentation"].to_numpy()
123123

124+
# There might be spots at the border of the image, pciseq runs into an error if this is the case
125+
transcripts_at_border = transcripts_dataframe['x'] > (label_image.shape[1]-0.5)
126+
transcripts_dataframe = transcripts_dataframe.loc[transcripts_at_border]
127+
transcripts_at_border = transcripts_dataframe['y'] > (label_image.shape[0]-0.5)
128+
transcripts_dataframe = transcripts_dataframe.loc[transcripts_at_border]
129+
124130
# Grab all the pciSeq parameters
125131
opts_keys = [#'exclude_genes',
126132
'max_iter',

0 commit comments

Comments
 (0)