You need to create a vtkMRMLScalarVolumeNode as shown here. I’m not sure how to set the pixel data in vtkImageData from a QByteArray but @pieper did something similar in the past so maybe he can help.
A much simpler approach is to write the byte array to a file, create a text header file (e.g., a NRRD image file header) and read the header file into Slicer using slicer.util.loadVolume("path/to/something.nhdr")
.