The cortical hemodynamic response to somatosensory stimulus is investigated at the level of individual vascular compartments using both depth-resolved optical imaging and in-vivo two-photon microscopy. We utilize a new imaging and spatiotemporal analysis approach that exploits the different characteristic dynamics of responding arteries, arterioles, capillaries and veins to isolate their three-dimensional spatial extent within the cortex. This spatial delineation is validated using vascular casts. Temporal delineation is supported by in-vivo two-photon microscopy of the temporal dynamics and vascular mechanisms of the arteriolar and venous responses. Using these techniques we have been able to characterize the roles of the different vascular compartments in generating and controlling the hemodynamic response to somatosensory stimulus. We find that changes in arteriolar total hemoglobin concentration agree well with arteriolar dilation dynamics, which in turn correspond closely with changes in venous blood flow. For 4-s stimuli, we see only small changes in venous hemoglobin concentration, and do not detect measurable dilation or ballooning in the veins. Instead, we see significant evidence of capillary hyperemia. We compare our findings to historical observations of the composite hemodynamic response from other modalities including functional magnetic resonance imaging. Implications of our results are discussed with respect to mathematical models of cortical hemodynamics, and to current theories on the mechanisms underlying neurovascular coupling. We also conclude that our spatiotemporal analysis approach is capable of isolating and localizing signals from the capillary bed local to neuronal activation, and holds promise for improving the specificity of other hemodynamic imaging modalities.