Covering from photography to depth and spectral estimation, diverse computational imaging (CI) applications benefit from the versatile modulation of coded apertures (CAs). The light wave fields as space, time, or spectral can be modulated to obtain projected encoded information at the sensor that is then decoded by efficient methods, such as the modern deep learning decoders. Despite the CA can be fabricated to produce an analog modulation, a binary CA is mostly preferred since easier calibration, higher speed, and lower storage are achieved. As the performance of the decoder mainly depends on the structure of the CA, several works optimize the CA ensembles by customizing regularizers for a particular application without considering critical physical constraints of the CAs. This work presents an end-to-end (E2E) deep learning-based optimization of CAs for CI tasks. The CA design method aims to cover a wide range of CI problems easily changing the loss function of the deep approach. The designed loss function includes regularizers to fulfill the widely used sensing requirements of the CI applications. Mainly, the regularizers can be selected to optimize the transmittance, the compression ratio and the correlation between measurements, while a binary CA solution is encouraged, and the performance of the CI task is maximized in applications such as restoration, classification, and semantic segmentation.