Skip to content
Snippets Groups Projects
Commit d789e9af authored by Lucas Miranda's avatar Lucas Miranda
Browse files

Updated tutorials

parent 44c8abd0
No related branches found
No related tags found
No related merge requests found
Pipeline #160617 failed
Source diff could not be displayed: it is too large. Options to address this: view the blob.
%% Cell type:code id:18d4d54e tags: %% Cell type:code id:18d4d54e tags:
   
``` python ``` python
%load_ext autoreload %load_ext autoreload
%autoreload 2 %autoreload 2
``` ```
   
%% Cell type:markdown id:2780fd26 tags: %% Cell type:markdown id:2780fd26 tags:
   
# Formatting your data: feature extraction from motion tracking output # Formatting your data: feature extraction from motion tracking output
   
%% Cell type:markdown id:b059b912 tags: %% Cell type:markdown id:b059b912 tags:
   
##### What we'll cover: ##### What we'll cover:
   
* Create and run a project. * Create and run a project.
* Load a previously generated project. * Load a previously generated project.
* Interact with your project: generate coordinates, distances, angles, and areas. * Interact with your project: generate coordinates, distances, angles, and areas.
* Exploratory visualizations: heatmaps and processed animations. * Exploratory visualizations: heatmaps and processed animations.
   
%% Cell type:markdown id:7632cba8 tags: %% Cell type:markdown id:7632cba8 tags:
   
Let's start by importing some packages. We'll use python's os library to handle paths, pickle to load saved objects, and the data entry API within DeepOF, located in deepof.data Let's start by importing some packages. We'll use python's os library to handle paths, pickle to load saved objects, and the data entry API within DeepOF, located in deepof.data
   
%% Cell type:code id:4d85f5bf tags: %% Cell type:code id:4d85f5bf tags:
   
``` python ``` python
import os import os
import pickle import pickle
import deepof.data import deepof.data
``` ```
   
%% Cell type:markdown id:ffdcefa1 tags: %% Cell type:markdown id:ffdcefa1 tags:
   
We'll also need some plotting gear: We'll also need some plotting gear:
   
%% Cell type:code id:e438d39f tags: %% Cell type:code id:e438d39f tags:
   
``` python ``` python
import deepof.visuals import deepof.visuals
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
import seaborn as sns import seaborn as sns
``` ```
   
%% Cell type:markdown id:9fd9cdbb tags: %% Cell type:markdown id:9fd9cdbb tags:
   
### Creating and running a project ### Creating and running a project
   
%% Cell type:markdown id:1465ef19 tags: %% Cell type:markdown id:1465ef19 tags:
   
With that out of the way, the first thing to do when starting a DeepOF project is to load your videos and DeepLabCut tracking files into a deepof.data.Project object. With that out of the way, the first thing to do when starting a DeepOF project is to load your videos and DeepLabCut tracking files into a deepof.data.Project object.
   
Like depicted in the cell below, the three crucial parameters to input are the project, video and tab paths. Like depicted in the cell below, the three crucial parameters to input are the project, video and tab paths.
   
* project_path specifies where the project folder containing all processing and output files will be created. * project_path specifies where the project folder containing all processing and output files will be created.
* video_path points towards where your DLC labeled videos are stored * video_path points towards where your DLC labeled videos are stored
* similarly, table_path shoult point to the directory containing all tracking files (in either csv or h5 format) * similarly, table_path shoult point to the directory containing all tracking files (in either csv or h5 format)
* last but not least, you can give your project a name (optional; deepof_project by default). * last but not least, you can give your project a name (optional; deepof_project by default).
   
%% Cell type:markdown id:50dcb2d8 tags: %% Cell type:markdown id:50dcb2d8 tags:
   
The dataset used in this tutorial is a subset of the social interaction (SI) dataset used in DeepOF's original paper. It contains six 10-minute-long videos with two animals (a C57Bl6 and a CD1) tracked in a round arena. Three of the C57Bl6 mice have been exposed to chronic social defeat stress (CSDS). The dataset used in this tutorial is a subset of the social interaction (SI) dataset used in DeepOF's original paper. It contains six 10-minute-long videos with two animals (a C57Bl6 and a CD1) tracked in a round arena. Three of the C57Bl6 mice have been exposed to chronic social defeat stress (CSDS).
   
%% Cell type:code id:88c90e17 tags: %% Cell type:code id:88c90e17 tags:
   
``` python ``` python
# my_deepof_project = deepof.data.Project( my_deepof_project = deepof.data.Project(
# project_path=os.path.join("tutorial_files"), project_path=os.path.join("tutorial_files"),
# video_path=os.path.join("tutorial_files/Videos/"), video_path=os.path.join("tutorial_files/Videos/"),
# table_path=os.path.join("tutorial_files/Tables/"), table_path=os.path.join("tutorial_files/Tables/"),
# project_name="tutorial_project", project_name="tutorial_project",
# arena="circular-manual", arena="circular-manual",
# animal_ids=["B", "W"], animal_ids=["B", "W"],
# video_format=".mp4", video_format=".mp4",
# exclude_bodyparts=["Tail_1", "Tail_2", "Tail_tip"], exclude_bodyparts=["Tail_1", "Tail_2", "Tail_tip"],
# video_scale=380, video_scale=380,
# enable_iterative_imputation=10, enable_iterative_imputation=10,
# smooth_alpha=1, smooth_alpha=1,
# exp_conditions=None, exp_conditions=None,
# ) )
``` ```
   
%% Cell type:markdown id:dae0d5c8 tags: %% Cell type:markdown id:dae0d5c8 tags:
   
As you may see, there are some extra (optional) parameters in the call above. These specify some details on how the videos and tracks will be processed. Some include: As you may see, there are some extra (optional) parameters in the call above. These specify some details on how the videos and tracks will be processed. Some include:
   
* arena: some functions within DeepOF (as you will see in the next tutorial on supervised annotations) require the program to detect the arena. This can be either done automatically in some settings (round arenas, with strong contrast between bedding and the outside, like in the tutorial videos). However, we recommend doing it manually to add precision and flexibility (see GUI below). Can be set to circular-autodetect, circular-manual, or polygonal-manual. * arena: some functions within DeepOF (as you will see in the next tutorial on supervised annotations) require the program to detect the arena. This can be either done automatically in some settings (round arenas, with strong contrast between bedding and the outside, like in the tutorial videos). However, we recommend doing it manually to add precision and flexibility (see GUI below). Can be set to circular-autodetect, circular-manual, or polygonal-manual.
* animal_ids: in case more than one animal is present in the dataset, the IDs assigned to each during DLC tracking need to be specified as a list. * animal_ids: in case more than one animal is present in the dataset, the IDs assigned to each during DLC tracking need to be specified as a list.
* exclude_body_parts: while DeepOF originally relies on 14 body part tracking models, body parts along the tail are no longer used. This step could be bypassed using smaller models following an 11-body-part scheme, such as the one presented in the landing page of the documentation. * exclude_body_parts: while DeepOF originally relies on 14 body part tracking models, body parts along the tail are no longer used. This step could be bypassed using smaller models following an 11-body-part scheme, such as the one presented in the landing page of the documentation.
* video_scale: diameter of the arena (in mm) if circular. In the case of polygonal arenas, the length (in mm) of the first edge as specified in the GUI (see below) should be provided. * video_scale: diameter of the arena (in mm) if circular. In the case of polygonal arenas, the length (in mm) of the first edge as specified in the GUI (see below) should be provided.
* enable_iterative_imputation: maximum number of iterations of the iterative imputation step, which aims to recover the position of occluded body parts. Higher numbers will increase precision, but also computation time, especially in multi-animal settings. * enable_iterative_imputation: maximum number of iterations of the iterative imputation step, which aims to recover the position of occluded body parts. Higher numbers will increase precision, but also computation time, especially in multi-animal settings.
* smooth_alpha: smoothing intensity. The higher the value, the more smoothing is applied. * smooth_alpha: smoothing intensity. The higher the value, the more smoothing is applied.
* exp_conditions: dictionary with a video IDs as keys, and data frames with all experimental conditions as values. DeepOF will use this information to enable all sorts of comparisons between conditions, as we will see in the following tutorials. We'll leave it blank for now and update it afterwards. * exp_conditions: dictionary with a video IDs as keys, and data frames with all experimental conditions as values. DeepOF will use this information to enable all sorts of comparisons between conditions, as we will see in the following tutorials. We'll leave it blank for now and update it afterwards.
   
For more details, feel free to visit the full API reference. For more details, feel free to visit the full API reference.
   
%% Cell type:markdown id:02ed7ba0 tags: %% Cell type:markdown id:02ed7ba0 tags:
   
Let's then create our first project, by running the .create() method in our newly created object: Let's then create our first project, by running the .create() method in our newly created object:
   
%% Cell type:code id:d2f00bc8 tags: %% Cell type:code id:d2f00bc8 tags:
   
``` python ``` python
# my_deepof_project = my_deepof_project.create() my_deepof_project = my_deepof_project.create()
``` ```
   
%% Cell type:markdown id:9a0c3bbc tags: %% Cell type:markdown id:9a0c3bbc tags:
   
As you will see, this organizes all required file into a folder in the specified path. Moreover, some processing steps are computed on the go, such as distances, angles and areas. This makes it easier for DeepOF to load all required features later on, without the need to compute them every time. As you will see, this organizes all required file into a folder in the specified path. Moreover, some processing steps are computed on the go, such as distances, angles and areas. This makes it easier for DeepOF to load all required features later on, without the need to compute them every time.
   
In addition, if "circular-manual" or "polygonal-manual" were selected in the 'arena' parameter, a GUI will pop up in the "detecting arena" step. In addition, if "circular-manual" or "polygonal-manual" were selected in the 'arena' parameter, a GUI will pop up in the "detecting arena" step.
   
%% Cell type:markdown id:d82da5cc tags: %% Cell type:markdown id:d82da5cc tags:
   
