You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/inputs.rst
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -59,6 +59,8 @@ this array into a numpy array called ``bad_frames.npy``:
59
59
Put this file into the first folder in your ops['data_path'] (the first
60
60
folder you choose in the GUI).
61
61
62
+
.. _inputs-diff-file-types:
63
+
62
64
Different file types
63
65
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
64
66
@@ -173,7 +175,7 @@ Elements of these ``BinaryRWFile`` instances can be accessed similar to how one
173
175
f_input.shape # returns shape of your input (num_frames, Ly, Lx)
174
176
f_input[0] # returns the first frame with shape (Ly, Lx)
175
177
176
-
Also, ``BinaryRWFile`` instances can be directly passed to the several wrapper functions ``suite2p`` offers (e.g., ``suite2p.detection_wrapper``, ``suite2p.extraction_wrapper``, etc.). If you'd like to run only specific modules, you will have to use the ``BinaryRWFile`` class. For example, this is how you can run the detection module on an input file that has already been registered.
178
+
Also, ``BinaryRWFile`` instances can be directly passed to the several wrapper functions ``suite2p`` offers (e.g., ``suite2p.detection_wrapper``, ``suite2p.extraction_wrapper``, etc.). These wrapper functions can also directly work with Numpy arrays so feel free to pass them as inputs. If you'd like to run only specific modules, you will have to use the ``BinaryRWFile`` class. For example, this is how you can run the detection module on an input file that has already been registered.
Here is a summary of all the parameters that the pipeline takes, and its
5
-
default value.
4
+
Suite2p can be run with different configurations using the ``ops`` dictionary. The ``ops`` dictionary will describe the settings used for a particular run of the pipeline. Here is a summary of all the parameters that the pipeline takes and their default values.
6
5
7
6
Main settings
8
7
~~~~~~~~~~~~~
@@ -27,6 +26,8 @@ These are the essential settings that are dataset-specific.
27
26
- 1.0 for GCaMP6m
28
27
- 1.25-1.5 for GCaMP6s
29
28
29
+
- **force_sktiff**: (*boolean, default: False*) specifies whether or not to use scikit-image for reading in tiffs
30
+
30
31
- **fs**: (*float, default: 10.0*) Sampling rate (per plane). For
31
32
instance, if you have a 10 plane recording acquired at 30Hz, then the
32
33
sampling rate per plane is 3Hz, so set ops['fs'] = 3.
@@ -42,16 +43,60 @@ These are the essential settings that are dataset-specific.
42
43
line scanning (set by user). If set to any value besides 0, then this
43
44
offset is used and applied to all frames in the recording.
44
45
46
+
- **bidi_corrected**: (*bool, default: False*) Specifies whether to do bidi correction.
47
+
45
48
- **frames_include**: (*int, default: -1*) if greater than zero, only *frames_include* frames are processed. useful for testing parameters on a subset of data.
46
49
50
+
- **multiplane_parallel**: (*boolean, default: False*) specifies whether or not to run pipeline on server
51
+
52
+
- **ignore_flyback**: (*list[ints], default: empty list*) specifies which planes will be ignored as flyback planes by the pipeline.
53
+
54
+
File input/output settings
55
+
~~~~~~~~~~~~~~~~~~~~~~~~~~
56
+
57
+
Suite2p can accomodate many different file formats. Refer to this
58
+
:ref:`page <inputs-diff-file-types>` for a detailed list of formats suite2p can work with.
59
+
60
+
- **fast_disk**: (*list[str], default: empty list*) specifies location where temporary binary file will be stored. Defaults to ``save_path0`` if no directory is provided by user.
61
+
62
+
- **delete_bin** (*bool, default:False*) specifies whether to delete binary file created during registration stage.
63
+
64
+
- **mesoscan** (*bool, default: False*) specifies whether file being read in is a scanimage mesoscope recording
65
+
66
+
- **bruker** (*bool, default: False*) specifies whether provided tif files are single page BRUKER tiffs
67
+
68
+
- **bruker_bidirectional** (*bool, default: False*) specifies whether BRUKER files are bidirectional multiplane recordings. The ``True`` setting corresponds to the following plane order (first plane is indexed as zero): [0,1,2,2,1,0]. ``False`` corresponds to [0,1,2,0,1,2].
69
+
70
+
- **h5py** (*list[str], default: empty list*) specifies path to h5py file that will be used as inputs. Keep in mind the pathname provided here overwrites the pathname specified in ``ops[data_path]``.
71
+
72
+
- **h5py_key** (*str, default: 'data'*) key used to access data array in h5py file. Only use this when the ``h5py`` setting is set to ``True``.
73
+
74
+
- **nwb_file** (*str, default: ''*) specifies path to NWB file you use to use as input
75
+
76
+
- **nwb_driver** (*str, default: ''*) location of driver for NWB file. Leave this empty if the pathname refers to a local file.
77
+
78
+
- **nwb_series** (*str, default: ''*) Name of TwoPhotonSeries values you wish to retrieve from your NWB file.
79
+
80
+
- **save_path0** (*list[str], default: empty list*) List containing pathname of where you'd like to save your pipeline results. If list is empty, the first element of ``ops['data_path']`` is used.
81
+
82
+
- **save_folder** (*list[str], default: empty list*) List containing directory name you'd like results to be saved under. Defaults to ``"suite2p"``.
83
+
84
+
- **look_one_level_down**: (*bool, default: False*) specifies whether to look in all subfolders when searching for tiffs. Make sure to specify subfolders in the ``subfolders`` parameter below.
85
+
86
+
- **subfolders** (*list[str], default: empty list*) Specifies subfolders you'd like to look through. Make sure to have the above parameter ``ops[look_one_level_down] = True`` when using this parameter.
87
+
88
+
- **move_bin** (*bool, default: False*) If True and ``ops['fast_disk']`` is different from ``ops[save_disk]``, the created binary file is moved to ``ops['save_disk']``.
before signal extraction with probability threshold of "preclassify".
52
95
If this is set to 0.0, then all detected ROIs are kept and signals
53
96
are computed.
54
97
98
+
- **save_nwb**: (*bool, default: False*) whether to save output as NWB file
99
+
55
100
- **save_mat**: (*bool, default: False*) whether to save the results in
56
101
matlab format in file "Fall.mat". NOTE the cells you click in the GUI
57
102
will NOT change "Fall.mat". But there is a **new** button in the GUI
@@ -69,8 +114,11 @@ Output settings
69
114
a timing dictionary for each plane. Timing dictionary will contain keys
70
115
corresponding to stages and values corresponding to the duration of that stage.
71
116
72
-
Registration
73
-
~~~~~~~~~~~~
117
+
118
+
Registration settings
119
+
~~~~~~~~~~~~~~~~~~~~~
120
+
121
+
These settings are specific to the registration module of suite2p.
74
122
75
123
- **do_registration**: (*bool, default: True*) whether or not to run
76
124
registration
@@ -81,7 +129,7 @@ Registration
81
129
expression, you may want to use this channel for alignment rather
82
130
than the functional channel.
83
131
84
-
- **nimg_init**: (*int, default: 200*) how many frames to use to
132
+
- **nimg_init**: (*int, default: 300*) how many frames to use to
85
133
compute reference image for registration
86
134
87
135
- **batch_size**: (*int, default: 500*) how many frames to register
@@ -119,13 +167,24 @@ Registration
119
167
- **reg_tif_chan2**: (*bool, default: False*) whether or not to write
120
168
the registered binary of the non-functional channel to tiff files
121
169
122
-
**1P registration settings**
170
+
- **subpixel**: (*int, default:10*) Precision of Subpixel Registration (1/subpixel steps)
171
+
172
+
- **th_badframes**: (*float, default: 1.0*) Involved with setting threshold for excluding frames for cropping. Set this smaller to exclude more frames.
173
+
174
+
- **norm_frames**: (*bool, default: True*) Normalize frames when detecting shifts
175
+
176
+
- **force_refImg**: (*bool, default: False*) Specifies whether to use refImg stored in ``ops``. Make sure that ``ops['refImg']`` has a valid file pathname.
177
+
178
+
- **pad_fft**: (*bool, default: False*) Specifies whether to pad image or not during FFT portion of registration.
179
+
180
+
1P registration
181
+
^^^^^^^^^^^^^^^
123
182
124
183
- **1Preg**: (*bool, default: False*) whether to perform high-pass
125
184
spatial filtering and tapering (parameters set below), which help
126
185
with 1P registration
127
186
128
-
- **spatial_hp**: (*int, default: 42*) window in pixels for spatial
187
+
- **spatial_hp_reg**: (*int, default: 42*) window in pixels for spatial
129
188
high-pass filtering before registration
130
189
131
190
- **pre_smooth**: (*float, default: 0*) if > 0, defines stddev of
@@ -136,7 +195,8 @@ Registration
136
195
on edges - they are set to zero (important for vignetted windows, for
137
196
FFT padding do not set BELOW 3*ops['smooth_sigma'])
138
197
139
-
**Non-rigid registration**
198
+
Non-rigid registration
199
+
^^^^^^^^^^^^^^^^^^^^^^
140
200
141
201
- **nonrigid**: (*bool, default: True*) whether or not to perform
142
202
non-rigid registration, which splits the field of view into blocks
@@ -156,13 +216,13 @@ Registration
156
216
- **maxregshiftNR**: (*float, default: 5.0*) maximum shift in pixels of
157
217
a block relative to the rigid shift
158
218
159
-
ROI detection
160
-
~~~~~~~~~~~~~
219
+
ROI detection settings
220
+
~~~~~~~~~~~~~~~~~~~~~~
161
221
162
222
- **roidetect**: (*bool, default: True*) whether or not to run ROI
163
223
detect and extraction
164
224
165
-
- **sparse_mode**: (*bool, default: False*) whether or not to use sparse_mode cell detection
225
+
- **sparse_mode**: (*bool, default: True*) whether or not to use sparse_mode cell detection
166
226
167
227
- **spatial_scale**: (*int, default: 0*), what the optimal scale of the
168
228
recording is in pixels. if set to 0, then the algorithm determines it
@@ -172,12 +232,14 @@ ROI detection
172
232
- **connected**: (*bool, default: True*) whether or not to require ROIs
173
233
to be fully connected (set to *0* for dendrites/boutons)
174
234
175
-
- **threshold_scaling**: (*float, default: 5.0*) this controls the
235
+
- **threshold_scaling**: (*float, default: 1.0*) this controls the
176
236
threshold at which to detect ROIs (how much the ROIs have to stand
177
237
out from the noise to be detected). if you set this higher, then
178
238
fewer ROIs will be detected, and if you set it lower, more ROIs will
179
239
be detected.
180
240
241
+
- **spatial_hp_detect**: (*int, default: 25*) window for spatial high-pass filtering for neuropil subtracation before ROI detection takes place.
242
+
181
243
- **max_overlap**: (*float, default: 0.75*) we allow overlapping ROIs
182
244
during cell detection. After detection, ROIs with more than
183
245
ops['max_overlap'] fraction of their pixels overlapping with other
@@ -200,8 +262,33 @@ ROI detection
200
262
- **nbinned**: (*int, default: 5000*) maximum number of binned frames
201
263
to use for ROI detection.
202
264
203
-
Signal extraction
204
-
~~~~~~~~~~~~~~~~~
265
+
- **denoise**: (*bool, default: False*) Whether or not binned movie should be denoised before cell detection in sparse_mode. If True, make sure to set ``ops['sparse_mode']`` is also set to True.
266
+
267
+
Cellpose Detection
268
+
^^^^^^^^^^^^^^^^^^
269
+
These settings are only used if ``ops['anatomical_only']`` is set to an integer greater than 0.
270
+
271
+
- **anatomical_only**: (*int, default: 0*) If greater than 0, specifies what to use `Cellpose <https://cellpose.readthedocs.io/>`_ on.
272
+
273
+
- 1: Will find masks on max projection image divided by mean image.
274
+
- 2: Will find masks on mean image
275
+
- 3: Will find masks on enhanced mean image
276
+
- 4: Will find masks on maximum projection image
277
+
278
+
- **diameter**: (*int, default: 0*) Diameter that will be used for cellpose. If set to zero, diameter is estimated.
279
+
280
+
- **cellprob_threshold**: (*float, default: 0.0*) specifies threshold for cell detection that will be used by cellpose.
281
+
282
+
- **flow_threshold**: (*float, default: 1.5*) specifies flow threshold that will be used for cellpose.
283
+
284
+
- **spatial_hp_cp**: (*int, default: 0*) Window for spatial high-pass filtering of image to be used for cellpose.
285
+
286
+
- **pretrained_model**: (*str, default: 'cyto'*) Path to pretrained model or string for model type (can be user's model ).
287
+
288
+
Signal extraction settings
289
+
~~~~~~~~~~~~~~~~~~~~~~~~~~
290
+
291
+
- **neuropil_extract**: (*bool, default: True*) Whether or not to extract signal from neuropil. If False, Fneu is set to zero.
205
292
206
293
- **allow_overlap**: (*bool, default: False*) whether or not to extract
207
294
signals from pixels which belong to two ROIs. By default, any pixels
@@ -214,39 +301,58 @@ Signal extraction
214
301
- **inner_neuropil_radius**: (*int, default: 2*) number of pixels to
215
302
keep between ROI and neuropil donut
216
303
217
-
Spike deconvolution
218
-
~~~~~~~~~~~~~~~~~~~
304
+
- **lam_percentile**: (*int, default: 50*)Percentile of Lambda within area to ignore when excluding cell pixels for neuropil extraction
219
305
220
-
We neuropil-correct the trace Fout = F - ops['neucoeff'] \* Fneu, and
221
-
then baseline-correct these traces with an ops['baseline'] filter, and
306
+
Spike deconvolution settings
307
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
308
+
309
+
We neuropil-correct the trace ``Fout = F - ops['neucoeff'] * Fneu``, and
310
+
then baseline-correct these traces with an ``ops['baseline']`` filter, and
222
311
then detect spikes.
223
312
313
+
- **spikedetect**: (*bool, default: True*) Whether or not to run spike_deconvolution
314
+
224
315
- **neucoeff**: (*float, default: 0.7*) neuropil coefficient for all ROIs.
225
316
226
317
- **baseline**: (*string, default 'maximin'*) how to compute the
227
318
baseline of each trace. This baseline is then subtracted from each
228
319
cell. *'maximin'* computes a moving baseline by filtering the data
229
-
with a Gaussian of width ops['sig_baseline'] \* ops['fs'], and then
230
-
minimum filtering with a window of ops['win_baseline'] \* ops['fs'],
320
+
with a Gaussian of width ``ops['sig_baseline'] * ops['fs']``, and then
321
+
minimum filtering with a window of ``ops['win_baseline'] * ops['fs']``,
231
322
and then maximum filtering with the same window. *'constant'*
232
323
computes a constant baseline by filtering with a Gaussian of width
233
-
ops['sig_baseline'] \* ops['fs'] and then taking the minimum value of
324
+
``ops['sig_baseline'] * ops['fs']`` and then taking the minimum value of
234
325
this filtered trace. *'constant_percentile'* computes a constant
235
-
baseline by taking the ops['prctile_baseline'] percentile of the
326
+
baseline by taking the ``ops['prctile_baseline']`` percentile of the
236
327
trace.
237
328
238
329
- **win_baseline**: (*float, default: 60.0*) window for maximin filter
239
330
in seconds
240
331
241
332
- **sig_baseline**: (*float, default: 10.0*) Gaussian filter width in
242
333
seconds, used before maximin filtering or taking the minimum value of
243
-
the trace, ops['baseline'] = 'maximin' or 'constant'.
334
+
the trace, ``ops['baseline'] = 'maximin'`` or ``'constant'``.
244
335
245
336
- **prctile_baseline**: (*float, optional, default: 8*) percentile of
246
-
trace to use as baseline if ops['baseline'] = 'constant_percentile'.
337
+
trace to use as baseline if ``ops['baseline'] = 'constant_percentile'``.
338
+
339
+
Classification settings
340
+
~~~~~~~~~~~~~~~~~~~~~~~
247
341
248
-
Channel 2 settings
249
-
~~~~~~~~~~~~~~~~~~
342
+
- **soma_crop**: (*bool, default: True*) Specifies whether to crop dendrites for cell classification stats (e.g., compactness)
343
+
344
+
- **use_builtin_classifier**: (*bool, default: False*) Specifies whether or not to use built-in classifier for cell detection. This will override classifier specified in ``ops['classifier_path']`` if set to True.
345
+
346
+
- **classifier_path**: (*str, default: ''*) Path to classifier file you want to use for cell classification
347
+
348
+
Channel 2 specific settings
349
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~
250
350
251
351
- **chan2_thres**: threshold for calling an ROI "detected" on a second
252
352
channel
353
+
354
+
355
+
Miscellaneous settings
356
+
~~~~~~~~~~~~~~~~~~~~~~
357
+
358
+
- **suite2p_version**: specifies version of suite2p pipeline that was run with these settings. Changing this parameter will NOT change the version of suite2p used.
0 commit comments