sorry, forget my previous post..<br>I just found the solution:<br><br>for whoever could be interested, this is my working :) callback:<br><br>void callback(vtkObject *caller, unsigned long event_id, void *clientdata, void *calldata)<br>{<br> vtkRenderWindowInteractor *interactor = static_cast< vtkRenderWindowInteractor* >( clientdata );<br> //why is this necessary?<br> vtkInteractorStyleUser *style = static_cast< vtkInteractorStyleUser* >( caller ); <br> <br> switch( event_id ){<br> case vtkCommand::CharEvent:<br> switch( style->GetChar() ){<br> case 'h':<br> scroll_Z=scroll_Z+10;<br> global_XYslice->SetDisplayExtent(0,127, 0,127, scroll_Z,scroll_Z);<br>
g_win->Render();<br> break; <br> }<br> break;<br> }<br>}<br><br>thanks anyway..<br><br><br><br><b><i>Alessio Balzide <mail_di_ale@yahoo.it></i></b> ha scritto:<blockquote class="replbq" style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"> good morning everybody!<br>I'm visualizing a 3D "analyze" volume, slice by slice. Ok I can do that, but I cannot interact with the slices (moving them through the volume). Can someone explain me how to do that?<br><br>Here's my obviously-not-working idea: (the code is in C++)<br>I use "vtkInteractorStyleUser.h", create a callback and updatie the position of the slices. But it doesn't work.. even if I re-render the window. Why????<br><br>This is my code:<br>//Extract a slice<br>vtkExtractVOI *extractor_XY = vtkExtractVOI::New();<br>
extractor_XY->SetInputConnection(ImgReader->GetOutputPort());<br> extractor_XY->SetVOI( 0, hdr.dim[1]-1, 0, hdr.dim[2]-1, scroll_Z, scroll_Z);<br> extractor_XY->Update();<br> global_extrator_XY = extractor_XY;<br><br> //Create its texture<br> vtkTexture *texture_XY = vtkTexture::New();<br> texture_XY->SetInputConnection(extractor_XY->GetOutputPort());<br> texture_XY->InterpolateOn();<br> texture_XY->SetLookupTable(grayScaleLookupTable);<br> texture_XY->MapColorScalarsThroughLookupTableOn();<br> global_ texture_XY = texture_XY;<br><br> //Create a plane for the texture<br> vtkPlaneSource *plane_XY = vtkPlaneSource::New();<br> plane_XY->SetXResolution(1);<br> plane_XY->SetYResolution(1);<br> plane_XY->SetOrigin(0.0, 0.0, scroll_Z);<br> plane_XY->SetPoint1(hdr.dim[1]-1, 0.0, scroll_Z);<br> plane_XY->SetPoint2(0.0, hdr.dim[1]-1,
scroll_Z);<br> global_plane_XY = plane_XY;<br><br> //Shot it through the pipeline<br> vtkPolyDataMapper *mapper_XY = vtkPolyDataMapper::New();<br> mapper_XY->SetInputConnection(plane_XY->GetOutputPort());<br> mapper_XY->ImmediateModeRenderingOn();<br>global_mapper_XY = mapper_XY;<br> vtkActor *actorSlice_XY = vtkActor::New();<br> actorSlice_XY->SetMapper(mapper_XY);<br> actorSlice_XY->SetTexture(texture_XY);<br><br>and in the callback, I change the "scroll_Z" value, update the global variables, and re-render... Why the hell is it not working?????<br><br>Thanks for your comprehension<br>Ale<br><br><br><br><br><br><div> </div><hr size="1"><font face="Arial" size="2"></font><hr size="1"><font face="Arial" size="2"><font face="Arial" size="2">L'email della prossima generazione? Puoi averla con la <a
href="http://us.rd.yahoo.com/mail/it/taglines/hotmail/nowyoucan/nextgen/*http://it.docs.yahoo.com/nowyoucan.html">nuova Yahoo! Mail</a></font>_______________________________________________<br>This is the private VTK discussion list. <br>Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ<br>Follow this link to subscribe/unsubscribe:<br>http://www.vtk.org/mailman/listinfo/vtkusers<br></font></blockquote><font face="Arial" size="2"><br></font><p> 
<hr size=1><font face="Arial" size="2"><hr size=1><font face="Arial" size="2">L'email della prossima generazione? Puoi averla con la <a href="http://us.rd.yahoo.com/mail/it/taglines/hotmail/nowyoucan/nextgen/*http://it.docs.yahoo.com/nowyoucan.html">nuova Yahoo! Mail</a></font>