Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
bc2a298
don't include docs and .github in sdist
emiddell Jun 24, 2025
59362d8
Describe version updates in installation docs
emiddell Jun 24, 2025
825fbb4
fix pmcx version inconsistency and update docs to use pip --no-deps
emiddell Jun 25, 2025
b21a3f0
refactor stacking/unstacking, handling of affected additional coordin…
emiddell Jun 27, 2025
1b0ec31
change x-coordinates from LAS to RAS coordinate system (#110)
harmening Jul 15, 2025
c62e26e
better normal estimiation in plots.OptodeSelector and less constraine…
emiddell Jul 16, 2025
ce4ef0f
keep OptodeSelector.points quantified
emiddell Jul 16, 2025
0da1993
linking multimodal signal decomposition methods from the docs
emiddell Jul 18, 2025
ce4b642
added some references to method docstrings
avolu Jul 18, 2025
630241e
Fixed a bug in motion_correct_wavelet affecting the selection of coef…
emiddell Jul 21, 2025
ac12bb2
added PR #110 to CHANGELOG
emiddell Jul 21, 2025
43f1866
renamed several artifact correction methods from motion_correct.motio…
emiddell Jul 22, 2025
6a67304
bugfix in test_load_tsv_missing_columns
emiddell Jul 22, 2025
1e5c6da
updated motion correction unit tests
emiddell Jul 25, 2025
3048ea6
fix first sample in sci and psp
emiddell Jul 25, 2025
e8c4931
added plots.segmented_cmap and addressed linter complaints
emiddell Jul 25, 2025
8967379
try to address SVD error in savgol_filter on Windows
emiddell Jul 25, 2025
f5444d5
fallback to lower poly order when SVD in savgol_filter does not converge
emiddell Jul 25, 2025
c923194
catch NaNs before applying savgol_filter
emiddell Jul 25, 2025
96b3506
support in scalp plot for centering the value range extending the col…
emiddell Jul 25, 2025
599d1f7
added legendre polynomial and cosine drift regressors
emiddell Jul 25, 2025
885b396
provide a working template for cedalion/_version.py
emiddell Aug 4, 2025
61ab02e
Added example notebook for ICA ERBM (#112)
jackybehrendt12 Aug 4, 2025
01e01db
minor addition to scalp_plot() in plots.py (#113)
dboas Aug 4, 2025
2aa6b7e
update repair amp
bilal-siddique6 Aug 6, 2025
1a30888
revised NaN sample replacement in repair amp
bilal-siddique6 Aug 7, 2025
9b82770
revised NaN val replacement
bilal-siddique6 Aug 7, 2025
f60c9e8
revised NaN value replacement
bilal-siddique6 Aug 7, 2025
4755c9b
Merge pull request #114 from ibs-lab/dev-bilal
avolu Aug 8, 2025
b3ad819
support reading snirf files from Kernel's moments pipeline
emiddell Aug 18, 2025
55ee09f
Merge pull request #117 from ibs-lab/read_kernel_snirf
avolu Aug 19, 2025
cbd8c88
Update references.bib
avolu Aug 30, 2025
96c1c1a
Bugfix in AR-IRLS
emiddell Sep 13, 2025
7febd56
more prominent reload message in colab_setup.py
emiddell Sep 13, 2025
80d9fdd
remove unused function cedalion.plots._robust_scalp_plot
emiddell Sep 14, 2025
5b2adc3
minor edits in the image reconstruction example
emiddell Sep 14, 2025
bf57d8a
fix displaying of gifs in rendered notebooks
emiddell Sep 14, 2025
5c996d2
fixes for reference list and citations within notebooks
emiddell Sep 14, 2025
eef151f
revised README, install and colab instructions
emiddell Sep 14, 2025
9ea01e7
revised test_installation notebook
emiddell Sep 15, 2025
bd093d4
link to examples/00_test_installation.ipynb in installation instructions
emiddell Sep 15, 2025
2682a1e
several changes on example notebooks
emiddell Sep 17, 2025
aa4af34
add colab cells to new notebooks
emiddell Sep 17, 2025
9fb567e
remove autoreload as it doesn't work on colab
emiddell Sep 17, 2025
070bd38
minor fixes in 25_intro_quality_workshop.ipynb
emiddell Sep 18, 2025
75ac8f9
Snirf2bids creating metadata (#83)
shakiba93 Sep 22, 2025
ca63286
interim fix to pyproject.toml to use unreleased snirf2bids also on colab
emiddell Sep 23, 2025
805b79d
added snirf2bids example dataset and tree command
emiddell Sep 23, 2025
b04def8
replace tree with seedir
emiddell Sep 23, 2025
f082cd4
added a demo mode to snirf2bids notebook that uses an example notebook
emiddell Sep 24, 2025
3a9d091
Merge branch 'dev' into snirf2bids_example_dataset
emiddell Sep 24, 2025
6528f38
moved to io example folder and added to docs makefile
avolu Sep 24, 2025
f4a0854
Merge pull request #125 from ibs-lab/snirf2bids_example_dataset
avolu Sep 24, 2025
2d0c95b
fix json rendering in nbsphinx
emiddell Sep 24, 2025
e1e78ef
Merge branch 'snirf2bids_example_dataset' into dev
emiddell Sep 24, 2025
adbcb6d
retain samples coordinate in physio.global_component_subtract for k=0
emiddell Sep 29, 2025
b4c3f6a
tests for sigproc.global_component_subtract
emiddell Sep 29, 2025
e9c040d
postpone evaluation of annotations
emiddell Sep 29, 2025
c14d81e
update MRIsegmentation markdown with recent changes in Nils MRIsegmen…
harmening Oct 2, 2025
8fa0e70
fix parcellation plot issue
shakiba93 Oct 14, 2025
a918a54
clear outputs
shakiba93 Oct 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright 2024 The Cedalion Developers
Copyright 2024-2025 The Cedalion Developers

Permission is hereby granted, free of charge, to any person obtaining a copy of this
software and associated documentation files (the “Software”), to deal in the Software
Expand Down
78 changes: 31 additions & 47 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,58 +1,42 @@
# Cedalion - fNIRS analysis toolbox

A python-based framework for the data-driven analysis of multimodal fNIRS and DOT in naturalistic environments. Developed by the [Intelligent Biomedical Sensing (IBS) Lab](https://ibs-lab.com/) with and for the community.

<p align="center">
<img src="docs/img/IBS_clr_small.png" />
<img src="docs/img/cedalion_frontpage.png" />
</p>

# cedalion - fNIRS analysis toolbox

To avoid misinterpretations and to facilitate studies in naturalistic environments, fNIRS measurements will increasingly be combined with recordings from physiological sensors and other neuroimaging modalities.
The aim of this toolbox is to facilitate this kind of analyses, i.e. it should allow the easy integration of machine learning techniques and provide unsupervised decomposition techniques for
multimodal fNIRS signals.

## Documentation

The [documentation](https://doc.ibs.tu-berlin.de/cedalion/doc/dev) contains
[installation instructions](https://doc.ibs.tu-berlin.de/cedalion/doc/dev/getting_started/installation.html) as
well as several [example notebooks](https://doc.ibs.tu-berlin.de/cedalion/doc/dev/examples.html)
that illustrate the functionality of the toolbox.
For discussions and help you can visit the [cedalion forum on openfnirs.org](https://openfnirs.org/community/cedalion/)


## Development environment

To create a conda environment with the necessary dependencies run:

```
$ conda env create -n cedalion -f environment_dev.yml
```

Afterwards activate the environment and add an editable install of `cedalion` to it:
```
$ conda activate cedalion
$ pip install -e .
$ bash install_nirfaster.sh CPU # or GPU
```

This will also install Jupyter Notebook to run the example notebooks.

If conda is too slow consider using the faster drop-in replacement [mamba](https://mamba.readthedocs.io/en/latest/).
If you have Miniconda or Anaconda you can install mamba with:
'''
$ conda install mamba -c conda-forge
'''
and then create the environment with
```
$ mamba env create -n cedalion -f environment_dev.yml
```
Please note: If this does not socceed there is another route to go:
Install the libmamba solver
'''
$ conda install -n base conda-libmamba-solver
'''
and then build the environment with the --solver=libmamba
```
$ conda env create -n cedalion -f environment_dev.yml --solver=libmamba
```
[installation instructions](https://doc.ibs.tu-berlin.de/cedalion/doc/dev/getting_started/installation.html), an [API reference](https://doc.ibs.tu-berlin.de/cedalion/doc/dev/api/modules.html) as
well as many [example notebooks](https://doc.ibs.tu-berlin.de/cedalion/doc/dev/examples.html) that illustrate the functionality of the toolbox.



## Installation

Please refer to the [installation instructions](https://doc.ibs.tu-berlin.de/cedalion/doc/dev/getting_started/installation.html) in the documentation for installing Cedalion
on you computer.

To test the [example notebooks](https://doc.ibs.tu-berlin.de/cedalion/doc/dev/examples.html) without installing Cedalion locally, you can also [run the notebooks on Google Colab](https://doc.ibs.tu-berlin.de/cedalion/doc/dev/getting_started/colab_setup.html).

## Versions
The `main` branch acts as a relase branch, i.e. the latest commit there is the most
current release. Development happens in the `dev` branch. Please refer to the [CHANGELOG](https://doc.ibs.tu-berlin.de/cedalion/doc/dev/CHANGELOG.html) for a release
history and current differences between the `dev` and `main` branches.


## Forum

For discussions and help please visit the [Cedalion forum on openfnirs.org](https://openfnirs.org/community/cedalion/)


## How to cite Cedalion
A paper for the toolbox is currently in the making. If you use this toolbox for a publication in the meantime, please cite us using GitHub's "Cite this repository" feature in the "About" section. If you want to contact us or learn more about the IBS-Lab please go to https://www.ibs-lab.com/


## License

Cedalion is licensed under the MIT license.
24 changes: 24 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
# Changelog

## Unreleased changes (available on the `dev` branch)

### Added
- An example notebook for ICA source extraction was added, by [Jacqueline Behrendt](https://github.com/jackybehrendt12).
([#112](https://github.com/ibs-lab/cedalion/pull/112))
### Changed
- The ninja HD and UHD cap coordinates were changed from a right-handed to a left-handed
coordinate system, by [Nils Harmening](https://github.com/harmening). ([#110](https://github.com/ibs-lab/cedalion/pull/110))
- Changed the names of several motion correction algorithms from `motion_correct.motion_correct_X`
to `motion_correct.X`. Argument names were made PEP8 compliant. The example `22_motion_artefacts_and_correction` was improved. By [Eike Middell](https://github.com/emiddell).


### Deprecated
### Removed
### Fixed

- Fixed a bug in motion_correct_wavelet affecting the selection of coefficients for IQR-based thresholding. The issue caused unintended suppression of high-frequency components, particularly near the end of recordings. Changed by [Eike Middell](https://github.com/emiddell).
- Fixed a bug in the stopping criterion of motion_correct.pca_recurse caused by an inverted
boolean mask of motion artifacts, by [Eike Middell](https://github.com/emiddell).
- Fixed an issue with constant regressors when fitting a GLM using the AR-IRLS method. The autoregressive filter used to
account for serial correlations was not properly applied to them. The fix ignores samples at the beginning of the time
series until the filter is initialized, by [Eike Middell](https://github.com/emiddell).


## Version 25.1.0 (2025-06-22)

All dependencies have been updated to recent versions. Please rebuild the environment.
Expand Down
20 changes: 0 additions & 20 deletions docs/LICENSE.md

This file was deleted.

4 changes: 4 additions & 0 deletions docs/_static/css/rtd_fixes.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@ ul.xr-var-list li.xr-var-item label {
margin-top: 2px !important;
margin-bottom: 2px !important;
}

div.citation .label {
width: 5em;
}
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

project = "cedalion"
copyright = "2024, the cedalion developers"
author = "the cedalion developers"
copyright = "2024-2025, the Cedalion developers"
author = "the Cedalion developers"

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
Expand Down
1 change: 1 addition & 0 deletions docs/data_io/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,5 @@ Examples
../examples/getting_started_io/10_xarray_datastructs_fnirs.ipynb
../examples/getting_started_io/11_recording_container.ipynb
../examples/getting_started_io/13_data_structures_intro.ipynb
../examples/getting_started_io/14_snirf2bids.ipynb
../examples/getting_started_io/34_store_hrfs_in_snirf_file.ipynb
4 changes: 4 additions & 0 deletions docs/examples/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,20 @@ EXAMPLE_NOTEBOOKS = getting_started_io/00_test_installation.ipynb \
getting_started_io/11_recording_container.ipynb \
getting_started_io/13_data_structures_intro.ipynb \
getting_started_io/34_store_hrfs_in_snirf_file.ipynb \
getting_started_io/14_snirf2bids.ipynb \
plots_visualization/12_plots_example.ipynb \
machine_learning/50_finger_tapping_lda_classification.ipynb \
machine_learning/52_ica_erbm_fingertapping_example.ipynb \
modeling/31_glm_basis_functions.ipynb \
modeling/32_glm_fingertapping_example.ipynb \
modeling/33_glm_illustrative_example.ipynb \
modeling/35_statsmodels_overview.ipynb \
modeling/36_glm_workshop.ipynb \
signal_quality/20_scalp_coupling_index.ipynb \
signal_quality/21_data_quality_and_pruning.ipynb \
signal_quality/22_motion_artefacts_and_correction.ipynb \
signal_quality/24_downweighting_noisy_channels.ipynb \
signal_quality/25_intro_quality_workshop.ipynb \
head_models/40_image_reconstruction.ipynb \
head_models/41_photogrammetric_optode_coregistration.ipynb \
head_models/42_1010_system.ipynb \
Expand Down
41 changes: 33 additions & 8 deletions docs/getting_started/colab_setup.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
## Running Notebooks in Google Colab
# Running Notebooks in Google Colab

If you would like to test cedalion before going through the installation process on your local machine, you can run the example notebooks through Google Colab. Note that some cedalion features, such as interactive plotting and visualizations, are currently not working in colab. To use these features, you will need to install cedalion on your local machine.
If you would like to test cedalion before going through the installation process on your local machine, you can run the example notebooks through Google Colab. Note however, that some cedalion features, such as interactive plotting and visualizations, are currently not working in colab. To use these features, you will need to install cedalion on your local machine.

### Setup
## Setup
To run a notebook using Google Colab, follow the steps below. Setup should take less than 5 minutes total.

1. Click the link at the top of an example notebook to open it in Google Colab: [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)]()
1. Click the link at the top right of an example notebook to open it in Google Colab:

[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)]()
2. Run the first cell to install the required dependencies.
- Optional: set options to specify the branch of cedalion to use (--branch).
![Colab Cell](../img/colab/colab_cell.png)
Expand All @@ -15,12 +17,35 @@ To run a notebook using Google Colab, follow the steps below. Setup should take
5. Proceed with the rest of the example notebook.


### Using your own data
## Using your own data

You have two options to use your own data in a colab notebook.

### 1. Upload data directly to the instance

Follow these steps to use your own data in a colab notebook.
![File upload](../img/colab/colab_fileupload.jpg)
1. Click the file icon in the left sidebar.
2. Click the upload icon (page with arrow).
![File upload](../img/colab/colab_fileupload.jpg)
3. Choose the folder/file to upload.
4. Files can now be accessed in the notebook, for example:
![File access](../img/colab/colab_fileaccess.png)
```python
import cedalion.io
rec = cedalion.io.read_snirf("uploaded_file.snirf)
```

5. When the instance is destroyed, uploaded and created files are deleted.



### 2. Use Google Drive
During the execution of the first notebook cell, a connection was created between
your Google Drive and the instance running the notebook. The drive is mounted
under `/content/drive`.

1. Copy files to you Google Drive.
2. Files can now be accessed in the notebook, for example:
```python
import cedalion.io
rec = cedalion.io.read_snirf("/content/drive/path/in/drive/uploaded_file.snirf)
```
3. Results saved to Google Drive persist when the instance is destroyed.
11 changes: 10 additions & 1 deletion docs/getting_started/contributing_code/contributing_code.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,19 @@ how to dormat these docstrings. We will follow the Google style as described in

Please add references to the literature if you are implementing a published algorithm.
There is a global bibtex file under `docs/references.bib` to which reference entries
should be added with a unique bibtex label. Refer to a reference entry with:
should be added with a unique bibtex label. In docstrings cite a reference entry with:
```
:cite:t:`BIBTEXLABEL`
```

In notebooks you can add citations in markdown cells like this:
```
<cite data-cite="Barker2013">(Barker,2013)</cite>
```

If citations do not show correctly in the rendered documentation, check the Sphinx output for errors while parsing `references.bib`. Duplicate or ill-formed entries are
often the culprit.

Further options are documented in the
[sphinxcontrib-bibtex documentation](https://sphinxcontrib-bibtex.readthedocs.io/en/latest/quickstart.html#minimal-example).

Expand Down
Loading
Loading