Hi Chiara,
Sorry for the late response, I was quite busy...
MITK is definitely able to handle vtk unstructured grid data. I wrote
the support for it a couple of months ago and am using it continuously.
I am not sure right now if version 0.9 of MITK really exists, but it
would be quite old. Nevertheless, you can try the code below and if it
does not work update to version 0.9.6. This one should have all the
changes in order to make unstructured grid rendering possible.
mitk::DataTreeNode::Pointer meshNode = mitk::DataTreeNode::New();
mitk::UnstructuredGrid::Pointer grid = mitk::UnstructuredGrid::New();
grid->SetVtkUnstructuredGrid(vtkGrid);
meshNode->SetData(grid);
mitk::DataTreeNodeFactory::SetDefaultUnstructuredGridProperties(meshNode
);
// this enables cuts through the unstructured grid to be visible in 2D
views
meshNode->SetProperty("outline polygons",
mitk::BoolProperty::New(true));
// if you have scalar data associated with your unstructured grid, you
// can visualize it the following way (no vector data support yet)
mitk::UnstructuredGridHistogram::Pointer histogram =
mitk::UnstructuredGridHistogram::New();
histogram->Initialize(grid);
mitk::TransferFunction::Pointer tf = mitk::TransferFunction::New();
tf->InitializeByItkHistogram(histogram);
meshNode->SetProperty("TransferFunction",
mitk::TransferFunctionProperty::New(tf.GetPointer()));
Hope that helps,
Sascha
>Hi Sascha,
>
>The error I got was in the MainApp of MITK version 0.9, run on Linux
>OpenSuse 10.3 and on windows. So the new question is:
>Is the MainApp able to load and render a vtlUnstructuredGrid? if yes,
mine >gives the error
>
>ERROR: In
\ToolKit\ThirdParty\thirdParty\VTK->5.1\VTK\Rendering\vtkVolume.cxx,
line 363 vtkVolume (0B8FC8F8): You must >specify a mapper!
>
>I actually had the same problem in my code (in which I used the MITK
>BaseData class for vtkUnstructuredGrid as you said).
>Can you help me?
>
>thank you
>Chiara
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users