Near-infrared spectroscopy (NIRS) is a non-invasive cortical imaging technique that provides many of the advantages of cortical fMRI with additional benefits of low cost, portability, and increased temporal resolution—features that make it potentially ideal for clinical diagnostic applications. However, the usefulness of NIRS is contingent on the ability to reliably localize the measured signal cortically. Although this can be achieved by supplementing NIRS data collection with an MRI scan, a much more appealing alternative is to use a portable magnetic measuring system to record the locations of optodes. Previous work has shown that optode skull measurements can be projected to the brain consistently within reasonable error bounds. Yet, as we show, if this is done without explicitly modeling the geometry of the holder securing the NIR optodes to participants' heads, considerable bias in the projection loci results. Here, we describe an algorithm that not only overcomes this bias but also corrects for measurement error in both optode position and skull reference points (which are used to register the measurements to standard brain templates) by applying geometric constraints. This method has been implemented as part of our NIRS Analysis Package (NAP), a public domain Matlab toolbox for analysis of NIRS data.