MOCA: a systematic toolbox for designing and assessing modular functional near-infrared brain imaging probes

Abstract. Significance The expansion of functional near-infrared spectroscopy (fNIRS) systems toward broader utilities has led to the emergence of modular fNIRS systems composed of repeating optical source/detector modules. Compared to conventional fNIRS systems, modular fNIRS systems are more compact and flexible, making wearable and long-term monitoring possible. However, the large number of design parameters makes understanding their impact on a probe’s performance a daunting task. Aim We aim to create a systematic software platform to facilitate the design, characterization, and comparison of modular fNIRS probes. Approach Our software—modular optode configuration analyzer (MOCA)—implements semi-automatic algorithms that assist in tessellating user-specified regions-of-interest, in interconnecting modules of various shapes, and in quantitatively comparing probe performance using metrics, such as spatial channel distributions and average brain sensitivity of the resulting probes. There is also support for limited parameter sweeping capabilities. Results Through several examples, we show that users can use MOCA to design and optimize modular fNIRS probes, study trade-offs between several module shapes, improve brain sensitivity in probes via module re-orientation, and enhance probe performance via adjusting module spatial layouts. Conclusion Despite its simplicity, our modular probe design platform offers a framework to describe and quantitatively assess probes made by modules, opening a new door for the growing fNIRS user community to approach the challenging problem of module- and probe-parameter selection and fine-tuning.


Introduction
Functional near-infrared spectroscopy (fNIRS) is an emerging neuroimaging technique to non-invasively measure brain activity using non-ionizing light. 1 Unlike functional magnetic resonance imaging (fMRI) 2 that requires high-strength magnetic fields and large scanners, fNIRS utilizes near-infrared (NIR) light to detect brain activation by measuring the associated hemodynamics. The portability of fNIRS positions it as a competitive imaging modality to address some of the challenges of conventional neuroimaging techniques, such as fMRI and magnetoencephalography, including a lack of wearability for continuous monitoring, limited temporal resolution, and need for subject immobility during use. 3 It has shown great promise for safe and long-term monitoring of brain activity and is increasingly used in studies for behavioral 4

and
A fully automated probe design and optimization pipeline is impractical without applicationdependent design constraints. Instead, we report a simplified, easy-to-use software toolbox to help designers navigate the vast parameter space of a modular probe. We also share a number of fundamental modular probe design strategies, discovered through our explorations via this toolbox that were not widely recognized or previously studied. The entire workflow has been implemented into an open-source, MATLAB-based toolbox called Modular Optode Configuration Analyzer (MOCA). 42 MOCA supports a list of commonly used module shapes, user-defined optode layouts, and region-of-interest (ROI) coverage, and can produce quantitative performance metrics, such as distributions of source-detector (SD) separations, sensitivity maps, and spatial multiplexing groupings. These performance metrics also allow comparisons between different designs of modular probes. Although MOCA is not designed as a fully automated software that produces "optimal" probes regardless of application, its unique capability to describe and sweep modular probe parameters in operator-guided interrogations offers valuable perspective to start approaching the complex modular hardware design problem and make informed comparisons between well-constrained design choices.
The remainder of the paper is outlined below. In Sec. 2, we discuss the relevant design considerations when developing a modular probe using MOCA. We specifically focus on the parameterization of the modules, processes required to assemble modules into functional probes, and related performance metrics for system characterization and comparisons. In Sec. 4, we demonstrate MOCA's capability in designing full-head probes using a variety of module shapes and compare their trade-offs regarding channel density, SD separations, and average brain sensitivities. Furthermore, we utilize MOCA to showcase potential improvements to published fNIRS probes by altering module orientations, spacing, and staggering layouts. In Sec. 5, we highlight a number of generalizable design strategies that were discovered via our experiments using MOCA, including the importance of considering module orientations, tiling strategies, and module spacing tuning, among others.

Modular Probe Parameters and Performance Metrics
A diagram showing the overall design process of a modular fNIRS system is shown in Fig. 1. Specifically, the three parts describing MOCA's workflow are (1) the design parameters describing a single module design; (2) the processes and parameters used to assemble the modules into a probe; and (3) the derived performance metrics used to characterize the resulting probe. MOCA starts with the definition of essential module parameters (shown in the left column in Fig. 1), applies those parameters along with probe-level constraints to a probe-generation process (center column in Fig. 1), and derives quantitative performance metrics of the resulting probe (shown in the right column in Fig. 1). Arrows in Fig. 1 define dependencies between the derived performance metrics and the input parameters. For example, to calculate the probe's channel distribution, one must define the module geometry, ROI, and optode layout design parameters.

Essential Module-Level Design Parameters of fNIRS Modular Probes
The basic building block of a modular probe is an fNIRS module. It is typically in the form of an optoeletronic circuit made of a rigid 29,30,33,43 or rigid-flex 44,45 substrate with on-board light sources, optical sensors, auxiliary sensors, microcontrollers, and other communication electronics. A modular probe is subsequently constructed by replicating and interconnecting multiple identical modules. Therefore, the design decisions regarding the module-level parameters are highly important and directly impact the functionalities and restrictions of the resulting probe. ROI. It is also possible to design probes that combine multiple polygonal shapes, such as a combination of hexagonal and pentagonal modules. Such hybrid-shape modular systems may bring advantages in tessellating curved surfaces, but they also require more complex analyses. MOCA supports a number of built-in module shapes including three equilateral polygons (triangle, square, and hexagon). In such cases, the module edge length is the only shape parameter that needs to be defined. One should be aware that a small-sized module requires a large number of boards to cover a given area, thus resulting in higher fabrication cost and higher complexity in assembly and analysis. Moreover, a small module size also limits the maximum intra-module SDS. Shorter SD separations are known to be more sensitive to superficial tissues rather than brain activities. On the other hand, a small-module size provides better probe-to-scalp coupling when a rigid-board-based module is used. MOCA provides support for user-specified arbitrary polygonal modules, defined by a sequence of two-dimensional (2D) coordinates. Subsequent analyses of these user-defined arbitrary modules shapes only use the bounding box of these polygons when varying probe-level parameters.

