Skip to content

Commit 7462624

Browse files
committed
fix calcul of zmap when loading the projection
1 parent ab7a4b7 commit 7462624

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "fishfeats"
7-
version = "1.4.0"
7+
version = "1.4.1"
88
description = "Napari plugin for RNA-Fish+cells analysis pipeline"
99
license.file = "LICENSE"
1010
readme = "README.md"

src/fish_feats/MainImage.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,11 @@ def popFromJunctions(self, proj=None, zpos=False ):
501501
print("Calculating the z-map to place cells in 3D")
502502
zmap = self.calculate_zmap(proj, step_size=200, window_size=250)
503503

504-
self.pop.createCellsFromMask(self.junmask, self.junstain, results, find_z=zpos, zmap = zmap, cells_direction=self.zdirection, talkative=self.verbose)
504+
if self.junstain is None:
505+
junstain = self.img[self.junchan]
506+
else:
507+
junstain = self.junstain
508+
self.pop.createCellsFromMask(self.junmask, junstain, results, find_z=zpos, zmap = zmap, cells_direction=self.zdirection, talkative=self.verbose)
505509
ut.show_info("Created "+str(len(self.pop.cells))+" cells")
506510
return 1
507511

@@ -1129,14 +1133,17 @@ def tryTogether(self):
11291133

11301134
def calculate_zmap(self, projimg, step_size, window_size):
11311135
""" Calculate the zmap of the cells position based on the projection """
1136+
junstain = self.junstain
11321137
if self.junstain is None:
11331138
self.check_separation()
1139+
junstain = self.junstain
11341140
if self.junstain is None:
1141+
junstain = self.img[self.junchan]
11351142
ut.show_warning("Load junction staining (separated if necessary) before")
11361143
return
11371144
zmap = np.zeros(projimg.shape, "uint8")
11381145
for i, x in enumerate(range(0, projimg.shape[0], step_size)):
1139-
zmap_cur = process_x( x, step=step_size, projimg=projimg, img=self.junstain, winsize=window_size )
1146+
zmap_cur = process_x( x, step=step_size, projimg=projimg, img=junstain, winsize=window_size )
11401147
zmap[x:(x+step_size),:] = zmap_cur
11411148
return zmap
11421149

0 commit comments

Comments
 (0)