flatironinstitute / NoRMCorre

Matlab routines for online non-rigid motion correction of calcium imaging data
GNU General Public License v2.0
142 stars 88 forks source link

Small bright artifacts after registration #29

Closed jtworig closed 4 years ago

jtworig commented 4 years ago

Hi, I've been using NoRMCorre to register single-plane 2-photon calcium imaging movies. Often, after performing non-rigid or rigid registration, the output movie contains one or more bright artifacts that do not correspond to any labeled cell structure. These artifacts usually consist of a bright 2x2 pixel square with more bright spots radiating out from this central spot in all 4 directions (see in lower right of attached image). I am running normcorre on 256x256 movies with 400+ frames, with the following parameters, all others being default:

options_nonrigid = NoRMCorreSetParms('d1',size(Y,1),'d2',size(Y,2),'grid_size',[64,64],'overlap_pre',[16,16],'mot_uf',4,'max_shift',[20,20],'max_dev',[8,8],'shifts_method','FFT');

I have tried changing patch and overlap size slightly, but the artifact remains. Using cubic or linear shifts reduces the intensity of the artifact, but it still remains. Any ideas of parameters to change to prevent this?

testImage

epnev commented 4 years ago

@jtworig This can be due to the Fourier interpolation so I would use cubic or linear shifts. Other than that, I would try changing the grid_size just to check whether this happens right at the background. It would help to see the original frame alongside the corrected that has artifact and also have a sense of how big the shifts are.

epnev commented 4 years ago

Can you describe how you resolved the issue? Just curious

On Wed, Mar 18, 2020 at 1:18 PM jtworig notifications@github.com wrote:

Closed #29 https://github.com/flatironinstitute/NoRMCorre/issues/29.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/flatironinstitute/NoRMCorre/issues/29#event-3142427689, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABV3HNWS4IO3HRCHJY6JXVLRID67VANCNFSM4K5DGXRQ .

jtworig commented 4 years ago

@epnev I switched to cubic shifts and tried a few different values for grid_size and overlap_pre, before settling on 'grid_size', [128,128], 'overlap_pre', [32,32]. These options nearly completely removed the artifact in the corrected movie. Thanks!