![arena_GUI](./tutorial_files/Assets/arena_GUI.png) ![arena_GUI](./tutorial_files/Assets/arena_GUI.png)
   
%% Cell type:markdown id:5398d2a3 tags: %% Cell type:markdown id:5398d2a3 tags:
   
A window per video will appear, and allow you to manually mark where the arena is with just a few clicks. All results will be stored for further processing. A window per video will appear, and allow you to manually mark where the arena is with just a few clicks. All results will be stored for further processing.
   
Clicking anywhere in the video will make an orange marker appear. In the case of polygonal arenas, at least a marker per corner should be used. When dealing with circular (or elliptical) arenas, DeepOF will fit an ellipse to the marked points after a minimum of 5 clicks. The ellipse can always be refined by adding more markers. Once finished with a video, press 'q' to save and move to the next one. If you made a mistake and would like to correct it, press 'd' to delete the last added marker. Clicking anywhere in the video will make an orange marker appear. In the case of polygonal arenas, at least a marker per corner should be used. When dealing with circular (or elliptical) arenas, DeepOF will fit an ellipse to the marked points after a minimum of 5 clicks. The ellipse can always be refined by adding more markers. Once finished with a video, press 'q' to save and move to the next one. If you made a mistake and would like to correct it, press 'd' to delete the last added marker.
   
**NOTE**: in polygonal arenas, the first edge you input will be used to scale the coordinates to the proper distances (pixels to millimeters). Make sure you always mark the same edge first, and that it coincides with the length passed to the "video_scale" parameter when creating the project. **NOTE**: in polygonal arenas, the first edge you input will be used to scale the coordinates to the proper distances (pixels to millimeters). Make sure you always mark the same edge first, and that it coincides with the length passed to the "video_scale" parameter when creating the project.
   
**NOTE2**: currently, area computation works on a single core, and can take some time for large datasets. We're working on making it faster, but for now, know you only need to run it once! We cover how to load previously created projects right afterwards. **NOTE2**: currently, area computation works on a single core, and can take some time for large datasets. We're working on making it faster, but for now, know you only need to run it once! We cover how to load previously created projects right afterwards.
   
%% Cell type:markdown id:a99d8cf5 tags: %% Cell type:markdown id:a99d8cf5 tags:
   
### Loading a previously generated project ### Loading a previously generated project
   
%% Cell type:markdown id:0651bdc8 tags: %% Cell type:markdown id:0651bdc8 tags:
   
Once you ran your project at least once, it can be loaded without much effort from the path you specified in the first place (plus the project name -deepof_project, if you didn't specify otherwise-). Once you ran your project at least once, it can be loaded without much effort from the path you specified in the first place (plus the project name -deepof_project, if you didn't specify otherwise-).
   
%% Cell type:code id:899cbab7 tags: %% Cell type:code id:899cbab7 tags:
   
``` python ``` python
# Load a previously saved project # Load a previously saved project
my_deepof_project = deepof.data.load_project("./tutorial_files/tutorial_project/") my_deepof_project = deepof.data.load_project("./tutorial_files/tutorial_project/")
``` ```
   
%% Cell type:markdown id:7079cbfb tags: %% Cell type:markdown id:7079cbfb tags:
   
### Interacting with your project: generating coordinates, distances, angles, and areas. ### Interacting with your project: generating coordinates, distances, angles, and areas.
   
%% Cell type:markdown id:73f40230 tags: %% Cell type:markdown id:73f40230 tags:
   
That's it for basic project creation. We now have a DeepOF project up and running! Before ending the tutorial, however, let's explore the object that the commands above produced. That's it for basic project creation. We now have a DeepOF project up and running! Before ending the tutorial, however, let's explore the object that the commands above produced.
   
%% Cell type:markdown id:3a24e71c tags: %% Cell type:markdown id:3a24e71c tags:
   
For starters, if we print it, we see it's a DeepOF analysis of 6 videos. Furthermore, the object belongs to a custom class within DeepOF, called Coordinates. This class allows the package to store all sorts of relevant information required for further processing, as we'll see below: For starters, if we print it, we see it's a DeepOF analysis of 6 videos. Furthermore, the object belongs to a custom class within DeepOF, called Coordinates. This class allows the package to store all sorts of relevant information required for further processing, as we'll see below:
   
%% Cell type:code id:ee51de4a tags: %% Cell type:code id:ee51de4a tags:
   
``` python ``` python
print(my_deepof_project) print(my_deepof_project)
print(type(my_deepof_project)) print(type(my_deepof_project))
``` ```
   
%% Output %% Output
   
deepof analysis of 6 videos deepof analysis of 6 videos
<class 'deepof.data.Coordinates'> <class 'deepof.data.Coordinates'>
   
%% Cell type:markdown id:16891425 tags: %% Cell type:markdown id:16891425 tags:
   
As described before, the .create() method runs most of the heavy preprocessing already, which allows us to extract features including coordinates, distances, angles, and areas. Let's see how that works! As described before, the .create() method runs most of the heavy preprocessing already, which allows us to extract features including coordinates, distances, angles, and areas. Let's see how that works!
   
%% Cell type:markdown id:c887b0e9 tags: %% Cell type:markdown id:c887b0e9 tags:
   
![preprocessing](./tutorial_files/Assets/deepof_preprocessing.png) ![preprocessing](./tutorial_files/Assets/deepof_preprocessing.png)
   
%% Cell type:markdown id:787fae4a tags: %% Cell type:markdown id:787fae4a tags:
   
With the .get_coords() method, for example, we can obtain the processed (smooth and imputed) tracks for all videos in a dictionary. The returned objects are called table dictionaries (TableDict is the name of the class). They follow a dictionary-like structure, where each value is a data frame. They also provide a plethora of extra methods, some of which we'll cover in these tutorials. Let's retrieve these for one of the animals: With the .get_coords() method, for example, we can obtain the processed (smooth and imputed) tracks for all videos in a dictionary. The returned objects are called table dictionaries (TableDict is the name of the class). They follow a dictionary-like structure, where each value is a data frame. They also provide a plethora of extra methods, some of which we'll cover in these tutorials. Let's retrieve these for one of the animals:
   
%% Cell type:code id:e94d1215 tags: %% Cell type:code id:e94d1215 tags:
   
``` python ``` python
my_deepof_project.get_coords(polar=False, center="Center", align="Spine_1")['20191204_Day2_SI_JB08_Test_54'] my_deepof_project.get_coords(polar=False, center="Center", align="Spine_1")['20191204_Day2_SI_JB08_Test_54']
``` ```
   
%% Output %% Output
   
