A Python tool for converting behavioral annotation data from Drosophila fly videos (annotated via ImageJ) into a structured and analysis-friendly format.
- Converts ImageJ CSV files to structured timeline and event data
- Generates visualizations of grooming events
- Produces summary statistics
- Provides batch processing capabilities
- Python 3.x
- Conda (for environment management)
- Clone this repository
- Create the conda environment: conda env create -f environment.yml
- Activate the environment: conda activate fly_analysis
- Install required packages: conda install pandas numpy matplotlib pytest
Run the script with the following command:
python main.py --input <input_path> --output <output_path> [--total_frames ]
--input: Path to input CSV file or directory containing CSV files (required)--output: Path to output directory for storing results (required)--total_frames: Total number of frames to consider (default: 8999)
python main.py --input data/annotations/ --output results/fly_analysis --total_frames 10000
For each processed file, the following outputs are generated:
- Timeline Table:
<filename>_timeline.csv - Event List:
<filename>_events.csv - Timeline Plot:
<filename>_timeline.png - Box Plot:
<filename>_boxplot.png
Additionally, the tool generates:
- Consolidated summary report
- Error log (if applicable)
Run tests using pytest: