Skip to content

Commit 7fee1af

Browse files
chriski777carsen-stringer
authored andcommitted
Update colab 2023 to fully fix #1011 and update some comments on notebook
1 parent 6632a88 commit 7fee1af

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

jupyter/run_suite2p_colab_2023.ipynb

+11-5
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@
321321
"4. Classification of ROIs\n",
322322
"5. Spike Deconvolution\n",
323323
"\n",
324-
"To run `registration`, `detection`, and `extraction` separately, we must first talk about a special class in `suite2p` called a `BinaryRWFile`. You can think of `BinaryRWFile` as a class for reading/writing image data that acts like a numpy array. "
324+
"To run `registration`, `detection`, and `extraction` separately, we must first talk about a special class in `suite2p` called a `BinaryFile`. You can think of `BinaryFile` as a class for reading/writing image data that acts like a numpy array. "
325325
]
326326
},
327327
{
@@ -355,7 +355,7 @@
355355
"id": "0idbURhWYsDM"
356356
},
357357
"source": [
358-
"We'll run the registration module only on our example image which only contains data from a single channel. You can add in data for the second channel (e.g., `f_reg_chan2` and `f_raw_chan2`) using similar code to what we have above. Refer to the docs to see what the outputs refer to."
358+
"We'll run the registration module only on our example image which only contains data from a single channel. You can add in data for the second channel (e.g., `f_reg_chan2` and `f_raw_chan2`) using similar code to what we have above. When writing a new `BinaryFile`, please make sure to specify the number of frames your `BinaryFile` instance will have. Refer to the docs to see what the outputs refer to."
359359
]
360360
},
361361
{
@@ -382,7 +382,12 @@
382382
"source": [
383383
"### Running ROI Detection\n",
384384
"\n",
385-
"To run ROI detection alone (called by the `detection_wrapper` function in the detection module), we'll first instantiate the necessary parameters. You only need a `BinaryRWFile` corresponding to a registered/unregistered recording. Here, we'll pass the `f_reg` we obtained after running the registration module above."
385+
"To run ROI detection alone (called by the `detection_wrapper` function in the detection module), we'll first instantiate the necessary parameters. You only need a `BinaryRWFile` corresponding to a registered/unregistered recording. Here, we'll pass the `f_reg` we obtained after running the registration module above.\n",
386+
"\n",
387+
"Suite2p provides a default classification file containing a default dataset that is used to train a classifier that will be used for your data. One could specify their own classification file if they'd like. To do so, they should save a numpy file with a dict containing the following keys: \n",
388+
"- `'stats'`: ROI Stats\n",
389+
"- `'keys'`: keys of ROI stats that will be used for classification\n",
390+
"- `'iscell'`: labels specifying whether an ROI is a cell or not\n"
386391
]
387392
},
388393
{
@@ -394,7 +399,8 @@
394399
"outputs": [],
395400
"source": [
396401
"# Use default classification file provided by suite2p \n",
397-
"classfile = suite2p.classification.builtin_classfile"
402+
"classfile = suite2p.classification.builtin_classfile\n",
403+
"np.load(classfile, allow_pickle=True)[()]"
398404
]
399405
},
400406
{
@@ -416,7 +422,7 @@
416422
},
417423
"source": [
418424
"### Running Fluorescence Extraction\n",
419-
"To run extraction alone (called by the `extraction_wrapper` function in the extraction module), we can just make use of any `stat` dictionary (from previous runs of suite2p or a custom user-made one). In this case, we'll use the one output by the cell above. If you'd like to extract signal, you can pass a `binaryRWFile` corresponding to the recording for the second channel to the `f_reg_chan2` parameter."
425+
"To run extraction alone (called by the `extraction_wrapper` function in the extraction module), we can just make use of any `stat` dictionary (from previous runs of suite2p or a custom user-made one). In this case, we'll use the one output by the cell above. If you'd like to extract signal, you can pass a `binaryFile` corresponding to the recording for the second channel to the `f_reg_chan2` parameter."
420426
]
421427
},
422428
{

0 commit comments

Comments
 (0)