B_Spine_1 B_Center B_Left_bhip \ B_Spine_1 B_Center B_Left_bhip \
x y x y x y x y x y x y
00:00:00 0.0 17.041283 0.0 0.0 16.235626 -9.286406 00:00:00 0.0 17.041283 0.0 0.0 16.235626 -9.286406
00:00:00.039935995 0.0 16.475167 0.0 0.0 15.143549 -10.150172 00:00:00.039935995 0.0 16.475167 0.0 0.0 15.143549 -10.150172
00:00:00.079871991 0.0 16.446049 0.0 0.0 11.477393 -12.396184 00:00:00.079871991 0.0 16.446049 0.0 0.0 11.477393 -12.396184
00:00:00.119807987 0.0 15.217471 0.0 0.0 10.208930 -14.160422 00:00:00.119807987 0.0 15.217471 0.0 0.0 10.208930 -14.160422
00:00:00.159743982 0.0 15.037661 0.0 0.0 10.836279 -15.220016 00:00:00.159743982 0.0 15.037661 0.0 0.0 10.836279 -15.220016
... ... ... ... ... ... ... ... ... ... ... ... ... ...
00:09:58.800320021 0.0 17.383252 0.0 0.0 15.964064 -11.925356 00:09:58.800320021 0.0 17.383252 0.0 0.0 15.964064 -11.925356
00:09:58.840256017 0.0 15.069470 0.0 0.0 15.782188 -13.477302 00:09:58.840256017 0.0 15.069470 0.0 0.0 15.782188 -13.477302
00:09:58.880192012 0.0 19.435457 0.0 0.0 12.847697 -11.565332 00:09:58.880192012 0.0 19.435457 0.0 0.0 12.847697 -11.565332
00:09:58.920128008 0.0 19.435457 0.0 0.0 12.847697 -11.565332 00:09:58.920128008 0.0 19.435457 0.0 0.0 12.847697 -11.565332
00:09:58.960064004 0.0 19.435457 0.0 0.0 12.847697 -11.565332 00:09:58.960064004 0.0 19.435457 0.0 0.0 12.847697 -11.565332
B_Left_ear B_Left_fhip ... \ B_Left_ear B_Left_fhip ... \
x y x y ... x y x y ...
00:00:00 2.338149 35.826017 14.520708 16.191088 ... 00:00:00 2.338149 35.826017 14.520708 16.191088 ...
00:00:00.039935995 0.671672 35.836244 14.183559 14.703795 ... 00:00:00.039935995 0.671672 35.836244 14.183559 14.703795 ...
00:00:00.079871991 0.097058 35.005123 13.716176 13.898245 ... 00:00:00.079871991 0.097058 35.005123 13.716176 13.898245 ...
00:00:00.119807987 -0.358944 35.315238 15.230370 11.435026 ... 00:00:00.119807987 -0.358944 35.315238 15.230370 11.435026 ...
00:00:00.159743982 0.861588 34.324995 14.984768 10.471671 ... 00:00:00.159743982 0.861588 34.324995 14.984768 10.471671 ...
... ... ... ... ... ... ... ... ... ... ... ...
00:09:58.800320021 10.656661 35.405103 14.810418 11.274649 ... 00:09:58.800320021 10.656661 35.405103 14.810418 11.274649 ...
00:09:58.840256017 7.241669 39.238723 14.817890 9.091584 ... 00:09:58.840256017 7.241669 39.238723 14.817890 9.091584 ...
00:09:58.880192012 7.622541 42.242592 14.851511 12.187561 ... 00:09:58.880192012 7.622541 42.242592 14.851511 12.187561 ...
00:09:58.920128008 7.622541 42.242592 14.851511 12.187561 ... 00:09:58.920128008 7.622541 42.242592 14.851511 12.187561 ...
00:09:58.960064004 7.622541 42.242592 14.851511 12.187561 ... 00:09:58.960064004 7.622541 42.242592 14.851511 12.187561 ...
W_Right_bhip W_Right_ear \ W_Right_bhip W_Right_ear \
x y x y x y x y
00:00:00 -11.115287 -13.877286 -11.056773 52.165913 00:00:00 -11.115287 -13.877286 -11.056773 52.165913
00:00:00.039935995 -13.884385 -18.083860 -11.634608 53.793769 00:00:00.039935995 -13.884385 -18.083860 -11.634608 53.793769
00:00:00.079871991 -15.550991 -13.873025 -12.439161 53.259569 00:00:00.079871991 -15.550991 -13.873025 -12.439161 53.259569
00:00:00.119807987 -14.469009 -16.138564 -11.961743 52.265874 00:00:00.119807987 -14.469009 -16.138564 -11.961743 52.265874
00:00:00.159743982 -14.028915 -18.169221 -19.961073 49.485545 00:00:00.159743982 -14.028915 -18.169221 -19.961073 49.485545
... ... ... ... ... ... ... ... ... ...
00:09:58.800320021 -20.815692 -6.861448 -17.302919 31.105013 00:09:58.800320021 -20.815692 -6.861448 -17.302919 31.105013
00:09:58.840256017 -20.930728 -7.043085 -17.317452 31.011691 00:09:58.840256017 -20.930728 -7.043085 -17.317452 31.011691
00:09:58.880192012 -20.912197 -7.052485 -17.362287 30.948820 00:09:58.880192012 -20.912197 -7.052485 -17.362287 30.948820
00:09:58.920128008 -20.912197 -7.052485 -17.362287 30.948820 00:09:58.920128008 -20.912197 -7.052485 -17.362287 30.948820
00:09:58.960064004 -20.912197 -7.052485 -17.362287 30.948820 00:09:58.960064004 -20.912197 -7.052485 -17.362287 30.948820
W_Right_fhip W_Spine_2 W_Tail_base \ W_Right_fhip W_Spine_2 W_Tail_base \
x y x y x x y x y x
00:00:00 -10.837443 11.900607 1.303025 -19.189055 -9.987794 00:00:00 -10.837443 11.900607 1.303025 -19.189055 -9.987794
00:00:00.039935995 -13.457341 12.356739 1.828954 -24.439299 -1.620732 00:00:00.039935995 -13.457341 12.356739 1.828954 -24.439299 -1.620732
00:00:00.079871991 -14.284002 12.808460 0.793345 -21.164099 1.765989 00:00:00.079871991 -14.284002 12.808460 0.793345 -21.164099 1.765989
00:00:00.119807987 -14.571504 13.210702 1.309584 -22.165508 2.815459 00:00:00.119807987 -14.571504 13.210702 1.309584 -22.165508 2.815459
00:00:00.159743982 -14.900604 11.323389 1.955114 -22.447853 2.289354 00:00:00.159743982 -14.900604 11.323389 1.955114 -22.447853 2.289354
... ... ... ... ... ... ... ... ... ... ... ...
00:09:58.800320021 -12.210518 10.521213 -6.286187 -15.291244 -18.448989 00:09:58.800320021 -12.210518 10.521213 -6.286187 -15.291244 -18.448989
00:09:58.840256017 -12.259446 10.426808 -6.220324 -15.480332 -18.379192 00:09:58.840256017 -12.259446 10.426808 -6.220324 -15.480332 -18.379192
00:09:58.880192012 -12.239039 10.390575 -6.179682 -15.503151 -18.331690 00:09:58.880192012 -12.239039 10.390575 -6.179682 -15.503151 -18.331690
00:09:58.920128008 -12.239039 10.390575 -6.179682 -15.503151 -18.331690 00:09:58.920128008 -12.239039 10.390575 -6.179682 -15.503151 -18.331690
00:09:58.960064004 -12.239039 10.390575 -6.179682 -15.503151 -18.331690 00:09:58.960064004 -12.239039 10.390575 -6.179682 -15.503151 -18.331690
y y
00:00:00 -46.786090 00:00:00 -46.786090
00:00:00.039935995 -48.755033 00:00:00.039935995 -48.755033
00:00:00.079871991 -41.624561 00:00:00.079871991 -41.624561
00:00:00.119807987 -42.444154 00:00:00.119807987 -42.444154
00:00:00.159743982 -44.418900 00:00:00.159743982 -44.418900
... ... ... ...
00:09:58.800320021 -26.719926 00:09:58.800320021 -26.719926
00:09:58.840256017 -26.895317 00:09:58.840256017 -26.895317
00:09:58.880192012 -26.956528 00:09:58.880192012 -26.956528
00:09:58.920128008 -26.956528 00:09:58.920128008 -26.956528
00:09:58.960064004 -26.956528 00:09:58.960064004 -26.956528
[14999 rows x 44 columns] [14999 rows x 44 columns]
   
%% Cell type:markdown id:127fe5bb tags: %% Cell type:markdown id:127fe5bb tags:
   
Note that there are a few parameters you can pass to the .get_coords() method. If "polar" is set to True, polar coordinates will be used, instead of Cartesian. Both "center" and "align" control how translational and rotational variance are removed from the data: the former will use the specified body part as [0, 0] (or the center of the arena, if set to "arena"). The latter will rotate the mice on each time point, to align the line connecting the body parts specified in the "center" and "align" methods with the y-axis. Note that there are a few parameters you can pass to the .get_coords() method. If "polar" is set to True, polar coordinates will be used, instead of Cartesian. Both "center" and "align" control how translational and rotational variance are removed from the data: the former will use the specified body part as [0, 0] (or the center of the arena, if set to "arena"). The latter will rotate the mice on each time point, to align the line connecting the body parts specified in the "center" and "align" methods with the y-axis.
   
%% Cell type:markdown id:6ca1106c tags: %% Cell type:markdown id:6ca1106c tags:
   
Furthermore, not only processed coordinates can be retrieved, but also distances, angles, and areas with the .get_distances(), .get_angles(), and .get_areas(), respectively. Furthermore, not only processed coordinates can be retrieved, but also distances, angles, and areas with the .get_distances(), .get_angles(), and .get_areas(), respectively.
   
%% Cell type:code id:3c0688fb tags: %% Cell type:code id:3c0688fb tags:
   
``` python ``` python
my_deepof_project.get_distances()['20191204_Day2_SI_JB08_Test_54'] my_deepof_project.get_distances()['20191204_Day2_SI_JB08_Test_54']
``` ```
   
%% Output %% Output
   
