|
16 | 16 | from caiman.source_extraction.cnmf.cnmf import load_CNMF |
17 | 17 | from caiman.source_extraction.cnmf.params import CNMFParams |
18 | 18 |
|
| 19 | +############################## |
| 20 | +# This is a tool that can help you visualise dumps of the CNMF object, |
| 21 | +# generated as demonstrated in demo_pipeline. |
| 22 | +# |
| 23 | +# If you're already using it, that's fine, but there are better tools |
| 24 | +# out there (such as the Mesmerize-vis package). To use, point it at the |
| 25 | +# hdf5 file that CLI demo or jupyter notebook made, or have your own code |
| 26 | +# call the save method on the CNMF object, and then feed that (and then the |
| 27 | +# mmap file) into this script when it asks, and you'll see your ROIs and |
| 28 | +# be able to experiment with thresholding (and re-save with those different |
| 29 | +# thresholds). |
| 30 | +# |
| 31 | +# mesmerize-vis offers a better approach to these things, and is much more |
| 32 | +# recent and better maintained. |
| 33 | + |
| 34 | + |
| 35 | + |
19 | 36 | # Always start by initializing Qt (only once per application) |
20 | 37 | app = QtWidgets.QApplication([]) |
21 | 38 |
|
@@ -66,7 +83,7 @@ def make_color_img(img, gain=255, min_max=None, out_type=np.uint8): |
66 | 83 | M = FileDialog() |
67 | 84 | d, f = os.path.split(cnm_obj.mmap_file) |
68 | 85 | cnm_obj.mmap_file = M.getOpenFileName(caption='Load memory mapped file', |
69 | | - directory=d, filter=f + ';;*.mmap')[0] |
| 86 | + filter=f + ';;*.mmap')[0] |
70 | 87 |
|
71 | 88 | if fpath[-3:] == 'nwb': |
72 | 89 | mov = caiman.load(cnm_obj.mmap_file, |
@@ -405,23 +422,23 @@ def move(event): |
405 | 422 |
|
406 | 423 |
|
407 | 424 | ## PARAMS |
408 | | -params = [{'name': 'min_cnn_thr', 'type': 'float', 'value': 0.99, 'limits': (0, 1),'step':0.01}, |
409 | | - {'name': 'cnn_lowest', 'type': 'float', 'value': 0.1, 'limits': (0, 1),'step':0.01}, |
410 | | - {'name': 'rval_thr', 'type': 'float', 'value': 0.85, 'limits': (-1, 1),'step':0.01}, |
411 | | - {'name': 'rval_lowest', 'type': 'float', 'value': -1, 'limits': (-1, 1),'step':0.01}, |
412 | | - {'name': 'min_SNR', 'type': 'float', 'value': 2, 'limits': (0, 20),'step':0.1}, |
413 | | - {'name': 'SNR_lowest', 'type': 'float', 'value': 0, 'limits': (0, 20),'step':0.1}, |
414 | | - {'name': 'RESET', 'type': 'action'}, |
| 425 | +params = [{'name': 'min_cnn_thr', 'type': 'float', 'value': 0.99, 'limits': (0, 1), 'step':0.01}, |
| 426 | + {'name': 'cnn_lowest', 'type': 'float', 'value': 0.1, 'limits': (0, 1), 'step':0.01}, |
| 427 | + {'name': 'rval_thr', 'type': 'float', 'value': 0.85, 'limits': (-1, 1), 'step':0.01}, |
| 428 | + {'name': 'rval_lowest', 'type': 'float', 'value': -1, 'limits': (-1, 1), 'step':0.01}, |
| 429 | + {'name': 'min_SNR', 'type': 'float', 'value': 2, 'limits': (0, 20), 'step':0.1}, |
| 430 | + {'name': 'SNR_lowest', 'type': 'float', 'value': 0, 'limits': (0, 20), 'step':0.1}, |
| 431 | + {'name': 'RESET', 'type': 'action'}, |
415 | 432 | {'name': 'SHOW BACKGROUND', 'type': 'action'}, |
416 | | - {'name': 'SHOW NEURONS', 'type': 'action'} |
| 433 | + {'name': 'SHOW NEURONS', 'type': 'action'} |
417 | 434 | ] |
418 | 435 |
|
419 | 436 | ## Create tree of Parameter objects |
420 | 437 | pars = Parameter.create(name='params', type='group', children=params) |
421 | 438 |
|
422 | 439 |
|
423 | 440 | params_action = [{'name': 'Filter components', 'type': 'bool', 'value': True, 'tip': "Filter components"}, |
424 | | - {'name': 'View components', 'type': 'list', 'values': ['All','Accepted', |
| 441 | + {'name': 'View components', 'type': 'list', 'limits': ['All','Accepted', |
425 | 442 | 'Rejected', 'Unassigned'], 'value': 'All'}, |
426 | 443 | {'name': 'ADD GROUP', 'type': 'action'}, |
427 | 444 | {'name': 'REMOVE GROUP', 'type': 'action'}, |
|
0 commit comments