# The NIRS Brain AnalyzIR Toolbox
## 6 Toolbox Utilities
### Probe Registration  
The _nirs.core.Probe_ object class encodes both two-dimensional and three-dimensional information about the fNIRS sensor layout. Three-dimensionally registered information can be imported directly from the raw data files (e.g., the case in NIRx data file format) or using third-party code such as AtlasViewer [61]. Within the toolbox there are features to register the probe. To register a fNIRS probe a set of landmarks need to be defined relative to the fNIRS sensors in the two-dimensional space. For example, the 10-20 point FpZ might be located in between two specific optodes on the probe. These landmarks are defined as either \"anchors\" or \"attractors\" and can be any of the standard 10-20, 10-10, or 10-5 head point coordinates. Anchors define landmarks that are fixed in position relative to the fNIRS optodes. Attractors define directional information. For example, the \(y\)-axis of the fNIRS probe might be oriented in the direction of the 10-20 points FpZ to Cz. This notation is similar to the use in the AtlasViewer program [61]. The probe is then registered to a generic spherical shape using an interactive relaxation of a network of connected springs between the optodes. In our toolbox, the springs connecting optodes are automatically populated (c.f. AtlasViewer where this is user-defined). For disjointed probes (e.g., where the probe on the left/right hemispheres are separate pieces), an option is included to separate register each part as long as each piece has at least one anchor point. In registering the probe to the spherical shape, the size of the shape (head) can be changed by specifying the distance over the top of the head from the nasion to inion, left/right perarticular points, and the head circumference. If only one of the three distances is specified, then the shape is isotropically stretched.  
Once the probe is registered into a 10-20 (spherical) space, a head/brain model can be registered into the same space. A version of the Colin27 atlas [62] is included in the toolbox, which has been preprocessed using FreeSurfer [63] to generate a layered head model (skin, skull, cerebral spinal fluid, gray/white matter). The gray/white matter surfaces have been labeled using both the AAL2 [64; 65] and Freesurfer \"aparc\" [66] parcellation labels which is stored in the variable. Subject specific models can also be imported from FreeSurfer or similar programs. The registration of the fNIRS probe to the brain model can either be done by rescaling the brain to match the measured head circumference of the subject or by re-registering the probe to match the measurements computed from the brain/head model.  
Once registered, the probe object's drawing is controlled through the _default_draw_ field, which provides the choose of the original two-dimensional (\"2D\"), in 10-20 space (\"10-20\"; which uses a Clarke azimuthal map projection), or as a three-dimensional drawing overlain on the head mesh \"3D mesh(<view>)\". The keyword \"zoom\" added to the end of the draw field string will cause the view to be zoomed to show only the part of the map covered by the probe (c.f. showing the whole 10-20 map as demonstrated back in Figure 1).