(B_Left_bhip, B_Spine_2) (W_Center, W_Right_fhip) \ (B_Left_bhip, B_Spine_2) (W_Center, W_Right_fhip) \
00:00:00 15.294229 13.097221 00:00:00 15.294229 13.097221
00:00:00.039935995 15.264173 14.866295 00:00:00.039935995 15.264173 14.866295
00:00:00.079871991 14.663255 15.611454 00:00:00.079871991 14.663255 15.611454
00:00:00.119807987 14.804978 16.004378 00:00:00.119807987 14.804978 16.004378
00:00:00.159743982 15.041685 15.228391 00:00:00.159743982 15.041685 15.228391
... ... ... ... ... ...
00:09:58.800320021 13.848864 13.115358 00:09:58.800320021 13.848864 13.115358
00:09:58.840256017 13.526511 13.095647 00:09:58.840256017 13.526511 13.095647
00:09:58.880192012 13.801566 13.063902 00:09:58.880192012 13.801566 13.063902
00:09:58.920128008 13.801566 13.063902 00:09:58.920128008 13.801566 13.063902
00:09:58.960064004 13.801566 13.063902 00:09:58.960064004 13.801566 13.063902
(W_Center, W_Left_fhip) (B_Right_ear, B_Spine_1) \ (W_Center, W_Left_fhip) (B_Right_ear, B_Spine_1) \
00:00:00 18.654549 14.300370 00:00:00 18.654549 14.300370
00:00:00.039935995 20.383799 14.756100 00:00:00.039935995 20.383799 14.756100
00:00:00.079871991 20.207855 14.490980 00:00:00.079871991 20.207855 14.490980
00:00:00.119807987 19.823826 15.648562 00:00:00.119807987 19.823826 15.648562
00:00:00.159743982 20.769126 16.058247 00:00:00.159743982 20.769126 16.058247
... ... ... ... ... ...
00:09:58.800320021 15.272792 17.047292 00:09:58.800320021 15.272792 17.047292
00:09:58.840256017 15.262735 17.452928 00:09:58.840256017 15.262735 17.452928
00:09:58.880192012 15.306780 18.024676 00:09:58.880192012 15.306780 18.024676
00:09:58.920128008 15.306780 18.024676 00:09:58.920128008 15.306780 18.024676
00:09:58.960064004 15.306780 18.024676 00:09:58.960064004 15.306780 18.024676
(B_Center, B_Right_fhip) (B_Nose, W_Nose) \ (B_Center, B_Right_fhip) (B_Nose, W_Nose) \
00:00:00 13.307170 198.053922 00:00:00 13.307170 198.053922
00:00:00.039935995 13.469051 202.762435 00:00:00.039935995 13.469051 202.762435
00:00:00.079871991 14.120393 203.411343 00:00:00.079871991 14.120393 203.411343
00:00:00.119807987 14.674685 202.302336 00:00:00.119807987 14.674685 202.302336
00:00:00.159743982 15.184137 201.555974 00:00:00.159743982 15.184137 201.555974
... ... ... ... ... ...
00:09:58.800320021 12.428442 148.947746 00:09:58.800320021 12.428442 148.947746
00:09:58.840256017 10.621567 145.290080 00:09:58.840256017 10.621567 145.290080
00:09:58.880192012 12.458673 147.479959 00:09:58.880192012 12.458673 147.479959
00:09:58.920128008 12.458673 147.479959 00:09:58.920128008 12.458673 147.479959
00:09:58.960064004 12.458673 147.479959 00:09:58.960064004 12.458673 147.479959
(W_Left_ear, W_Nose) (B_Tail_base, W_Nose) \ (W_Left_ear, W_Nose) (B_Tail_base, W_Nose) \
00:00:00 18.915606 148.682085 00:00:00 18.915606 148.682085
00:00:00.039935995 19.199412 157.634272 00:00:00.039935995 19.199412 157.634272
00:00:00.079871991 22.317250 166.003249 00:00:00.079871991 22.317250 166.003249
00:00:00.119807987 21.072843 171.913365 00:00:00.119807987 21.072843 171.913365
00:00:00.159743982 21.258547 174.999760 00:00:00.159743982 21.258547 174.999760
... ... ... ... ... ...
00:09:58.800320021 23.578072 173.390137 00:09:58.800320021 23.578072 173.390137
00:09:58.840256017 23.603226 170.363060 00:09:58.840256017 23.603226 170.363060
00:09:58.880192012 23.564206 169.135490 00:09:58.880192012 23.564206 169.135490
00:09:58.920128008 23.564206 169.135490 00:09:58.920128008 23.564206 169.135490
00:09:58.960064004 23.564206 169.135490 00:09:58.960064004 23.564206 169.135490
(B_Right_bhip, B_Spine_2) (B_Center, B_Left_fhip) ... \ (B_Right_bhip, B_Spine_2) (B_Center, B_Left_fhip) ... \
00:00:00 11.352427 17.696946 ... 00:00:00 11.352427 17.696946 ...
00:00:00.039935995 11.621177 16.623784 ... 00:00:00.039935995 11.621177 16.623784 ...
00:00:00.079871991 11.461481 15.889020 ... 00:00:00.079871991 11.461481 15.889020 ...
00:00:00.119807987 12.029250 15.497258 ... 00:00:00.119807987 12.029250 15.497258 ...
00:00:00.159743982 12.912796 14.875425 ... 00:00:00.159743982 12.912796 14.875425 ...
... ... ... ... ... ... ... ...
00:09:58.800320021 13.705981 15.145972 ... 00:09:58.800320021 13.705981 15.145972 ...
00:09:58.840256017 13.381874 14.145984 ... 00:09:58.840256017 13.381874 14.145984 ...
00:09:58.880192012 13.731724 15.632956 ... 00:09:58.880192012 13.731724 15.632956 ...
00:09:58.920128008 13.731724 15.632956 ... 00:09:58.920128008 13.731724 15.632956 ...
00:09:58.960064004 13.731724 15.632956 ... 00:09:58.960064004 13.731724 15.632956 ...
(W_Center, W_Spine_2) (B_Tail_base, W_Tail_base) \ (W_Center, W_Spine_2) (B_Tail_base, W_Tail_base) \
00:00:00 15.650178 98.128243 00:00:00 15.650178 98.128243
00:00:00.039935995 19.941976 103.329454 00:00:00.039935995 19.941976 103.329454
00:00:00.079871991 17.233418 112.995114 00:00:00.079871991 17.233418 112.995114
00:00:00.119807987 18.067626 120.138537 00:00:00.119807987 18.067626 120.138537
00:00:00.159743982 18.335068 123.879733 00:00:00.159743982 18.335068 123.879733
... ... ... ... ... ...
00:09:58.800320021 13.452932 232.725078 00:09:58.800320021 13.452932 232.725078
00:09:58.840256017 13.575291 229.550823 00:09:58.840256017 13.575291 229.550823
00:09:58.880192012 13.580242 227.365469 00:09:58.880192012 13.580242 227.365469
00:09:58.920128008 13.580242 227.365469 00:09:58.920128008 13.580242 227.365469
00:09:58.960064004 13.580242 227.365469 00:09:58.960064004 13.580242 227.365469
(B_Left_ear, B_Nose) (B_Nose, B_Right_ear) \ (B_Left_ear, B_Nose) (B_Nose, B_Right_ear) \
00:00:00 15.958751 18.862163 00:00:00 15.958751 18.862163
00:00:00.039935995 15.336850 16.465716 00:00:00.039935995 15.336850 16.465716
00:00:00.079871991 15.235294 15.122226 00:00:00.079871991 15.235294 15.122226
00:00:00.119807987 16.106972 15.177336 00:00:00.119807987 16.106972 15.177336
00:00:00.159743982 18.105548 16.304625 00:00:00.159743982 18.105548 16.304625
... ... ... ... ... ...
00:09:58.800320021 21.064461 22.771844 00:09:58.800320021 21.064461 22.771844
00:09:58.840256017 16.473568 22.886996 00:09:58.840256017 16.473568 22.886996
00:09:58.880192012 18.671978 21.823175 00:09:58.880192012 18.671978 21.823175
00:09:58.920128008 18.671978 21.823175 00:09:58.920128008 18.671978 21.823175
00:09:58.960064004 18.671978 21.823175 00:09:58.960064004 18.671978 21.823175
(W_Left_bhip, W_Spine_2) (W_Center, W_Spine_1) \ (W_Left_bhip, W_Spine_2) (W_Center, W_Spine_1) \
00:00:00 12.385698 20.063313 00:00:00 12.385698 20.063313
00:00:00.039935995 15.770459 21.979316 00:00:00.039935995 15.770459 21.979316
00:00:00.079871991 14.512332 20.005466 00:00:00.079871991 14.512332 20.005466
00:00:00.119807987 15.156571 20.297740 00:00:00.119807987 15.156571 20.297740
00:00:00.159743982 15.140400 21.108747 00:00:00.159743982 15.140400 21.108747
... ... ... ... ... ...
00:09:58.800320021 15.959499 15.193842 00:09:58.800320021 15.959499 15.193842
00:09:58.840256017 15.970098 15.144409 00:09:58.840256017 15.970098 15.144409
00:09:58.880192012 16.005486 15.172837 00:09:58.880192012 16.005486 15.172837
00:09:58.920128008 16.005486 15.172837 00:09:58.920128008 16.005486 15.172837
00:09:58.960064004 16.005486 15.172837 00:09:58.960064004 16.005486 15.172837
(B_Center, B_Spine_1) (W_Right_bhip, W_Spine_2) \ (B_Center, B_Spine_1) (W_Right_bhip, W_Spine_2) \
00:00:00 13.866569 10.990415 00:00:00 13.866569 10.990415
00:00:00.039935995 13.405917 13.792246 00:00:00.039935995 13.405917 13.792246
00:00:00.079871991 13.382224 14.562744 00:00:00.079871991 13.382224 14.562744
00:00:00.119807987 12.382525 13.743853 00:00:00.119807987 12.382525 13.743853
00:00:00.159743982 12.236212 13.464188 00:00:00.159743982 12.236212 13.464188
... ... ... ... ... ...
00:09:58.800320021 14.144830 13.668491 00:09:58.800320021 14.144830 13.668491
00:09:58.840256017 12.262096 13.799025 00:09:58.840256017 12.262096 13.799025
00:09:58.880192012 15.814718 13.820064 00:09:58.880192012 15.814718 13.820064
00:09:58.920128008 15.814718 13.820064 00:09:58.920128008 15.814718 13.820064
00:09:58.960064004 15.814718 13.820064 00:09:58.960064004 15.814718 13.820064
(B_Spine_2, B_Tail_base) (W_Left_ear, W_Spine_1) (B_Spine_2, B_Tail_base) (W_Left_ear, W_Spine_1)
00:00:00 14.630636 27.171833 00:00:00 14.630636 27.171833
00:00:00.039935995 14.515957 25.867469 00:00:00.039935995 14.515957 25.867469
00:00:00.079871991 14.816680 27.690706 00:00:00.079871991 14.816680 27.690706
00:00:00.119807987 16.005507 29.150648 00:00:00.119807987 16.005507 29.150648
00:00:00.159743982 15.589586 26.537352 00:00:00.159743982 15.589586 26.537352
... ... ... ... ... ...
00:09:58.800320021 14.777048 18.947365 00:09:58.800320021 14.777048 18.947365
00:09:58.840256017 14.639053 18.991163 00:09:58.840256017 14.639053 18.991163
00:09:58.880192012 15.440113 19.010041 00:09:58.880192012 15.440113 19.010041
00:09:58.920128008 15.440113 19.010041 00:09:58.920128008 15.440113 19.010041
00:09:58.960064004 15.440113 19.010041 00:09:58.960064004 15.440113 19.010041
[14999 rows x 26 columns] [14999 rows x 26 columns]
   
%% Cell type:code id:674f6247 tags: %% Cell type:code id:674f6247 tags:
   
``` python ``` python
my_deepof_project.get_angles()['20191204_Day2_SI_JB08_Test_54'] my_deepof_project.get_angles()['20191204_Day2_SI_JB08_Test_54']
``` ```
   
%% Output %% Output
   
