Hi Thomas,
Here is code :
node= reader->GetOutput();
node->SetProperty("volumerendering", mitk::BoolProperty::New(true));
mitk::TransferFunction::Pointer tf = mitk::TransferFunction::New();
mitk::Image::Pointer image = dynamic_cast<mitk::Image*>(node->GetData());
mitk::TransferFunctionInitializer::Pointer tfInit =
mitk::TransferFunctionInitializer::New(tf);
tfInit->SetTransferFunctionMode(3);
mitk::GPUVolumeMapper3D::Pointer GPUMapper = mitk::GPUVolumeMapper3D::New();
node->SetMapper(3,GPUMapper);
FourView->GetRenderWindow4()->GetRenderer()->SetMapperID(3);
node->SetProperty("TransferFunction",mitk::TransferFunctionProperty::New (
tf.GetPointer() ) );
node->SetProperty("volumerendering.usegpu",mitk::BoolProperty::New(true),FourView->GetRenderWindow4()->GetRenderer());
node->SetName("InputNode");
m_storage->Add(node);
geometry= m_storage->ComputeBoundingGeometry3D(m_storage->GetAll());
mitk::RenderingManager::GetInstance()->InitializeViews(geometry);
mitk::RenderingManager::GetInstance()->RequestUpdateAll();
I have attached screenshots what I got on running this, what I want it to
be.
Hope you get what is my problem.
Well when I am not using GPU its appearing at focus.
Thanks and Regards
Tab
On Thu, Feb 28, 2013 at 6:59 PM, Kilgus, Thomas <[email protected]
> wrote:
> Hi Tab,****
>
> ** **
>
> I am not sure if I understand your problem. The volume is not focused in
> which sense? Could you maybe attach a screen shot? ****
>
> ** **
>
> mitk::RenderingManager::GetInstance()->InitializeViews(geometry); -> This
> should focus the given “geometry “****
>
> if you call:****
>
> mitk::RenderingManager::RequestUpdate(FourView->GetRenderWindow4);****
>
> ** **
>
> Regards,****
>
> Thomas****
>
> ** **
>
> Thomas Kilgus****
>
> German Cancer Research Center (DKFZ)****
>
> Div. Medical and Biological Informatics ****
>
> Junior group: Computer-assisted Interventions (E131)****
>
> Im Neuenheimer Feld 280****
>
> 69120 Heidelberg, Germany****
>
> Phone: +49(0) 6221-42-3545****
>
> ** **
>
> ** **
>
> > ****
>
> > ****
>
> > Hi all,****
>
> > ****
>
> > I turned on gpu volume rendering with****
>
> > ****
>
> >
> node->SetProperty("volumerendering.usegpu",mitk::BoolProperty::New(true),FourView->GetRenderWindow4()->GetRenderer());
> ****
>
> > ****
>
> > and after adding node to storage I am updating rendering with****
>
> > ****
>
> > mitk::RenderingManager::GetInstance()->InitializeViews(geometry);****
>
> > ****
>
> > but in render window volume is not appearing at focus I have to zoom out
> to find it. It is ok when I am using normal volume rendering. What I tried
> to set camera is:****
>
> > ****
>
> > mitk::Point3D n = node->GetData()->GetGeometry()->GetCenter();****
>
> > vtkCamera * camera = vtkCamera::New();****
>
> > camera =
> FourView->GetRenderWindow4()->GetRenderer()->GetVtkRenderer()->GetActiveCamera();
> ****
>
> > camera->SetFocalPoint(n.GetElement(0),n.GetElement(1),n.GetElement(2));*
> ***
>
> > camera->SetPosition(0,0,0);****
>
> > camera->ComputeViewPlaneNormal();****
>
> >
> FourView->GetRenderWindow4()->GetRenderer()->GetVtkRenderer()->SetActiveCamera(camera);
> ****
>
> >
> FourView->GetRenderWindow4()->GetRenderer()->GetVtkRenderer()->ResetCamera();
> ****
>
> > ****
>
> > but it is not effective.****
>
> > ****
>
> > Is there any setting through mitkCameraController or any way to reset
> camera focus on volume?****
>
> > ****
>
> > Regards,****
>
> > Tab****
>
> > ****
>
> > ****
>
> > ****
>
> >
> ------------------------------------------------------------------------------
> ****
>
> > The Go Parallel Website, sponsored by Intel - in partnership with
> Geeknet, ****
>
> > is your hub for all things parallel software development, from weekly
> thought ****
>
> > leadership blogs to news, videos, case studies, tutorials, tech docs, **
> **
>
> > whitepapers, evaluation guides, and opinion stories. Check out the most
> ****
>
> > recent posts - join the conversation now.
> http://goparallel.sourceforge.net/****
>
> > ****
>
> > _______________________________________________****
>
> > mitk-users mailing list****
>
> > mitk-users@...****
>
> > https://lists.sourceforge.net/lists/listinfo/mitk-users****
>
> > ****
>
> ** **
>
> ** **
>
> ** **
>
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users