Target regions-of-interest
An ROI refers to the area of the scalp directly above the cortex for which brain activities are expected to occur. 46 For simplicity, here, we focus on designing probes based on the coverage of a 2D ROI. For generality, MOCA specifies an ROI geometry as a closed polygon made of a sequence of 2D coordinates. Users need to specify at least three Cartesian coordinates to define a closed ROI. In the future, MOCA can potentially be expanded to support three-dimensional (3D) surfaces as ROIs through the use of 3D surface tessellation tools, such as the Iso2Mesh 47 mesh generator and 3D photon transport modeling tools, such as NIRFAST 48 and Monte Carlo eXtreme 49 (MCX).

Optode layout within a single module
Optode layout refers to the spatial arrangement of optical sources and light sensors within the boundaries of a single polygonal module. In MOCA, each source and detector position is defined by a set of discrete 2D coordinates relative to the module's center. The 2D coordinates define the center of the active area of the light-emitting diode (LED), laser, or photo detector. The physical dimensions of the optodes as well as the size and location of electronic components needed to drive each optode are not considered. The SD separations between all combinations of SD pairs are derived based upon the optode positions.

Maximum source-detector separation and maximum short separation channel
MOCA also considers the maximum SD separation (SDS max ) as a key design parameter. Typically, SDS max is determined by the signal-to-noise ratio of the detected signal. 50 A large SDS has low detector sensitivity due to the exponential decay of light intensity as SDS increases. This maximum separation limits the number inter-module channels that emerge from a particular tessellation of modules over an ROI. By default, MOCA considers any SDS below 10 mm to be a short-separation (SS) channel. This threshold can be manually changed to fit any specific optode performance or probe application. MOCA uses 30 mm as the default SDS max . 51,52 MOCA bounds the SD range by the SS channel threshold and the SDS max .

Probe-Level Assembly Process Parameters
A modular probe is constructed when multiple modules are arranged to form a non-overlapping coverage of the ROI area. The final probe is dependent on the tessellation (the number of modules and the spacing between them) and the orientation of each individual module in the probe.

Exploring module tessellation and probe spacing
MOCA provides a process to tessellate modules over a user-defined 2D polygonal ROI, which is generally known as the "tiling" problem in computational geometry. 53 Here, a "complete tessellation" refers to the tiling of an ROI using a single module shape without overlapping or leaving a gap in coverage. Each of the three built-in polygons (triangle, square, and hexagon) has the ability to cover a 2D area. 54 MOCA performs the tessellation by first tiling the module shape along a horizontal axis starting at the lowest vertical coordinate of the ROI until the width of the row composed of adjacent modules is wider than the width of the corresponding segment of ROI the row is tiled over. It then repeats this row-generation process until the height of all the rows combined is larger than the maximum height of the defined ROI. This dimension comparison in both axes accounts for module shapes with non-vertical and non-horizontal sides. For irregular module shapes, MOCA uses the maximum width and maximum height of the defined polygon as the bounding box to create a tiling grid of the module over the ROI. Using the maximum width and height of the ROI as a guide for tiling ensures the full ROI is covered. Although MOCA offsets and flips the three equilateral polygon shapes to prevent gaps, irregular module shapes have inherent gaps between modules when tessellated. Additionally, MOCA accepts manually defined tessellations by reading a sequence of coordinates defining the center of modules to specify each individual module's location within the ROI. Following tessellation, each module is assigned a unique index and an adjacency matrix is constructed to represent which modules are next to one another.
To extend the flexibility of probe creation, users can change probe spacing, the minimum distance between adjacent modules in all directions. Additionally, a module can be manually deleted from the tessellation to allow the probe to more closely follow the boundaries of the ROI or better represent intentional empty spaces in the probe. When individual modules are removed from the probe, the adjacency matrix is re-calculated from the resulting probe.

Guiding module orientation and connection routing
Module orientation refers to the rotation of the module along the normal direction of the ROI plane. In a complete tessellation of the three equilateral polygon shapes, MOCA appropriately flips and translates modules to prevent gaps and overlaps. For tessellations of irregular shapes, each module is simply placed in the same orientation as it was originally defined. After probe generation, MOCA allows the user to manually change the orientation of individual modules based on their assigned indices. For asymmetric optode layouts, changing the module orientation alters the SDS of inter-module channels, resulting in different performance metrics.
Additionally, MOCA creates a single sequential path to connect all modules to form a linear data communication bus, referred to as the "routing" process. In such a path, all modules are connected and every module is visited exactly once-a classic problem known as the Hamilton path 55 in graph theory. In most configurations, a Hamilton path is not unique, and computing such a path is known to be an NP-hard problem, i.e., problems that do not have a polynomial complexity when the node number grows. However, due to the limited module numbers commonly used in an fNIRS probes, an exhaustive search of the adjacency matrix can typically identify all Hamilton paths in a given tessellation with no more than a few minutes of computation. For any computed path, MOCA then orients each module based on the angle of a vector defined by the center of the oriented module and the center of the following module in the path. The orientation angle is relative to the horizontal axis.