(B_Right_ear, B_Nose, B_Left_ear) \ (B_Right_ear, B_Nose, B_Left_ear) \
00:00:00 1.160113 00:00:00 1.160113
00:00:00.039935995 1.432389 00:00:00.039935995 1.432389
00:00:00.079871991 1.216272 00:00:00.079871991 1.216272
00:00:00.119807987 1.173849 00:00:00.119807987 1.173849
00:00:00.159743982 1.447212 00:00:00.159743982 1.447212
... ... ... ...
00:09:58.800320021 1.157507 00:09:58.800320021 1.157507
00:09:58.840256017 1.174168 00:09:58.840256017 1.174168
00:09:58.880192012 1.078723 00:09:58.880192012 1.078723
00:09:58.920128008 1.170956 00:09:58.920128008 1.170956
00:09:58.960064004 1.207300 00:09:58.960064004 1.207300
(B_Spine_1, B_Center, B_Right_fhip) \ (B_Spine_1, B_Center, B_Right_fhip) \
00:00:00 1.377328 00:00:00 1.377328
00:00:00.039935995 1.185691 00:00:00.039935995 1.185691
00:00:00.079871991 1.511253 00:00:00.079871991 1.511253
00:00:00.119807987 1.406159 00:00:00.119807987 1.406159
00:00:00.159743982 1.190478 00:00:00.159743982 1.190478
... ... ... ...
00:09:58.800320021 0.893153 00:09:58.800320021 0.893153
00:09:58.840256017 0.892060 00:09:58.840256017 0.892060
00:09:58.880192012 0.951965 00:09:58.880192012 0.951965
00:09:58.920128008 0.903225 00:09:58.920128008 0.903225
00:09:58.960064004 0.896515 00:09:58.960064004 0.896515
(B_Spine_1, B_Center, B_Spine_2) \ (B_Spine_1, B_Center, B_Spine_2) \
00:00:00 1.651250 00:00:00 1.651250
00:00:00.039935995 1.228362 00:00:00.039935995 1.228362
00:00:00.079871991 1.159734 00:00:00.079871991 1.159734
00:00:00.119807987 1.618816 00:00:00.119807987 1.618816
00:00:00.159743982 1.229561 00:00:00.159743982 1.229561
... ... ... ...
00:09:58.800320021 0.820365 00:09:58.800320021 0.820365
00:09:58.840256017 0.740130 00:09:58.840256017 0.740130
00:09:58.880192012 0.867792 00:09:58.880192012 0.867792
00:09:58.920128008 0.829609 00:09:58.920128008 0.829609
00:09:58.960064004 0.743844 00:09:58.960064004 0.743844
(B_Spine_1, B_Center, B_Left_fhip) \ (B_Spine_1, B_Center, B_Left_fhip) \
00:00:00 1.214725 00:00:00 1.214725
00:00:00.039935995 1.160516 00:00:00.039935995 1.160516
00:00:00.079871991 1.264802 00:00:00.079871991 1.264802
00:00:00.119807987 1.216881 00:00:00.119807987 1.216881
00:00:00.159743982 1.162294 00:00:00.159743982 1.162294
... ... ... ...
00:09:58.800320021 0.791607 00:09:58.800320021 0.791607
00:09:58.840256017 0.818470 00:09:58.840256017 0.818470
00:09:58.880192012 0.859339 00:09:58.880192012 0.859339
00:09:58.920128008 0.800677 00:09:58.920128008 0.800677
00:09:58.960064004 0.822546 00:09:58.960064004 0.822546
(B_Right_fhip, B_Center, B_Spine_2) \ (B_Right_fhip, B_Center, B_Spine_2) \
00:00:00 1.805680 00:00:00 1.805680
00:00:00.039935995 1.370046 00:00:00.039935995 1.370046
00:00:00.079871991 1.190446 00:00:00.079871991 1.190446
00:00:00.119807987 1.765511 00:00:00.119807987 1.765511
00:00:00.159743982 1.356475 00:00:00.159743982 1.356475
... ... ... ...
00:09:58.800320021 0.859565 00:09:58.800320021 0.859565
00:09:58.840256017 0.779166 00:09:58.840256017 0.779166
00:09:58.880192012 0.861663 00:09:58.880192012 0.861663
00:09:58.920128008 0.861166 00:09:58.920128008 0.861166
00:09:58.960064004 0.781150 00:09:58.960064004 0.781150
(B_Right_fhip, B_Center, B_Left_fhip) \ (B_Right_fhip, B_Center, B_Left_fhip) \
00:00:00 1.281616 00:00:00 1.281616
00:00:00.039935995 1.299858 00:00:00.039935995 1.299858
00:00:00.079871991 1.295514 00:00:00.079871991 1.295514
00:00:00.119807987 1.277808 00:00:00.119807987 1.277808
00:00:00.159743982 1.286804 00:00:00.159743982 1.286804
... ... ... ...
00:09:58.800320021 0.832034 00:09:58.800320021 0.832034
00:09:58.840256017 0.870837 00:09:58.840256017 0.870837
00:09:58.880192012 0.853209 00:09:58.880192012 0.853209
00:09:58.920128008 0.833963 00:09:58.920128008 0.833963
00:09:58.960064004 0.872829 00:09:58.960064004 0.872829
(B_Spine_2, B_Center, B_Left_fhip) \ (B_Spine_2, B_Center, B_Left_fhip) \
00:00:00 0.880634 00:00:00 0.880634
00:00:00.039935995 1.502996 00:00:00.039935995 1.502996
00:00:00.079871991 1.331724 00:00:00.079871991 1.331724
00:00:00.119807987 0.915767 00:00:00.119807987 0.915767
00:00:00.159743982 1.450061 00:00:00.159743982 1.450061
... ... ... ...
00:09:58.800320021 0.753215 00:09:58.800320021 0.753215
00:09:58.840256017 0.793762 00:09:58.840256017 0.793762
00:09:58.880192012 0.707809 00:09:58.880192012 0.707809
00:09:58.920128008 0.749906 00:09:58.920128008 0.749906
00:09:58.960064004 0.795213 00:09:58.960064004 0.795213
(B_Nose, B_Right_ear, B_Spine_1) \ (B_Nose, B_Right_ear, B_Spine_1) \
00:00:00 1.432043 00:00:00 1.432043
00:00:00.039935995 1.322836 00:00:00.039935995 1.322836
00:00:00.079871991 1.192038 00:00:00.079871991 1.192038
00:00:00.119807987 1.470723 00:00:00.119807987 1.470723
00:00:00.159743982 1.327486 00:00:00.159743982 1.327486
... ... ... ...
00:09:58.800320021 1.138762 00:09:58.800320021 1.138762
00:09:58.840256017 0.974592 00:09:58.840256017 0.974592
00:09:58.880192012 1.224486 00:09:58.880192012 1.224486
00:09:58.920128008 1.166492 00:09:58.920128008 1.166492
00:09:58.960064004 1.007716 00:09:58.960064004 1.007716
(B_Center, B_Spine_1, B_Right_ear) \ (B_Center, B_Spine_1, B_Right_ear) \
00:00:00 1.196342 00:00:00 1.196342
00:00:00.039935995 1.363091 00:00:00.039935995 1.363091
00:00:00.079871991 1.463842 00:00:00.079871991 1.463842
00:00:00.119807987 1.226859 00:00:00.119807987 1.226859
00:00:00.159743982 1.344254 00:00:00.159743982 1.344254
... ... ... ...
00:09:58.800320021 0.947757 00:09:58.800320021 0.947757
00:09:58.840256017 1.021022 00:09:58.840256017 1.021022
00:09:58.880192012 0.905549 00:09:58.880192012 0.905549
00:09:58.920128008 0.952019 00:09:58.920128008 0.952019
00:09:58.960064004 1.030307 00:09:58.960064004 1.030307
(B_Center, B_Spine_1, B_Left_ear) ... \ (B_Center, B_Spine_1, B_Left_ear) ... \
00:00:00 1.011682 ... 00:00:00 1.011682 ...
00:00:00.039935995 1.351738 ... 00:00:00.039935995 1.351738 ...
00:00:00.079871991 1.366577 ... 00:00:00.079871991 1.366577 ...
00:00:00.119807987 1.040176 ... 00:00:00.119807987 1.040176 ...
00:00:00.159743982 1.325993 ... 00:00:00.159743982 1.325993 ...
... ... ... ... ... ...
00:09:58.800320021 0.855670 ... 00:09:58.800320021 0.855670 ...
00:09:58.840256017 0.993133 ... 00:09:58.840256017 0.993133 ...
00:09:58.880192012 0.875838 ... 00:09:58.880192012 0.875838 ...
00:09:58.920128008 0.859763 ... 00:09:58.920128008 0.859763 ...
00:09:58.960064004 1.002433 ... 00:09:58.960064004 1.002433 ...
(W_Center, W_Spine_1, W_Right_ear) \ (W_Center, W_Spine_1, W_Right_ear) \
00:00:00 1.018039 00:00:00 1.018039
00:00:00.039935995 1.044152 00:00:00.039935995 1.044152
00:00:00.079871991 1.133077 00:00:00.079871991 1.133077
00:00:00.119807987 1.039895 00:00:00.119807987 1.039895
00:00:00.159743982 1.079375 00:00:00.159743982 1.079375
... ... ... ...
00:09:58.800320021 0.071047 00:09:58.800320021 0.071047
00:09:58.840256017 0.121503 00:09:58.840256017 0.121503
00:09:58.880192012 0.090246 00:09:58.880192012 0.090246
00:09:58.920128008 0.063343 00:09:58.920128008 0.063343
00:09:58.960064004 0.103528 00:09:58.960064004 0.103528
(W_Center, W_Spine_1, W_Left_ear) \ (W_Center, W_Spine_1, W_Left_ear) \
00:00:00 1.087471 00:00:00 1.087471
00:00:00.039935995 1.148573 00:00:00.039935995 1.148573
00:00:00.079871991 1.152785 00:00:00.079871991 1.152785
00:00:00.119807987 1.115584 00:00:00.119807987 1.115584
00:00:00.159743982 1.189133 00:00:00.159743982 1.189133
... ... ... ...
00:09:58.800320021 0.077788 00:09:58.800320021 0.077788
00:09:58.840256017 0.062928 00:09:58.840256017 0.062928
00:09:58.880192012 0.132222 00:09:58.880192012 0.132222
00:09:58.920128008 0.069335 00:09:58.920128008 0.069335
00:09:58.960064004 0.044864 00:09:58.960064004 0.044864
(W_Right_ear, W_Spine_1, W_Left_ear) \ (W_Right_ear, W_Spine_1, W_Left_ear) \
00:00:00 1.217084 00:00:00 1.217084
00:00:00.039935995 1.133904 00:00:00.039935995 1.133904
00:00:00.079871991 1.129943 00:00:00.079871991 1.129943
00:00:00.119807987 1.256596 00:00:00.119807987 1.256596
00:00:00.159743982 1.170519 00:00:00.159743982 1.170519
... ... ... ...
00:09:58.800320021 0.026153 00:09:58.800320021 0.026153
00:09:58.840256017 0.048816 00:09:58.840256017 0.048816
00:09:58.880192012 0.014020 00:09:58.880192012 0.014020
00:09:58.920128008 0.046125 00:09:58.920128008 0.046125
00:09:58.960064004 0.032698 00:09:58.960064004 0.032698
(W_Nose, W_Left_ear, W_Spine_1) \ (W_Nose, W_Left_ear, W_Spine_1) \
00:00:00 1.281608 00:00:00 1.281608
00:00:00.039935995 1.240229 00:00:00.039935995 1.240229
00:00:00.079871991 1.141603 00:00:00.079871991 1.141603
00:00:00.119807987 1.318291 00:00:00.119807987 1.318291
00:00:00.159743982 1.275993 00:00:00.159743982 1.275993
... ... ... ...
00:09:58.800320021 0.100734 00:09:58.800320021 0.100734
00:09:58.840256017 0.067761 00:09:58.840256017 0.067761
00:09:58.880192012 0.197988 00:09:58.880192012 0.197988
00:09:58.920128008 0.113071 00:09:58.920128008 0.113071
00:09:58.960064004 0.082304 00:09:58.960064004 0.082304
(W_Right_bhip, W_Spine_2, W_Center) \ (W_Right_bhip, W_Spine_2, W_Center) \
00:00:00 0.907083 00:00:00 0.907083
00:00:00.039935995 0.875619 00:00:00.039935995 0.875619
00:00:00.079871991 0.858561 00:00:00.079871991 0.858561
00:00:00.119807987 0.933607 00:00:00.119807987 0.933607
00:00:00.159743982 0.886386 00:00:00.159743982 0.886386
... ... ... ...
00:09:58.800320021 0.123158 00:09:58.800320021 0.123158
00:09:58.840256017 0.117070 00:09:58.840256017 0.117070
00:09:58.880192012 0.114509 00:09:58.880192012 0.114509
00:09:58.920128008 0.114700 00:09:58.920128008 0.114700
00:09:58.960064004 0.109632 00:09:58.960064004 0.109632
(W_Right_bhip, W_Spine_2, W_Left_bhip) \ (W_Right_bhip, W_Spine_2, W_Left_bhip) \
00:00:00 0.957481 00:00:00 0.957481
00:00:00.039935995 0.926542 00:00:00.039935995 0.926542
00:00:00.079871991 0.840083 00:00:00.079871991 0.840083
00:00:00.119807987 0.980755 00:00:00.119807987 0.980755
00:00:00.159743982 0.941864 00:00:00.159743982 0.941864
... ... ... ...
00:09:58.800320021 0.127283 00:09:58.800320021 0.127283
00:09:58.840256017 0.029155 00:09:58.840256017 0.029155
00:09:58.880192012 0.097007 00:09:58.880192012 0.097007
00:09:58.920128008 0.115985 00:09:58.920128008 0.115985
00:09:58.960064004 0.021057 00:09:58.960064004 0.021057
(W_Right_bhip, W_Spine_2, W_Tail_base) \ (W_Right_bhip, W_Spine_2, W_Tail_base) \
00:00:00 0.866423 00:00:00 0.866423
00:00:00.039935995 0.829069 00:00:00.039935995 0.829069
00:00:00.079871991 0.740774 00:00:00.079871991 0.740774
00:00:00.119807987 0.882201 00:00:00.119807987 0.882201
00:00:00.159743982 0.854115 00:00:00.159743982 0.854115
... ... ... ...
00:09:58.800320021 0.152219 00:09:58.800320021 0.152219
00:09:58.840256017 0.140526 00:09:58.840256017 0.140526
00:09:58.880192012 0.247217 00:09:58.880192012 0.247217
00:09:58.920128008 0.141577 00:09:58.920128008 0.141577
00:09:58.960064004 0.133632 00:09:58.960064004 0.133632
(W_Center, W_Spine_2, W_Left_bhip) \ (W_Center, W_Spine_2, W_Left_bhip) \
00:00:00 0.999432 00:00:00 0.999432
00:00:00.039935995 1.004840 00:00:00.039935995 1.004840
00:00:00.079871991 0.937553 00:00:00.079871991 0.937553
00:00:00.119807987 1.033831 00:00:00.119807987 1.033831
00:00:00.159743982 1.030953 00:00:00.159743982 1.030953
... ... ... ...
00:09:58.800320021 0.023098 00:09:58.800320021 0.023098
00:09:58.840256017 0.015894 00:09:58.840256017 0.015894
00:09:58.880192012 0.023890 00:09:58.880192012 0.023890
00:09:58.920128008 0.013881 00:09:58.920128008 0.013881
00:09:58.960064004 0.008530 00:09:58.960064004 0.008530
(W_Center, W_Spine_2, W_Tail_base) \ (W_Center, W_Spine_2, W_Tail_base) \
00:00:00 0.905761 00:00:00 0.905761
00:00:00.039935995 0.919997 00:00:00.039935995 0.919997
00:00:00.079871991 0.838244 00:00:00.079871991 0.838244
00:00:00.119807987 0.931403 00:00:00.119807987 0.931403
00:00:00.159743982 0.953687 00:00:00.159743982 0.953687
... ... ... ...
00:09:58.800320021 0.036456 00:09:58.800320021 0.036456
00:09:58.840256017 0.116224 00:09:58.840256017 0.116224
00:09:58.880192012 0.174100 00:09:58.880192012 0.174100
00:09:58.920128008 0.026288 00:09:58.920128008 0.026288
00:09:58.960064004 0.108771 00:09:58.960064004 0.108771
(W_Left_bhip, W_Spine_2, W_Tail_base) (W_Left_bhip, W_Spine_2, W_Tail_base)
00:00:00 0.884871 00:00:00 0.884871
00:00:00.039935995 0.966073 00:00:00.039935995 0.966073
00:00:00.079871991 0.900188 00:00:00.079871991 0.900188
00:00:00.119807987 0.910080 00:00:00.119807987 0.910080
00:00:00.159743982 0.988059 00:00:00.159743982 0.988059
... ... ... ...
00:09:58.800320021 0.016655 00:09:58.800320021 0.016655
00:09:58.840256017 0.107108 00:09:58.840256017 0.107108
00:09:58.880192012 0.078203 00:09:58.880192012 0.078203
00:09:58.920128008 0.011959 00:09:58.920128008 0.011959
00:09:58.960064004 0.102508 00:09:58.960064004 0.102508
[14999 rows x 36 columns] [14999 rows x 36 columns]
   
