updated to make use of stateS.scanSet and to check for empty slices outside the dose field.
updated to make use of stateS.scanSet and to check for empty slices outside the dose field.

aditiiyer/CERR,cerr/CERR,aditiiyer/CERR,aditiiyer/CERR,cerr/CERR,cerr/CERR,cerr/CERR,aditiiyer/CERR,aditiiyer/CERR,cerr/CERR,cerr/CERR,aditiiyer/CERR,aditiiyer/CERR,cerr/CERR,cerr/CERR,cerr/CERR,aditiiyer/CERR