[vtkusers] vtk JS - Slice Scrolling with vtkInteractorStyleImage

Logan Langholz llangholz89 at gmail.com
Fri Jun 16 14:11:37 EDT 2017


Hello, 

I’ve been playing around with the vtk.js library and am currently stuck when trying to scroll through slices of a volume using the vtkInteractorStyleImage class. Using the examples as a guide and the ‘LIDC2.vti’ example volume, I can get various slices to show up on loading with ‘mapper.setZSclice()’, but am then unable to scroll through.  Here’s that bit of the code:

	const mapper = vtkImageMapper.newInstance();
	mapper.setInputData(data);
	mapper.setZSlice(50);
	
	const iStyle = vtkInteractorStyleImage.newInstance();
	iStyle.setInteractionMode(‘IMAGE_SLICING’);
	renderWindow.getInteractor().setInteractorStyle(iStyle);

Looking at the source code, clicking while holding ‘control’ should allow me to scroll through, but I’m not getting that event.  If I switch the interaction mode to ‘IMAGE3D’ and hold shift, I can get the expected rotation event.  

I’m not sure if it’s just something simple that I’m overlooking in the setup (which is likely given that I’m still relatively new to this), but I appreciate any help and pointers!  

Cheers,

-Logan


More information about the vtkusers mailing list