%% Cell type:code id:7e5de031 tags: %% Cell type:code id:7e5de031 tags:
   
``` python ``` python
my_deepof_project.get_areas()['20191204_Day2_SI_JB08_Test_54'] my_deepof_project.get_areas()['20191204_Day2_SI_JB08_Test_54']
``` ```
   
%% Output %% Output
   
B_head_area B_torso_area B_back_area B_full_area \ B_head_area B_torso_area B_back_area B_full_area \
00:00:00 287.018462 467.472460 513.431000 1697.086099 00:00:00 287.018462 467.472460 513.431000 1697.086099
00:00:00.039935995 298.006089 461.593907 511.611552 1664.187297 00:00:00.039935995 298.006089 461.593907 511.611552 1664.187297
00:00:00.079871991 283.907493 436.994147 491.022208 1571.659017 00:00:00.079871991 283.907493 436.994147 491.022208 1571.659017
00:00:00.119807987 336.017364 459.434553 495.609970 1674.157290 00:00:00.119807987 336.017364 459.434553 495.609970 1674.157290
00:00:00.159743982 338.565821 456.785954 510.514167 1706.762126 00:00:00.159743982 338.565821 456.785954 510.514167 1706.762126
... ... ... ... ... ... ... ... ... ...
00:09:58.800320021 364.598702 512.092068 562.957165 1882.932433 00:09:58.800320021 364.598702 512.092068 562.957165 1882.932433
00:09:58.840256017 342.771541 514.231920 543.299019 1832.083470 00:09:58.840256017 342.771541 514.231920 543.299019 1832.083470
00:09:58.880192012 388.332158 529.127829 558.340318 1889.399535 00:09:58.880192012 388.332158 529.127829 558.340318 1889.399535
00:09:58.920128008 388.332158 529.127829 558.340318 1889.399535 00:09:58.920128008 388.332158 529.127829 558.340318 1889.399535
00:09:58.960064004 388.332158 529.127829 558.340318 1889.399535 00:09:58.960064004 388.332158 529.127829 558.340318 1889.399535
W_head_area W_torso_area W_back_area W_full_area W_head_area W_torso_area W_back_area W_full_area
00:00:00 588.316685 575.287843 557.837678 2402.446220 00:00:00 588.316685 575.287843 557.837678 2402.446220
00:00:00.039935995 532.941463 711.610814 747.171324 2612.577515 00:00:00.039935995 532.941463 711.610814 747.171324 2612.577515
00:00:00.079871991 615.224965 659.274363 696.773878 2680.819039 00:00:00.079871991 615.224965 659.274363 696.773878 2680.819039
00:00:00.119807987 664.955274 698.278394 709.587295 2725.074795 00:00:00.119807987 664.955274 698.278394 709.587295 2725.074795
00:00:00.159743982 589.501549 713.393985 706.975280 2732.936140 00:00:00.159743982 589.501549 713.393985 706.975280 2732.936140
... ... ... ... ... ... ... ... ... ...
00:09:58.800320021 516.368794 466.566421 607.161201 1974.352930 00:09:58.800320021 516.368794 466.566421 607.161201 1974.352930
00:09:58.840256017 517.334943 468.582411 611.765902 1979.455000 00:09:58.840256017 517.334943 468.582411 611.765902 1979.455000
00:09:58.880192012 516.875687 468.401897 613.444346 1980.834529 00:09:58.880192012 516.875687 468.401897 613.444346 1980.834529
00:09:58.920128008 516.875687 468.401897 613.444346 1980.834529 00:09:58.920128008 516.875687 468.401897 613.444346 1980.834529
00:09:58.960064004 516.875687 468.401897 613.444346 1980.834529 00:09:58.960064004 516.875687 468.401897 613.444346 1980.834529
[14999 rows x 8 columns] [14999 rows x 8 columns]
   
