Hi Jochen, 

Thanks for your quick answer. 
I used the right button click to Global Reinit my scene. But it only force the 
display of the black slice into the 3D renderer. 

What is strange is that I get the following error message: 

ERROR: In ..\..\Rendering\vtkPolyDataMapper.cxx, line 61 
vtkPainterPolyDataMapper (121EE7B8): Mapper has no input. 

ERROR: In ..\..\Rendering\vtkPolyDataMapper.cxx, line 61 
vtkPainterPolyDataMapper (121F35A0): Mapper has no input. 

ERROR: In ..\..\Filtering\vtkDemandDrivenPipeline.cxx, line 803 
vtkStreamingDemandDrivenPipeline (121E8658): Input for connection index 0 on 
input port index 0 for algorithm vtkCutter(121D7AF0) is NULL, but a vtkDataSet 
is required. 

ERROR: In ..\..\Filtering\vtkDemandDrivenPipeline.cxx, line 803 
vtkStreamingDemandDrivenPipeline (121EB008): Input for connection index 0 on 
input port index 0 for algorithm vtkCutter(121E2060) is NULL, but a vtkDataSet 
is required. 

My interpretation is that the node insertion of the geometry has not been 
linked with the vtk mapper ... I'm trying to get a better understanding of VTK 
rendering principles ... 
The strange fact is that even with a simple vtk file (lungs.vtk) I have the 
same issue. 

I also tried to control the camera through the following code (from 
mitkCameraVisualization.cpp) : 

mitk::CameraVisualization::Pointer myFilter = mitk::CameraVisualization::New(); 

mitk::PropertyList::Pointer p = mitk::PropertyList::New(); 
mitk::Vector3D lookAtVector; 
mitk::FillVector3D(lookAtVector,0,0.,-800.); 
mitk::Vector3D lookUpVector; 
mitk::FillVector3D(lookUpVector,1.,0.,0.); 
//mitk::FillVector3D(offset2, -1.2, 3.45, -6.789); 
p->SetProperty("CameraVisualization_DirectionOfProjectionInToolCoordinates", 
mitk::Vector3DProperty::New(lookAtVector)); // store 
DirectionOfProjectionInToolCoordinates parameter 
p->SetProperty("CameraVisualization_ViewUpInToolCoordinates", 
mitk::Vector3DProperty::New(lookUpVector)); // store ViewUpInToolCoordinates 
parameter 
p->SetProperty("CameraVisualization_FocalLength", 
mitk::Vector3DProperty::New(10)); // store FocalLength parameter 
p->SetProperty("CameraVisualization_ViewAngle", 
mitk::Vector3DProperty::New(45)); // store ViewAngle parameter 

myFilter->SetParameters(p); 
// set renderer 
myFilter->SetRenderer(mitk::BaseRenderer::GetInstance(m_MultiWidget->mitkWidget4->GetRenderWindow()));
 
//Update filter 
myFilter->Update(); 

But it does not seem to change anything. 

Thank you for your support. 

Tangi 

------------------------------------- 
Tangi MEYER 
Virtual and Augmented Reality 
System and Software Engineer 
Leuvensesteenweg 325 
B-1932 Zaventem - Belgium 
Telephone: +32 (0) 2 721 54 84 
Fax: +32 (0) 2 721 54 44 
------------------------------------- 

----- Original Message ----- 
From: "Neuhaus Jochen" <[email protected]> 
To: "Tangi Meyer" <[email protected]>, 
"[email protected]" <[email protected]> 
Sent: Thursday, 19 November, 2009 13:32:42 GMT +00:00 GMT Britain, Ireland, 
Portugal 
Subject: AW: [mitk-users] [CAMDASS] Camera viewport control and other IGT 
stuff. 




Hi Tangi, 



If you haven’t already loaded a dataset, the renderer probably doesn’t have a 
correct view geometry. Just rightclick a node in the datamanager and select 
“Global Reinit”. This should reset the views so that the global bounding box 
includes all existing objects at their current positions. You can get the same 
by calling 

