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