Performance Metrics to Characterize Probes
Each metric described below changes as module-and probe-level parameters are altered either manually or through MOCA's sweeping functions. MOCA not only helps unravel the complex interplay between choices of different parameters, but also guides the probe designer in making trade-offs between conflicting design targets-improving one metric may come at the risk of worsening another. We have chosen the following set of essential performance metrics due to their ability to easily inform a breadth of end-user probe requirements such as cost, weight, depth sensitivity, and sampling rate estimates.

Total module and optode counts
Based on the module design and tessellation, MOCA computes the total number of modules, n m , needed to cover the ROI. In addition, MOCA also outputs the total number of sources (n s ) and detectors (n d ) of the final probe. All modules, sources, and detectors of an assembled probe are given unique identifiable index numbers (m i , s i , and d i , respectively). Module and optode counts are performance metrics outputted by MOCA from which cost, weight, and power estimates can be deduced.

Inter-and intra-module channel distribution
For any assembled probe, MOCA generates histograms of the SD separations for all combinations of SD pairs. Particularly, it outputs separately the distribution of inter-and intra-module channels that are below the SDS max previously defined by the user. These channel distributions aid the user in designing the probe based on the targeted application and population. For example, shorter channels are more applicable to infant populations. Additionally, MOCA outputs channel density, a metric commonly used for fNIRS probe bench marking. Channel density is defined as the number of channels, n channels , divided by the area of the ROI. 24 Furthermore, MOCA can provide a spatial plot overlaying channels on the assembled probe, allowing for visual inspection of low channel density areas within the probe.

Spatial brain sensitivity
Brain sensitivity (S brain ) refers to the magnitude of the measurement signal change at a detector given a localized perturbation of optical properties of brain tissue. 56 A higher S brain value suggests the probe is more sensitive to the anticipated brain activation. It is calculated from the spatial probability distribution of photons scattering through complex tissue as they travel from the source to the detector. 57 Although modeling 3D head/brain anatomies and 3D-based light simulations have been reported, including several related works from our group, 47,49,58,59 we deliberately chose a simplified layered-slab head model and 2D based probe layout as default models to evaluate a modular probe in MOCA. Such a decision was largely motivated by (1) significantly faster computation and pre-/post-processing to accommodate fast sweeping of a large parameter space, and (2) avoiding another added layer of complexity when probe design is coupled with underlying brain anatomy in a 3D head model. A comparison between S brain computed by 2D and atlas-based analyses is provided in Sec. 4. Nonetheless, MOCA can export 2D probe data to established 3D probe modeling toolkits, such as AtlasViewer 41 and MCX, 49 to perform more advanced analyses when 3D head models are necessary.
MOCA uses a five-layer slab model consisting of tissue imitating the scalp, skull, cerebral spinal fluid (CSF), white matter (WM), and gray matter (GM) to determine the spatial sensitivity profile for each SD pair in a probe. 60 The thickness of each tissue layer in the slab is set to the average thickness of that tissue type computed using the top half of a tetrahedral brain model. 61 We define the brain region as the combination of GM and WM tissues. The optical properties and resulting thicknesses for each tissue type are summarized in Table 1.
For each SD pair in the assembled probe, 3 × 10 8 photons are simulated using our in-house 3D Monte Carlo photon transport simulator, MCX, 49 using a pencil beam source and a single 1.5-mm radius detector placed at the surface of the slab at its corresponding SDS. In a voxelated grid, S brain is defined as a ratio dividing the region-wise summation of the sensitivity matrix in each brain tissue region by the summation of the entire sensitivity matrix for each sourcedetector separation, 57 i.e., E Q -T A R G E T ; t e m p : i n t r a l i n k -; e 0 0 1 ; 1 1 6 ; 2 9 9 S brain ðs; dÞ ¼ where the sensitivity matrix, also known as the Jacobian (J), is computed using the adjoint Monte Carlo method. 62 In addition to S brain , MOCA also calculates the average brain sensitivity for the entire probe, S brain , based on all the SD separations above the SS threshold. SS channels are excluded in the calculation of S brain because, by definition, they are designed to only sample superficial layers. 57

Spatial multiplexing groups
The density of assembled modular probes may impact the probe's temporal sampling rate when illuminating each source sequentially. MOCA introduces spatial multiplexing, an encoding strategy that can potential accelerate data acquisition by simultaneously turning on multiple light sources at the same time. Because of the high attenuation of light in the head and brain tissues at large separations, MOCA can ignore the cross-talk of light sources that are far away from a given detector and assign sources into spatial multiplexing groups, or SMG, so that all sources Table 1 Optical properties used in the slab model for calculating brain sensitivity based on Fang et al. 58 The thickness of each layer is derived by dividing the total tissue volume by the tissue's surface area from a tetrahedral five tissue brain model. 61 The absorption coefficient, μ a , is the average path a photon will travel in the medium before being absorbed. Similarly, the scattering coefficient, μ s , defines the average path length of photons before a scattering event. Anisotropy, g, is a unit less measure of the amount of forward direction retained after a single scattering event.
Tissue type within an SMG can be turned on simultaneously. By default, MOCA uses the SDS max as the minimal distance between sources. This distance, however, can be defined by the user. Notably, unlike frequency multiplexing, spatial multiplexing does not require extra energy-intensive hardware or post-measurement separation of combined signals. The search for the SMG starts by randomly specifying a source position as the seed; a circle of radius SDS max centered at the seed position is drawn and a random source outside of this circle that is at least 2 × SDS max away is picked; the above process repeats until no additional source can be found. Once an SMG is identified, a new source that does not belong to any existing SMG is selected as the new seed for the next SMG and the above process repeats until every source is allocated. The total number of spatial multiplexing groups, n SMG , depends on the tessellation of the module over the ROI as well as the choice of the seed position. As with channels, the n SMG are for a single wavelength. Thus, when estimating the total sampling rate of the probe using dual-wavelength sources, the control unit must cycle through each group twice (once for each wavelength).
In addition to n SMG , MOCA calculates the spatial multiplexing ratio (SMR), defined as SMR ¼ n s ∕n SMG . This ratio is interpreted as the acceleration factor of the data acquisition speed when using spatial multiplexing. For example, for a 20-source probe, an n SMG of 5 can accelerate the data acquisition by a factor of SMR ¼ 20∕5 ¼ 4 fold.

