No subject
Wed Oct 7 22:37:18 EDT 2009
generate a tetrahedral mesh from DICOM data for the purpose of finite
element analysis.
VTK is not a mesh generation system. It's primary purpose is
visualization. Some posts have suggested alternative systems for
finite element mesh generation. Please review those e-mails.
Please stop asking the same questions over and over using multiple
email addresses.
Bill
On Sun, Oct 25, 2009 at 5:09 PM, InfoSeekerr
<ali.mahmoud.habib at gmail.com> wrote:
>
> I want to create a tetrahedral mesh upon 3D volume come from 2D slices, b=
ut
> it give error any suggestion please:
>
> My code:
>
> vtk::vtkDICOMImageReader ^VDR =3D gcnew vtk::vtkDICOMImageReader();
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0VDR->SetDirectoryName("H:\=
\work\\Master
> Degree\\DataSet\\case2\\DICOM\\PA1\\ST1\\SE2");
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0VDR->SetDataOrigin(0, 0, 0=
);
>
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0vtk::vtkImageChangeInforma=
tion ^VIC =3D gcnew
> vtk::vtkImageChangeInformation();
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0VIC->SetInput(VDR->GetOutp=
ut());
>
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0vtkClipVolume ^v =3D gcnew=
vtkClipVolume();
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0v->SetInputConnection(VDR-=
>GetOutputPort());
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0v->SetValue(2.0);
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0v->GenerateClippedOutputOf=
f();
>
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0vtkDataSetMapper ^mapper =
=3D gcnew vtkDataSetMapper();
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0mapper->SetInputConnection=
(v->GetOutputPort());
>
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0// actor coordinates geome=
try, properties, transformation
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0vtkActor ^aSphere =3D gcne=
w vtkActor();
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0aSphere->SetMapper(mapper)=
;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0// aSphere.GetProperty().S=
etRepresentationToWireframe();
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0//aSphere.GetProperty().Se=
tColor(0,0,1); // sphere color blue
>
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0// a renderer and render w=
indow
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0vtkRenderer ^ren1 =3D gcne=
w vtkRenderer();
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0vtkRenderWindow ^renWin =
=3D gcnew vtkRenderWindow();
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0renWin->AddRenderer(ren1);
>
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0// an interactor
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0vtkRenderWindowInteractor =
^iren =3D gcnew vtkRenderWindowInteractor();
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0iren->SetRenderWindow(renW=
in);
>
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0// add the actor to the sc=
ene
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0ren1->AddActor(aSphere);
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0//ren1.SetBackground(1,1,1=
); // Background color white
>
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0// render an image (lights=
and cameras are created automatically)
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0renWin->Render();
>
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0// begin mouse interaction
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0iren->Start();
> --
> View this message in context: http://www.nabble.com/what%27s-wrong-with-m=
y-code-tp26051836p26051836.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/openso=
urce/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.or=
g/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
More information about the vtkusers
mailing list