-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
86 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
CellReg_directory=fileparts(which('CellReg_setup.m')); | ||
addpath(genpath(fullfile(CellReg_directory,'CellReg'))); | ||
addpath(genpath(fullfile(CellReg_directory,'GUI'))); | ||
addpath(genpath(fullfile(CellReg_directory,'Helper'))); | ||
savepath(); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
%% Converting the outputs from CNMF-e or Suite2p to the required input format for CellReg | ||
|
||
input_format='Suite2p'; % could be either 'CNMF-e' or 'Suite2p' | ||
|
||
%% Choosing the files for conversion: | ||
[file_names,files_path]=uigetfile('*.mat','MultiSelect','on',... | ||
'Choose the spatial footprints from all the sessions: ' ); | ||
|
||
if iscell(file_names) | ||
number_of_sessions=size(file_names,2); | ||
else | ||
number_of_sessions=1; | ||
end | ||
for n=1:number_of_sessions | ||
if iscell(file_names) | ||
this_session_data=load([files_path file_names{n}]); | ||
else | ||
this_session_data=load([files_path file_names]); | ||
end | ||
if strcmp(input_format,'Suite2p') | ||
this_session_x_size=this_session_data.ops.Lx+1; | ||
this_session_y_size=this_session_data.ops.Ly+1; | ||
this_session_num_cells=size(this_session_data.stat,2); | ||
this_session_converted_footprints=zeros(this_session_num_cells,this_session_y_size,this_session_x_size); | ||
for k=1:this_session_num_cells | ||
for l=1:length(this_session_data.stat{k}.ypix) | ||
this_session_converted_footprints(k,this_session_data.stat{k}.ypix(l)+1,this_session_data.stat{k}.xpix(l)+1)=this_session_data.stat{k}.lam(l); | ||
end | ||
end | ||
|
||
elseif strcmp(input_format','CNMF-e') | ||
this_session_y_size=this_session_data.neuron.options.d1; | ||
this_session_x_size=this_session_data.neuron.options.d2; | ||
this_session_num_cells=size(this_session_data.neuron.A,2); | ||
this_session_converted_footprints=zeros(this_session_num_cells,this_session_y_size,this_session_x_size); | ||
for k=1:this_session_num_cells | ||
this_session_converted_footprints(k,:,:)=reshape(this_session_data.neuron.A(:,k),this_session_y_size,this_session_x_size); | ||
end | ||
end | ||
if iscell(file_names) | ||
save([files_path 'converted_' file_names{n}],'this_session_converted_footprints','-v7.3') | ||
else | ||
save([files_path 'converted_' file_names],'this_session_converted_footprints','-v7.3') | ||
end | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
%% Converting the Inscopix .tif cell spatial footprints to input format for CellReg | ||
|
||
[files_path]=uigetdir('Choose the location of the footprints from one session: ' ); | ||
file_names = dir(fullfile(files_path, '**', '*_CNMFe_CellSet_C*')); | ||
% | ||
this_session_num_cells = length(file_names); | ||
|
||
% get size of footprints first | ||
fname = file_names(1); | ||
fname = fullfile(fname.folder, fname.name); | ||
footprint = read(Tiff(fname,'r')); | ||
[~,folder_name] = fileparts(files_path); | ||
% | ||
this_session_converted_footprints=zeros(this_session_num_cells,size(footprint, 1), size(footprint, 2)); | ||
|
||
% | ||
for n=1:this_session_num_cells | ||
|
||
fname = file_names(n); | ||
fname = fullfile(fname.folder, fname.name); | ||
|
||
% | ||
footprint = read(Tiff(fname,'r')); | ||
this_session_converted_footprints(n,:,:)= footprint; | ||
|
||
end | ||
fname_out = fullfile(file_names(1).folder, [folder_name, '_converted.mat']); | ||
save(fname_out,'this_session_converted_footprints','-v7.3') | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,3 +47,5 @@ | |
|
||
|
||
end | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,12 +5,12 @@ in Ca2+ imaging data. The package includes a GUI that supports the entire regist | |
For more information contact [email protected] or join our [slack channel](https://cellreg.slack.com). | ||
|
||
## Setting up the repository | ||
We encourage the use of official versions (e.g., v1.4.5) for easier debugging processes. Switch to the releases tab on GitHub and checkout the latest version. | ||
We encourage the use of official versions (e.g., v1.4.9) for easier debugging processes. Switch to the releases tab on GitHub and checkout the latest version. | ||
|
||
1. Cloning: | ||
`git clone https://github.com/zivlab/CellReg.git` | ||
2. Checkout version: | ||
`git checkout v<major>.<minor>.<bugfix> (e.g., v1.4.5)` | ||
`git checkout v<major>.<minor>.<bugfix> (e.g., v1.4.9)` | ||
3. Run `setup.m` | ||
|
||
## Usage and documentation | ||
|