In the demos, I used this approach to render segmentation masks on the render windows.
previewImage->InitializeByLabeledImage(outputImage); previewImage->SetGeometry(this->GetWorkingPlaneGeometry()->Clone())
While this won't work when confirm button is clicked (since the geometry is not of an image).
The proposed solution was to use:
mitk::SegTool2D::WriteSliceToVolume( previewImage, this->GetWorkingPlaneGeometry(), outputImage.GetPointer(), timeStep, true);
This 'works' but produces a plain full mask for the slice.