cortex-lab / Suite2P

Tools for processing 2P recordings
Other
121 stars 66 forks source link

view motion corrected recordings #99

Closed johannasigl closed 6 years ago

johannasigl commented 6 years ago

Thanks for the great pipeline! I am still figuring things out though. Is there a way to view the registered/motion corrected movies? Thanks!

marius10p commented 6 years ago

Sure, just give it a path in master_file. By default, it's empty so it won't save registered tiffs:

ops0.RegFileTiffLocation = []; %'D:/DATA/'; % leave empty to NOT save registered tiffs (slow)

carsen-stringer commented 6 years ago

Alternatively, you can view the registered binaries in matlab (those will be output to the folder specified in ops0.RegFileRoot). Make sure you set ops0.DeleteBin = 0 (otherwise the binary files are deleted after signal extraction)

In order to view them, load your regops file (saved from the registration into the ops0.ResultsSavePath/mouse_name/date/expts/ folder). Then choose which plane to process and this will contain the path to the registered binary file. Then you can read the binary file in using fread.

I've added a file to the github to do this in the main folder "view_registered_binaries.m." Try this out and let me know if you run into any issues with it.

johannasigl commented 6 years ago

Thanks so much, what a stupid question..

Also, is there a way to overlay the ROI map with the mean image in the roi gui? Cheers!

carsen-stringer commented 6 years ago

One option is to show a view which outlines the ROIs on the mean image. We haven't really found a good way to view an overlay onto the mean image. Is this sufficient for your application?

cells_overlap

ghost commented 6 years ago

Is there an option to save the motion corrected red channel as well as the green channel? Currently if I provide a list of TIFF files saved from a ScanImage acquisition in which the frames for each channel are interleaved (green, red, green,etc), only the results for green channel registration (motion correction) are saved. Ideally I would like to have both channels saved for post-hoc analysis.

carsen-stringer commented 6 years ago

You can save a registered red binary file using the option ops.REDbinary=1. I've now set it so that if you set ops.REDbinary=1 and provide a file location for ops.RegFileTiffLocation, then both green and red registered tiffs will be saved. The red tiffs will be appended with _RED. I've updated the README with these options, let me know if it works for you.

carlyrosewilling commented 6 years ago

Hi, I am looking to plot the ROI ellipses onto the mean image, similar to above. Is there a way to save the mean image during registration so that I can plot the ROIs over afterwards? Thank you in advance!

carsen-stringer commented 6 years ago

The mean image is saved during registration, sorry this is not documented. There is an ops structure that saves in each F_*.mat file that contains the output of the registration. ops.mimg1 is the mean image across the whole recording. ops.mimg is the target image computed at the beginning of registration to which all the frames are aligned.

I've added the function that made the plot above to the github, it's in the gui2P folder and it's mimgandcells.m.

YGUO29 commented 6 years ago

Hi, I had a tiff file with 2000+ frames, but the registered file only has 2000 frames... Is there a parameter I should change? I already set ops0.DeleteBin = 0 Thank you!