[vtkusers] Export resultant image of vtkFixedPointVolumeRayCastMapper as byte array and display it in an html page?

Kevin H. Hobbs hobbsk at ohio.edu
Thu Nov 15 08:33:28 EST 2012


On 11/14/2012 12:21 AM, abhishek wrote:
> Dear Users, 
> 
> I want to export resultant image of vtkFixedPointVolumeRayCastMapper as byte
> array and display it in an html page. On reading documentation of
> vtkFixedPointVolumeRayCastMapper, I found that there is a class called
> "vtkFixedPointRayCastImage" and method "GetRayCastImage" in
> "vtkFixedPointVolumeRayCastMapper". But this returns a *null* image.

I've used :

	// Render Window
	vtkRenderWindow * render_window = vtkRenderWindow::New();
	render_window->SetSize( WSIZE, WSIZE / 2 );
	render_window->SetOffScreenRendering( 1 );
	render_window->AddRenderer( renderer );
	// ***** STEREO *****
	//render_window->StereoRenderOn();

	// Window to Image	
	vtkWindowToImageFilter * win_2_image
		= vtkWindowToImageFilter::New();
	win_2_image->SetInput( render_window );

	// PNG Writer
	vtkPNGWriter * writer = vtkPNGWriter::New();
	writer->SetFileName( out_file_name );
	writer->SetInputConnection( win_2_image->GetOutputPort() );

	render_window->Render();

	writer->Write();

at the end of my rendering pipeline. You could just update the
vtkWindowToImageFilter directly and get it's output.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 251 bytes
Desc: OpenPGP digital signature
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20121115/a4e15849/attachment.pgp>


More information about the vtkusers mailing list