The four R scripts together form a radiation-free 3D back-surface scanner for assessing spinal deformity. A camera photographs a patient's bare back while a horizontal grating pattern (fringes) is projected onto it. refcalvert.r runs once per rig setup to compute the camera/projector geometry and fringe frequency from a reference-plane photo. surfcolour.r takes the patient's back photo, autocrops it to the back region, removes the arms via armpit detection, demodulates the fringe pattern using Fourier Transform Profilometry (FFT → phase → unwrap → height), and produces a 3D surface map, while simultaneously locating the coloured marker stickers on the spine and PSIS to define the anatomical reference frame. blob.r re-thresholds the UV image with user-controlled settings to fine-tune marker detection if needed. Finally, clinic2.r loads the reconstructed surface, rotates and tilts it so the PSIS line is horizontal and the vertebra prominens sits over the sacrum, then fits a 5th-order polynomial through the spinal markers to extract clinically meaningful parameters — Cobb-like angles, coronal imbalance, axial rotation, transverse skin angles, kyphosis and lordosis angles, scapular height differences, and bilateral/volumetric asymmetry — and renders everything into a multi-page PDF report (results.pdf) plus two bilateral-asymmetry maps (bamall.pdf, bamhigh.pdf) and a numeric summary (results.txt). In short: photo in → 3D surface + spinal landmarks out → clinically interpretable deformity report, with no X-ray exposure.