Four basis transmit k-space trajectories (a single variable density spiral-in, a two stack of variable density spiral-in, a three stack of variable density spiral-in and a SPINS trajectory) were optimized for pTx radiofrequency pulse design in order to match the excitation target pattern. The parameter to be optimized where the parameter of the analytical equations of the basis trajectories. The procedure was tested on local excitation and whole brain-like excitation target patterns. Optimized trajectories enabled considerably improved radiofrequency pulse performance, compared to radiofrequency pulses based on unsuited trajectories. The optimization code is available online as open source (https://github.com/ole1965/workflow_OTUP.git).