Optimization for ECT treatment planning