-
Notifications
You must be signed in to change notification settings - Fork 30
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
Regions of Interest Feature #327
Comments
Hi,
The Regions of Interest (ROI) is a limited functionality feature and that's
why it isn't documented. Currently, if you specify a single ROI for CTrax,
JCTrax or Two-Fly Tracker and JAABA will compute additional features:
Distance to ROI and angle between animal's head direction and the line
joining the center of the animal and the ROI. This can definitely be useful
for behaviors like investigating where JAABA can potentially learn to
predict investigating whenever the animal's distance is smaller than a
threshold.
What tracker are you currently using? MoTR? It should be relatively easy to
add single ROI features for MoTR trackers if that would be helpful.
Mayank
…On Tue, Nov 12, 2019 at 1:40 PM 2909ft ***@***.***> wrote:
Hello everybody! I have a minor question: there is a feature on the
PrepareJAABAData interface which I am not entirely sure what it is used for
(see attached image). Would it be possible to use this "regions of
interest" feature to limit a specific behavior to happen only inside a
certain ROI? (e.g.: every time the mouse is inside the ROI, the assigned
behavior is always "Investigating"). If not, what is this feature used for?
I couldn't find any information about it on the JAABA website.
[image: image]
<https://urldefense.com/v3/__https://user-images.githubusercontent.com/57539512/68653504-2ffc8680-052c-11ea-9676-804497daf93e.png__;!oCotSwSxbw8!XH6kb44g-qAVoZZpx0p0hfiJreJxP0CQurM9VZmrHOZoz5PVx90FADW_iHC2BDItq94$>
Thank you for your time!
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<https://urldefense.com/v3/__https://github.com/kristinbranson/JAABA/issues/327?email_source=notifications&email_token=AAJNKY6CMUOCBAFZ2UAFHADQTJQG5A5CNFSM4JL7YGLKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HYTZ62A__;!oCotSwSxbw8!XH6kb44g-qAVoZZpx0p0hfiJreJxP0CQurM9VZmrHOZoz5PVx90FADW_iHC2AJRqxGs$>,
or unsubscribe
<https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AAJNKY2KV6U2KV2YMVIVVMLQTJQG5ANCNFSM4JL7YGLA__;!oCotSwSxbw8!XH6kb44g-qAVoZZpx0p0hfiJreJxP0CQurM9VZmrHOZoz5PVx90FADW_iHC2ohXz3LA$>
.
|
Thank you for the reply! |
I'll have to check and get back to you about it. It was added a long time
back and I didn't write that part.
Mayank
…On Tue, Nov 19, 2019 at 2:34 PM 2909ft ***@***.***> wrote:
Thank you for the reply!
Yes, I am currently using MoTR. Altough I am thinking of switching to APT
at some point.
"This can definitely be useful for behaviors like investigating where
JAABA can potentially learn to predict investigating whenever the animal's
distance is smaller than a threshold." Yes, this is exactly what I wanted
to do.
Does JAABA take my selected ROI into account automatically or do I need to
do anything else after I am done with PrepareJAABAData?
Kind regards,
Filipa
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<https://urldefense.com/v3/__https://github.com/kristinbranson/JAABA/issues/327?email_source=notifications&email_token=AAJNKY7IA37DRMWJ5TV7BJTQUOTYPA5CNFSM4JL7YGLKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEENMQ5I*issuecomment-555403381__;Iw!oCotSwSxbw8!XtsAiGjyj1BsazcoE27a-Gme7Ak9DozGNhRbBD6XTigux1IPnVJuHgCOzbdhK1hOk-U$>,
or unsubscribe
<https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AAJNKY4OPJLUMICSYGI7TSTQUOTYPANCNFSM4JL7YGLA__;!oCotSwSxbw8!XtsAiGjyj1BsazcoE27a-Gme7Ak9DozGNhRbBD6XTigux1IPnVJuHgCOzbdhoFm8WHw$>
.
|
Awesome, thank you so much! |
Hi Felipa,
I've added the option to add ROIs for MoTR. To use these, when you create a
new project in JAABA, select "flies_withrois" or "mice_withrois". The
difference is that in flies_withrois, it computes arena-based perframe
features, so you'll have to specify the arena parameters in
PrepapreJAABAData. mice_withrois doesn't compute the arena perframe
features.
I couldn't test it because I don't have a MoTR mat file to work with. Can
you try it out? If it fails, can you send me an example MoTR mat file so
that I can debug it?
On Tue, Nov 19, 2019 at 2:44 PM Mayank Kabra <[email protected]>
wrote:
… I'll have to check and get back to you about it. It was added a long time
back and I didn't write that part.
Mayank
On Tue, Nov 19, 2019 at 2:34 PM 2909ft ***@***.***> wrote:
> Thank you for the reply!
> Yes, I am currently using MoTR. Altough I am thinking of switching to APT
> at some point.
> "This can definitely be useful for behaviors like investigating where
> JAABA can potentially learn to predict investigating whenever the animal's
> distance is smaller than a threshold." Yes, this is exactly what I wanted
> to do.
> Does JAABA take my selected ROI into account automatically or do I need
> to do anything else after I am done with PrepareJAABAData?
> Kind regards,
> Filipa
>
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub
> <https://urldefense.com/v3/__https://github.com/kristinbranson/JAABA/issues/327?email_source=notifications&email_token=AAJNKY7IA37DRMWJ5TV7BJTQUOTYPA5CNFSM4JL7YGLKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEENMQ5I*issuecomment-555403381__;Iw!oCotSwSxbw8!XtsAiGjyj1BsazcoE27a-Gme7Ak9DozGNhRbBD6XTigux1IPnVJuHgCOzbdhK1hOk-U$>,
> or unsubscribe
> <https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AAJNKY4OPJLUMICSYGI7TSTQUOTYPANCNFSM4JL7YGLA__;!oCotSwSxbw8!XtsAiGjyj1BsazcoE27a-Gme7Ak9DozGNhRbBD6XTigux1IPnVJuHgCOzbdhoFm8WHw$>
> .
>
|
Thank you so much!! Apologies for the late reply, I will be trying it out this week Kind regards, |
I finally sat down on my desk and tested it :) Apologies for the delay! Whenever JAABA is regenerating the missing files for the experiment directories, this error message pops up (see attached, it says "Error adding expdir C:\users\torrao\Desktop\JAABA-master\perframe\Exp20191204T115052: MATLAB:badsubscript: Index exceeds the number of array elements"). Is this a bug or am I doing something wrong? I will also attach a MoTR mat file so that you can try it out (on a zip file because github doesn't let me attach a mat file). Let me know if you require more information, and thank you so much once again! |
I downloaded JAABA from here around 2 hours ago and that's the version I used. Did you add the missing file after that? |
Just about then I think :).
…On Wed, Dec 4, 2019 at 5:13 PM 2909ft ***@***.***> wrote:
I downloaded JAABA from here around 2 hours ago and that's the version I
used. Did you add the missing file after that?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<https://urldefense.com/v3/__https://github.com/kristinbranson/JAABA/issues/327?email_source=notifications&email_token=AAJNKY2EC5N2F4VLRKBIS3DQW6JU5A5CNFSM4JL7YGLKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEF4XL7Y*issuecomment-561608191__;Iw!oCotSwSxbw8!S0AdYD7FgExH8fhUOTSP_otLjPq9Def7YU4Rzrj1O8bC2w1ajM4rPEQ8i7SxPhbHEmQ$>,
or unsubscribe
<https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AAJNKY4VYHJK2GLASPKEIYLQW6JU5ANCNFSM4JL7YGLA__;!oCotSwSxbw8!S0AdYD7FgExH8fhUOTSP_otLjPq9Def7YU4Rzrj1O8bC2w1ajM4rPEQ8i7SxXNYrMhk$>
.
|
Alright, I will try it again then :) |
Unfortunately it still gives me the same error message :( |
Sorry about that. I'll take a look.
…On Wed, Dec 4, 2019 at 6:24 PM 2909ft ***@***.***> wrote:
Unfortunately it still gives me the same error message :(
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<https://urldefense.com/v3/__https://github.com/kristinbranson/JAABA/issues/327?email_source=notifications&email_token=AAJNKY5OQNELWSKWU2J7AJLQW6R7NA5CNFSM4JL7YGLKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEF442ZQ*issuecomment-561630566__;Iw!oCotSwSxbw8!UXPyvCiRsGxY5tCl9EuFb5wNl5-OVTWY5k93V0_qvFXPBpMsNBvHYQZ4CCzZb0Ko8A0$>,
or unsubscribe
<https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AAJNKY2JMURFI6QEPEKKFMLQW6R7NANCNFSM4JL7YGLA__;!oCotSwSxbw8!UXPyvCiRsGxY5tCl9EuFb5wNl5-OVTWY5k93V0_qvFXPBpMsNBvHYQZ4CCzZljm8NjQ$>
.
|
Thank you very much! :)
Error in StartJAABA (line 38) |
My commit message got typed into the code. Sorry. Fixed that.
Mayank
…On Thu, Dec 5, 2019 at 5:39 PM 2909ft ***@***.***> wrote:
Thank you very much! :)
Now there seems to be another problem whenever I try to launch JAABA using
StartJAABA. This error message appears:
StartJAABA
Number of threads allocated for computation: 2
Number of threads allocated for display: 2
Error: File: JLabel.m Line: 1293 Column: 41
Invalid expression. When calling a function or indexing a variable, use
parentheses. Otherwise, check for mismatched delimiters.
Error in StartJAABA (line 38)
JLabel('nthreads',nthreads);
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<https://urldefense.com/v3/__https://github.com/kristinbranson/JAABA/issues/327?email_source=notifications&email_token=AAJNKY6K6TOC4GX6KU5TVDDQXDVNHA5CNFSM4JL7YGLKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEGAQCHQ*issuecomment-562102558__;Iw!oCotSwSxbw8!RYDxDQd3mlGCYGi0G9UPlqtABctiTWPwxAepU9kkESuPtlVcL5PDRbCBkcVXwa6BYzQ$>,
or unsubscribe
<https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AAJNKY7JPWGWAXIVV7BTJGLQXDVNHANCNFSM4JL7YGLA__;!oCotSwSxbw8!RYDxDQd3mlGCYGi0G9UPlqtABctiTWPwxAepU9kkESuPtlVcL5PDRbCBkcVXe6rcBnQ$>
.
|
Thank you Mayank! It's working perfectly now :)
Do you know how to fix it? |
Seems Matlab changed the way it handles loops. I've tried to fix it. Can
you test it?
Mayank
…On Thu, Dec 5, 2019 at 11:20 PM 2909ft ***@***.***> wrote:
Thank you Mayank! It's working perfectly now :)
I believe JAABAPlot might also have a bug? I get this error message
whenever I try to launch it
JAABAPlot
Error: File: JAABAPlot.m Line: 3709 Column: 22
Assigning to the for-loop variable 'i' is not supported in parfor-loops.
For more information, see Parallel for Loops in MATLAB,
"Nested for-Loops: Requirements and Limitations".
Do you know how to fix it?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<https://urldefense.com/v3/__https://github.com/kristinbranson/JAABA/issues/327?email_source=notifications&email_token=AAJNKYYVWEPS5EH6FULVIKLQXE5PJA5CNFSM4JL7YGLKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEGBRONY*issuecomment-562239287__;Iw!oCotSwSxbw8!QZWfNZhMwl8yN3JWOcPqmxX3wV7MMKyF8RwMMBPp_QKlEt3ow9Fah3i57__lYC7SxQ8$>,
or unsubscribe
<https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AAJNKY4BEPKKQ7KS6LFTXKLQXE5PJANCNFSM4JL7YGLA__;!oCotSwSxbw8!QZWfNZhMwl8yN3JWOcPqmxX3wV7MMKyF8RwMMBPp_QKlEt3ow9Fah3i57__lzxNKvqA$>
.
|
Thank you! Yes, it fixed the bug on that line, but there's still the same one but now on line Line: 4721 Column: 23 ahahah |
Seems to be working fine! Thank you very much :) Have a nice day! |
Hi! I'm working on scoring exploratory behavior in mice towards two distinct objects. Thanks a lot! Cheers, |
Hi Candela,
The scores file stores only the predictions. The ROI details should be
available in the trx file.
Mayank
…On Thu, Jan 7, 2021 at 1:55 AM puessirvetelo ***@***.***> wrote:
Hi! I'm working on scoring exploratory behavior in mice towards two
distinct objects.
I've tracked the video with MoTR and, then, set the area surrounding each
object as distinct ROIs in PrepareJAABAData. The JAABA project is set as
"mice_withrois". After training and saving the JAABA project, I've exported
the scores of this first video but cannot seem to find the data regarding
ROIs in the scores file. Am I doing something wrong?
Thanks a lot!
Cheers,
Candela
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<https://urldefense.com/v3/__https://github.com/kristinbranson/JAABA/issues/327*issuecomment-755639759__;Iw!!Eh6p8Q!QLF-hI844J-i3z5MtREEC4ANi07633O5lZsO8tUIWp690WhtIn8hJP-nfC4WpTmFqkw$>,
or unsubscribe
<https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AAJNKY6GS4R2F7RFZQGC6ZDSYTBLTANCNFSM4JL7YGLA__;!!Eh6p8Q!QLF-hI844J-i3z5MtREEC4ANi07633O5lZsO8tUIWp690WhtIn8hJP-nfC4WDwT7KVc$>
.
|
Hi Mayank, Thanks for the quick reply! Actually, I was wondering about the predictions based on ROIs, such as frames in which the behavior is being predicted within each ROI (considering I've set two ROIs in PrepareJAABAData) or distance to ROI, angle between animal's head direction, etc. Is that retrievable data? If it is, where could I find it? Many thanks again! Candela |
Hi Candela,
You can retrieve some of the data from the per-frame files which will be
stored in "perframe" directory within each experiment's directory (
http://jaaba.sourceforge.net/DataFormatting.html#PerFrameDirectoryStructure).
The per-frame files store the per-frame features that are computed from the
input trajectories and give information about the animal's state in the
current frame. The per-frame files are mat files in which the data is
stored in the "data" field which is a cell array. Data in cell j stores the
information about j-th trajectory/animal. The length of data{j} is the same
as the length of the corresponding trajectory. The length can be short by 1
or 2 if the per-frame feature is a first derivative or a second derivative
with respect to time. To find the frames that the data corresponds to look
at the "firstframe" and "endframe" of the corresponding trajectory in the
tracks file (
http://jaaba.sourceforge.net/DataFormatting.html#TracksFileStructure).
The per-frame files of interest are:
* dist2roi2_{j}: This gives the distance of the animal to the ROI j. There
is a chance that this statistic is computed but not saved.
* mindist2roi2: This gives the distance of the animal to the closest ROI.
* dmindist2roi2: Rate of change (i.e., time derivative) of mindist2roi2. So
how fast is the animal approaching or receding from the closest ROI.
* angle2closestroi2: Direction of the closest ROIs center relative to the
animal's body. If the animal is facing the ROI then this will be 0, while
if the animal is facing in opposite direction then it'll be pi.
There could be other per-frame files with roi2 in their names. If it's
unclear what they might store based on their name, feel free to ask us.
HTH,
Mayank
…On Thu, Jan 7, 2021 at 9:32 PM puessirvetelo ***@***.***> wrote:
Hi Mayank,
Thanks for the quick reply! Actually, I was wondering about the
predictions based on ROIs, such as frames in which the behavior is being
predicted within each ROI (considering I've set two ROIs in
PrepareJAABAData) or distance to ROI, angle between animal's head
direction, etc. Is that retrievable data? If it is, where could I find it?
Many thanks again!
Candela
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<https://urldefense.com/v3/__https://github.com/kristinbranson/JAABA/issues/327*issuecomment-756207704__;Iw!!Eh6p8Q!VuoH10ADHhveYkVLSQpO938Q2Tv4pfrzHXH1EUTkiu9dG_HykRYx3cli_Hi8HZMSQCU$>,
or unsubscribe
<https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AAJNKY5C42P2I7QIR23IIUDSYXLJDANCNFSM4JL7YGLA__;!!Eh6p8Q!VuoH10ADHhveYkVLSQpO938Q2Tv4pfrzHXH1EUTkiu9dG_HykRYx3cli_Hi8egZOd8c$>
.
|
And I forgot to mention that all the per-frame features are computed from
the information that is available in the tracks file. You might be better
off computing the features directly from the tracks file in most cases. The
only thing different for your tracks file is that it'll have an extra field
"roi2" that stores the ROI information. For circular ROI with center (x,y)
and radius r, roi2 will be (x,y,r,NaN) and for rectangular arena with
center (x,y) and width w and height h roi2 will be (x,y,w,h).
Mayank
…On Fri, Jan 8, 2021 at 6:34 PM Mayank Kabra ***@***.***> wrote:
Hi Candela,
You can retrieve some of the data from the per-frame files which will be
stored in "perframe" directory within each experiment's directory (
http://jaaba.sourceforge.net/DataFormatting.html#PerFrameDirectoryStructure).
The per-frame files store the per-frame features that are computed from the
input trajectories and give information about the animal's state in the
current frame. The per-frame files are mat files in which the data is
stored in the "data" field which is a cell array. Data in cell j stores the
information about j-th trajectory/animal. The length of data{j} is the same
as the length of the corresponding trajectory. The length can be short by 1
or 2 if the per-frame feature is a first derivative or a second derivative
with respect to time. To find the frames that the data corresponds to look
at the "firstframe" and "endframe" of the corresponding trajectory in the
tracks file (
http://jaaba.sourceforge.net/DataFormatting.html#TracksFileStructure).
The per-frame files of interest are:
* dist2roi2_{j}: This gives the distance of the animal to the ROI j.
There is a chance that this statistic is computed but not saved.
* mindist2roi2: This gives the distance of the animal to the closest ROI.
* dmindist2roi2: Rate of change (i.e., time derivative) of mindist2roi2.
So how fast is the animal approaching or receding from the closest ROI.
* angle2closestroi2: Direction of the closest ROIs center relative to the
animal's body. If the animal is facing the ROI then this will be 0, while
if the animal is facing in opposite direction then it'll be pi.
There could be other per-frame files with roi2 in their names. If it's
unclear what they might store based on their name, feel free to ask us.
HTH,
Mayank
On Thu, Jan 7, 2021 at 9:32 PM puessirvetelo ***@***.***>
wrote:
> Hi Mayank,
>
> Thanks for the quick reply! Actually, I was wondering about the
> predictions based on ROIs, such as frames in which the behavior is being
> predicted within each ROI (considering I've set two ROIs in
> PrepareJAABAData) or distance to ROI, angle between animal's head
> direction, etc. Is that retrievable data? If it is, where could I find it?
>
> Many thanks again!
>
> Candela
>
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub
> <https://urldefense.com/v3/__https://github.com/kristinbranson/JAABA/issues/327*issuecomment-756207704__;Iw!!Eh6p8Q!VuoH10ADHhveYkVLSQpO938Q2Tv4pfrzHXH1EUTkiu9dG_HykRYx3cli_Hi8HZMSQCU$>,
> or unsubscribe
> <https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AAJNKY5C42P2I7QIR23IIUDSYXLJDANCNFSM4JL7YGLA__;!!Eh6p8Q!VuoH10ADHhveYkVLSQpO938Q2Tv4pfrzHXH1EUTkiu9dG_HykRYx3cli_Hi8egZOd8c$>
> .
>
|
Great! I'll look into all of that, I believe it'll be really helpful to perform this scoring. Many thanks for all the help! Candela |
Hello everybody! I have a minor question: there is a feature on the PrepareJAABAData interface which I am not entirely sure what it is used for (see attached image). Would it be possible to use this "regions of interest" feature to limit a specific behavior to happen only inside a certain ROI? (e.g.: every time the mouse is inside the ROI, the assigned behavior is always "Investigating"). If not, what is this feature used for? I couldn't find any information about it on the JAABA website.
Thank you for your time!
The text was updated successfully, but these errors were encountered: