Skip to content

Commit

Permalink
Update colab 2023 to fully fix #1011 and update some comments on note…
Browse files Browse the repository at this point in the history
…book
  • Loading branch information
chriski777 authored and carsen-stringer committed Aug 5, 2023
1 parent 6632a88 commit 7fee1af
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions jupyter/run_suite2p_colab_2023.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@
"4. Classification of ROIs\n",
"5. Spike Deconvolution\n",
"\n",
"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. "
"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. "
]
},
{
Expand Down Expand Up @@ -355,7 +355,7 @@
"id": "0idbURhWYsDM"
},
"source": [
"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."
"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."
]
},
{
Expand All @@ -382,7 +382,12 @@
"source": [
"### Running ROI Detection\n",
"\n",
"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."
"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",
"\n",
"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",
"- `'stats'`: ROI Stats\n",
"- `'keys'`: keys of ROI stats that will be used for classification\n",
"- `'iscell'`: labels specifying whether an ROI is a cell or not\n"
]
},
{
Expand All @@ -394,7 +399,8 @@
"outputs": [],
"source": [
"# Use default classification file provided by suite2p \n",
"classfile = suite2p.classification.builtin_classfile"
"classfile = suite2p.classification.builtin_classfile\n",
"np.load(classfile, allow_pickle=True)[()]"
]
},
{
Expand All @@ -416,7 +422,7 @@
},
"source": [
"### Running Fluorescence Extraction\n",
"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."
"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."
]
},
{
Expand Down

0 comments on commit 7fee1af

Please sign in to comment.