This repository is related to the paper by "Ensemble dynamics and information flow deduction from whole-brain imaging data" by Toyoshima et al (2024), (doi://10.1371/journal.pcbi.1011848). Please cite this paper if you use the codes and resources. The dataset and resources relevant to this code will be found in the figshare repository (doi://10.6084/m9.figshare.21968078) and (doi://10.6084/m9.figshare.24623805).