cortex-lab / Suite2P

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

Optimization for detection of subcellular structures such as dendrites and axons #78

Open ghost opened 7 years ago

ghost commented 7 years ago

I'm currently using Suite2P to segment GCaMP6-labeled axons and dendrites that exist in imaging planes that are devoid of somata. Suite2P does a decent job at finding ROIs on GCaMP6-labeled subcellular structures and excluding noise, however it tends to select small circular regions of high activity along a process (such as axonal boutons), rather than selecting the entire co-active process (the entire axon). Since the parameter space for optimization of the segmentation might be large, can you recommend parameters that would bias the segmentation to select ROIs that aren't necessarily circular, are small (few pixels), and which occur continuously along a process that spans the majority of the frame? Thanks in advance.

bill-connelly commented 7 years ago

I'd just like to second Ryan's request.

bill-connelly commented 7 years ago

Example: There is an axon running down the right of the image, and on the far left there is another short section of axon.

image

ghost commented 7 years ago

With some training of the classifier and quick manual editing of ROIs in the GUI, it isn't too difficult to get valid ROIs on a subcellular structure like an axon. As I said, the output tends to be biased towards boutons, which isn't necessarily a bad thing depending on your scientific question. With my data, the following parameters seem important:

db(i).diameter - important to set this to be the expected diameter (in pixels I believe) of the structure. ops0.sig - For me, having this greater than one produced very poor ROI output ops0.nSVDforROI - This is hard to estimate for subcellular structures, but if you can estimate the number of active, round regions you are expecting, it seems to improve the ROI selection.

Similar to what Marius mentioned in a separate github issue about this, the answer seems to be merging the ROIs that have a similar activity pattern and that are within a certain spacial distance from each other. I am working on an approach to run pairwise cross-correlations between the ROI traces and then merge them if they are within a set distance of each other and correlated enough above a user-defined threshold. I am doing this in Python since Matlab isn't my strength, but it would be great if there was a feature in Suite2P to perform this.

axonrois