mitk :: RenderingManager :: GetInstance ()-> InitializeViews ( myDataStorage -> 
ComputeBoundingGeometry3D ( myDataStorage -> GetAll ())); // reset render 
window geometry to include all objects 



Best Regards, 

Jochen 








Von: Tangi Meyer [mailto:[email protected]] 
Gesendet: Donnerstag, 19. November 2009 14:13 
An: [email protected] 
Betreff: [mitk-users] [CAMDASS] Camera viewport control and other IGT stuff. 




Dear MITK users, 

I'm trying to use IGT with our Polaris Spectra Passive Toolkit. 

The IGT example module is used as a basis. So I've rebuilt a plugin which uses 
most of the original IGT example plugin (I removed all recording and plotting). 

My primary goal is to track and visualize the NDI rigid bodies into the 3D 
window from the standard view. 

So I reused code parts from the IGT tutorial and IGT testing. 

Basically: 

Draw a cone associated to my NDI device 

mitk::Cone::Pointer cone = mitk::Cone::New(); //instantiate a new cone 
float scale[] = {100.0, 100.0, 100.0}; 
cone->GetGeometry()->SetSpacing(scale); //scale it a little that so we can see 
something 
mitk::DataTreeNode::Pointer node = mitk::DataTreeNode::New(); //generate a new 
node to store the cone into 
//the DataStorage. 
node->SetData(cone); //The data of that node is our cone. 
node->SetName("My tracked object"); //The node has additional properties like a 
name 
node->SetColor(1.0, 0.0, 0.0); //or the color. Here we make it red. 
this->GetDefaultDataStorage()->Add(node); //After adding the Node with the cone 
in it to the 
//DataStorage, MITK will show the cone in the 
//render windows. 

//For updating the render windows we use another filter of the MITK-IGT 
pipeline concept. The 
//NavigationDataObjectVisualizationFilter needs as input a NavigationData and a 
//PolyData. In our case the input is the source and the PolyData our cone. 

//First we create a new filter for the visualization update. 
m_Visualizer = mitk::NavigationDataObjectVisualizationFilter::New(); 
m_Visualizer->SetInput(0, m_Source->GetOutput(0)); //Then we connect to the 
pipeline. 
m_Visualizer->SetBaseData(0, cone); //After that we have to assign the cone to 
the input 

Try to position the viewport camera as the NDI reference camera (in the middle 
of the NDI IR cameras) so that my tracked object is in the field of view. 

mitk::CameraVisualization::Pointer myFilter = mitk::CameraVisualization::New(); 
//mitk::GlobalInteraction::GetInstance()->Initialize("global"); 

// Define position for the navigation data 
mitk::NavigationData::PositionType position; 
position[0] = 0; 
position[1] = 0; 
position[2] = 0; 
// Define orientation for the navigation data 
mitk::NavigationData::OrientationType orientation; 
orientation[0] = 0; 
orientation[1] = 0; 
orientation[2] = 0; 
orientation[3] = 1; 

// set parameters of navigation data 
mitk::NavigationData::Pointer nd1 = mitk::NavigationData::New(); 
nd1->SetPosition(position); 
nd1->SetOrientation(orientation); 

myFilter->SetInput(nd1); 
// set renderer 
myFilter->SetRenderer(mitk::BaseRenderer::GetInstance(m_MultiWidget->mitkWidget4->GetRenderWindow()));
 
//Update filter 
myFilter->Update(); 

In order to make it simple, all this code is in the OnTestNavigation() method 
of the plugin. 

I did try to adapt my camera orientation but nothing is visible. Two objects 
appear in the datamanager: My tracked Object and MyInstrument 0. 

It is probably obvious so I'm digging in the documentation but any help is 
appreciated. 

Thanks. 

Tangi 

------------------------------------- 
Tangi MEYER 
Virtual and Augmented Reality 
System and Software Engineer 
Leuvensesteenweg 325 
B-1932 Zaventem - Belgium 
Telephone: +32 (0) 2 721 54 84 
Fax: +32 (0) 2 721 54 44 
-------------------------------------
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to