[vtkusers] new users .. need some help for, as usual, 3D rendering

Florent.Chandelier at USherbrooke.ca Florent.Chandelier at USherbrooke.ca
Mon Sep 20 18:21:27 EDT 2004


Hi all,

my name is florent chandelier, and i'm a phd student at the university
of Sherbrooke and I'm so new to VTK
I have to work on a fluid mechanics and 3D modelling.

As i've been told, vtk is one of the best soft for that so here I am.

Everything's going fine with the provided medical examples but not when
I tried to do this :

I want to render a 3D model of bone from BMP slices.
My guess was to use the medical2.cxx, and especially the bone rendering
section to get my model but all I have is  the empty cube rendering
window, without any display.

here is the part of my code :

vtkRenderer *aRenderer = vtkRenderer::New();
  vtkRenderWindow *renWin = vtkRenderWindow::New();
    renWin->AddRenderer(aRenderer);
  vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();
    iren->SetRenderWindow(renWin);

// things I've changed
  vtkBMPReader *v16 = vtkBMPReader::New();
    v16->SetFilePrefix("slices"); // my files are named slices.0 to
slices.xx
    v16->Update ();
    v16->SetDataExtent(0,255,0,255,0,20);

this is the only things i have changed and all I got is .. the empty
cube window.

I have few more questions :
does the "SetDataSpacing" refers to the voxel size ???
do I have to filter my images first to get only the border of the bone (
I'm working on cancelous/trabecular bone samples )

In fact I do not really understand how VTK render the voxel information ...

any sugestions, reading or else is greatfully accepted ...

flo




More information about the vtkusers mailing list