|
321 | 321 | "4. Classification of ROIs\n",
|
322 | 322 | "5. Spike Deconvolution\n",
|
323 | 323 | "\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. " |
325 | 325 | ]
|
326 | 326 | },
|
327 | 327 | {
|
|
355 | 355 | "id": "0idbURhWYsDM"
|
356 | 356 | },
|
357 | 357 | "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." |
359 | 359 | ]
|
360 | 360 | },
|
361 | 361 | {
|
|
382 | 382 | "source": [
|
383 | 383 | "### Running ROI Detection\n",
|
384 | 384 | "\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" |
386 | 391 | ]
|
387 | 392 | },
|
388 | 393 | {
|
|
394 | 399 | "outputs": [],
|
395 | 400 | "source": [
|
396 | 401 | "# 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)[()]" |
398 | 404 | ]
|
399 | 405 | },
|
400 | 406 | {
|
|
416 | 422 | },
|
417 | 423 | "source": [
|
418 | 424 | "### 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." |
420 | 426 | ]
|
421 | 427 | },
|
422 | 428 | {
|
|
0 commit comments