<div dir="ltr">There is a wiki page that describes these classes:<div><a href="http://www.vtk.org/Wiki/VTK/Image_Rendering_Classes">http://www.vtk.org/Wiki/VTK/Image_Rendering_Classes</a></div><div><br></div><div>The SetSlicePlane() method should work if you want to manually set the</div><div>position of the slice in 3D (note that the slice is in world coords).  And of</div><div>course the SetSlicePlane() method is mutually exclusive with the settings</div><div>SliceAtFocalPointOn() and SliceFacesCameraOn().  You can control the<br></div><div>slice plane manually, or the slice plane can be controlled by the camera,</div><div>but not both!</div><div><br></div><div> - David</div><div><br></div><div><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Feb 18, 2016 at 7:21 AM, Lonni Besançon <span dir="ltr"><<a href="mailto:lonni.besancon@gmail.com" target="_blank">lonni.besancon@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hello everybody,<br>
<br>
So I want to implement an interface that would provide in a first part of my<br>
window my whole 3D dataset and in the second part only the cutting plane<br>
image of that data (a 2D slice of the dataset).<br>
<br>
I looked at the examples provided  here (vtkImageSlice)<br>
<<a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/ImageData/ImageReslice" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK/Examples/Cxx/ImageData/ImageReslice</a>>   and<br>
here (vtkImageReslice)<br>
<<a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/ImageData/ImageReslice" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK/Examples/Cxx/ImageData/ImageReslice</a>>  .<br>
I managed to adapt it to my dataset to get this code:<br>
<br>
/std::string filename ="Data/ftlelog.vtk" ;<br>
vtkSmartPointer<vtkDataSetReader> reader =<br>
vtkSmartPointer<vtkDataSetReader>::New();<br>
reader->SetFileName(filename.c_str());<br>
reader->Update();<br>
vtkSmartPointer<vtkImageData> imageData =<br>
vtkSmartPointer<vtkImageData>::New();<br>
imageData->ShallowCopy(reader->GetOutput());<br>
vtkSmartPointer<vtkImageData> datasetImage =<br>
vtkSmartPointer<vtkImageData>::New();<br>
datasetImage->ShallowCopy(reader->GetOutput());<br>
vtkSmartPointer<vtkImageResliceMapper> imageResliceMapper =<br>
vtkSmartPointer<vtkImageResliceMapper>::New();<br>
<br>
vtkSmartPointer<vtkImageSlice> imageSlice =<br>
vtkSmartPointer<vtkImageSlice>::New();<br>
imageSlice->SetMapper(imageResliceMapper);<br>
<br>
vtkSmartPointer<vtkRenderer> renderer = vtkSmartPointer<vtkRenderer>::New();<br>
renderer->AddViewProp(imageSlice);<br>
renderer->ResetCamera();<br>
<br>
// Setup render window<br>
vtkSmartPointer<vtkRenderWindow> renderWindow =<br>
vtkSmartPointer<vtkRenderWindow>::New();<br>
renderWindow->SetSize(300, 300);<br>
renderWindow->AddRenderer(renderer);<br>
<br>
// Setup render window interactor<br>
vtkSmartPointer<vtkRenderWindowInteractor> renderWindowInteractor =<br>
vtkSmartPointer<vtkRenderWindowInteractor>::New();<br>
<br>
vtkSmartPointer<vtkInteractorStyleImage> style =<br>
vtkSmartPointer<vtkInteractorStyleImage>::New();<br>
<br>
renderWindowInteractor->SetInteractorStyle(style);/<br>
<br>
This compiles and works fine. Clicking and moving my mouse cursor updates<br>
the slicing and it works like a charm. In other words, my image is always<br>
located at the same place but I get different slices of the data displayed<br>
onto it.<br>
However, I would like to be able to slice according to normal and origin<br>
that I would manually input.<br>
I thought modifying the plane itself would work but apparently it doesn't.<br>
I was therefore thinking that I should try and set the normal and origin of<br>
the vtkImageSlice directly. But from the documentation I got that the slice<br>
can be set manualy thanks to vtkImageMapper3D (abstract of<br>
vtkImageResliceMapper).<br>
Thus, I tried to simply push my plane along one axis, to see what I would<br>
get. In that case, I see my image moving (being pushed along the axis) but I<br>
don't get to see any slices of the data.<br>
<br>
I am pretty sure there is something that I did not understand with the<br>
different classes involved here and their purpose. Get I can get some<br>
clarifications?<br>
<br>
Thanks in advance<br></blockquote></div></div></div></div>