[vtkusers] isosurface of iron protein

Jothy jothybasu at gmail.com
Tue Nov 23 06:54:52 EST 2010


Could you please try this and let's know the results?

An isosurface of the electron potential of an iron protein molecule.

  // Read in the data. Note the different
  // file format this time.
  reader = new vtkStructuredPointsReader;
    reader->SetFilename("../../data/ironProt.vtk);

  // Set up the contour.
  iso = new vtkContourFilter;
    iso->SetInput(reader-> GetOutput());
    iso->SetValue(0,128);

  // Clean up duplicate points.
  clean = new vtkCleanPolyData;
    clean->SetInput(iso->GetOutput());

  // Smooth any two edges if the angle
  // between them is less than 45 degrees.
  normals = new vtkPolyNormals;
    normals->SetInput(clean->GetOutput());
    normals->SetFeatureAngle(45);

  // Map to polygons and make the actor!
  isoMapper = new vtkPolyMapper;
    isoMapper->SetInput(normals->GetOutput());

  isoActor = new vtkActor;
    isoActor->SetMapper(isoMapper);
    isoActor->GetProperty()->SetColor(bisque);



Code is from this link.

http://web.cs.wpi.edu/~matt/courses/cs563/talks/vtk/visualization.html

Jothy

On Mon, Nov 22, 2010 at 12:48 PM, sophia_t14 <sophia_t14 at yahoo.com> wrote:

>
> http://vtk.1045678.n5.nabble.com/file/n3275295/iron_protein.jpg
>
> So sorry... The code are as follow....
>
> vtkRenderer aRenderer
>  vtkRenderWindow renWin
>  renWin AddRenderer aRenderer
> vtkRenderWindowInteractor iren
>  iren SetRenderWindow renWin
>
> vtkStructuredPointsReader reader
>  reader SetFileName "$VTK_DATA_ROOT/Data/ironProt.vtk"
>
> vtkContourFilter ironExtractor
>  ironExtractor SetInput [reader GetOutput]
>  ironExtractor SetValue 0 128
>
> vtkPolyDataNormals ironNormals
>  ironNormals SetInput [ironExtractor GetOutput]
>  ironNormals SetFeatureAngle 45
>
> vtkPolyDataMapper ironMapper
>  ironMapper SetInput [ironNormals GetOutput]
>  ironMapper ScalarVisibilityOff
>
> vtkActor iron
>  iron SetMapper ironMapper
>  [iron GetProperty] SetDiffuseColor .68 .08 .12
>
>  vtkOutlineFilter outlineData
>  outlineData SetInput  [reader GetOutput]
>
> vtkPolyDataMapper mapOutline
>  mapOutline SetInput [outlineData GetOutput]
> vtkActor outline
>  outline SetMapper mapOutline
>  [outline GetProperty] SetColor 0 0 0
>
> vtkCamera aCamera
>  aCamera SetViewUp  0 0 -1
>  aCamera SetPosition  0.25 0.75 0.25
>  aCamera SetFocalPoint  0 0 0
>  aCamera ComputeViewPlaneNormal
>
> aRenderer AddActor outline
> aRenderer AddActor iron
>
> aRenderer SetActiveCamera aCamera
> aRenderer ResetCamera
> aCamera Dolly 1.5
>
> aRenderer SetBackground 1 1 1
> renWin SetSize 640 480
>
> aRenderer ResetCameraClippingRange
>
> iren AddObserver UserEvent {wm deiconify .vtkInteract}
>
> iren Initialize
> wm withdraw .
>
>
> --
> View this message in context:
> http://vtk.1045678.n5.nabble.com/isosurface-of-iron-protein-tp3275278p3275295.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/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20101123/19fdea04/attachment.htm>


More information about the vtkusers mailing list