Additional Functionalities
MOCA was created as an exploratory tool to interrogate specific design parameters and reveal the trade-offs, within a well-constrained search space, regarding specific design decisions. MOCA possess functions to facilitate changing probe-level parameters and exporting the desired probe for use in existing probe design tools such as AtlasViewer.

Altering spacing between modules
An optional parameter during module tessellation is probe spacing-a uniform distance assumed between adjacent modules. The spacing sweep function varies the probe spacing within a userdefined range in user-defined increments. For the three built-in polygons (triangle, square, and hexagon), spacing is increased between all adjacent sides of the modules within the probe. For arbitrary shapes, spacing is added to the horizontal and vertical sides of the rectangular bounding box. The number of modules required to cover the ROI is continuously adjusted as probe spacing is varied. The performance metrics for each of the resulting probes are reported by MOCA as a function of probe spacing.

Exhaustive search of module orientations
MOCA provides a limited orientation enumeration function to re-orient modules through a predefined number of orientations. For the three built-in polygons, the default number of reorientations per module is simply the number of sides of the polygon. For arbitrary shapes, the default number of re-orientations is four based on the bounding box. Additionally, a user can describe the number of orientations for any shape. MOCA re-orients modules in evenly spaced angle increments. An exhaustive search is performed using the number of modules in the probe and the number of user-defined orientations. Each probe resulting from each permutation of module re-orientations is characterized by MOCA and reported as a function of various probe layouts.

Staggering rows of modules
Staggering modules refer to shifting a row (or column) of tessellated modules in the x (or y) axis. Staggering is performed on tiling grid probe layouts. Adjusting this probe-level parameter is particularly useful for improving probes composed of modules with symmetrical optode layouts, where re-orienting modules does not affect SDS, or when high-density probes are needed, where probe spacing cannot be increased. A user defines both the range and increment by which to offset a particular row. Each resulting probe is analyzed and the corresponding performance metrics are calculated. MOCA then reports a plot of the S brain , SMR, and the number of channels for each staggered probe.

Exporting Probe for Use in AtlasViewer
MOCA performs its analysis of module-and probe-level parameters on an infinite slab model derived from the Colin27 atlas. When 3D analysis is desired, MOCA can export the probe layout to a ".sd" file for use in "SDgui"a built-in tool of AtlasViewer 41 used for creating and editing .sd files. To properly represent a modular probe layout in AtlasViewer (which treats all optodes individually without a reference to a module), MOCA first translates the module-level parameters by creating fixed/rigid springs between all optode pairs (source-source, source-detector, and detector-detector) within each module. These fixed springs maintain the relative optode layout within each module while permitting bending at the junctions between springs. MOCA then adds fixed springs between each inter-module channel (SD pairs between modules with distances below the SDS max ) to translate the probe-level parameters (spacing, orientation, staggering). As an additional constraint, MOCA adds flexible springs (springs of length -1) for inter-module channels above the SDS max . Finally, to register the probe to the surface of the selected atlas, MOCA adds three dummy optodes to the exported ".sd" file. All three optodes are placed at the midpoint between the minimum and maximum x coordinates of all optodes in the probe. The y coordinate of the first, second, and third dummy optodes are set to the minimum y coordinate, midpoint, and maximum y coordinate of all optodes in the probe, respectively. The first, second, and third dummy optodes are assigned to the Fpz, Cz, and Oz positions, respectively, in the standard 10-10 system. This places any MOCA-designed probe at the top of an atlas by default. A user can change the dummy optode anchors to re-position the probe on an atlas. The exported .sd file can then be loaded into AtlasViewer for placement on a generic or subject-specific atlas (Fig. 2).

Results and Practical Examples
In this section, we first validate the S brain derived from a simplified five-layer slab model against previously published atlas-based S brain results. 56  MOCA's assembly processes as investigational tools to potentially improve existing designs by altering probe-level parameters, such as probe spacing, module orientations, and the staggering of modules within an assembled probe. Figure 3 shows S brain calculated using our five-layer slab model at SD separations ranging from 1 to 60 mm in 1-mm increments (blue line). We also overlay full-head averages of S brain and standard deviations at 20, 25, 30, 35, and 40 mm separations from a previously published study 56 using the Colin27 atlas.

Slab-Based Brain Sensitivity Corresponds with Atlas-Based Sensitivity
Simulations on a five-layer slab model show an increase in S brain as SDS increases. Additionally, S brain for SD separations below 10 mm is <1.17%. At 20-, 25-, 30-, 35-, and 40-mm separations, the maximum difference between the atlas-based and slab-based S brain values is <0.6%. Figure 3 shows that using 2D approximation of the ROI and a layered brain structure provides a reasonable trade-off between accuracy and computational efficiency, especially for high-density probe characterization.

