Re: vtkImageData only shows one slice in vtkResliceImageViewer
Esmeralda Ruiz <[email protected]> Tue, 26 Mar 2019 16:52:20 +0100
| Newsgroups | gmane.comp.lib.vtk.user |
|---|---|
| Message-ID | <CA+fPws23vtALzAHMpSzANX8fbyYsHejyQYATOfOv=Jnync4NNA@mail.gmail.com> |
--===============0423051563== Content-Type: multipart/alternative; boundary="0000000000003531e0058501554c" --0000000000003531e0058501554c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I cheked the extent and it is correct in z from 0..11. Why can,t i scroll the vtkimagedata in the viewer? Thanks El mar., 26 mar. 2019 a las 16:06, zandarina (<[email protected]>) escribi=C3=B3: > Dear all, > > I have a question. I want to show using vtkResliceImageViewer the > slices i > have got from the reslicer > filter. So i append in z the output and i call a fuction to show me the > vtkImageData withh all the slices extracted from the reslicer filter. But > my > surprise is that only show one slice. But if i use the same > vtkResliceImageViewer with the whole volume it works propertly. What can= i > do to show the slices obtained form the reslicer in the viewer. > > Thanks > > > vtkImageAppend* append1 =3D vtkImageAppend::New(); > //Define Stack in Z > append1->SetAppendAxis(2); > > ... > > // done > reslice->Update(); > > > //Append the slices into an image > append1->AddInputData(reslice->GetOutput()); > append1->Update(); > > image_paraxial =3D append1->GetOutput(); > > vtkNew<vtkResliceImageViewer> image_viewer_; > > vtkNew<vtkGenericOpenGLRenderWindow> renderWindow; > SetRenderWindow(renderWindow); > > image_viewer_->SetRenderWindow(renderWindow); > > image_viewer_->SetupInteractor(renderWindow->GetInteractor()); > > //vtkSmartPointer<vtkImageData> image_data =3D > vtkImageData::SafeDownCast( > > //scene.get_volume()->GetMapper()->GetInputDataObject(0, 0)); > > image_viewer_->SetInputData(image_data); > image_viewer_->SetSliceOrientationToXY(); > image_viewer_->SetSlice(1); > image_viewer_->SetResliceModeToAxisAligned(); > > > > -- > Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=3Dvtkusers > > Follow this link to subscribe/unsubscribe: > https://vtk.org/mailman/listinfo/vtkusers > --0000000000003531e0058501554c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div>I cheked the extent and it is correct in z from 0..11= . Why can,t i scroll the vtkimagedata in the viewer?</div><div><br></div><d= iv>Thanks<br></div></div><br><div class=3D"gmail_quote"><div dir=3D"ltr" cl= ass=3D"gmail_attr">El mar., 26 mar. 2019 a las 16:06, zandarina (<<a hre= f=3D"mailto:[email protected]">[email protected]</a>>) e= scribi=C3=B3:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0p= x 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">De= ar all,<br> <br> I have a question. I want to show=C2=A0 =C2=A0 =C2=A0 =C2=A0using vtkReslic= eImageViewer the slices i<br> have got from the reslicer<br> filter. So i append in z the output and i call a fuction to show me the<br> vtkImageData withh all the slices extracted from the reslicer filter. But m= y<br> surprise is that only show one slice. But if i use the same<br> vtkResliceImageViewer=C2=A0 with the whole volume it works propertly. What = can i<br> do to show the slices obtained form the reslicer in the viewer.<br> <br> Thanks<br> <br> <br> vtkImageAppend* append1 =3D vtkImageAppend::New();<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 //Define Stack in Z<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 append1->SetAppendAxis(2);<br> <br> ...<br> <br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 // done<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 reslice->Update(= );<br> <br> <br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 //Append the slices= into an image<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 append1->AddInpu= tData(reslice->GetOutput());<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 append1->Update(= );<br> <br> image_paraxial =3D append1->GetOutput();<br> <br> vtkNew<vtkResliceImageViewer> image_viewer_;<br> <br> vtkNew<vtkGenericOpenGLRenderWindow> renderWindow;<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 SetRenderWindow(renderWindow);<br> <br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 image_viewer_->SetRenderWindow(renderWindow);<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 image_viewer_->SetupInteractor(renderWindow->GetInteractor= ());<br> <br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 //vtkSmartPointer<vtkImageData> image_data =3D vtkImageDat= a::SafeDownCast(<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 //scene.get_volume()->GetMapper()= ->GetInputDataObject(0, 0));<br> <br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 image_viewer_->SetInputData(image_data);<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 image_viewer_->SetSliceOrientationToXY();<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 image_viewer_->SetSlice(1);<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 image_viewer_->SetResliceModeToAxisAligned();<br> <br> <br> <br> --<br> Sent from: <a href=3D"http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.h= tml" rel=3D"noreferrer" target=3D"_blank">http://vtk.1045678.n5.nabble.com/= VTK-Users-f1224199.html</a><br> _______________________________________________<br> Powered by <a href=3D"http://www.kitware.com" rel=3D"noreferrer" target=3D"= _blank">www.kitware.com</a><br> <br> Visit other Kitware open-source projects at <a href=3D"http://www.kitware.c= om/opensource/opensource.html" rel=3D"noreferrer" target=3D"_blank">http://= www.kitware.com/opensource/opensource.html</a><br> <br> Please keep messages on-topic and check the VTK FAQ at: <a href=3D"http://w= ww.vtk.org/Wiki/VTK_FAQ" rel=3D"noreferrer" target=3D"_blank">http://www.vt= k.org/Wiki/VTK_FAQ</a><br> <br> Search the list archives at: <a href=3D"http://markmail.org/search/?q=3Dvtk= users" rel=3D"noreferrer" target=3D"_blank">http://markmail.org/search/?q= =3Dvtkusers</a><br> <br> Follow this link to subscribe/unsubscribe:<br> <a href=3D"https://vtk.org/mailman/listinfo/vtkusers" rel=3D"noreferrer" ta= rget=3D"_blank">https://vtk.org/mailman/listinfo/vtkusers</a><br> </blockquote></div> --0000000000003531e0058501554c-- --===============0423051563== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Search the list archives at: http://markmail.org/search/?q=vtkusers Follow this link to subscribe/unsubscribe: https://vtk.org/mailman/listinfo/vtkusers --===============0423051563==--