vtkWin32RenderWindowInteractor (00000212DF4DB820): No renderer defined!

I am working on a reading dicom images using Qt framework and VTK.
I followed the below example .

When i open a dicom image file from a directory, I was not able to view the image and I get the following error.

ERROR: In D:\VTK\VTK-9.0.1\Rendering\UI\vtkWin32RenderWindowInteractor.cxx, line 178
vtkWin32RenderWindowInteractor (00000212DF4DB820): No renderer defined!

How can i resolve this?

Thanks in advance.

Instead of starting from scratch, I would recommend to build upon/customize/extend any of the free, open-source VTK+Qt based medical image viewers, such as 3D Slicer or MITK.

If you want to implement something small and simple then users expect to get a web application that runs in their browser, on their tablets and phones.
If you need to implement something more sophisticated then a desktop application makes sense, but you cannot afford to start one from scratch, because the development would just requite too much time and money.