[Insight-users] 3D surface..
yasser salman
yass71 at yahoo . com
Wed, 11 Jun 2003 07:09:09 -0700 (PDT)
hi saby..,
in ur skullydoo if i wanna to release the skin from 3D
surface reconstructed, also bone..how can it comes??
also i already construct the 3d Surface from single
.raw format using marching
cube ..,and the result seems close with ur skullyDOO
(it's a trevial reffernce for us:) thanx skullyDoo:))
but i have problem..,
- i wanna to extracat bone and skin and brain
indevidualy. in my case all skin and bone and brain
constructed at the same volume here is my code:
vtkRenderer *aRenderer = vtkRenderer::New();
vtkRenderWindow *renWin = vtkRenderWindow::New();
renWin->AddRenderer(aRenderer);
vtkRenderWindowInteractor *iren =
vtkRenderWindowInteractor::New();
iren->SetRenderWindow(renWin);
vtkImageReader *Reader = vtkImageReader::New();
Reader->SetFilePrefix ("D:/ImageData/t1");
Reader->SetFileDimensionality(3);
Reader->SetFilePattern("%s%.d.raw");
Reader->SetDataByteOrderToBigEndian();
Reader->SetDataExtent (0,180,0,216,0,180);
Reader->SetDataScalarTypeToUnsignedChar();
Reader->SetDataOrigin(0,0,0);
Reader->SetDataSpacing(1,1,1);
Reader->SetDataMask(0x7ff);
Reader->Update();
vtkMarchingCubes* mc=vtkMarchingCubes::New();
mc->SetInput(Reader->GetOutput());
mc->SetValue(0,63);
mc->ComputeGradientsOff();
mc->ComputeScalarsOn();
mc->ComputeNormalsOn();
mc->Update();
vtkPolyDataMapper* mcmap=vtkPolyDataMapper::New();
mcmap->SetInput(mc->GetOutput());
mcmap->ScalarVisibilityOff();
vtkActor* mcactor=vtkActor::New();
mcactor->SetMapper(mcmap);
mcactor->GetProperty()->SetColor(1,1,1);
vtkCamera *aCamera = vtkCamera::New();
aCamera->SetViewUp (0, 0, -1);
aCamera->SetPosition (0, 1, 0);
aCamera->SetFocalPoint (0, 0, 0);
aCamera->ComputeViewPlaneNormal();
aRenderer->AddActor(mcactor);
aRenderer->SetActiveCamera(aCamera);
aRenderer->ResetCamera ();
aCamera->Dolly(1.5);
renWin->SetSize(640, 480);
iren->SetDesiredUpdateRate(3.0);
iren->Initialize();
iren->Start();
return 0;
__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar . yahoo . com