%% Cell type:markdown id:3fa733d0 tags: %% Cell type:markdown id:3fa733d0 tags:
   
Last but not least, features can be merged using the .merge() method, which can yield combinations of features if needed. For example, the code in the following cell creates an object with both coordinates and areas per time point: Last but not least, features can be merged using the .merge() method, which can yield combinations of features if needed. For example, the code in the following cell creates an object with both coordinates and areas per time point:
   
%% Cell type:code id:b34be811 tags: %% Cell type:code id:b34be811 tags:
   
``` python ``` python
my_deepof_project.get_coords().merge(my_deepof_project.get_areas())['20191204_Day2_SI_JB08_Test_54'] my_deepof_project.get_coords().merge(my_deepof_project.get_areas())['20191204_Day2_SI_JB08_Test_54']
``` ```
   
%% Output %% Output
   
(B_Center, x) (B_Center, y) (B_Left_bhip, x) \ (B_Center, x) (B_Center, y) (B_Left_bhip, x) \
00:00:00 223.193283 184.124115 222.160935 00:00:00 223.193283 184.124115 222.160935
00:00:00.039935995 222.081848 185.302109 221.340759 00:00:00.039935995 222.081848 185.302109 221.340759
00:00:00.079871991 220.547333 186.246719 219.854218 00:00:00.079871991 220.547333 186.246719 219.854218
00:00:00.119807987 218.467209 184.700256 216.118439 00:00:00.119807987 218.467209 184.700256 216.118439
00:00:00.159743982 219.402542 182.458069 214.480026 00:00:00.159743982 219.402542 182.458069 214.480026
... ... ... ... ... ... ... ...
00:09:58.800320021 108.366647 302.971861 127.398353 00:09:58.800320021 108.366647 302.971861 127.398353
00:09:58.840256017 108.605596 310.532362 127.530082 00:09:58.840256017 108.605596 310.532362 127.530082
00:09:58.880192012 108.844546 318.092862 124.715041 00:09:58.880192012 108.844546 318.092862 124.715041
00:09:58.920128008 108.844546 318.092862 124.715041 00:09:58.920128008 108.844546 318.092862 124.715041
00:09:58.960064004 108.844546 318.092862 124.715041 00:09:58.960064004 108.844546 318.092862 124.715041
(B_Left_bhip, y) (B_Left_ear, x) (B_Left_ear, y) \ (B_Left_bhip, y) (B_Left_ear, x) (B_Left_ear, y) \
00:00:00 202.799423 191.852982 166.609666 00:00:00 202.799423 191.852982 166.609666
00:00:00.039935995 203.517593 192.753159 164.698335 00:00:00.039935995 203.517593 192.753159 164.698335
00:00:00.079871991 203.126160 197.765198 159.669617 00:00:00.079871991 203.126160 197.765198 159.669617
00:00:00.119807987 201.998322 202.173355 153.366486 00:00:00.119807987 201.998322 202.173355 153.366486
00:00:00.159743982 200.481461 206.756088 150.536057 00:00:00.159743982 200.481461 206.756088 150.536057
... ... ... ... ... ... ... ...
00:09:58.800320021 297.067658 106.577644 339.902678 00:09:58.800320021 297.067658 106.577644 339.902678
00:09:58.840256017 302.013032 104.571034 350.229231 00:09:58.840256017 302.013032 104.571034 350.229231
00:09:58.880192012 311.241029 102.564423 360.555784 00:09:58.880192012 311.241029 102.564423 360.555784
00:09:58.920128008 311.241029 102.564423 360.555784 00:09:58.920128008 311.241029 102.564423 360.555784
00:09:58.960064004 311.241029 102.564423 360.555784 00:09:58.960064004 311.241029 102.564423 360.555784
(B_Left_fhip, x) (B_Left_fhip, y) (B_Nose, x) \ (B_Left_fhip, x) (B_Left_fhip, y) (B_Nose, x) \
00:00:00 201.709718 187.509186 188.298004 00:00:00 201.709718 187.509186 188.298004
00:00:00.039935995 201.841401 188.076859 194.544312 00:00:00.039935995 201.841401 188.076859 194.544312
00:00:00.079871991 201.092896 184.567551 205.235306 00:00:00.079871991 201.092896 184.567551 205.235306
00:00:00.119807987 199.648239 181.772736 214.989639 00:00:00.119807987 199.648239 181.772736 214.989639
00:00:00.159743982 201.725708 177.796661 221.262161 00:00:00.159743982 201.725708 177.796661 221.262161
... ... ... ... ... ... ... ...
00:09:58.800320021 118.557281 318.548034 91.342528 00:09:58.800320021 118.557281 318.548034 91.342528
00:09:58.840256017 120.285217 323.409210 93.433890 00:09:58.840256017 120.285217 323.409210 93.433890
00:09:58.880192012 119.021164 334.388275 86.603620 00:09:58.880192012 119.021164 334.388275 86.603620
00:09:58.920128008 119.021164 334.388275 86.603620 00:09:58.920128008 119.021164 334.388275 86.603620
00:09:58.960064004 119.021164 334.388275 86.603620 00:09:58.960064004 119.021164 334.388275 86.603620
(B_Nose, y) ... (W_Tail_base, x) (W_Tail_base, y) \ (B_Nose, y) ... (W_Tail_base, x) (W_Tail_base, y) \
00:00:00 147.322081 ... 321.353759 97.605996 00:00:00 147.322081 ... 321.353759 97.605996
00:00:00.039935995 145.935454 ... 332.379546 98.838112 00:00:00.039935995 145.935454 ... 332.379546 98.838112
00:00:00.079871991 142.500976 ... 350.856689 101.147659 00:00:00.079871991 142.500976 ... 350.856689 101.147659
00:00:00.119807987 138.281066 ... 361.710663 101.918587 00:00:00.119807987 138.281066 ... 361.710663 101.918587
00:00:00.159743982 133.663879 ... 369.073914 106.446114 00:00:00.159743982 133.663879 ... 369.073914 106.446114
... ... ... ... ... ... ... ... ... ...
00:09:58.800320021 360.831938 ... 267.896393 517.758606 00:09:58.800320021 360.831938 ... 267.896393 517.758606
00:09:58.840256017 367.135740 ... 267.855316 517.770020 00:09:58.840256017 367.135740 ... 267.855316 517.770020
00:09:58.880192012 377.042506 ... 267.961975 517.801758 00:09:58.880192012 377.042506 ... 267.961975 517.801758
00:09:58.920128008 377.042506 ... 267.961975 517.801758 00:09:58.920128008 377.042506 ... 267.961975 517.801758
00:09:58.960064004 377.042506 ... 267.961975 517.801758 00:09:58.960064004 377.042506 ... 267.961975 517.801758
B_head_area B_torso_area B_back_area B_full_area \ B_head_area B_torso_area B_back_area B_full_area \
00:00:00 287.018462 467.472460 513.431000 1697.086099 00:00:00 287.018462 467.472460 513.431000 1697.086099
00:00:00.039935995 298.006089 461.593907 511.611552 1664.187297 00:00:00.039935995 298.006089 461.593907 511.611552 1664.187297
00:00:00.079871991 283.907493 436.994147 491.022208 1571.659017 00:00:00.079871991 283.907493 436.994147 491.022208 1571.659017
00:00:00.119807987 336.017364 459.434553 495.609970 1674.157290 00:00:00.119807987 336.017364 459.434553 495.609970 1674.157290
00:00:00.159743982 338.565821 456.785954 510.514167 1706.762126 00:00:00.159743982 338.565821 456.785954 510.514167 1706.762126
... ... ... ... ... ... ... ... ... ...
00:09:58.800320021 364.598702 512.092068 562.957165 1882.932433 00:09:58.800320021 364.598702 512.092068 562.957165 1882.932433
00:09:58.840256017 342.771541 514.231920 543.299019 1832.083470 00:09:58.840256017 342.771541 514.231920 543.299019 1832.083470
00:09:58.880192012 388.332158 529.127829 558.340318 1889.399535 00:09:58.880192012 388.332158 529.127829 558.340318 1889.399535
00:09:58.920128008 388.332158 529.127829 558.340318 1889.399535 00:09:58.920128008 388.332158 529.127829 558.340318 1889.399535
00:09:58.960064004 388.332158 529.127829 558.340318 1889.399535 00:09:58.960064004 388.332158 529.127829 558.340318 1889.399535
W_head_area W_torso_area W_back_area W_full_area W_head_area W_torso_area W_back_area W_full_area
00:00:00 588.316685 575.287843 557.837678 2402.446220 00:00:00 588.316685 575.287843 557.837678 2402.446220
00:00:00.039935995 532.941463 711.610814 747.171324 2612.577515 00:00:00.039935995 532.941463 711.610814 747.171324 2612.577515
00:00:00.079871991 615.224965 659.274363 696.773878 2680.819039 00:00:00.079871991 615.224965 659.274363 696.773878 2680.819039
00:00:00.119807987 664.955274 698.278394 709.587295 2725.074795 00:00:00.119807987 664.955274 698.278394 709.587295 2725.074795
00:00:00.159743982 589.501549 713.393985 706.975280 2732.936140 00:00:00.159743982 589.501549 713.393985 706.975280 2732.936140
... ... ... ... ... ... ... ... ... ...
00:09:58.800320021 516.368794 466.566421 607.161201 1974.352930 00:09:58.800320021 516.368794 466.566421 607.161201 1974.352930
00:09:58.840256017 517.334943 468.582411 611.765902 1979.455000 00:09:58.840256017 517.334943 468.582411 611.765902 1979.455000
00:09:58.880192012 516.875687 468.401897 613.444346 1980.834529 00:09:58.880192012 516.875687 468.401897 613.444346 1980.834529
00:09:58.920128008 516.875687 468.401897 613.444346 1980.834529 00:09:58.920128008 516.875687 468.401897 613.444346 1980.834529
00:09:58.960064004 516.875687 468.401897 613.444346 1980.834529 00:09:58.960064004 516.875687 468.401897 613.444346 1980.834529
[14999 rows x 52 columns] [14999 rows x 52 columns]
   
