cortex-lab / Suite2P

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

Variable to store identified cell clusters #96

Closed ananthamurthy closed 6 years ago

ananthamurthy commented 6 years ago

I wanted to see how well the detection algorithm was doing with different diameters(db(i).diameter). For this, I wished to plot the mean registered image (ops.mimg) and the the identified cell clusters (output figure of sourceryAddon.m) side by side, as subplots. How could I get the various cell clusters as a variable to be plotted? Currently I seem to need to modify part of the code, viz., the function sourcery.m and drawClusters.m to do the needful.

carsen-stringer commented 6 years ago

The output of the pipeline will save stat, which will contain the pixels of each cell. Have you tried using the GUI to do this? Try running newmain and load your F..._...mat file there. You can switch between cell view and mean image view very quickly by using keyboard shortcuts (the letters on each button).

Alternatively you can populate a matrix with stat, ` img = zeros(length(ops.yrange), length(ops.xrange)); for j = 1:length(stat) img(stat(j).ipix) = 1; end

subplot(1,2,1), imagesc(img)

subplot(1,2,2), imagesc(ops.mimg1(ops.yrange, ops.xrange)) ` if you just want 1's where the ROIs are and zeros elsewhere.