Comparison between Sample Modules of Various Shapes
MOCA allows the comparison of a wide range of fNIRS module designs by quantifying the effects of probe-level design parameters on a probe's performance. As a showcase, here we report the results from a comparison of three equilateral module shapes (square, hexagon, and triangle) with the same optode layout tessellated over a 200 × 200 mm ROI, derived from the average surface area of the top half of an adult male head. 63 Square 29-31 and hexagonal 32,33,43 fNIRS modules have been extensively studied in literature and are chosen here for a quantitative comparison. While an equilateral triangle has not been reported in published module designs, we include it here because of the potential suitability for better tessellation of a 3D surface in future extensions. With this comparison, we want to demonstrate both the scalability of MOCA in analyzing full-head probes and how performance metrics change across module-level design decisions.
As mentioned above, MOCA systematically tessellates the target ROI using the module geometry and assigns each module an index number. If not considering within-module optode locations, only translation is needed for both square and hexagon modules to completely cover a region. For the triangle shape, MOCA rotates every other triangle and its optodes 180 deg to fill the ROI without leaving any gaps. No other probe-level parameter changes are made for this

Slab estimation Strangman2013
SD separation (mm) Brain sensitivity (%) Fig. 3 Results comparing brain sensitivity derived from finite slab models used by MOCA and atlas-based models. The blue line shows calculated brain sensitivity based on a five-layer slab model for SD separations from 0 to 60 mm in 1-mm increments. Overlaid in black are the brain sensitivity results calculated from an atlas by averaging brain sensitivity for fixed source-detector separations across nineteen locations in the international 10-20 system. 56 comparison. Probe spacing is set to zero. The default SS threshold is set to 10 mm, and the SDS max is set to 30 mm. The minimum distance between sources used in calculating SMGs is set to 2 × SDS max . To avoid simultaneously changing multiple parameters and only focus on module shape, an identical optode layout made of two sources and two detectors is used in all three module designs in this example. The edge-length of the square is set to 33.33 mm, determined by the average length of three previously reported square-shaped module designs. [29][30][31] The edge-length of the hexagon and triangle is set to 20.68 and 50.65 mm, respectively, calculated to achieve the same area as the square module. The three module designs as well as the tessellation of the hexagon-based probe over the ROI are shown in Fig. 4. The derived performance metrics for each of the three sample probes are summarized in Table 2. The results that follow are only applicable for the specific module-and probe-level parameters chosen for this showcase.  Table 2 shows that the number of modules    Fig. 5(c)]. The hexagon-based probe appears to have the shortest inter-module channels [ Fig. 5(b)]. Due to its symmetry and given the SDS max setting, the square-based probe happens to have all SD separations at 24 mm. Notably, the triangle-based probe adds the most inter-module channels, almost twice the number of intra-module channels [ Fig. 5(d)], while also requiring two fewer modules than the hexagon-based probe ( Table 2, Rows 1-5). Figure 5(d) also shows that the number of inter-module channels is greater than the number of intra-module channels for all three probes.

Combining intra-and inter-module channels for brain sensitivity
The S brain values derived from the three probe designs, grouped by intra-module channels, intermodule channels, and all channels, are summarized in Fig. 6. Only channels above the SS threshold and below the SDS max are used. Despite having the fewest total channels ( Table 2, Row 3), the square-based probe results in a higher S brain than the hexagon-based probe. For the squareand triangle-based probes, the use of inter-module channels increases the probe's S brain as compared to simply using intra-module channels alone. For the hexagon-based probe, S brain computed using only intra-module channels is similar to that when using only inter-module channels (6.44% versus 6.54%). Due to having the same optode layout, the intra-module S brain is the same for all three probes.

Effect of module shapes on improving sampling rate
The total n s compared to the n SMG arising from the tessellation of each module over the ROI are compared in Fig. 7(a). The total number of sources for the square-, hexagon-and triangle-based probes are 72, 84, and 80, respectively. Figure 7(b) overlays the first SMG over the trianglebased full-head probe. Using the n SMG for each probe ( Table 2, Row 10), the SMR (the ratio between n s and n SMG ) is 8, 10.5, and 6.15 for the square-, hexagon-, and triangle-based probe, respectively. This result indicates that the hexagon-based probe's sampling rate can benefit the most when using group-based spatial multiplexing.

Improving Existing Probes through Probe-Level Parameter Alterations
The ability to compute performance metrics from basic design parameters allows users to explore probe-level alterations and potentially improve existing probes using MOCA. Here, we simulate and alter published examples to demonstrate how even simple module layout changes such as rotating selected modules, altering probe spacing, and staggering modules can potentially improve published probe designs.

Effect of optode orientation on probe characteristics
Re-orienting modules within existing probes alters the SDS distribution and, consequently, the probe's S brain and SMR. In Fig. 8, we simulate a 36 mm 2 square module in a probe configuration inspired by the μNTS fNIRS module described in Chitnis et al. 29 The modules in the initial tessellation are oriented in the same direction as in the original paper [ Fig. 8(a)]. In our investigation, the spacing between each module is set to 5 mm and the SDS max is set to 30 mm. Each module has two sources and four detectors, resulting in 8 intra-module channels per module ranging from 8 to 29 mm. A total of 256 different probe configurations result from exhaustively re-orienting each module individually by 90 deg. Without losing generality, a subset of 128 layouts are shown in Fig. 8(b) to show the range of the variations. Of the 256 possible layout configurations, eight of those layouts result in a maximum average brain sensitivity of 9.87%. These eight layouts also achieve the minimum number (n SMG ¼ 4) of spatial multiplexing groups. The intra-and inter-module channel distribution and channel count resulting from the MOCA analysis of the original probe layout are shown in Fig. 8(d). Figure 8(c) shows the same four-module probe but constructed with the bottom-left and topright modules rotated 90 deg clockwise, corresponding to layout number 66 in Fig. 8(b). Using MOCA, the spatial channel plot overlaid onto this re-oriented probe shows a denser coverage of the center of the ROI compared to the original probe layout. The channel count distribution of this re-oriented probe is shown in Fig. 8(e). As expected, the intra-module channels in Figs. 8(a) and 8(c) are identical. However, re-orienting the two modules produces a shift toward longer separation inter-module channels that are known to be more sensitive to brain tissues. The number of inter-module channels within the 10-to 20-mm range decreases from 8 to 4 and the number of 29-mm separation inter-module channels increases from 2 to 12 upon re-orienting the two modules. The re-orientation of modules not only allows the probe to have more longseparation (LS) channels, it also increases the total number of inter-module channels from 14 to 20 [ Figs. 8(d) and 8(e)]. Additionally, S brain of the probe increases from 8.56% to 9.87% [ Fig. 8(f)] while the number of spatial multiplexing groups, and subsequently the probe's sampling rate, remains the same.

