[vtkusers] Please Help : 3D reconstitution and contour Filtring

BEN REGUIGA Mohamed mohamed.ben.reguiga at dapsys.com
Wed Feb 7 03:27:19 EST 2007


hello,
I'm still new in VTK's world and I'm faced a big problem!
in my project I'm devolopping a 3D reconstitution , like in the Medical 
examples. I've done the MPR and the MIP functions and every thing is 
allright.
But when I implemented the 3D contour filtring : nothing appears in the 
renderWindow and it takes several minutes before that the rendender windo is 
shown and nothing inside!
this is the code :
(the files are on the disk)

vtkVolume16Reader *v16 = vtkVolume16Reader::New();
v16->SetDataDimensions(512,512);
v16->SetDataByteOrderToLittleEndian();
v16->SetFilePrefix (argv[1]);
v16->SetImageRange(1, 330);
v16->SetDataSpacing (0.65, 0.65, 1.0); //Pixel Spacing

//vtkContourFilter *boneExtractor = vtkContourFilter::New();
vtkMarchingCubes *boneExtractor = vtkMarchingCubes::New(); // I think that 
it's faster than vtkContourFilter
boneExtractor->SetInputConnection(v16->GetOutputPort());
boneExtractor->SetValue(0, 1250);

vtkPolyDataNormals *boneNormals = vtkPolyDataNormals::New();
boneNormals->SetInputConnection(boneExtractor->GetOutputPort());
boneNormals->SetFeatureAngle(60.0);

vtkStripper *boneStripper = vtkStripper::New();
boneStripper->SetInputConnection(boneNormals->GetOutputPort());
vtkPolyDataMapper *boneMapper = vtkPolyDataMapper::New();
boneMapper->SetInputConnection(boneStripper->GetOutputPort());
boneMapper->ScalarVisibilityOff();

vtkLODActor *bone = vtkLODActor::New();
//vtkActor *actorBone = vtkActor::New();
bone->SetNumberOfCloudPoints( 1000000 );
bone->SetMapper( boneMapper );
bone->GetProperty()->SetColor( 1, 1,1 );
bone->GetProperty()->SetOpacity( 1.0 );

aRenderer->AddActor(bone);
aRenderer->Render();// takes several minutes
aRenderer->SetBackground(0.35,0.36,0.85);
renWin->SetSize(640, 480);
iren->Initialize();
iren->Start();

the Images' dimensions are 512*512*2 (CT thorax).
there is something else, is that , when I do the same with only 100 images , 
the 3D reconstitution appears!

SO could you please help me and telle me what's wrong with this code?
is it possible to know if the memory is enough to do the reconstitution or 
not , if it depends on memory of course?
and how can I ptimize the time of rendering, witch takes sometimes 5 
minutes!
I'm developping using VSC++ 2005, PC : 1Go of RAM and 2.9 GHz µP!

thak you for your help!





More information about the vtkusers mailing list