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

question on findWheelMoves3 #6

Open
yilmazduygu opened this issue Jan 26, 2023 · 4 comments
Open

question on findWheelMoves3 #6

yilmazduygu opened this issue Jan 26, 2023 · 4 comments

Comments

@yilmazduygu
Copy link

Hi,
I'm using this script to extract movements from my wheel data, first of, thanks a lot for putting it here! I wanted to get precise movement offsets so I attempted to adapt what you've done in onsets:

`offsetSamps = find(isMoving(1:end-1) & ~isMoving(2:end));

wheelToepOffsetsDev = zeros(length(offsetSamps), tThreshSamps);
c = 0; cwt = 0;
while isempty(onsetSamps)
i2proc = (1:p.batchSize) + c;
[icomm] = intersect( i2proc(1:end-1), offsetSamps );
[
, itpltz] = intersect( i2proc(1:end-1), offsetSamps );
i2proc(i2proc > length(t)) = [];
if ~isempty(icomm)
w2e = hankel(pos(i2proc), nan(1,tThreshSamps));
w2e = abs(bsxfun(@minus, w2e, w2e(:,1)));
wheelToepOnsetsDev(cwt + (1:length(icomm)), :) = w2e(itpltz, :);
cwt = cwt + length(icomm);
end
c = c + p.batchSize;
if i2proc(end) >= onsetSamps(end), break, end
end
warning('on', 'MATLAB:hankel:AntiDiagonalConflict')

hasOffset = wheelToepOffsetsDev > p.posThreshOffset;
[a, b] = find(~fliplr(hasOffset));
offsetLags = tThreshSamps+accumarray(a(:), b(:), [], @min);
offsetSamps = offsetSamps + offsetLags;
offsets = t(offsetSamps);
`

This gives me lots of 'MATLAB:hankel:AntiDiagonalConflict' warnings. As it might show, I don't know much math, so I don't know how ok it is to ignore it. I'd appreciate any help

Thanks in advance!

@nsteinme
Copy link
Contributor

Hm, I think @k1o0 would have to comment on the details here, this has been too long ago for me to remember. However I wanted to just comment that you'd have to be very careful in interpreting wheel offsets, since mice can often spin the wheel and let go, letting it spin for a while after they stopped moving their limbs. You might be better off in general looking at video of the mice if you're interested in this.

@yilmazduygu
Copy link
Author

I see, that makes sense. I will figure out an alternative confirmatory measure using the videos. But yes, if @k1o0 could comment on the details, it would help a lot.

Thank you!

@yilmazduygu
Copy link
Author

Btw is there a publication that I could cite for this?

@nsteinme
Copy link
Contributor

nsteinme commented Jan 31, 2023 via email

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

2 participants