README.md 3.77 KB
Newer Older
ferrari's avatar
ferrari committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
IPI extractor core
==================

`ipi_extract.py` is a graphic utility made for the manual extraction of sperm whale inter pulse interval (IPI).


Prerequisite
------------
This program use the following libraries (other versions might work):
* numpy              1.16
* matplotlib          3.1
* pandas              0.24
* pydub                0.23
* pysoundfile        0.9
* python               3.6 
* scipy                  1.2

*Note that in order to play the sound signal, pydub requires [additional libraries](https://github.com/jiaaro/pydub#playback)*


Options
-------
There are two ways to set the options. The first way is by setting the option in the command line.
The list of available options can be obtained by typing 
`python ipi_extract.py -h`

If no options are given pass via the command line, then the script will assume that the second way is used.
In that case the script will ask the user the value for each of the option.

e.g. `What is the input file path?`

Usage
-----
![GUI example](gui_example.png "GUI example")

The GUI can be split into three parts. 
At the top a segment of 20ms of sound signal is displayed. 
The middle part is made of three groups of plots.
The button part is made of additional interactive buttons. The code is written in a way that allow the implementation of other widget in script that wwould import this (see [IPI_bombyx.py](IPI_bombyx.py) as an example)

The annotation are saved once the GUI is closed.

###Sectioning clicks
The top part is composed of two arrows and the sound signal. Clicking one of the arrow will translate the signal by 15s in the corresponding direction.
Clicking on the sound signal will select the click that will be analysed. The click selected will be at the maximum near the location clicked (0.1 s).
The click will then be displayed in one of the 3 groups of plots selected by the radio button bellow them.
While hovering above the signal, the cursor will have the color of the selected group.
Clicking on a new click will change the click to be analysed. An already analysed click can be clicked again.

*Note that a click can be assigned to two groups of plots. This currently cause desync in the display of the annotation*

###Assigning labels
Clicking on any of the plot (meaning also in the non-current groups) will update the corresponding values.
Not all plots need to be labeled. Non label plots will have a `nan` value in the database.

####Signal and spectrogram

####Autocorrelation and Cesptrum
These two plots works in the same way. Clicking on them will set the IPI to the clicked location. 
The automatic IPI set is the maximum in a range of 0.15 ms. 

####Reset
Clicking on `Reset current` will set all the annotable values of the current click to `nan`.
###Other functionalities
####resizing
In order to have a responsive GUI, the automatic resizing of the plots have been deactivated
You can click on `resize plot` to have compute one resize for the current layout (takes ~1sec).
####Listsening to the sound
By clicking on `Play current segment`, the sound of the current signal segment will be played.
Note that while the sound is played, the interface becomes irresponsive. 
As stated above, the audio player used by pydub require additional libraries.
If you're using this script on a remote server, the sound might be play over there or not work depending on the method you use to access said server.