Victor Nozais
email: victor.nozais@gmail.com

Stephanie J Forkel

Chris Foulon

Laurent Petit

Michel Thiebaut De Schotten

Functionnectome: a framework to analyse the contribution of brain circuits to fMRI

In recent years, the field of functional neuroimaging has moved from a pure localisationist approach of isolated functional brain regions to a more integrated view of those regions within functional networks. The methods used to investigate such networks, however, rely on local signals in grey matter and are limited in identifying anatomical circuitries supporting the interaction between brain regions. Mapping the brain circuits mediating the functional signal between brain regions would propel forward our understanding of the brain's functional signatures and dysfunctions. We developed a novel method to unravel the relationship between brain circuits and functions: The Functionnectome. The Functionectome combines the functional signal from fMRI with the anatomy of white matter brain circuits to unlock and chart the first maps of functional white matter. To showcase the versatility of this new method, we provide the first functional white matter maps revealing the joint contribution of connected areas to motor, working memory, and language functions. The Functionnectome comes with an open source companion software and opens new avenues into studying functional networks by applying the method to already existing dataset and beyond task fMRI.

Introduction

Magnetic resonance imaging (MRI) has allowed peering inside the living human brain like never before 1,2, . In particular, functional MRI (fMRI) has allowed the investigation of the brain's dynamic activity, and revealed its functional architecture by contrasting the involvement of regions during tasks [START_REF] Ogawa | Brain magnetic resonance imaging with contrast dependent on blood oxygenation[END_REF] .

While the classical fMRI approach was very fruitful [START_REF] Yarkoni | Largescale automated synthesis of human functional neuroimaging data[END_REF] , the field of functional neuroimaging has recently moved away from a pure localisationist view of activated brain regions towards an interactive network approach identified with functional [START_REF] Biswal | Functional connectivity in the motor cortex of resting human brain using echo-planar mri[END_REF][START_REF] Fox | The human brain is intrinsically organized into dynamic, anticorrelated functional networks[END_REF] and effective connectivity [START_REF] Friston | Functional Connectivity: The Principal-Component Analysis of Large (PET) Data Sets[END_REF] . Functional connectivity consists in the coordinated activity of distant brain regions. The resulting brain maps reveal functional networks across brain regions that work in synchrony. However, functional connectivity does not offer any information about the causal relationship between these regions.

Effective connectivity, on the other hand, uses a model of directional interaction between brain areas unmasking the modulatory effect some areas have on others within a functional cascade. These methods have demonstrated that the brain is functioning as an interconnected unity rather than a fractionated entity. Despite these advancements, both methods are limited in their ability to identify the anatomical circuits supporting the interaction between brain regions. Knowing the underlying structural substrates would be crucial, for instance, when the interaction between regions is significant but might be supported by an indirect anatomical network. This additional knowledge would have far-reaching implications on the functioning of the healthy brain and in the presence of brain damage. The anatomical circuits of the brain support its functioning [START_REF] Thiebaut De Schotten | Rostro-caudal Architecture of the Frontal Lobes in Humans[END_REF] and are responsible for behavioural and cognitive disorders when impaired [START_REF] Thiebaut De Schotten | Direct evidence for a parietal-frontal pathway subserving spatial awareness in humans[END_REF][START_REF] Forkel | Anatomical predictors of aphasia recovery: a tractography study of bilateral perisylvian language networks[END_REF][START_REF] De Groot | Cerebral white matter lesions and subjective cognitive dysfunction: The Rotterdam Scan Study[END_REF] . Historically, in the human brain, the anatomical circuitries have been explored through post-mortem white matter dissection [START_REF] Ludwig | Atlas Cerebri Humani: Der Innere Bau Des Gehirns[END_REF] .

Although dissections have enhanced our understanding of the physical connections between brain regions, its use remains limited as it can only be done in post mortem specimens, and requires laborious and inherently destructive procedures.

Advances in MRI facilitated the study of the in-vivo circuitry of the human brain using diffusion-weighted imaging tractography [START_REF] Jeurissen | Diffusion MRI fiber tractography of the brain[END_REF] . This method captures the local orientation of water diffusion [START_REF] Stejskal | Spin Diffusion Measurements: Spin Echoes in the Presence of a Time-Dependent Field Gradient[END_REF] , which preferentially follows along the direction of axons within the white matter. Tractography can provide an indirect measure of the axonal direction and can reconstruct bundles of axons (i.e. pathways). When applied to the entire brain, whole-brain tractograms can be computed and are commonly referred to as the structural connectome [START_REF] Sporns | Networks of the Brain[END_REF] . This non-invasive in-vivo method has been of tremendeous help in mapping the anatomy of white matter [START_REF] Catani | [END_REF][START_REF] Oishi | MRI Atlas of Human White Matter[END_REF] in healthy populations and has been successfully extended to clinical applications [START_REF] Thiebaut De Schotten | Direct evidence for a parietal-frontal pathway subserving spatial awareness in humans[END_REF][START_REF] Forkel | Anatomical predictors of aphasia recovery: a tractography study of bilateral perisylvian language networks[END_REF][START_REF] Riva-Posse | A connectomic approach for subcallosal cingulate deep brain stimulation surgery: prospective targeting in treatment-resistant depression[END_REF] . While tractography allows us to study the connections between brain regions, it does not inform us about their functions.

Preliminary evidence on the functional roles of white matter connections has thus far been inferred indirectly by mapping functional deficits on the white matter. This is typically achieved by mapping lesions onto the white matter and scrutinising the resulting functional deficits [START_REF] De Schotten | Brain disconnections link structural connectivity with function and behaviour[END_REF] . However, the scope of this approach is limited by the variability of the lesion topology, and the incomplete mapping of the brain areas contributing to function. Therefore, a method that can directly project fMRI on the white matter would be needed to shed light on the functional role of brain circuits.