Effect of probe spacing on probe performance
Probe spacing-the distance between edges of adjacent modules in a probe-is a parameter that can vary the resulting channel distribution and channel density of a probe by altering the relative distances between optodes on neighboring modules. To investigate the effect of this parameter, in Fig. 9, we simulate the probe layout described by Zhao et al., 33 which utilizes hexagonal shaped LUMO fNIRS modules developed by Gowerlabs. 64 The length of each side of the hexagonalshaped module used in our investigation is set to 18 mm and each module contains three sources and four detectors. The SDS max is set to 30 mm. A uniform spacing is set between all adjacent modules. Probe spacing is varied from 0 to 30 mm in 1 mm increments. When all modules are densely packed with a spacing of 1 mm, the probe results in 328 total channels (184 of which are inter-module channels), an S brain of 5.95%, and 12 SMGs. When the probe spacing is increased to 6 mm, the number of channels and spatial multiplexing groups remain the same while the S brain increases [ Fig. 9(b)]. The increase in S brain arises due to the overall increased distances between sources and detectors of inter-module channels which sample deeper into the brain tissue. This results in a local maximum S brain of 7.87%.
When we increase probe spacing to 8 mm, the inter-module channel separations increase to above the SDS max . This decreases the number of usable inter-module channels and the probe's S brain . The SMR remains unchanged between 6-and 8-mm probe spacing. Above 11 mm, the increase in probe spacing increases the relative distance between adjacent sources, allowing more sources to be turned on at the same time and decreasing the n SMG needed. This trend continues as we increase probe spacing. Consequently, the probe's S brain reaches a minimal plateau of 3% at 15 mm spacing and beyond because only intra-module channels above the SS threshold remain within the SD range [ Fig. 9(b)]. Similarly, since modules are further apart, the n SMG continues to drop which increases the SMR (and the sampling rate of the probe when spatial multiplexing encoding is utilized). At 29-mm spacing, the SMR value is 12 due to only three spatial multiplexing groups needed (one for each of the three sources on each module).

Effect of staggering modules on probe characteristics
Staggering adjacent modules within a high-density probe can increase inter-module SD separations to improve performance. To demonstrate the effect of staggering on the resulting probe, in Fig. 10 we simulate a 42 mm 2 square module in a 3 × 1 layout configuration inspired by M3BA modules. 30 Each of our simulated modules contain two sources and two detectors. The probe was staggered by translating the center module between 0 mm and 42 mm along the horizontal axis. In Fig. 10(a), we overlaid the intra-(blue) and inter-module (orange) channels over the threemodule probe. The resulting channel distribution shows 12 intra-module channels at 28 mm and 4 inter-module channels at 14-mm SD separations [ Fig. 10(b)]. The S brain of this probe using all channels is 8.79% [ Fig. 10(c)]. When analyzed separately by intra-and inter-module channels, the S brain using only intra-module channels (10.75%) is larger the S brain when using only intermodule channels (2.9%) since in this tessellation intra-module channels are larger and probe deeper into the tissue.
In Fig. 10(c), we show the effect of staggering the tessellated module layout by translating the center module along the horizontal axis. This alteration increases the inter-module channel separations. Consequently, the S brain due to only inter-module channels increases until the intermodule channel separations are larger than the SDS max . The S brain using all channels increases from 8.79% in the original tessellation to a maximum of 10.95% in the staggered tessellation at 26 mm. The n SMG between the two layouts remained the same until a staggering amount of 31 mm at which point the sources are far away enough to group them together [ Fig. 10(f)].

