diff --git a/celltraj/trajectory.py b/celltraj/trajectory.py index f253943..c822bbf 100644 --- a/celltraj/trajectory.py +++ b/celltraj/trajectory.py @@ -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]) diff --git a/pyproject.toml b/pyproject.toml index 8c99df8..661c3df 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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="copperma@ohsu.edu" }, ]