Skip to content

Commit f285aa8

Browse files
committed
Improved docstrings, type hints etc.
1 parent 329a108 commit f285aa8

5 files changed

Lines changed: 18 additions & 10 deletions

File tree

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
/example_datasets/
1+
.ipynb_checkpoints/

example_datasets.zip

-30.8 MB
Binary file not shown.

saibr/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
from .saibr import *
22
from .funcs import *
33
from .roi import *
4+
from .legacy import *

saibr/legacy.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from saibr import SaibrCalibrate, saibr_correlation, saibr_correlation_3channel, saibr_correct, saibr_correct_3channel
2+
3+
AfCorrelation = SaibrCalibrate
4+
af_correlation = saibr_correlation
5+
af_correlation_3channel = saibr_correlation_3channel
6+
af_subtraction = saibr_correct
7+
af_subtraction_3channel = saibr_correct_3channel

saibr/saibr.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,12 @@ def run(self):
8787

8888
# Perform regression
8989
if self.rfp is None:
90-
self.params, self.af_vals, self.gfp_vals = af_correlation(np.array(self.gfp_filtered),
91-
np.array(self.af_filtered), self.mask,
92-
intercept0=self.intercept0,
93-
method=self.method)
90+
self.params, self.af_vals, self.gfp_vals = saibr_correlation(np.array(self.gfp_filtered),
91+
np.array(self.af_filtered), self.mask,
92+
intercept0=self.intercept0,
93+
method=self.method)
9494
else:
95-
self.params, self.af_vals, self.rfp_vals, self.gfp_vals = af_correlation_3channel(
95+
self.params, self.af_vals, self.rfp_vals, self.gfp_vals = saibr_correlation_3channel(
9696
np.array(self.gfp_filtered), np.array(self.af_filtered), np.array(self.rfp_filtered), self.mask,
9797
intercept0=self.intercept0, method=self.method)
9898

@@ -274,8 +274,8 @@ def _plot_residuals_3channel(self, s: float = 0.001):
274274
return fig, ax
275275

276276

277-
def af_correlation(img1: np.ndarray, img2: np.ndarray, mask: np.ndarray = None, intercept0: bool = False,
278-
method: str = 'OLS') -> Tuple[list, np.ndarray, np.ndarray]:
277+
def saibr_correlation(img1: np.ndarray, img2: np.ndarray, mask: np.ndarray = None, intercept0: bool = False,
278+
method: str = 'OLS') -> Tuple[list, np.ndarray, np.ndarray]:
279279
"""
280280
Calculates pixel-by-pixel correlation between two channels
281281
Takes 3d image stacks shape [n, 512, 512]
@@ -347,8 +347,8 @@ def af_correlation(img1: np.ndarray, img2: np.ndarray, mask: np.ndarray = None,
347347
return params, xdata, ydata
348348

349349

350-
def af_correlation_3channel(img1: np.ndarray, img2: np.ndarray, img3: np.ndarray, mask: Optional[np.ndarray] = None,
351-
intercept0: bool = False, method: str = 'OLS') -> Tuple[
350+
def saibr_correlation_3channel(img1: np.ndarray, img2: np.ndarray, img3: np.ndarray, mask: Optional[np.ndarray] = None,
351+
intercept0: bool = False, method: str = 'OLS') -> Tuple[
352352
list, np.ndarray, np.ndarray, np.ndarray]:
353353
"""
354354
Calculates pixel-by-pixel correlation between three channels

0 commit comments

Comments
 (0)