Projection data are acquired by one or more gamma detectors of a medical imaging system. The counts for each projection are binned into time bins to provide respective frames. Using a computer processor, a respective weight factor is computed for each pair of input points among a plurality of input points associated with respective time bins, each input point being an M-dimensional representation of the frame corresponding to the associated time bin for one of the projections. Each weight factor is inversely proportional to a distance computed between the corresponding pair of input points according to an adaptive distance measure that is dependent on the projection data corresponding to said one projection. An N-dimensional surrogate respiratory signal (N<;M) is generated based on an optimization of a nonlinear objective function using the weight factors, wherein the surrogate respiratory signal is indicative of patient respiratory activity.