Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modifying .npy outputs to reload into GUI #1152

Open
katereinhart opened this issue Nov 15, 2024 · 0 comments
Open

Modifying .npy outputs to reload into GUI #1152

katereinhart opened this issue Nov 15, 2024 · 0 comments

Comments

@katereinhart
Copy link

katereinhart commented Nov 15, 2024

I’m conducting longitudinal imaging of jrgeco mice and using the GUI for motion correction and cell detection, which works great—thank you! I manually add ROIs to evaluate "responding" and "nonresponding" cells over time. With many cells and multiple days of imaging, s2p has been helpful for quick visualization of cells and their correlations to 1D variables (stimulus trace).

Question 1: Are the correlations to 1D variables stored in any of the output files? Also, the 1D variable must be reloaded every time I manually add more cells, not sure if this can be fixed in future versions.
Question 2: Can ROIs or cell determinations be modified outside the GUI (e.g., in .npy files) and then reloaded? If so, which files/variables need to be edited? Possibly, "ops.stats" and "ops.iscell" (different from iscell.npy and stat.npy outputs - and not exactly sure what these -esp. ops.stats- values are).
I ask because I’d like to exclude 'non-cells' from the visual skew and 1D variable correlation maps, as they still affect calculations (see screenshot of skewness) I know skewness can be calculated in MATLAB (for me), but s2p's tools for quick visualization help me decide whether such analyses would be useful for my studies.

I have tried this level of filtering out 'not cells' from .npy files, and although i am able to reload the stat.npy file back into the GUI, some of the previously labeled 'cells' have been moved to 'not cells' - so it seems that additional variables/files need to be edited.

%Filter indices where iscell[:, 0] == 1 (cells)
cell_indices = np.where(iscell[:, 0] == 1)[0]

% Filter data arrays based on the valid cell indices
F_cells = F[cell_indices, :]
Fneu_cells = Fneu[cell_indices, :]
spks_cells = spks[cell_indices, :]
stat_cells = stat[cell_indices]

iscell_cells = iscell[cell_indices, :]

Many thanks!
Screenshot 2024-11-15 125930

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant