Skip to content

suite2p registration

Compute Credits

This tool uses 2.0 compute credits per hour.

Overview

This suite2p registration tool is a wrapper for the suite2p function registration.registration_wrapper().
You can find more information on this processing step in the suite2p docs.

suite2p registration aligns each frame to a reference frame via phase correlation, in a rigid and optionally non-rigid way, to correct for motion artifacts.
Note that this tool constitutes the second step of Run suite2p pipeline.

Input files

Source Parameter File Type File Format
Raw Binary Movie suite2p_data bin
Parameters file config npy

Parameters

Parameter suite2p name Required? Default Description
Raw Binary Movie - True N/A Input raw suite2p binary movie [.bin]
Parameters file - True N/A Input suite2p parameters file, as outputted by the binary conversion tool [.npy]
Frames to Include frames_include False -1 [from suite2p docs] "If greater than zero, only [the first] <frames_include frames are processed. Useful for testing parameters on a subset of data." Note that suite2p will not run on less than 50 frames, and might have unpredictable behavior on less than 200 frames [int, -1 or =50]
Align By Channel align_by_chan False 1 [from suite2p docs] "Which channel to use for alignment (1-based, so 1 means 1st channel and 2 means 2nd channel). If you have a non-functional channel with something like td-Tomato expression, you may want to use this channel for alignment rather than the functional channel." [int, [1 <nchannels]]
Number of Frames for Initialization nimg_init False 300 [from suite2p docs] "How many frames to use to compute reference image for registration." [int, =1]
Batch Size batch_size False 500 [from suite2p docs] "How many frames to register simultaneously in each batch. This depends on memory constraints - it will be faster to run if the batch is larger, but it will require more RAM." [int, =1]
Maximum Registration Shift maxregshift False 0.1 [from suite2p docs] "The maximum shift as a fraction of the frame size. If the frame is Ly pixels x Lx pixels, then the maximum pixel shift in pixels will be max(Ly,Lx) * ops['maxregshift']." [float, [0.01 1]]
Smooth Sigma smooth_sigma False 1.15 [from suite2p docs] "Standard deviation in pixels of the gaussian used to smooth the phase correlation between the reference image and the frame which is being registered. A value of 4 is recommended for one-photon recordings (with a 512x512 pixel FOV)." [float, =0.01]
Smooth Sigma Time smooth_sigma_time False 0 [from suite2p docs] "Standard deviation in time frames of the gaussian used to smooth the data before phase correlation is computed. Might need this to be set to 1 or 2 for low SNR data." [float, =0]
Two-Step Registration two_step_registration False False [from suite2p docs] "Whether or not to run registration twice (for low SNR data). keep_movie_raw must be True for this to work." [bool]
Subpixel subpixel False 10 [from suite2p docs] "Precision of Subpixel Registration (1/subpixel steps)." [float, =1]
Threshold for Bad Frames th_badframes False 1.0 [from suite2p docs] "Involved with setting threshold for excluding frames for cropping. Set this smaller to exclude more frames." [float, =0]
Normalize Frames norm_frames False True [from suite2p docs] "Normalize frames when detecting shifts." [bool]
Force refImg force_refImg False False [from suite2p docs] "Specifies whether to use refImg stored in ops. Make sure that ops['refImg'] has a valid file pathname." [bool]
Pad FFT pad_fft False False [from suite2p docs] "Specifies whether to pad image or not during FFT portion of registration." [bool]
1P Registration 1Preg False False [from suite2p docs] "Whether to perform high-pass spatial filtering and tapering (parameters set below), which help with 1P registration." [bool]
Spatial HP Registration spatial_hp_reg False 42 [from suite2p docs] "Window in pixels for spatial high-pass filtering before registration." [int, =1]
Pre Smooth pre_smooth False 0 [from suite2p docs] "If 0, defines stddev of Gaussian smoothing, which is applied before spatial high-pass filtering." [float]
Spatial Taper spatial_taper False 40.0 [from suite2p docs] "How many pixels to ignore on edges - they are set to zero (important for vignetted windows, for FFT padding do not set BELOW 3*ops['smooth_sigma'])." [float, =0]
Nonrigid Registration nonrigid False True [from suite2p docs] "Whether or not to perform non-rigid registration, which splits the field of view into blocks and computes registration offsets in each block separately." [bool]
Block Size block_size False [128, 128] [from suite2p docs] "Size of blocks for non-rigid registration, in pixels. HIGHLY recommend keeping this a power of 2 and/or 3 (e.g. 128, 256, 384, etc) for efficient FFT." [list[int, int] with int 1]
SNR Threshold snr_thresh False 1.2 [from suite2p docs] "How big the phase correlation peak has to be relative to the noise in the phase correlation map for the block shift to be accepted. In low SNR recordings like one-photon, I'd recommend a larger value like 1.5, so that block shifts are only accepted if there is significant SNR in the phase correlation." [float, 0]
Maximum Registration Shift for Nonrigid maxregshiftNR False 5.0 [from suite2p docs] "Maximum shift in pixels of a block relative to the rigid shift." [float, =0]
Compute Bidirectional Phase Offset do_bidiphase False False [from suite2p docs] "Whether or not to compute bidirectional phase offset from misaligned line scanning experiment (applies to 2P recordings only). suite2p will estimate the bidirectional phase offset from ops['nimg_init'] frames if this is set to 1 (and ops['bidiphase']=0), and then apply this computed offset to all frames." [bool]
Bidirectional Phase Offset bidiphase False 0 [from suite2p docs] "Bidirectional phase offset from line scanning (set by user). If set to any value besides 0, then this offset is used and applied to all frames in the recording." [int, =0]
Bidirectional Correction bidi_corrected False False [from suite2p docs] "Specifies whether to do bidi correction." [bool]
FOV vmin Percentile - False 0 Minimum value for the colormap range, as percentile of the FOV fluorescence [float, [0 )]
FOV vmax Percentile - False 99 Maximum value for the colormap range, as percentile of the FOV fluorescence [float, ( 100]]
FOV Colormap - False plasma Colormap for plotting the FOV [str]
Show Grid on FOV - False True Whether or not to show the grid on FOVs [bool]
FOV Ticks Step - False 128 Step for the x- and y-ticks [int, >0]
Movie Display Rate - False 10 Display rate for the preview movies, in Hz [float, >=0.1]

Output files

File name File type Notes
data.bin suite2p binary movie This registered binary is an instance of the suite2p BinaryRWFile class.
ops_registration.npy NumPy file Contains a dictionary of parameters populated by suite2p registration.

You can explore 2 preview figures and 1 preview movie for data.bin.
You can find below an example of these previews obtained from processing a 5-minute 2P movie of mouse cortex (data courtesy of Dr. Ahmet Arac, MD, at UCLA):

Projection images from the registration process.
x and y offsets for both rigid and non-rigid registration.
Side-by-side raw and registered movies.