Here we introduce a novel method and a software: the Functionnectome, that unlocks the function of the white matter. Functional white matter analysis is derived from the combination of task-related functional MRI and new anatomical priors for brain circuits. In doing so, we provide the first functional white matter maps revealing the joint contribution of connected areas to motor, working memory, and language functions. The Functionnectome is available as a companion open-source software (https://github.com/NotaCS/Functionnectome). In fMRI studies, patterns of task-based neural activation are classically derived from the statistical analysis of each voxel's time-course, usually using the general linear model (GLM) with the predicted hemodynamic response from the task. In order to evaluate the participation of white matter pathways in these tasks, we designed a new method, the Functionnectome, which combines the functional signal from distant voxels of the classical fMRI 4D volume (Fig. 1a) using their probabilistic structural relationship given by anatomical priors of the involved brain circuits (Fig. 1b). These priors are probability maps derived from high resolution tractography (Fig. 1d). The resulting 4D volume, a "functionnectome" (Fig. 1c), can then be analysed with the usual statistical tools to reveal the activation patterns emerging from the signal (Fig. 1e). Here, we illustrated this process by applying the Functionnectome to motor (n=46), working memory (n=45), and language (n=44) functional volumes of the test-retest Human Connectome Project (HCP) dataset. Results from the functionnectome maps (a, c) are presented side by side with classical task activation analysis (b, d). The white matter "activations" displayed on the functionnectome zmaps correspond to significant involvement of the associated pathways during the task. The right finger taping Functionnectome analysis (Figure 2a) revealed the wellestablished motor system circuit with significant involvement of the posterior arm of the left internal capsule, connections to subcortical areas and the cerebellum through the brain stem (i.e. pons). This activation was accompanied by an involvement of the frontal aslant tract (FAT) connecting the Supplementary motor area (SMA) with the frontal operculum and short u-shaped fibers around the hand area in the primary motor cortex (M1) [START_REF] Catani | Short frontal lobe connections of the human brain[END_REF] . The joint contribution of both hemispheres to motor execution [START_REF] Perez | Mechanisms Underlying Functional Changes in the Primary Motor Cortex Ipsilateral to an Active Hand[END_REF] was represented by the involvement of the body of the corpus callosum. In contrast, a classical fMRI analysis applied to the same data showed the involvement of the left motor hand area together with the SMA, and striatum as well as the right anterior lobe of the cerebellum (Figure 2b).

Results

Motor tasks

These results were elegantly mirrored by the Functionnectome and activation analyses for the left finger tapping task (Figure 2c-d). Similarly, the right foot motor activation task (clenching toes) Functionnectome analysis revealed the involvement of the frontal aslant tract, the corpus callosum, the internal capsule, and connections through the pons to the cerebellum (Figure 3a).

Classical analyses showed significant activation of the left motor foot area with the SMA, striatum, and right anterior lobe of the cerebellum (Figure 3b).

A left-right flipped pattern of results was observed for the left foot motor task Functionnectome and classical analysis (Figure 3 c andd). Superior Posterior lobe of the Cerebellum.

Visual working memory task

On the Functionnectome analysis maps, the working memory task revealed activation of cortico-cortical circuits necessary for the functional integration of the different involved areas [START_REF] Olesen | Increased prefrontal and parietal activity after training of working memory[END_REF] (Figure 4a). As such, the first and second branches of the superior longitudinal fasciculus (SLF 1, 2) were involved. This dorsal network is linking the superior and middle frontal gyri with the parietal lobe, which are both hubs of the working memory network. Likewise, U-shaped fibers, the frontal aslant tract and the frontal superior longitudinal tract [START_REF] Rojkova | Atlasing the frontal lobe connections and their variability due to age and education: a spherical deconvolution tractography study[END_REF] complete the network by connecting different regions within the frontal cortex and the SMA. We also observed the involvement of the corpus callosum, which facilitates interhemispheric integration required for working memory [START_REF] Blackmon | The corpus callosum and recovery of working memory after epilepsy 23 surgery[END_REF] .

In addition to cortico-cortical pathways, the cortico-ponto-cerebellar tract was also activated and connects the classical fMRI (Figure 4b) fronto-parietal working memory network with the cerebellum. The Functionnectome analysis for a language task (semantic) is displayed in Figure 5a and revealed the involvement of the language "ventral stream". The ventral stream is composed of the uncinate and the inferior fronto-occipital fasciculus connecting the inferior frontal gyrus, and the temporal lobe, and the occipital lobe [START_REF] Almairac | The left inferior fronto-occipital fasciculus subserves language semantics: a multilevel lesion study[END_REF][START_REF] Duffau | New insights into the anatomo-functional connectivity of the semantic system: a study using cortico-subcortical electrostimulations[END_REF] . In addition, the analysis also showed the middle longitudinal fasciculus which links the temporal pole to the inferior parietal lobe [START_REF] Menjot De Champfleur | Middle longitudinal fasciculus delineation within language pathways: A diffusion tensor imaging study in human[END_REF] as well as the posterior segment of the arcuate fasciculus which links posterior temporal regions to the parietal lobe [START_REF] Catani | [END_REF] . Both hemispheres could interact during the task thanks to the involvement of callosal connections. We also observed a significant involvement of the fornix during the task.

Language (semantics)

As expected, the classic fMRI maps displayed activation in the posterior inferior frontal gyrus, the superior temporal gyrus, and the inferior parietal lobe, forming the semantic network [START_REF] Catani | [END_REF][START_REF]Meta-analyzing left hemisphere language areas: Phonology, semantics, and sentence processing[END_REF] . The anterior part of the temporal lobe was activated (Figure 5b), which is in line with the literature highlighting it as a central hub for semantic processing [START_REF] Jackson | The Semantic Network at Work and Rest: Differential Connectivity of Anterior Temporal Lobe Subregions[END_REF] . The orbitofrontal cortex has previously been linked to language and semantic cognition [START_REF] Jackson | The Semantic Network at Work and Rest: Differential Connectivity of Anterior Temporal Lobe Subregions[END_REF] . Lastly, activation of the amygdala, mammillary bodies, and hippocampus reflects the involvement of a limbic network, integrating emotions with semantic memory [START_REF]A revised limbic system model for memory, emotion and behaviour[END_REF] .

For each analysis reported above, we repeated the analysis in a replication dataset of the same participants (same session, opposite phase of acquisition). Table 1 indicates the reproducibility rate of the results . The Functionnectome results were systematically more reproducible (r = 0.82 +/-0.06) than the classical analysis (r = 0.72 +/-0.05).

Motor Memory Language

Right

Discussion

We propose a new method, the Functionnectome, to investigate the functional involvement of brain circuits during task-related cerebral processes. Applying our method to a high-quality functional neuroimaging dataset revealed -for the first time -the white matter circuits supporting motor, working memory, and language activations. Results also indicated a higher reproducibility of the Functionnectome maps compared to classical task-related activation methods suggesting that the functioning of the brain is mediated by interactions via anatomical circuits rather than the isolated contribution of brain regions. To support the broad uptake of this method and facilitate its application to a wide range of datasets, including in the clinic, we provide a GUI and terminal-based companion software. This toolbox allows the implementation of the Functionnectome to any previously acquired fMRI dataset and beyond. While the toolbox is flexible and users can integrate their own priors, the current release and the high quality priors accompanying it open up novel avenues for research on the integrative function of white matter.

Obtaining significant activation of brain circuits with our method requires the functional involvement of the brain areas at both ends of this circuit. As first examples of such functional exploration of white matter, we investigated the brain circuits supporting prominent activation tasks including motor, memory and language functions. Our knowledge of the fine circuitry of the motor system is mostly derived from animal and lesion studies. The Functionnectome applied to motor tasks offer the unique opportunity to explore these circuits in the healthy human brain. In that regard, our findings match the pathways suggested by the literature and were replicated with both hands and feets twice. We confirmed the involvement of the internal capsule, which is a well established [START_REF] Fries | Motor recovery following capsular stroke. Role of descending pathways from multiple motor areas[END_REF] part of the ascending and descending motor pathways that include the cortico-subcortical motor loops [START_REF] Haber | The cortico-basal ganglia integrative network: The role of the thalamus[END_REF][START_REF] Schmahmann | Fiber Pathways of the Brain[END_REF] and the corticocerebellar pathways. The latter has been long known to be part of the motor system [START_REF] Evarts | Motor Mechanisms of the CNS: Cerebrocerebellar Interrelations[END_REF] , with relays in subcortical nuclei, but has never been directly shown before.

The cortico-ponto-cerebellar pathways [START_REF] Ramnani | The primate cortico-cerebellar system: anatomy and function[END_REF] connect the primary motor cortex of one hemisphere with ipsilateral pontine nuclei and the contralateral anterior lobe of the cerebellum, passing through the internal capsule and the pons. The involvement of the corpus callosum in the motor tasks cannot be directly identified with fMRI but has long been considered essential to integrate the left and right motor systems 36,37, .

The Functionnectome maps distinctly isolated these circuits.

Similarly, the patterns of white matter activation from the working memory task confirm and complement the literature. For example, the involvement of the superior longitudinal fasciculus reported with the Functionnectome has been well described [START_REF] Thiebaut De Schotten | Monkey to human comparative anatomy of the frontal lobe association tracts[END_REF] . Our results also confirm the importance of the cerebellum in working memory [START_REF] Ramnani | The primate cortico-cerebellar system: anatomy and function[END_REF][START_REF]Cortico-cerebellar networks for visual attention and working memory[END_REF] but extend this insight by mapping the full circuitry supporting its involvement. Similarly, the fronto-frontal tracts involvement in the working memory Functionnectome supports the hypothesis of the frontal lobe working hierarchically [START_REF] Thiebaut De Schotten | Rostro-caudal Architecture of the Frontal Lobes in Humans[END_REF][START_REF] Catani | Short frontal lobe connections of the human brain[END_REF][START_REF] Badre | Is the rostro-caudal axis of the frontal lobe hierarchical?[END_REF] . Additionally, classical working memory activation tasks [START_REF] Volle | Specific Cerebral Networks for Maintenance and Response Organization within Working Memory as Evidenced by the 'Double Delay/Double Response' Paradigm[END_REF] and clinical studies [START_REF] Blackmon | The corpus callosum and recovery of working memory after epilepsy 23 surgery[END_REF] unveiled the importance of both hemispheres for working memory, but researchers could only speculate about the underlying anatomical circuitry. Here, the Functionnectome revealed the exact portion of the corpus callosum that integrates bilateral contribution to working memory.

The language circuitry, and more so its semantic system, offers an even greater challenge as it cannot be explored in animal studies [START_REF] Duffau | New insights into the anatomo-functional connectivity of the semantic system: a study using cortico-subcortical electrostimulations[END_REF] . The Functionnectome confirmed, for the first time in the healthy human brain, the structural-functional circuitry supporting semantic processes originally suggested by lesion studies [START_REF] Almairac | The left inferior fronto-occipital fasciculus subserves language semantics: a multilevel lesion study[END_REF] or intraoperative stimulation [START_REF] Duffau | New insights into the anatomo-functional connectivity of the semantic system: a study using cortico-subcortical electrostimulations[END_REF] in humans (i.e. the uncinate fasciculus, the inferior frontooccipital fasciculus, the middle longitudinal fasciculus, and the posterior segment of the arcuate fasciculus). The Functionnectome also revealed the involvement of the anterior corpus callosum in story comprehension. Whilst some language processes require the integration of the left and right hemispheres via the posterior corpus callosum [START_REF] Sammler | Prosody meets syntax: the role of the corpus callosum[END_REF] , the anterior corpus callosum has been implicated in semantic disorders (e.g. semantic dementia) [START_REF] Agosta | Language networks in semantic dementia[END_REF] . The Functionnectome result also suggests an involvement of the fornix. As a limbic pathway, it may play an important role in the colouring of the story comprehension with emotions and memories [START_REF]A revised limbic system model for memory, emotion and behaviour[END_REF] . Our results thus prompt a closer inquiry into the role of the anterior corpus callosum and fornix in semantic processes and offer a non-invasive tool to study its involvement in healthy participants. In sum, our application of the Functionnectome to classical fMRI allows the confirmation and the exploration of the involvement of circuits for specific tasks for the first time in the healthy human brain.

As reproducibility of findings is at utmost importance in science [START_REF] Baker | 1,500 scientists lift the lid on reproducibility[END_REF] we verified whether our activation maps were consistent across different acquisitions. The replication of our analysis confirmed the high reproducibility of the results highlighted by our method. Importantly, the Functionnectome results were more reproducible than classical task-related activation methods. While the two methods are not identical and not perfectly comparable with regards to filtering, the observed differences also emerge from the fact that they rely on different assumptions for the assessment of the functioning of the brain. While classical fMRI computes differences between regions of the brain independently, the Functionnectome associates their circuits to brain function. Higher reproducibility for the Functionnectome would then suggest that the functioning of the brain is mediated by interactions via anatomical circuits rather than the isolated contribution of brain regions.

To upscale the validation of this network view of brain functioning, crowdsource analysis of additional data is possible. In this regard, we provide an open-source software that will allow easy application of the Functionnectome method to revisit already acquired fMRI datasets, either private or publicly available (e.g.

HCP [START_REF] Van Essen | The WU-Minn Human Connectome Project: an overview[END_REF] , UK Biobank 46 , ABIDE [START_REF] Martino | The autism brain imaging data exchange: towards a large-scale evaluation of the intrinsic brain architecture in autism[END_REF] ). The use of the Functionnectome is also not bound to the activation paradigm and can be combined with advanced fMRI statistics [START_REF] Friston | Functional Connectivity: The Principal-Component Analysis of Large (PET) Data Sets[END_REF] to reveal the dynamic causal interaction between brain circuits. Additionally, the Functionnectome can leverage the wealth of MRI modalities to explore the involvement of white matter circuits in different aspects of brain dynamics. For example, it could be applied to resting-state functional connectivity or cortical thickness to open up new perspectives in the study of functional synchronisation, cortical changes during development, and brain pathologies.

The Functionnectome is a new and promising method that relies on anatomical priors to determine how to project the functional signal onto the white matter. The current best way to obtain a complete 3D map of the white matter pathways in the living human brain is tractography. Although this method has been successfully applied to explore the relationship between white matter structure, and brain functions and dysfunctions [START_REF] Forkel | Anatomical predictors of aphasia recovery: a tractography study of bilateral perisylvian language networks[END_REF][START_REF] Catani | [END_REF] , tractography is still facing limitations [START_REF] Maier-Hein | The challenge of mapping the human connectome based on diffusion tractography[END_REF] .

Nonetheless, great progress has been made towards the resolution of these problems in the last decade [START_REF] Jeurissen | Diffusion MRI fiber tractography of the brain[END_REF] . Future developments in this area will likely improve upon the quality of current tractograms. These improvements will be implemented in the Functionnectome as priors can easily be replaced (see supplementary material)

in the future to incorporate novel advances in tractography. Similarly, although we provide high-quality anatomical priors based on best white matter mapping derived from the Human Connectome Project 7T [START_REF] Vu | High resolution whole brain diffusion imaging at 7 T for the Human Connectome Project[END_REF] in the software, other research teams are welcome to use homemade priors. Future developments of the priors might include a separation in interhemispheric (i.e. commissural circuits), cortico-subcortical (i.e.

projection circuits) and cortico-cortical connectivity (i.e. association circuits) to better disentangle brain circuitries.

Finally, the computation of the Functionnectome using every brain voxel can be very computationally expensive and thus time-consuming. While we recommend using this procedure, we acknowledge that not all research teams have access to the computing power required to compute the "voxel-wise" Functionnectome of several subjects in a reasonable amount of time. To circumvent this potential constraint, we provide an option within the software allowing the use of an atlas and its parcels instead of all voxels, for a less computationally intensive "region-wise" analysis. The anatomical priors come with this alternative option using the recently published multimodal parcellation atlas [START_REF] Glasser | A multi-modal parcellation of human cerebral cortex[END_REF] , should you choose to use this option (see supplementary materials).

Overall, we introduced and demonstrated the potential of the Functionnectome method, opening the field of in-vivo study of the function of white matter in healthy humans. In this context, the Functionnectome promotes a paradigm shift in the study of the brain, focusing on the interaction of brain regions in the support of a brain function, rather than the fractionated contribution of independent regions.

Methods

The following workflow was summarised in Figure 6.

Datasets

Two datasets derived from the Human Connectome Project [START_REF] Van Essen | The WU-Minn Human Connectome Project: an overview[END_REF]

Acquisition parameters and preprocessing

EPI acquisitions: Full description of the acquisition parameters have been described

elsewhere [START_REF]Pushing spatial and temporal resolution for functional and diffusion MRI in the Human Connectome Project[END_REF] . In brief, the data were acquired on a 3 Tesla Siemens Skyra scanner using a whole-brain EPI acquisition with a 32 channel head coil. The parameters were as follows: TE = 33.1 ms, TR = 720 ms, flip angle = 52°, BW = 2290 Hz/Px, inplane FOV = 208 × 180 mm, 72 slices, 2.0 mm isotropic voxels, and a multi-band acceleration factor of 8. Each task was acquired twice using a right-to-left and a leftto-right phase encoding. The EPI 4D acquisitions were then preprocessed through the "Minimal preprocessing pipeline" fMRIVolume [START_REF] Glasser | The minimal preprocessing pipelines for the Human Connectome Project[END_REF] , which applies movement and distortion corrections and performs a registration to the MNI152 space.

DWI acquisitions and tractography

Structural connectome data were downloaded here (subset of 100 subjects; available at https://osf.io/5zqwg/ and http://www.bcblab.com/BCB/Opendata.html)

This dataset was derived from the diffusion-weighted imaging dataset of 100 participants acquired at 7 Tesla by the Human Connectome Project Team 49 The scanning parameters have previously been described in [START_REF] Vu | High resolution whole brain diffusion imaging at 7 T for the Human Connectome Project[END_REF] . In brief, each diffusion-weighted imaging consisted of a total of 132 near-axial slices acquired with an acceleration factor of 3 [START_REF] Moeller | Multiband multislice GE-EPI at 7 tesla, with 16-fold acceleration using partial parallel imaging with application to high spatial and temporal whole-brain fMRI[END_REF] , isotropic (1.05 mm3) resolution and coverage of the whole head with a TE of 71.2 ms and with a TR of 7000 ms. At each slice location, diffusion-weighted images were acquired with 65 uniformly distributed gradients in multiple Q-space shells [START_REF] Caruyer | Design of multishell sampling schemes with uniform coverage in diffusion MRI[END_REF] and 6 images with no diffusion gradient applied. This acquisition was repeated four times with a b-value of 1000 and 2000 s mm-2 in pairs with anterior-to-posterior and posterior-to-anterior phase-encoding directions. The default HCP preprocessing pipeline (v3.19.0) [START_REF] Glasser | The minimal preprocessing pipelines for the Human Connectome Project[END_REF] was applied to the data [START_REF] Sotiropoulos | Advances in diffusion MRI acquisition and processing in the Human Connectome Project[END_REF] . In short, the susceptibility-induced off-resonance field was estimated from pairs of images with diffusion gradient applied with distortions going in opposite directions [START_REF] Andersson | How to correct susceptibility distortions in spin-echo echo-planar images: application to diffusion tensor imaging[END_REF] and corrected for the whole diffusion-weighted dataset using TOPUP [START_REF] Smith | Advances in functional and structural MR image analysis and implementation as FSL[END_REF] . Subsequently, motion and geometrical distortion were corrected using the EDDY tool as implemented in FSL.

Next, we discarded the volumes with a b-value of 1000 s/mm-2 and whole-brain deterministic tractography was subsequently performed in the native DWI space using StarTrack software (https://www.mr-startrack.com). A damped Richardson-Lucy algorithm was applied for spherical deconvolutions [START_REF] Smith | Advances in functional and structural MR image analysis and implementation as FSL[END_REF][START_REF] Dell'acqua | A modified damped Richardson-Lucy algorithm to reduce isotropic background effects in spherical deconvolution[END_REF] . A fixed fibre response corresponding to a shape factor of α = 1.5 × 10-3 mm2 s-1 was adopted, coupled with the geometric damping parameter of 8. Two hundred algorithm iterations were run. The absolute threshold was defined as three times the spherical fibre orientation distribution (FOD) of a grey matter isotropic voxel and the relative threshold as 8% of the maximum amplitude of the FOD [START_REF] Thiebaut De Schotten | A lateralized brain network for visuospatial attention[END_REF] . A modified Euler algorithm [START_REF] Dell'acqua | Can spherical deconvolution provide more information than fiber orientations? Hindrance modulated orientational anisotropy, a true-tract specific index to characterize white matter diffusion[END_REF] was used to perform the whole-brain streamline tractography, with an angle threshold of 35°, a step size of 0.5 mm and a minimum streamline length of 15 mm.

We co-registered the structural connectome data to the standard MNI 2 mm space using the following steps: first, whole-brain streamline tractography was converted into streamline density volumes where the intensities corresponded to the number of streamlines crossing each voxel. Second, a study-specific template of streamline density volumes was generated using the Greedy symmetric diffeomorphic normalisation (GreedySyN) pipeline distributed with ANTs [START_REF] Dell'acqua | Can spherical deconvolution provide more information than fiber orientations? Hindrance modulated orientational anisotropy, a true-tract specific index to characterize white matter diffusion[END_REF][START_REF] Avants | A reproducible evaluation of ANTs similarity metric performance in brain image registration[END_REF] . This provided an average template of the streamline density volumes for all subjects. The template was then co-registered with a standard 2 mm MNI152 template using flirt as implemented in FSL. This step produced a streamline density template in the MNI152 space. Third, individual streamline density volumes were registered to the streamline density template in the MNI152 space template and the same transformation was applied to the individual whole-brain streamline tractography using the trackmath tool distributed with the software package Tract Querier 62 using ANTs GreedySyn. This step produced a whole-brain streamline tractography in the standard MNI152 space.

Tractogram-derived anatomical priors

Our method projects the functional signal to white matter structures. To do so, knowledge of the underlying brain circuits is required. For each voxel of the brain, we produced a map indicating the brain circuits probability. This probability corresponds to the probability of connections derived from a normative population of 100 HCP participants. Specifically, for each voxel, all streamlines intersecting in this specific voxel were derived from tractograms, binarised and averaged across subjects, using a function similar to the "Disconnectome" function of the BCBtoolkit [START_REF] Foulon | Advanced lesion symptom mapping analyses and implementation as BCBtoolkit[END_REF] . Thus, each map has voxel values between 0 and 1, representing the probability of the presence of a streamline.

These probability maps serve as the anatomical priors for brain circuits. As part of the toolbox the priors can be adjusted in the future.

Functionnectome pre-processing

The Functionnectome method projects the BOLD signal obtained for each voxel onto the white matter passing through a voxel. Practically, the algorithm can be broken down in a few steps:

For each subject, the Functionnectome was provided with a mask selecting the voxels whose functional signal will be projected onto the white matter. Here we used the masks available from the HCP that excluded noisy voxels. These masks exclude voxels with a high coefficient of variation, i.e. higher than 0.5 standard deviations compared to neighbouring voxels (saved by the HCP pipeline in the file "RibbonVolumeToSurfaceMapping/goodvoxels.nii.gz").

Next, the time-series was extracted for each voxel and multiplied with its associated probability map. In doing so the functional signal is projected on the white matter, and weighted by the probability of the presence of a streamline, resulting in one 4D volume per voxel. All 4D volumes are subsequently fused together by voxel-wise addition and divided by the sum of all probability maps to produce a weighted average of the voxel-wise 4D volumes. This final step ensures that all voxels have a comparable range of values (equivalent to the range of values of the BOLD signal).

The final output of the algorithm is a functionnectome 4D volume.

The value of a given voxel v at a given time-point t in the functionnectome can thus be described with the following equation:

,ݒ݉݁ሺݐܿ݁݊݊݅ݐܿ݊ݑܨ ݐሻ ൌ ∑ אெ ሺ௩ሻൈிሺ,௧ሻ ∑ אಾ ሺ௩ሻ
With M the set of voxels selected by the input mask; P m the probability map derived from the voxel m; and F the original fMRI 4D volume.

Functional data pre-processing

To compare our method with standard analyses, we explored the activation patterns of HCP fMRI paradigms for motor (n=46), working memory (n=45), and language (n=44) tasks (see https://protocols.humanconnectome.org/HCP/3T/task-fMRIprotocol-details.html and [START_REF]Function in the human connectome: Task-fMRI and individual differences in behavior[END_REF] for a full description of the taks protocol). Briefly, the motor tasks consisted of finger tapping (left or right hand) and toes clenching (left or right foot); the working memory task was a 2-back task; and the language task corresponded to the comparison of comprehension of high and low semantic content (stories, math problems).

Processing of neuroimaging data

The activation analysis was applied to both the original functional dataset and the functionnectome 4D volumes. Processing was identical except for the application of a traditional spatial smoothing (FWHM = 4 mm) on the functional dataset (i.e. as a usual step to improve the signal/noise ratio and misalignment). Specifically, no spatial smoothing is required for the functionnectomes 4D volumes. Usual smoothing aims at improving the signal/noise ratio (SNR) using a weighted average of the local signal, assuming that neighbouring voxels share some signal of interest. The Functionnectome method combines the signal from distant yet structurally linked voxels, which has an analogous effect of improving the SNR, but is guided by actual brain circuits.

The processing was done using FEAT (FMRI Expert Analysis Tool, v6.00) from FSL (FMRIB's Software Library). First-level statistical analysis was carried out on each participant using FILM (FMRIB's Improved Linear Model) [START_REF]Temporal Autocorrelation in Univariate Linear Modeling of FMRI Data[END_REF] with prewhitening. For each task, we used the main contrasts provided with the HCP dataset. Then, a group-level analysis was performed on all participants using the first stage of FLAME (FMRIB's Local Analysis of Mixed Effects) [START_REF]Multilevel linear modelling for FMRI group analysis using Bayesian inference[END_REF] , resulting in the z-maps (z-transformed tmaps) presented in the results (fig. 1234).

Additional statistics (replication)

To test the reproducibility of our results, we used the two acquisitions realised for each subject: one with a left-right encoding phase, the other with a right-left encoding phase. We compared the z-maps resulting from the full processing of these two acquisitions using Pearson's correlation coefficient (excluding voxels outside the brain).

Visualisation

Functional z maps and functionectome maps were displayed on a standard template in MRIcron (https://www.nitrc.org/projects/mricron). Labelling for cortical regions and white matter pathways were added manually by expert anatomists (SJF and MTS).

The visualisation of 3D structures in 2D is limited and may appear ambiguous at times but the full trajectories of pathways were considered before labelling, especially in regions of overlap between white matter structures. The 3D renderings were generated using the associated z-map.

Introduction

The Functionnectome is a Python-based tool to allow projecting functional signals (or more generally grey matter information) onto the white matter. As input, the software accepts NifTI 4D volumes (usually fMRI files), uses predefined (but modifiable if needed) white matter priors for the computation, and outputs functionnectome 4D volumes. The user can choose between navigation through commands or a GUI (Graphical User Interface).

The generated functionnectomes 4D volumes can then be processed with the same statistical tools used to analyze fMRI. For example, the functionnectome generated from a classic task fMRI can be analyzed with the usual tools (e.g. generalized linear model) to reveal the whitematter pathways involved with the task.

Disclaimer

No financial conflicts.

Not licensed for medical use.

The software and its codes are licenced under the GNU General Public License.

Definitions

• "Functionnectome" (with an uppercase "F") refers to the overall method and the program applying the method. "functionnectome" (with a lowercase "f") refers to the 4D volume resulting from the application of the Functionnectome.

• "Voxel-wise" analysis refers to the projection of functional signals onto the white matter as this is done at the voxel level. "Region-wise" analysis runs on predefined parcels of brain regions, grouping voxels together and reducing the number of steps to the order of hundreds at most, though at the cost of precision.

Requirements (Read this before starting!)

1. The Functionnectome runs on Python 3.6 (or higher). In addition to the basic Python distributions, four python libraries are needed: Numpy, Pandas, Nibabel and H5py. If you install the Functionnectome toolbox using pip (see the "Installation" section), they will be installed automatically. Otherwise, you will have to install them manually on your python virtual environment.

2. Depending on the size of the input data, RAM usage can vary. An 8-12GB RAM is recommended, but for small input volumes, 4GB might suffice.

3. Expected input files are NifTI (.nii or .nii.gz) 4D volumes in MNI152 space, with 2mm 3 isotropic voxels.

Input files should either be:

o All in the same folder, e.g. :

• "/myHome/dataFMRI/subject01.nii"

• "/myHome/dataFMRI/subject02.nii" o Or in different folders but with "similar paths," i.e., with the same number of subfolders and the folder with the data ID at the same depth, e.g. :

• "/myHome/subject01/data/mydata.nii"

• "/myHome/subject02/data/mydata.nii" 5. For a voxel-wise analysis, a brain (or rather gray-matter) mask in MNI152 space, with 2mm 3 isotropic voxels, selecting the voxels with "interesting" functional signal, is also necessary. The mask should be a NifTI 3D volume, with the same spatial dimensions as the main 4D volume input.

6. The white matter anatomical priors are available online (https://www.dropbox.com/s/22vix4krs2zgtnt/functionnectome_7TpriorsH5.zip?dl= 0), but the toolbox gives you also the option to download them automatically.

7. The provided priors require input data to be in the MNI152 space, with 2mm 3 isotropic voxels.

8. We strongly recommend running the Functionnectome on a machine equipped with multiple CPUs (8 cores or more). At least for the voxel-wise analysis. The region-wise analysis is much less computationally demanding. Note that process parallelisation should not increase the RAM load.

Overview

In the GUI, the analysis parameters can be set and the input and the output can be defined.

The Functionnectome analysis can be launched from the GUI once the parameters are set. The settings can be saved and loaded for future analysis.

• Input: 4D volume, NifTI o Sum of all probability maps used for a given subject (depends on the mask)

o Used during the processing, might be useful for alternative processing *Unique ID: If all input files are in the same folder, the program uses the filenames (without the extension). If the files are in different folders with similar paths (cf. bullet 4 in Requirements), the ID is the name of the folder (e.g. it will be "subject01" in the example given above with "/myHome/subject01/data/mydata.nii")

A quick guide to run an analysis:

1. Select the input 4D files by clicking on either "Choose files" buttons (depending on your data storage organisation).

Select whether you want a region-wise or voxel-wise analysis

o If you chose the voxel-wise approach, select the masks that will filter out unwanted voxels. You can either choose one mask per input file or choose one unique mask applied to all input files.

3. Select the number of parallel processes you want to launch concurrently. The more processors, the faster the analysis. Importantly, the priors should be saved on a storage device with fast reading speed. You can estimate your running time using a value of 0.004 sec/voxel/volume. So, to get the estimate, compute:

o Duration (sec.) = 0.004 x VoxelMask x NbVol / NbCore

• VoxelMask: Number of voxels in the mask used in voxel-wise analysis.

Replace by the number of regions in region-wise analysis.

• NbVol: Number of volumes (i.e. time point) in your input 4D file.

• NbCore: Number of cores (CPU) used to run the computation.

o For example, running the Functionnectome in voxel-wise analysis, using a graymatter mask containing 180,000 voxels, and with an fMRI scan of 1,050 volumes, on a machine with 16 cores, gives:

• 0.004 x 180,000 x 1,050 / 16 = 47,250 sec » 13 hours o Using the region-wise analysis drastically cuts the time needed, even using a less powerful machine (at the cost of some precision and sensitivity in the final results). Indeed, with the same input fMRI volume, using a segmentation of 438 brain areas (as is the priors), with a 4-core machine, we get:

• 0.004 x 438 x 1,050 / 4 = 460 sec » 8 min 4. Choose the file type of the priors. If the priors of the software are to be used they are made available as HDF5 files. Where users wish to use their own templates we recommend using the same file type.

If the priors

have not yet been downloaded (or the path leading to the files is not set), you will be offered to automatically download it (or asked to select the file path). This should only happen once, when you first try to run the Functionnectome.

6. Choose the output folder. If the provided path doesn't exist, it will be automatically generated.

7. Choose whether or not you want to mask the output to remove voxels outside of the brain (as defined by a brain template). We recommend it (default behaviour).

8. Launch the analysis. Or save the settings in order to launch it later or with a command line.

Voxel-wise and region-wise analysis

Select whether you want to run a voxel-wise or a region-wise analysis. If you have enough computational power, we recommend using the voxel-wise analysis.

If you select the voxel-wise analysis (i.e. "voxel-wise functionnectome"), you will need to specify the mask(s) that will filter out unwanted voxels. Click on "Select mask(s)". A new window will pop open:

You can either attribute one mask per input file ("One mask per subject"), usually useful if the masks are created depending on the individual data; or select one unique mask that will be similarly applied to all inputs, for example, a mask delimiting the grey matter.

Selecting one mask per input uses the same procedure as the selection of the input 4D volumes (Manual selection in one folder, or pasting the paths).

The paths of the 4D inputs and the masks are automatically and systematically sorted.

Consequently, these inputs and the masks must have the same naming convention because the pairing between a mask and an input 4D volume is done using the position of the paths in the corresponding list. Using the "View selected files" and "View selected masks" buttons, check the paths to verify that this is correct.

The region-wise analysis uses priors derived from a brain parcellation. In the provided default priors, we used the HCP multi-modal parcellation (MMP, doi.org/10.1038/nature18933). The functional signal of a region is defined as the median of the voxel values at a given time point.

Number of processors to use

The Functionnectome processing time can be significantly cut down by parallelizing it. You can choose the number of processes (i.e. the number of CPU or core used at the same time). The maximum number of parallel processes is automatically detected and set as a top limit.

The parallelization happens at the subject level, so only one subject is run at a time, which limits the RAM load.

The Functionnectome parallel processing system does not support the spread of the computation across multiple machines/nodes. All the CPUs must be mounted on the same machine.

As an example, using 16 processes in parallel, the processing time of a typical fMRI scan with the voxel-wise analysis can be around 4 hours (but it depends a lot on the size of the input and how many voxels are kept with the mask).

White matter anatomical priors

As the Functionectome projects BOLD onto the brain's connections, the priors are necessary. They consist of the white matter probability maps and a brain template. The template is a T1 brain template and is used to define the dimensions of the images and to delimit the brain. The program can access them from two different types of storage:

• A collection of NifTI files, with a folder containing all the probability maps (voxel-wise or region-wise), and a brain template (same dimensions as the probability maps). This option might be better if you need to easily change (some of) the priors. • An HDF5 priors file (containing all the required images). This format allows for rapid access to the files, fast transfer of the file from one location to another, and because it is not easy to change, it reduces the risk of accidentally deleting necessarily data. Check the FAQ "How do I specify different paths to alternate priors?" if you want to create your own priors. Paths to the priors are saved in a file and are purposely not readily available (to encourage traceability practices). Ideally, the paths to the priors should be set once (when downloading them) and left alone. It is possible to specify alternative paths directly in the settings file (see FAQ "How do I specify different paths to alternate priors?"). For ease of use and to reduce the margin for errors, the settings file is always saved with the results. This way you'll always know what priors you used (default or manually changed).

Figure 1 :

 1 Figure 1: Experimental setup for the functionnectome. (a) Classical blood-oxygenlevel-dependent functional magnetic resonance imaging (BOLD fMRI) in the cortex is projected onto the white matter circuits using (b) anatomical priors of the brain circuits and a (c) weighted average equation. The priors are derived from (d) 100 high-resolution diffusion weighted imaging dataset. The output of the functionnectome is subsequently entered (e) in the same statistical design as classical fMRI. M: mask used in the analysis; ts: time-series; p: probability of occurrence of a streamline.

Figure 2 :

 2 Figure 2: Motor task activation network for finger-tapping with the left (a: Functionnectome, b: classic) and right hand (c: Functionnectome, d: classic). FAT: Frontal Aslant Tract; CC-Body: Corpus Callosum body; M1: Primary motor cortex; SMA: Supplementary motor area; Cer-AL: Cerebellar anterior lobe; IC-PA: Internal capsule posterior arm.

Figure 3 :

 3 Figure 3: Motor task activation network for toe clenching with the left (a: Functionnectome, b: classic) and right foot (c: Functionnectome, d: classic). FAT: Frontal Aslant Tract; CC-Body: Corpus Callosum body; M1: Primary motor cortex; SMA: Supplementary motor area; Cer-AL: Cerebellar anterior lobe; IC-PA: Internal capsule posterior arm.

Figure 4 :

 4 Figure 4: Working memory task activation network (a: Functionnectome, b: classic). FAT: Frontal Aslant Tract; FSL: Frontal Superior Longitudinal tract; SLF: Superior Longitudinal Fasciculus; CC-Body: Corpus Callosum body. CPC: Cortico-Ponto-Cerebellar tract; SMA: Supplementary Motor Area; SPL: Superior Parietal lobe; IPL: Inferior Parietal lobe; MFg: Middle frontal gyrus; Cau: Caudate nucleus; Cer-SPl:

Figure 5 :

 5 Figure 5: Semantic system task activation network (a: Functionnectome, b: classic). PSA: Posterior Segment of the arcuate fasciculus; MdLF: Middle Longitudinal Fasciculus; IFOF: Inferior Fronto-Occipital Fasciculus; Fx: Fornix; CC: Corpus Callosum; ILF: Inferior Longitudinal Fasciculus; Unc: Uncinate fasciculus; AC: Anterior Commissure; SFg: Superior Frontal gyrus; IFg: Inferior Frontal gyrus; IPL: Inferior Parietal Lobe; STg: Superior Temporal gyrus; OFC: orbital frontal cortex; hipp: hippocampus.

(

  http://www.humanconnectome.org/study/hcp-young-adult/ ; WU-Minn Consortium; Principal investigators: David Van Essen and Kamil Ugurbil; 1U54MH091657). This was funded by the 16 NIH Institutes and Centers that support the NIH Blueprint for Neuroscience Research, and by the McDonnell Center for Systems Neuroscience at Washington University.

Figure 6 :

 6 Figure 6: Flowchart of methods pipeline

Table 1 :

 1

			hand Left hand Right foot	Left foot	Working	Semantics
	Functionnectome	0.78	0.73	0.82	0.85	0.84	0.89
	Classical fMRI	0.71	0.68	0.70	0.72	0.70	0.83

Reproducibility of the analysis maps for each task, for the Functionnectome and classical fMRI analyses. The reproducibility is indicated as Pearson's correlation coefficient r .

Acknowledgements

We thank University of Bordeaux and CNRS for the infrastructural support. This project has received funding from the European Research Council (ERC) under the European Union's Horizon 2020 research and innovation programme (grant agreement No. 818521).

Data availability

All the raw anatomical and functional data are available on the HCP website. https://www.humanconnectome.org

Code availability

The functionnectomes and the associated maps are available on demand to the authors. The python compatible algorithm (version 3.6 or higher) for the Functionnectome analysis is freely available and comes with an optional GUI code (https://github.com/NotaCS/Functionnectome).

Authors contribution statement

V.N. implemented the methods, performed the analyses, wrote the manuscript. S.J.F wrote the manuscript and reviewed the neuroimaging data. C.F. conceived the study, implemented part of the methods and revised the manuscript. L.P. reviewed the neuroimaging data and revised the manuscript. M.T.S. conceived and coordinated the study, implemented the methods, performed the analyses, wrote the manuscript and provided funding.

Competing interest

The authors declare no competing of interest.

SUPPLEMENTARY MATERIAL Functionnectome: a framework to analyse the contribution of brain circuits to fMRI

Victor Nozais 1,2* , Stephanie J. Forkel 1,2,3 , Chris Foulon [START_REF] Yarkoni | Largescale automated synthesis of human functional neuroimaging data[END_REF] , Laurent Petit 1 , Michel Thiebaut de Schotten

Region-wise analysis

Principle

The Functionnectome has the ability to project the functional signal of each brain voxel onto the white matter. Although the principle is relatively straightforward, the computation can require up to several hundred thousand steps per subject, depending on how many voxels are kept for the analysis. This is quite computationally intensive and thus requires powerful computers and servers, which are not necessarily available to all. In order to make the Functionnectome accessible to the broadest audience, we added the possibility to use brain regions instead of voxels as spatial units, reducing the number of processing steps to a few hundred per subject. This simplification of the analyses decreases the computation time from hours per subject (or even days on consumer-grade computers) to minutes. The brain regions used for this example of simplified analysis, and the associated probability maps, were derived from the HCP multi-modal parcellation (MMP) and are included in the priors provided with the software. During the analysis, the functional signal from a given region at a specific time-point is defined as the median of the values of that region's voxels at that time-point. Here, we used the median instead of the mean in order to mitigate the effect of noisy voxels in small regions.

Results

All the analyses presented in the main body of the article were replicated using the region-wise analysis aforementioned. For the sake of comparison, we kept the same activation-values threshold as in the original analyses presented in the main text.

Supplementary discussion

The region-wise analysis delivers results comparable to those obtained with the voxel-wise analysis, albeit slightly less sensitive and specific. For instance, compared to the voxel-wise analysis, a few pathways were missing in the region-wise analysis (e.g. the superior longitudinal fasciculus 1 in the working memory task map -Supplementary figure 3), and other tracts were displaying a larger activations (e.g. the first branch of the superior longitudinal fasciculus -SLF1 -in the working memory task -Supplementary figure 3). The choice of brain segmentation used for the simplified region-wise analysis could improve the results. Here, the multimodal parcellation of the HCP has a general-purpose, but using a brain parcellation tailored for the specific analysis of a project could yield better results.

Overall, the region-wise analysis offers a way for any research team to use the Functionnectome and obtain results in a short amount of time, independently from the computational resources available.

Even teams considering the application of the voxel-wise analysis could use it as a quick test of their method, before investing the time and computational resources for the complete analysis.

The Functionnectome User-guide

Comprehensive guide

Installation

The project can be download through pip using the command line:

• pip install git+https://github.com/NotaCS/Functionnectome.git or • python -m pip install git+https://github.com/NotaCS/Functionnectome.git You can also manually download the project from GitHub: https://github.com/NotaCS/Functionnectome The priors will be automatically downloaded during the first launch of the Functionnectome, but you can also download them manually here: https://www.dropbox.com/s/22vix4krs2zgtnt/functionnectome_7TpriorsH5.zip?dl=0

If you download the priors manually, you will need to unzip the file. The path to the priors will be asked by the program during the first run.

Loading the input 4D volume

Once you have downloaded the package, launch the GUI. To do so, there are 3 possible ways:

• If the toolbox was installed using pip, simply call "FunctionnectomeGUI" (without the quotation marks) in a command window using the virtual environment where you installed the Functionnectome.

• If you manually downloaded the codes, run the functionnectome_GUI.py script from a python interpreter, or run "python functionnectome_GUI.py" in a command window.

In the GUI, you can specify the input data (assumed to be BOLD data, but any 4D nifty files are accepted). Two ways of selecting the files are possible depending on how they are stored on your computer: • On MacOS/Unix/Linux, use the "ls" command. For example, let's say that all my files are stored in paths as: "/myhome/current_project/subject????/functionalFiles/ fMRI_acquisition.nii.gz" with "????" being a unique ID (e.g a number) that is different for every subject. Use as many "?" as there are digits in the ID numbers. To display all the file-paths, simply enter the command (in the terminal): "ls -1 /myhome/current_project/subject????/funFiles/fMRI_acquisition.nii.gz" Here, "ls" will list all the paths, and the "-1" option will display one path per line.

• On Windows, use the "dir" command, similarly to the above-mentioned "ls".

For example: "dir C:\myHome\project\subject????\fMRI_acquisition.nii.gz" Copy the displayed result and paste it into the GUI.

If for some reason you enter or paste something wrong in the GUI text box, you can easily correct it manually or clear the whole box by clicking on "Clear". When you are done, click on "OK" to accept the file-paths. Or "Cancel" to return to the main window without keeping the paths or the changes made to existing paths.

Advanced tip: Once you have files selected, you can manually edit them (add/remove) by opening the "pasting" window and adding ore removing a line, even if you selected the all from one folder. Note that the added paths should still keep the same naming pattern as the other already there. Likewise, if you "Clear" the window and click on "OK", it will delete every path (not the files, of course, just the paths stored by the GUI). If you accidentally modify or clear the paths, simply click on "Cancel".

To differentiate the input files and to name the output folders, a unique ID is attributed to each of them. When selecting all inputs from the same folder (option 1), the unique ID is the name of the file (without the extension). When selecting from multiple similar folders (option 2), the program will automatically select the first divergence in the paths as the ID. The position of the ID in the path is displayed, and an example of ID (from the first selected path) is given. Subsequently, the GUI gives you the option to manually change the location in the paths where the program finds the IDs, using the little arrows near the position number: List of the paths given:

/myHome/workspace/myProject/myAcquisition/MRI/subject01/fMRI/readyData.nii.gz /myHome/workspace/myProject/myAcquisition/MRI/subject02/fMRI/readyData.nii.gz /myHome/workspace/myProject/myAcquisition/MRI/subject03/fMRI/readyData.nii.gz Position of the subject ID in the path (index of the folder in the path, starting at "0"):

/myHome/workspace/myProject/myAcquisition/MRI/subject01/fMRI/readyData.nii.gz Here, "subject01" has been automatically selected as it is the first (and only in the example) divergence between the paths.

Sometimes, the first divergence is not the one you want to keep. You can then manually modify the position. For example, if we have the paths:

/myHome/myProject/session1/subject01/readyData.nii.gz /myHome/myProject/session1/subject02/readyData.nii.gz /myHome/myProject/session2/subject03/readyData.nii.gz /myHome/myProject/session2/subject04/readyData.nii.gz

The number of the session is the first divergence between the paths, so the position will be automatically set at "2", and the example given will be "session1". The user will then have to change the position to "3" (which will change the example to "subject01").

Output options

Choose the output folder by either clicking on the "…" button or by copy-and-pasting the path to the text-box.

If the folder does not exist, it will be automatically created. It will serve as a "root" folder for the analysis, where the settings file (resulting from the parameters you entered in the GUI)

and the additional sub-folders will be stored. Multiple analyses can use the same output folder, as long as the IDs of the input data are different.

Typically, if you select "/myHome/myProject/myOutputFolder/" as the path to the output folder, the results will be stored in this structure (assuming you are doing a voxel-wise analysis):

/myHome/myProject/myOutputFolder/ The last parameter available is the "Mask the output" option. If checked (recommended and set as default), the functionnectome will be masked to remove all voxels outside of the brain (as defined by the brain template, which is part of the priors).

Save, Load, Launch & Exit

The buttons at the bottom of the GUI:

• Save: Saves the parameters entered on the GUI in a simple text file (with a ".fcntm" extension). It can be opened with any text editor. This settings file can be used to manually launch the Functionnectome from a terminal. All the parameters must be properly entered in the GUI before saving is possible.

• Load: Loads a settings file (".fcntm") to fill the GUI parameters. Useful if you want to run a different analysis using the same input 4D files.

• Launch: Saves the parameters in the output folder, closes the GUI, and runs the analysis using the provided settings.

• Exit: Closes the GUI without doing anything.

Frequently Asked Questions and advanced functions

How do I use the Functionnectome with command lines only?

You first need to create a settings file for your analysis (see below "Can I manually change/create a setting file?"). Let's assume it is called "settings.fcntm" and saved in /myPath/ Then:

• If you manually downloaded the scripts and saved it in, e.g. /myPath/, you can run the script by simply calling:

python -u /myPath/Functionnectome/functionnectome.py /myPath/settings.fcntm • If you installed the Functionnectome package using pip:

o You can directly call "Functionnectome" in a command window (with the correct virtual environment) followed by the path to the settings file, e.g. "Functionnectome /myPath/settings.fcntm".

o Or you can find where the functionnectome.py script is stored and use it as is shown above.

o You could also create a simple script importing the package, then running the function. For example, something like that:

from Functionnectome.functionnectome import run_functionnectome fpath="/myPath/settings.fcntm" run_functionnectome(fpath)

If you save it as "/myPath/runFunctionnectome.py", you can then simply call (in the correct python environment):

python -u /myPath/runFunctionnectome.py Can I manually change/create a setting file?

Sure, it is a simple text file on which we changed the extension to ".fcntm". You can create your own file in a text editor (or copy a saved settings file from the GUI), you just need to make sure that the internal architecture is the same as in a GUI generated file. Don't forget to have the "Number of subjects" and "Number of masks" values matching the respective numbers of paths you provide in the file.

The Functionnectome program possesses a simple system to check if the file is correctly organized, so if your custom settings file is completely off the mark, you'll get a notification.

Note that the "Position of the subjects ID in their path" starts at 0 (first folder). The last part of the path (i.e. the name of the file) can be designated with -1. This "-1" index is actually what is used when loading all the 4D input files from a single directory.

You can find examples of settings files in the project directory.

How do I specify different paths to alternate priors?

Since we strongly recommend not changing the default path to the priors too often (for the sake of traceability), we provide an alternative way to change the priors used for a given analysis. This can be especially useful when working on a machine different from usual, as is the case when running analyses on a computer grid/cluster or a distant server.

To give non-default priors or override the absence of default priors, copy and paste the following lines at the end of the settings file (with the ".fcntm" extension) you are using as input for the Functionnectome program (add an empty line before the first "###" in the file): The labels, written in green above, must always be present. Conversely, you only need to fill in the paths (in blue above) that are useful. For example, if you are using an HDF5 priors file, you only need to enter the first path. The lines where the unnecessary path would have been written must be kept though, with empty lines: An example file using this option can be found in the project directory:

• settings_example2.fcntm

How do I make my own anatomical priors?

No readily available, easy to use code yet.

(You could use the "disconnectome" tool of the BCBtoolkit -http://toolkit.bcblab.com/ -, with one-voxel masks for the "lesions", and doing it for every brain voxel. This is what we did. But we plan to write a python script to do it more efficiently soon)

How do I create my own HDF5 file for my priors?

We provide a script to import the priors in NifTI format into a single HDF5 file. You can find it in the project/package under the name makeHDF5prior.py.

It is not the final version yet. For now, you need to specify the paths to all folders directly in the script. And both voxel-wise and region-wise priors must be given.

The script will detect all the NifTI files in the given folder, and import them into the HDF5 file. The voxel-wise probability maps files must all be named with the following pattern: something_xx_yy_zz.nii.gz "something" can be any string of character, but must not contain a "_". "xx", "yy", and "zz" are the spatial coordinates of the specific voxel linked to the given probability map. Be aware that these are the "raw" coordinates, before applying the transformation matrix (quaternion) given in the NifTI header.

The region-wise probability maps and their associated region masks must have the same name.

How do I use the Functionnectome on a distant computational grid/server?

The simplest way would be to transfer the functionnectome.py script and the priors (in the HDF5 file) to the machine you plan to use. Prepare manually the settings file (see "Can I manually change / create a setting file?") and give the location of the HDF5 prior on the distant machine as an alternate priors file (see "How do I specify different paths to alternate priors?"). Then run the script with the settings file as the argument (see "How do I use the Functionnectome with command lines only?").

Will this work on my OS?

The scripts have been tested on a Linux machine. It should work perfectly fine on a Mac. It hasn't been tested on Windows yet, but was coded with portability in mind, so it might work. Proper tests on different OS are planned.

Will parallelizing the analysis use more RAM?

No. Or at least at least it shouldn't. The script uses shared memory between processes to avoid RAM overload, and more processes should only split the data in smaller chunks, not copy it multiple times.

I think you are doing something wrong / poorly optimized…

If you have any advice, as long as the discussion remains respectful, we are happy to hear it. Leave a comment on the GitHub page or send us an e-mail.