What’s new#
v0.4.6#
Bug fixes#
Fix
frites.conn.conn_spec()in multitaper mode : the cross- and auto-spectra are now averaged over tapers (the complex coefficients used to be averaged before, cancelling most of the signal). Coherence and PLV values change for every multitaper user (brainets/frites#69)Fix the hanning smoothing kernel of
frites.conn.conn_spec()(sm_timesof 2 samples gave a NaN output, 3 samples no smoothing) (brainets/frites#69)The cross-spectrum (
metric='sxy') offrites.conn.conn_spec()is now complex (the imaginary part used to be silently dropped) (brainets/frites#69)frites.conn.conn_spec()setszero_mean=Falseexplicitly in the time-frequency decomposition : mne changed its default toTrue, which silently changed the results between mne versions (brainets/frites#70)frites.set_mpl_style()no longer depends onpkg_resources(absent from Python >= 3.12 environments) (brainets/frites#70)Remove the
np.in1dcompatibility shim added in v0.4.5 : no supported mne release usesnp.in1dand the shim modified the NumPy namespace globallyfrites.stats.trial_swap_surrogates()ignored itsrandom_state(the trials were shuffled with the global random generator) ; surrogates are now reproducibleNew
random_stateparameter forfrites.simulations.sim_local_ccd_ms()(the conditions were drawn from the global random generator)The copula normalization (
frites.core.copnorm_nd()and the GCMI estimators built on it) now raises aValueErroron NaN values instead of silently ranking them and returning a finite, meaningless mutual informationfrites.workflow.WfMiandfrites.workflow.WfConnComodraise an explicitValueErrorwhenn_perm=0is combined with a permutation-based correction (used to fail with a bareAssertionError) ; usemcp='noperm'to only compute the mutual informationfrites.conn.conn_reshape_undirected()andfrites.conn.conn_reshape_directed()no longer rely on deprecated xarray behaviours (xr.concatdefaultcoordsand implicitpandas.MultiIndexpromotion) that were about to change their resultsfrites.conn.conn_spec()no longer parallelizes both the time-frequency decomposition and the loop over pairs (nested parallelism oversubscribed the CPU with the defaultn_jobs=-1)frites.plot.plot_conn_circle()usesColormap.with_extremes(set_badis pending deprecation in matplotlib)
Dependencies#
Python >= 3.10 is now required (
python_requires) ; the continuous integration matrix moved from Python 3.8/3.9 to 3.10/3.11/3.12Tested against mne 1.5 up to 1.13 (mne >= 1.13 requires Python >= 3.11) and NumPy 2.x up to 2.5
Documentation build :
sphinxcontrib-bibtex >= 2.6andsphinx >= 7.4(brainets/frites#70)xarray >= 2023.8(xarray.Coordinates.from_pandas_multiindex)
v0.4.5#
Bug fixes#
Compatibility with NumPy 2 (brainets/frites, brainets/frites)
Support mne-python versions newer than 1.5.0, up to the current release (brainets/frites)
Restore a compatibility shim so mne keeps working with NumPy >= 2.4, which removed
np.in1dwhile mne still relies on it internally (brainets/frites)Fix type comparison in
frites.dataset.ds_utils.multi_to_uni_conditions()and infrites.plot.plot_conn_circle()(brainets/frites)
v0.4.4#
New Features#
Functions
frites.conn.conn_reshape_undirected()andfrites.conn.conn_reshape_directed()now supports multidimensional arrays (brainets/frites)New function
frites.core.ent_nd_g()to compute entropy on tensors (brainets/frites)New function
frites.conn.conn_ii()to estimate the interaction information (brainets/frites)New function
frites.conn.conn_pid()to estimate the partial information decomposition (brainets/frites)New function
frites.conn.conn_fit()to estimate the feature specific information transfer (brainets/frites#59) - aopy
Bug fixes#
Base 2
frites.core.ent_nd_g()(brainets/frites)
v0.4.3#
New Features#
frites.conn.conn_links()now accepts to use brain region names as source or target seeds (brainets/frites)New function
frites.stats.confidence_interval()for computing confidence intervals, standard deviation (sd) and standard error on the mean (sem) on numpy arrays and xarray DataArray (brainets/frites)New plotting module with two functions for plotting connectivity matrices,
frites.plot.plot_conn_heatmap()andfrites.plot.plot_conn_circle()(brainets/frites, brainets/frites, brainets/frites, brainets/frites)Add the possibility to control the node’s size in
frites.plot.plot_conn_circle()(brainets/frites)Add support for signed connectivity and improve node control of
frites.plot.plot_conn_circle()(brainets/frites)
Bug fixes#
Fix parallel computing of
frites.conn.conn_covgc()(brainets/frites)Use linearly spaced indices instead of closest time points in
frites.conn.define_windows()(brainets/frites)frites.conn.conn_spec()average over tapers after computing connectivity metric (brainets/frites).Thanks to adam2392 and ruuskas from the mne-connectivity package.
v0.4.2#
New Features#
New function
frites.simulations.sim_ground_truth()for simulating spatio-temporal ground-truths (brainets/frites)New function
frites.conn.conn_spec()for computing the single-trial spectral connectivity (brainets/frites) - ViniciusLima94New method
frites.workflow.WfMi.confidence_intervalmethod to estimate the confidence interval (brainets/frites, brainets/frites, brainets/frites, brainets/frites)New function
frites.conn.conn_net()for computing the net connectivity (brainets/frites)New function
frites.set_mpl_style()for example stylesNew function
frites.conn.conn_links()for generating connectivity links (brainets/frites)New function
frites.utils.downsample()for down-sampling DataArray (brainets/frites)frites.estimator.CorrEstimatorcan no be defined with Pearson or Spearman correlation with both vector or tensor-based implementations (brainets/frites)frites.workflow.WfStatsnow allows to pass rfx_center parameter for controlling whether effect-sizes should be centered and rfx_sigma for the hat correction (brainets/frites)frites.conn.conn_links()can now be used for selecting intra and / or inter-hemispheric connections (brainets/frites)frites.conn.conn_links()allows selecting links with inter / intra / both roi connections (brainets/frites)
Internal changes#
Do not allow anymore to add new keys to the CONFIG dict (brainets/frites)
v0.4.1#
New Features#
New
frites.estimator.CustomEstimatorfor defining custom estimators (brainets/frites, brainets/frites)New function
frites.conn.conn_fcd_corr()for computing the temporal correlation across networks (brainets/frites)New function
frites.utils.acf()for computing the auto-correlation (brainets/frites)New function
frites.conn.conn_ccf()for computing the cross-correlation (brainets/frites)
Bug fixes#
Fix attribute conversion in connectivity functions (brainets/frites)
v0.4.0#
New Features#
New estimators (
frites.estimator.CorrEstimator,frites.estimator.DcorrEstimator) for continuous / continuous relationships (brainets/frites, brainets/frites, brainets/frites)frites.conn.conn_dfc()supports passing other estimators (brainets/frites)frites.utils.time_to_sample()andfrites.utils.get_closest_sample()conversion functions (brainets/frites)frites.conn.conn_ravel_directed()reshaping function (brainets/frites)New
frites.workflow.WfMi.copyfor internal workflow copy (brainets/frites, brainets/frites)New
frites.workflow.WfMiCombineand example class for combining workflows (brainets/frites)New
frites.estimator.ResamplingEstimatortrial-resampling estimator (brainets/frites)
Bug fixes#
Fix
frites.workflow.WfMi.get_paramswhen returning a single output (brainets/frites)Improve attributes conversion for saving netcdf files (bool and dict) (brainets/frites, brainets/frites)
Fix Numpy np.float and np.int warnings related (brainets/frites, brainets/frites, brainets/frites)
v0.3.9#
New Features#
frites.conn.conn_dfc()supports multivariate data + improve computing efficiency (brainets/frites, brainets/frites)Reshaping connectivity arrays support elements on the diagonal + internal drop of duplicated elements (brainets/frites)
frites.conn.conn_dfc()supports better channel aggregation (brainets/frites)
Internal Changes#
Connectivity metric now use the
frites.dataset.SubjectEphyfor internal conversion of the input datafrites.workflow.WfMi.get_paramsreturns single-subject MI and permutations with dimension name ‘subject’ (instead of subjects) (brainets/frites)All connectivity metrics now use
frites.conn.conn_io()to convert inputs into a similar formatImprove CI
Bug fixes#
Fix
frites.dataset.SubjectEphywhen the data contains a single time point (brainets/frites)Fix attributes of
frites.conn.conn_covgc()(brainets/frites)Fix
frites.dataset.DatasetEphyrepresentation without data copy + html representation (brainets/frites, brainets/frites#16)Fix passing tail input to the
frites.workflow.WfMi(brainets/frites)
v0.3.8#
New Features#
new
frites.io.Attributesclass for managing and printing datasets’ and workflow’s attributes (brainets/frites)new
frites.dataset.SubjectEphysingle-subject container (brainets/frites)new estimators of mutual-information,
frites.estimator.GCMIEstimator(brainets/frites, brainets/frites, brainets/frites, brainets/frites),frites.estimator.BinMIEstimator(brainets/frites)new kernel smoothing function
frites.utils.kernel_smoothing()
Internal Changes#
Removed files (brainets/frites, brainets/frites, brainets/frites)
frites.dataset.DatasetEphydon’t perform internal data copy when getting the data in a specific ROI (brainets/frites)Compatibility of MI estimators with workflows (brainets/frites, brainets/frites)
Improve the way to manage pairs of brain regions (brainets/frites, brainets/frites, brainets/frites, brainets/frites)
Breaking changes#
frites.dataset.SubjectEphyandfrites.dataset.DatasetEphyto specify whether channels should be aggregated (default agg_ch=True) or not (agg=False) when computing MI. The agg_ch replace sub_roi (brainets/frites)The workflow WfComod has been renamed
frites.workflow.WfConnComod(brainets/frites)
Bug fixes#
Bug fixing according to the new version of
frites.dataset.DatasetEphy(brainets/frites, brainets/frites, brainets/frites, brainets/frites, brainets/frites, brainets/frites, brainets/frites, brainets/frites)
v0.3.6#
New Features#
frites.dataset.DatasetEphysupport multi-level anatomical informations (brainets/frites)
Internal Changes#
Connectivity functions have a better support of Xarray inputs (brainets/frites, brainets/frites, brainets/frites, brainets/frites)
Replace every string comparison ‘is’ with ‘==’ to test the content (brainets/frites)
v0.3.5#
New Features#
New function for reshaping undirected connectivity arrays (like DFC)
frites.conn.conn_reshape_undirected()(brainets/frites, brainets/frites)New function
frites.utils.savgol_filter()that works on DataArray (brainets/frites)New function for reshaping directed connectivity arrays (like COVGC)
frites.conn.conn_reshape_directed()(brainets/frites)New method
frites.workflow.WfMi.get_paramsin order to get the internal arrays formatted as DataArray (brainets/frites)Integration of MNE’s progress bar (brainets/frites, brainets/frites, brainets/frites)
Possibility to cache computations in the parallel function
Internal Changes#
DataArray now contain a name such as a type to make it clear what is it (brainets/frites)
sigma parameter when performing the t-test can be changed though the CONFIG file (brainets/frites)
Bug fixes#
Fix ttested attribute when saving (brainets/frites)
Fix computing the sigma across all ROI since it uses the maximum over every axes (brainets/frites)
Fix high RAM consumption when computing the pop_mean_surr (brainets/frites)
v0.3.4#
Bug fixes#
Fix
frites.workflow.WfMi.conjunction_analysisfor seeg data (brainets/frites)
Breaking changes#
Xarray is now the default output type as it supports the definition of multi-dimensional containers with label to each coordinates (brainets/frites) + illustrating examples of how to use xarray (brainets/frites)
Every connectivity measures have been moved to frites.conn (brainets/frites)
Deep support for correcting for multiple-comparisons using multi-dimensional data (brainets/frites, brainets/frites) + support for
frites.workflow.WfStatsEphy(brainets/frites) + support forfrites.dataset.DatasetEphy(brainets/frites) + support forfrites.workflow.WfMi(brainets/frites)
New Features#
New class
frites.simulations.StimSpecARfor generating Auto-Regressive Models (brainets/frites, brainets/frites)Conditional Covariance based Granger Causality + example (brainets/frites)
Internal Changes#
Improve testings (brainets/frites)
v0.3.3#
Internal Changes#
frites.workflow.WfFitandfrites.workflow.WfConnare now usingfrites.dataset.DatasetEphy.get_connectivity_pairs(brainets/frites)Improve warning messages + assert error for negative determinant for
frites.core.covgc
New Features#
New method
frites.dataset.DatasetEphy.get_connectivity_pairsin order to get possible connectivity pairs (brainets/frites)New function
frites.utils.define_windows()andfrites.utils.plot_windows()in order to generate and plot slicing windows + tests + example (brainets/frites)New function for computing the DFC
frites.core.dfc_gc(brainets/frites)When using DataArray with
frites.core.dfc_gcandfrites.core.covgc, temporal attributes are added (brainets/frites, brainets/frites)New function for computing the covgc
frites.core.covgc(brainets/frites)Step parameter for
frites.core.covgc(brainets/frites)frites.core.covgccan no be computed using Gaussian-Copula (brainets/frites)Add
frites.workflow.WfMi.conjunction_analysisfor performing conjunction analysis + example (brainets/frites)
Bug fixes#
Fix when data contains a single time point (brainets/frites)
Fix mi model and mixture (1d only) (brainets/frites)
v0.3.2#
Breaking changes#
Avoid duplicates dataset construction when using MNE / xarray (brainets/frites, brainets/frites)
frites.dataset.DatasetEphysupports None for the y input (brainets/frites)
Internal Changes#
Dtypes of y and z inputs are systematically check in
frites.dataset.DatasetEphyin order to define which MI can then be computed (brainets/frites)
New Features#
frites.dataset.DatasetEphysupports Xarray inputs + selection though coordinates (brainets/frites)New workflow for computing pairwise connectivity
frites.workflow.WfConn(brainets/frites)
Documentation#
Adding new examples for creating datasets (brainets/frites)
v0.3.1#
Breaking changes#
change
frites.workflow.WfFitinput directed for net (brainets/frites, brainets/frites#1)The GCRN is automatically defined (per subject when RFX / across subjects when FFX) (brainets/frites)
Remove the level input parameter + only mcp is used + only maxstat when performing cluster based (brainets/frites)
New Features#
frites.dataset.DatasetEphysupport spatio-temporal slicing (brainets/frites), resampling (brainets/frites) and savitzki-golay filter (brainets/frites)Support setting random_state in
frites.workflow.WfMiandfrites.workflow.WfFit(brainets/frites)DataArray outputs contains attributes that reflect the configuration of the workflow (brainets/frites)
Bug fixes#
Fix multi-sites concatenation (brainets/frites) in
frites.dataset.DatasetEphyFix p-values to zeros in
frites.workflow.WfFit(brainets/frites)Fix FIT outputs for 3D arrays and DataArray (brainets/frites)
Internal Changes#
Remap multiple conditions when integers (brainets/frites) in
frites.dataset.DatasetEphyWorkflows now have an internal configuration (brainets/frites)
Documentation#
Reformat examples gallery (brainets/frites)