Skip to content

Commit

Permalink
added intensity sum to compartment ratio
Browse files Browse the repository at this point in the history
  • Loading branch information
jcopperm committed Sep 3, 2024
1 parent 4e890e8 commit 17960d0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions celltraj/trajectory.py
Original file line number Diff line number Diff line change
Expand Up @@ -1030,6 +1030,14 @@ def get_cell_compartment_ratio(self,indcells=None,imgchannel=None,mskchannel1=No
cratio_frame[indcommon0]=np.divide(self.img_zstds[imgchannel]*np.multiply(props1['intensity_mean']+self.img_zmeans[imgchannel],props1['area']),self.img_zstds[imgchannel]*np.multiply(props2['intensity_mean']+self.img_zmeans[imgchannel],props2['area']))
else:
cratio_frame[indcommon0]=np.divide(np.multiply(props1['intensity_mean'],props1['area']),np.multiply(props2['intensity_mean'],props2['area']))
if noratio and not inverse_ratio:
cratio_frame[indcommon0]=np.multiply(props1['intensity_mean'],props1['area'])
elif noratio and inverse_ratio:
cratio_frame[indcommon0]=np.multiply(props2['intensity_mean'],props2['area'])
elif not noratio and not inverse_ratio:
cratio_frame[indcommon0]=np.divide(np.multiply(props1['intensity_mean'],props1['area']),np.multiply(props2['intensity_mean'],props2['area']))
elif not noratio and inverse_ratio:
cratio_frame[indcommon0]=np.divide(np.multiply(props2['intensity_mean'],props2['area']),np.multiply(props1['intensity_mean'],props1['area']))
else:
if intensity_ztransform:
cratio_frame[indcommon0]=np.divide(self.img_zstds[imgchannel]*props1['intensity_mean']+self.img_zmeans[imgchannel],self.img_zstds[imgchannel]*props2['intensity_mean']+self.img_zmeans[imgchannel])
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "celltraj"
version = "0.1.57"
version = "0.1.58"
authors = [
{ name="Jeremy Copperman", email="[email protected]" },
]
Expand Down

0 comments on commit 17960d0

Please sign in to comment.