Skip to content

Update at_colocalization_neighbors.m#19

Open
emmagao29 wants to merge 2 commits intoVH-Lab:masterfrom
emmagao29:patch-1
Open

Update at_colocalization_neighbors.m#19
emmagao29 wants to merge 2 commits intoVH-Lab:masterfrom
emmagao29:patch-1

Conversation

@emmagao29
Copy link
Copy Markdown
Collaborator

Is this the way to do it?

@stevevanhooser
Copy link
Copy Markdown
Contributor

Hi -

So, you don't need to update the overlapthreshold field with a new threshold for this one. The task that at_colocalization_rethreshold performs requires it to re-do the threshold. And the code is held-over, you should delete this bit:

colocalization_data.parameters.threshold = parameters.threshold;
colocalization_data.overlap_thresh = colocalization_data.overlap_ab >= parameters.threshold;

(parameters for this function will have a single field, 'number_neighbors', it has no field 'threshold')

But you just want to remove colocalizations that have fewer than N neighbors. Suppose you find all such ROIs and the indexes are in a vector called I.

Then you'll set those entries (i,:) to 0 in the overlapthresh field

for i=1:numel(I),
colocalization_data.overlap_thresh(I(i),:)) = 0;
end

you'll need to use the same code you used to find the number of neighbors before this, so find the list I

Make sense?

@emmagao29
Copy link
Copy Markdown
Collaborator Author

Yes!
Thank you so much! I will try my best with it!

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

Successfully merging this pull request may close these issues.

2 participants