mitk::StdFunctionCommand::ActionFunction mitk::DisplayActionEventFunctions::ScrollSliceStepperAction()
{
  auto actionFunction = [](const itk::EventObject& displayInteractorEvent)
  {
    if (DisplayScrollEvent().CheckEvent(&displayInteractorEvent))
    {
      const DisplayScrollEvent* displayActionEvent = dynamic_cast<const DisplayScrollEvent*>(&displayInteractorEvent);
      const BaseRenderer::Pointer sendingRenderer = displayActionEvent->GetSender();
      if (nullptr == sendingRenderer)
      {
        return;
      }

      mitk::SliceNavigationController* sliceNavigationController = sendingRenderer->GetSliceNavigationController();
      if (nullptr == sliceNavigationController)
      {
        return;
      }
      if (sliceNavigationController->GetSliceLocked())
      {
        return;
      }
      mitk::Stepper* sliceStepper = sliceNavigationController->GetSlice();
      if (nullptr == sliceStepper)
      {
        return;
      }

      // if only a single slice image was loaded, scrolling will affect the time steps
      if (sliceStepper->GetSteps() <= 1)
      {
        sliceStepper = sliceNavigationController->GetTime();
      }

      sliceStepper->MoveSlice(displayActionEvent->GetSliceDelta());
    }
  };

  return actionFunction;
}