%% Cell type:markdown id:0afd4280 tags: %% Cell type:markdown id:0afd4280 tags:
   
### Loading experimental conditions ### Loading experimental conditions
   
%% Cell type:markdown id:b9e4c272 tags: %% Cell type:markdown id:b9e4c272 tags:
   
So far, DeepOF does not know to which condition each animal belongs. This can be either set up at project creation (as described above) or specified afterward. So far, DeepOF does not know to which condition each animal belongs. This can be either set up at project creation (as described above) or specified afterward.
   
To simplify things, here we'll load an already created object and explain how it works after loading it. To simplify things, here we'll load an already created object and explain how it works after loading it.
   
%% Cell type:code id:51040e42 tags: %% Cell type:code id:51040e42 tags:
   
``` python ``` python
with open("./tutorial_files/tutorial_project/Coordinates/deepof_tutorial_exp_conds.pkl", "rb") as handle: with open("./tutorial_files/tutorial_project/Coordinates/deepof_tutorial_exp_conds.pkl", "rb") as handle:
exp_conds = pickle.load(handle) exp_conds = pickle.load(handle)
   
my_deepof_project._exp_conditions = exp_conds my_deepof_project._exp_conditions = exp_conds
``` ```
   
%% Cell type:markdown id:dced0767 tags: %% Cell type:markdown id:dced0767 tags:
   
By setting the _exp_conditions attribute in the Coordinates object, we can now have access to experimental information on the provided mice. Let's explore what's in there with the .get_exp_conditions property: By setting the _exp_conditions attribute in the Coordinates object, we can now have access to experimental information on the provided mice. Let's explore what's in there with the .get_exp_conditions property:
   
%% Cell type:code id:a0da64d3 tags: %% Cell type:code id:a0da64d3 tags:
   
``` python ``` python
print(my_deepof_project.get_exp_conditions) print(my_deepof_project.get_exp_conditions)
``` ```
   
%% Output %% Output
   
{'20191204_Day2_SI_JB08_Test_54': CSDS {'20191204_Day2_SI_JB08_Test_54': CSDS
0 Nonstressed, '20191204_Day2_SI_JB08_Test_56': CSDS 0 Nonstressed, '20191204_Day2_SI_JB08_Test_56': CSDS
0 Stressed, '20191204_Day2_SI_JB08_Test_61': CSDS 0 Stressed, '20191204_Day2_SI_JB08_Test_61': CSDS
0 Stressed, '20191204_Day2_SI_JB08_Test_62': CSDS 0 Stressed, '20191204_Day2_SI_JB08_Test_62': CSDS
0 Stressed, '20191204_Day2_SI_JB08_Test_63': CSDS 0 Stressed, '20191204_Day2_SI_JB08_Test_63': CSDS
0 Nonstressed, '20191204_Day2_SI_JB08_Test_64': CSDS 0 Nonstressed, '20191204_Day2_SI_JB08_Test_64': CSDS
0 Nonstressed} 0 Nonstressed}
   
%% Cell type:markdown id:d79d3214 tags: %% Cell type:markdown id:d79d3214 tags:
   
Note that each value is a data frame with a single row, where each column refers to an experimental trait. Adding more columns would allow DeepOF to compare more metadata on the animals (such as sex, strain, etc.). Note that each value is a data frame with a single row, where each column refers to an experimental trait. Adding more columns would allow DeepOF to compare more metadata on the animals (such as sex, strain, etc.).
   
%% Cell type:code id:79da9944 tags: %% Cell type:code id:79da9944 tags:
   
``` python ``` python
my_deepof_project.get_exp_conditions['20191204_Day2_SI_JB08_Test_54'] my_deepof_project.get_exp_conditions['20191204_Day2_SI_JB08_Test_54']
``` ```
   
%% Output %% Output
   
CSDS CSDS
0 Nonstressed 0 Nonstressed
   
%% Cell type:markdown id:a2b8650a tags: %% Cell type:markdown id:a2b8650a tags:
   
We can see that, as previously mentioned, there's a dictionary with all animal experiments as keys, and data frames with conditions as values. In this case we only have the CSDS condition, which can take two values ("Nonstressed" and "Stressed"). We also see there are exactly three animals per condition. We can see that, as previously mentioned, there's a dictionary with all animal experiments as keys, and data frames with conditions as values. In this case we only have the CSDS condition, which can take two values ("Nonstressed" and "Stressed"). We also see there are exactly three animals per condition.
   
%% Cell type:markdown id:b7d15f4a tags: %% Cell type:markdown id:b7d15f4a tags:
   
Now that we have a basic understanding of how to create and interact with a project, let's show some plots! Now that we have a basic understanding of how to create and interact with a project, let's show some plots!
   
%% Cell type:markdown id:95b88fbd tags: %% Cell type:markdown id:95b88fbd tags:
   
### Basic visual exploration ### Basic visual exploration
   
%% Cell type:markdown id:5540f140 tags: %% Cell type:markdown id:5540f140 tags:
   
Let's first see some basic heatmaps per condition. All plotting functions within DeepOF are hosted in the deepof.visuals module. Among many other things, we can plot average heatmaps per experimental condition! Let's see if we can visualize ant interesting patterns on the available data: Let's first see some basic heatmaps per condition. All plotting functions within DeepOF are hosted in the deepof.visuals module. Among many other things, we can plot average heatmaps per experimental condition! Let's see if we can visualize ant interesting patterns on the available data:
   
%% Cell type:code id:69d82405 tags: %% Cell type:code id:69d82405 tags:
   
``` python ``` python
sns.set_context("notebook") sns.set_context("notebook")
   
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(12, 6)) fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(12, 6))
   
deepof.visuals.plot_heatmaps( deepof.visuals.plot_heatmaps(
my_deepof_project, my_deepof_project,
["B_Nose"], ["B_Nose"],
center="arena", center="arena",
exp_condition="CSDS", exp_condition="CSDS",
condition_value="Nonstressed", condition_value="Nonstressed",
ax=ax1, ax=ax1,
show=False, show=False,
display_arena=True, display_arena=True,
experiment_id="average", experiment_id="average",
) )
   
deepof.visuals.plot_heatmaps( deepof.visuals.plot_heatmaps(
my_deepof_project, my_deepof_project,
["B_Nose"], ["B_Nose"],
center="arena", center="arena",
exp_condition="CSDS", exp_condition="CSDS",
condition_value="Stressed", condition_value="Stressed",
ax=ax2, ax=ax2,
show=False, show=False,
display_arena=True, display_arena=True,
experiment_id="average", experiment_id="average",
) )
   
plt.tight_layout() plt.tight_layout()
plt.show() plt.show()
``` ```
   
%% Output %% Output
   
   
%% Cell type:markdown id:3dc2a2e5 tags: %% Cell type:markdown id:3dc2a2e5 tags:
   
It seems stressed animals spend more time closer to the walls of the arena, and less time in the center! For details on how deepof.visuals.plot_heatmap() works, feel free to check the full API reference or the function docstring. It seems stressed animals spend more time closer to the walls of the arena, and less time in the center! For details on how deepof.visuals.plot_heatmap() works, feel free to check the full API reference or the function docstring.
   
%% Cell type:markdown id:4c301645 tags: %% Cell type:markdown id:4c301645 tags:
   
Finally, let's create an animated video showing our newly preprocessed data. DeepOF can produce reconstructions of the tracks and show them as videos. All animals and the arena are displayed by default. This is particularly useful when interpreting clusters and visualizing embeddings in the unsupervised pipeline, as we'll see in a later turorial. Finally, let's create an animated video showing our newly preprocessed data. DeepOF can produce reconstructions of the tracks and show them as videos. All animals and the arena are displayed by default. This is particularly useful when interpreting clusters and visualizing embeddings in the unsupervised pipeline, as we'll see in a later turorial.
   
%% Cell type:code id:b0f13977 tags: %% Cell type:code id:b0f13977 tags:
   
``` python ``` python
from IPython import display from IPython import display
   
video = deepof.visuals.animate_skeleton( video = deepof.visuals.animate_skeleton(
my_deepof_project, my_deepof_project,
experiment_id="20191204_Day2_SI_JB08_Test_54", experiment_id="20191204_Day2_SI_JB08_Test_54",
frame_limit=500, frame_limit=500,
dpi=60, dpi=60,
) )
   
html = display.HTML(video) html = display.HTML(video)
display.display(html) display.display(html)
plt.close() plt.close()
``` ```
   
%% Output %% Output
   
   
%% Cell type:markdown id:8ded862f tags: %% Cell type:markdown id:8ded862f tags:
   
### What's next ### What's next
   
%% Cell type:markdown id:d4f08308 tags: %% Cell type:markdown id:d4f08308 tags:
   
That's it for this tutorial. [Next](https://deepof.readthedocs.io/en/latest/tutorial_notebooks/deepof_supervised_tutorial.html), we'll see how to run a supervised annotation pipeline with pretrained models! That's it for this tutorial. [Next](https://deepof.readthedocs.io/en/latest/tutorial_notebooks/deepof_supervised_tutorial.html), we'll see how to run a supervised annotation pipeline with pretrained models!
......
Source diff could not be displayed: it is too large. Options to address this: view the blob.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment