Design methodology for 3d-stacked imaging systems with integrated deep learning