<div dir="ltr">The <span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">dicomMapper-></span><wbr style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">SliceFacesCameraOn() option causes the normal to automatically be set from the direction-of-projection of the camera. So if you use this option, you cannot directly set the normal. Instead, you would have to change the normal by changing the position of the camera.</span><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px"> - David</span></div><div><span style="font-size:12.8px"><br></span><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Mar 12, 2018 at 5:56 AM, ochampao <span dir="ltr"><<a href="mailto:ochampao@hotmail.com" target="_blank">ochampao@hotmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello vtkUsers,<br>
<br>
I am using a pipeline with vtkImageResliceMapper --> vtkImageSlice --><br>
vtkImageStack for displayng a slice of a volume imported from a dicom<br>
series. This works well with the default slicing plane (0,0,1), however,<br>
when I try changing the slicing plane using<br>
vtkImageResliceMapper::<wbr>GetSlicePlane()->SetNormal() the plane does not<br>
change. When I print the SlicePlane normal, I can see that the new normal is<br>
registered. Also, using UpdateInformation() or Modified() did not have any<br>
effect.<br>
<br>
My undersanding is that the SlicePlane is what determines the plane that the<br>
camera will follow when SliceFacesCameraOn() and SliceAtFocalPointOn() are<br>
used.<br>
<br>
What is the correct approach for changing the slicing plane of<br>
vtkImageResliceMapper?<br>
<br>
Below is the code that I am currently using.<br>
<br>
Thanks for your help.<br>
Panos.<br>
<br>
============================<br>
vtkNew<vtkDICOMImageReader> dicomReader;<br>
dicomReader->SetDirectoryName(<wbr>"path/to/dicom/series");<br>
dicomReader->Update();<br>
<br>
vtkNew<vtkImageResliceMapper> dicomMapper;<br>
dicomMapper->SetInputData(<wbr>dicomReader->GetOutput());<br>
dicomMapper->GetSlicePlane()-><wbr>SetNormal(0.0, 1.0, 0.0);<br>
dicomMapper-><wbr>SliceFacesCameraOn();<br>
dicomMapper-><wbr>SliceAtFocalPointOn();<br>
<br>
vtkNew<vtkImageSlice> dicomSlice;<br>
dicomSlice->SetMapper(<wbr>dicomMapper);<br>
dicomSlice->GetProperty()-><wbr>UseLookupTableScalarRangeOn();<br>
<br>
vtkNew<vtkImageStack> imageStack;<br>
imageStack->AddImage(<wbr>dicomSlice);<br>
<br>
vtkNew<vtkRenderer> renderer;<br>
renderer->AddViewProp(<wbr>imageStack);<br>
renderer->GetActiveCamera()-><wbr>ParallelProjectionOn();<br>
renderer->ResetCamera();<br>
renderer-><wbr>ResetCameraClippingRange();<br>
<br>
vtkNew<vtkRenderWindow> renderWindow;<br>
renderWindow->AddRenderer(<wbr>renderer);<br>
<br>
vtkNew<<wbr>vtkRenderWindowInteractor> renderWindowInteractor;<br>
vtkNew<<wbr>vtkInteractorStyleImage> style;<br>
style-><wbr>SetInteractionModeToImageSlici<wbr>ng();<br>
<br>
renderWindowInteractor-><wbr>SetInteractorStyle(style);<br>
renderWindowInteractor-><wbr>SetRenderWindow(renderWindow);<br>
renderWindowInteractor-><wbr>Initialize();<br>
renderWindowInteractor->Start(<wbr>);<br>
=============================<br></blockquote></div></div></div></div>