Optical neuroimaging provides an effective neuroscience tool for multi-scale investigation of the neural structures and functions, ranging from molecular, cellular activities to the inter-regional connectivity assessment. Amongst experimental preparations, the implementation of an artificial window to the central nervous system (CNS) is primarily required for optical visualization of the CNS and associated brain activities through the opaque skin and bone. Either thinning down or removing portions of the skull or spine is necessary for unobstructed long-term in vivo observations, for which types of the cranial and spinal window and applied materials vary depending on the study objectives. As diversely useful, a window can be designed to accommodate other experimental methods such as electrophysiology or optogenetics. Moreover, auxiliary apparatuses would allow the recording in synchrony with behavior of large-scale brain connectivity signals across the CNS, such as olfactory bulb, cerebral cortex, cerebellum, and spinal cord. Such advancements in the cranial and spinal window have resulted in a paradigm shift in neuroscience, enabling in vivo investigation of the brain function and dysfunction at the microscopic, cellular level. This Review addresses the types and classifications of windows used in optical neuroimaging while describing how to perform in vivo studies using rodent models in combination with other experimental modalities during behavioral tests. The cranial and spinal window has enabled longitudinal examination of evolving neural mechanisms via in situ visualization of the brain. We expect transformable and multi-functional cranial and spinal windows to become commonplace in neuroscience laboratories, further facilitating advances in optical neuroimaging systems.