Finding indices and number pixels for rectangle shapes

opened a new branch due to q_roi is not working in Travis