The aim of this study is to calculate setup margin based on six-dimensional (6D) corrected residual positional errors from kV cone beam computed tomography (CBCT) and from intrafraction projection kV imaging in coplanar and in noncoplanar couch positions in stereotactic radiotherapy. Six dimensional positional corrections were carried out before patient treatments, using a robotic couch and CBCT matching. A CBCT and stereoscopic ExacTrac image were acquired post-table position correction. Further, a series of intrafraction ExacTrac images were obtained for the variable couch position. Translational and rotational errors were identified as lateral (X), longitudinal (Y), vertical (Z); roll (Ɵ°), pitch (Φ°) and yaw (Ψ°). A total of 699 intrafraction image sets (361 coplanar and 338 noncoplanar) for 51 SRS/SRT patients were analysed. Rotational errors were corrected in terms of translational coordinates. Residual set-up margins were calculated from CBCT shifts. ExacTrac shifts give residual+intrafraction setup margins as a function of coplanar and noncoplanar couchpositions. The average residual positional error obtained from CBCT in X, Y, Z, Ɵ, Φ, Ψ were 0.1±0.4mm, 0.0±0.6mm,0.0±0.5mm, 0.2±0.8°, 0.1±0.6° and -0.1±0.7° respectively. For ExacTrac, the shits were -0.5±0.9mm, -0.0±1mm, -0.6±1.0mm, 0.4±0.9°, -0.2±0.6°, and -0.0±0.8°. CBCT calculated linear setup margins in X, Y, Z direction were 0.5, 1.2, and 1mm respectively. ExacTrac yielded coplanar and noncoplanar linear setup margins were 1.2, 1.3, 1.5, 1.4, 1.5, and 2.1mm respectively. CBCT-based gross residual set-up margin is equal to 1mm. ExacTrac calculated residual plus intrafraction setup margin falls within a 2mm range; attributed to intrafraction patient movement, table position inaccuracies, and poor image fusion in noncoplanar geometry. There could be variations in the required additional margin between centers and between machines, which require further studies.