Discussion
Through the case studies shown in Sec. 4, we demonstrate the high complexity in designing a modular probe, where even adjusting a single parameter may have a profound impact on other parameters and the overall performance. Despite the fact that MOCA only permits operatorguided parameter interrogation in a well-constrained problem, the results from the above experiments did reveal a number of important design strategies that were not previously discussed in literature, including the effect of module re-orientation, fine-tuning the space between modules, and module staggering to potentially improve existing fNIRS probes. Figure 5 reveals that despite having the same optode layout, probes composed of different module shapes covering the same ROI result in different channel distributions. Although the inter-module channels are identical between modules, the resulting total number of channels is related to the number of modules needed to cover the ROI. The effect of module shape on channel distribution is complex and requires a tool such as MOCA to thoroughly investigate. Certain module geometries result in optodes closer to the module's edges, effectively shortening intermodule channels in completely tessellated probes. Because the optode layout in Fig. 4 is not completely symmetric and each module shape is an equilateral polygon, each individual module can be re-oriented without overlapping while maintaining the complete tessellation of the probe. While not altering intra-module channel distributions, these orientation configurations spatially alter channel locations and alter inter-module channel separations. The results from Fig. 5 also show how some individual module shapes may be more appropriate for certain subject populations. For example, the high count of 19-mm inter-module channel separations in the hexagonbased probe make it better suited for infant populations. An important takeaway is that the number of inter-module channels of an assembled probe is not a simple multiplicative factor of the number of intra-module channels. These results demonstrate the dependency a probe's derived characteristics have on module shape even when different modules have the exact same optode layout.
The results in Fig. 6 provide a counter-example where higher channel density due to increased inter-module channels may not necessarily improve all performance metrics of a probe. Despite having fewer total channels than the hexagon-based probe, the square-based probe results in a higher average brain sensitivity (S brain ) due to larger inter-module channel separations. This reveals the trade-offs in performance metric improvement, emphasizing the need for S brain to be considered in conjunction with channel distribution when comparing probes. Additionally, this analysis reveals that the use of inter-module channels in addition to intramodule channels does not always lead to increased S brain for probes based on different module shapes. In fact, the use of only inter-module channels increases the average penetration depth for the square-and triangle-based probes due to the larger channel separations. However, for the hexagon-based probe design in this example, Fig. 6 shows that the contribution to S brain from using only intra-or only inter-module channels differed by merely 0.1%. These results show that adding inter-module channels to intra-module probes will not always result in improved S brain . Thus, users of this particular hexagon-based probe may benefit from the simplicity and faster sampling rate of using only intra-module channels rather than implementing a potentially complex data acquisition method to capture inter-module channels. Although ignoring inter-module channels can increase sampling rate without affecting S brain for this particular probe, it does result in fewer channels and lowers the channel density of the probe. Through this complex example, we show that it is non-trivial to consider all constraints in a modular probe. MOCA is positioned as a tool to help designers challenge hypotheses, explore alternative designs, and quantify various trade-offs. Figure 7 shows that the hexagon-based probe can achieve the highest sampling rate among the three configurations if a spatial multiplexing encoding strategy is implemented. The frame rate of a sequential encoding strategy is dependent on the total number of sources (n s ) because each source needs to be turned on and sampled once. Spatial multiplexing allows multiple sources within a group to be turned on simultaneously, allowing the sampling rate to increase by a factor of n s ∕n SMG , defined as the SMR. Therefore, despite having the lowest sampling rate when sampled sequentially due to the highest n s ( Table 2, Row 1), the hexagon-based probe has the fastest sampling rate of the three probes when spatial multiplexing is used due to the low n SMG [Fig. 7(a)]. These results demonstrate that a probe's sampling rate can be increased not only through firmware changes or advanced electronics, but also by using different module shapes with the same optode layout.
While MOCA's ability to change module-level parameters helps design new fNIRS modules, its ability to sweep through probe-level parameters helps potentially improve existing ones. Figure 8 shows how probes based on published modules can potentially improve S brain at no increased cost and without re-designing modules by altering the orientations of modules that make up the probe. The orientation changes in layout 66 [ Fig. 8(c)] increase the channel density at the center of the ROI, but also increase the number of inter-module channels by 43%. The emerging inter-module channels also have larger source-detector separation (SDS) and contribute to an increase in S brain without changing the SMR. The re-oriented probe in Fig. 8(c) is only a representative case of how a 2 × 2 probe composed of square modules can be potentially improved and is exhaustive only because the number of possible orientations of each of the four modules were limited to 4, resulting in 4 4 ¼ 256 probe layouts to analyze. Additionally, the reorientation of modules causes changes to performance metrics due to the asymmetry of the optode layout within each module. If the optode layout was symmetric, re-orienting modules would have no effect on either inter-or intra-module channels.
In Fig. 9, we investigated the effect of spacing between modules on the derived performance metrics of a probe composed of hexagonal-shaped modules. The results suggest that varying module spacing does have an impact on S brain . Since optodes are generally placed near the edges of the modules to maximize intra-module channel separations, dense probes with modules near one another tend to have shorter inter-module channel separations. This trend becomes more apparent as the size of the module increases. Increasing the probe spacing increases the distance between optodes on neighboring modules, thus increasing the S brain in the process. This increase in S brain , however, has a local maximum. As shown in Fig. 9, further increasing probe spacing leads to a drop in the number of inter-module channels as their SD separations become greater than the separation limit (SDS max ). Additionally, increasing the distance between modules reduces the number of multiplexing groups (n SMG ) which increases the SMR and consequently the probe's sampling rate. Once the probe spacing exceeds the user-specified SMG diameter, one source on each module can be turned on at the same time because each source would be outside the other's "effective" region. Because the distance between sources on the same module does not change, a different SMG is required for each source within a module. Thus, the limit to the minimum n SMG is equal to the number of sources on a single module, revealing a minimum improvement in sampling rate due to spatial multiplexing encoding. Compared to a sequential sampling strategy, a spatial multiplexing encoding strategy will increase a probe's sampling rate by at least a factor equal to the number of sources on one module. Figure 9 shows that probe spacing can both alter n SMG to help meet sampling rate requirements and alter inter-module channel separations to meet channel distribution needs. Figure 10 shows that staggering a probe layout can increase S brain in dense probes. Simulations using a published module shape 30 with zero probe spacing results in inter-module channels of 14-mm separations. These channels are too long to be SS channels and too short to be LS channels. Staggering spatially increases inter-module channel separations while maintaining the compactness of a probe [ Fig. 10(c)]. This improvement works with square or rectangular modules since staggering is done by translating user-specified modules along a horizontal or vertical axis. For module designs with symmetrical optode layouts, we recommend staggering probe layouts by translating every other module row by half of the module's maximum width in one axis [ Fig. 10(f)]. This ensures the optodes from the translated module are well separated from modules of the adjacent rows.
The results above are derived from investigating the module-and probe-level design parameters that MOCA currently supports. However, this only represents a small subset of the general parameters previously used in evaluating a modular probe. 24 For example, user feedback-based design parameters not yet accounted for in MOCA include conformability (a module's ability to conform to a curved surface), subject comfort, and safety limits such as operating voltage and heating effects. Source output power and module weight each require external instrumentation measurements while noise-equivalent power and dynamic range calculations require lab-specific phantoms. Power consumption depends on the type of optodes used as well as the control electronics of the individual module while a probe's battery life can be adjusted using existing off-the-shelf components. Each of these design parameters are based on specific electronic or material components chosen for a particular module design. MOCA was built to easily scale and incorporate more complex mechanical-, ergonomic-, safety-and experiment-specific considerations in the future as those design parameters are evaluated.
There are limitations to MOCA's current minimal subset of design parameters. First, the ability to re-orient, increase spacing, or stagger modules assumes that modules can be connected in any orientation. This is true for many published modular designs where cables of different lengths can be easily connected to the top of a module, but does not necessarily apply to more sophisticated designs that have embedded printed flex connectors or utilize headgears with predetermined mounting locations. Second, MOCA does not currently support multiple module shapes within the same probe or different optode layouts on different modules. Third, MOCA's channel count output does not include wavelength number as a multiplier. This approach allows one to quickly scale the channel distribution and channel counts when dual-wavelength or triplewavelength sources are utilized. Similarly, the n SMG is also defined for a single wavelength. Thus, when estimating the total sampling rate of the probe using multi-wavelength sources, the control unit must cycle through each group multiple times (once for each wavelength). Fourth, MOCA's analysis is based on the coordinates of the center of an optode's active area and does not account for the actual size of optode package, the shape of the optode's active area, or any master control unit needed to control a series of modules. Despite being able to place optodes near the edge of modules in MOCA, designers may face constraints in practice imposed by the fabrication process due to board materials, sizes, and electrical routing needed to drive these optoelectronics. In general, module shapes with large interior angles allow optodes to be placed closer to the module's perimeter. Fifth, MOCA's probe-level functions are only one way of interrogating parameters in a systematic way. These functions vary parameters in discrete increments (fixed number of orientations, a set spacing range, and user-defined translation amounts) and therefore only explore a subset of all potential probe layouts. They do not determine an optimal probe configuration-they assist in improving existing probes by adding design constraints (holding module-level parameters constant) and allowing a user to identify design choices that improve performance for their particular application. Finally, MOCA can output 2D optode layouts but relies on other existing software, such as AtlasViewer, 41 to perform 3D head contour registration. It does, however, automatically add spring relationships to embed modular aspects into an exported probe. For example, the distance between all optodes (both sources and detectors) within a module are fixed, while inter-module channels can vary slightly. This ensures that a physically rigid electronic module does not transform when registered to a surface. In addition, the performance metrics output by MOCA are currently based on a 2D probe layout and do not account for changes in SDS if the probe is wrapped on the 3D surface of a head. 34 Consequently, 2D derived metrics may underestimate the number of channels when a probe is made to conform to the scalp. This may result in an increase in the number of total inter-module channels for a probe. However, by working in 2D, MOCA can both help unearth design and performance relationships, as well as drastically constrain the vast potential design space by helping researchers converge on the module-and probe-level parameters that most impact performance.

Conclusion
We have developed a MATLAB-based modular probe design toolbox, MOCA, with the goal of providing fNIRS developers with a systematic yet easy-to-use software platform to navigate the large design space of modular fNIRS probes and provide metrics-based guidance. MOCA simplifies the design problem with module-level parameters, such as size, shape, and optode layout as well as probe-level parameters, such as the maximum SDS and ROI geometry to characterize a modular probe. It offers the ability to perform operator-guided sweeping of probe parameters, such as orientation, spacing, and module staggering offset, helping designers explore alternative designs that potentially improve upon existing probes or outline spectra of trade-offs. MOCA is quantitative, guided by application-specific fNIRS performance metrics, including channel distribution, average brain sensitivity, and spatial multiplexing groups, making it possible for quantitative characterization and comparison between various design decisions. Applying MOCA in several case studies, we identified several valuable design considerations that have not been widely recognized, including the importance of fine-tuning module orientation, spacing, and staggering distance. In the meantime, these case studies also demonstrate the complexity of modular probe optimization, where multiple variables compete and eventually lead to alternative designs with various trade-offs. While MOCA was not designed to provide full automation for complex probe design and optimization, it offers fNIRS probe designers a suite of powerful tools, including module tiling, routing, re-orientation, and fine-tuning of module spacing and staggering offset, with each outcome quantified by meaningful performance metrics. MOCA is expected to attract more research interests toward developing next-generation modular fNIRS systems.
Miguel Mireles is a postdoctoral research associate in biomedical engineering in the Bioengineering Department, Northeastern University College of Engineering, Boston, Massachusetts, USA. He received his PhD in photonics from ICFO-The Institute of Photonic Sciences, Barcelona, Spain. His research interests span from the design and development of nearinfrared systems to their application in neuroimaging and oncology treatment monitoring.
Qianqian Fang is currently an associate professor in the Bioengineering Department, Northeastern University College of Engineering, Boston, Massachusetts. He received his PhD from Dartmouth College in 2005. He then joined Massachusetts General Hospital and became an assistant professor in 2012, before he joined Northeastern University in 2015. His research interests include translational medical imaging systems, low-cost point-of-care devices for resource-limited regions, and high-performance computing tools to facilitate the development of next-generation imaging platforms.