Skip to content

Commit

Permalink
Merge pull request #464 from flatironinstitute/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
epnev authored Feb 20, 2019
2 parents 4f89df7 + 77cce24 commit 3c70e6b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
7 changes: 3 additions & 4 deletions caiman/base/movies.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,8 @@ def extract_shifts(self, max_shift_w=5, max_shift_h=5, template=None, method='op
min_val = np.percentile(self, 1)
if min_val < - 0.1:
logging.debug("min_val in extract_shifts: " + str(min_val))
warnings.warn(
'** Pixel averages are too negative. Removing 1 percentile. **')
logging.warning(
'Movie average is negative. Removing 1st percentile.')
self = self - min_val
else:
min_val = 0
Expand All @@ -273,8 +273,7 @@ def extract_shifts(self, max_shift_w=5, max_shift_h=5, template=None, method='op
template = np.median(self, axis=0)
else:
if np.percentile(template, 8) < - 0.1:
warnings.warn(
'Pixel averages are too negative for template. Removing 1 percentile.')
logging.warning('Movie average is negative. Removing 1st percentile.')
template = template - np.percentile(template, 1)

template = template[ms_h:h_i - ms_h,
Expand Down
3 changes: 2 additions & 1 deletion caiman/motion_correction.py
Original file line number Diff line number Diff line change
Expand Up @@ -2551,7 +2551,7 @@ def motion_correction_piecewise(fname, splits, strides, overlaps, add_to_movie=0
if num_splits is not None:
idxs = np.array(idxs)[np.random.randint(0, len(idxs), num_splits)]
save_movie = False
logging.warning('**** MOVIE NOT SAVED BECAUSE num_splits is not None ****')
#logging.warning('**** MOVIE NOT SAVED BECAUSE num_splits is not None ****')

if save_movie:
if base_name is None:
Expand All @@ -2561,6 +2561,7 @@ def motion_correction_piecewise(fname, splits, strides, overlaps, add_to_movie=0
fname_tot = os.path.join(os.path.split(fname)[0], fname_tot)
np.memmap(fname_tot, mode='w+', dtype=np.float32,
shape=prepare_shape(shape_mov), order=order)
logging.info('Saving file as {}'.format(fname_tot))
else:
fname_tot = None

Expand Down
4 changes: 2 additions & 2 deletions demos/general/demo_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def main():
# %% parameters for source extraction and deconvolution
p = 1 # order of the autoregressive system
gnb = 2 # number of global background components
merge_thresh = 0.8 # merging threshold, max correlation allowed
merge_thr = 0.85 # merging threshold, max correlation allowed
rf = 15
# half-size of the patches in pixels. e.g., if rf=25, patches are 50x50
stride_cnmf = 6 # amount of overlap between the patches in pixels
Expand All @@ -179,7 +179,7 @@ def main():
'stride': stride_cnmf,
'method_init': method_init,
'rolling_sum': True,
'merge_thr': merge_thresh,
'merge_thr': merge_thr,
'n_processes': n_processes,
'only_init': True,
'ssub': ssub,
Expand Down
2 changes: 1 addition & 1 deletion demos/notebooks/demo_pipeline.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
"# parameters for source extraction and deconvolution\n",
"p = 1 # order of the autoregressive system\n",
"gnb = 2 # number of global background components\n",
"merge_thr = 0.8 # merging threshold, max correlation allowed\n",
"merge_thr = 0.85 # merging threshold, max correlation allowed\n",
"rf = 15 # half-size of the patches in pixels. e.g., if rf=25, patches are 50x50\n",
"stride_cnmf = 6 # amount of overlap between the patches in pixels\n",
"K = 4 # number of components per patch\n",
Expand Down

0 comments on commit 3c70e6b

Please sign in to comment.