Framework for building Statistical Image And Shape Models