about vtk continuous display

I want vtk to display images continuously, because I am tracking the registration process, but my code will not respond to the image window when running. What should I do?

void Updata() {
		i++;
		cout << i << endl;
		viewer->SetInputData(image->GetOutput());
		std::string name =std::to_string(i);
		viewer->GetRenderWindow()->SetWindowName(name.c_str());
		viewer->Render();
	}
	void Setimage(vtkImageFlip* image) {
		this->image = image;
	}

Is it wrong for me to do this? I keep setting new images in vtkimageviewer2, and then render them.