Changes between Version 10 and Version 11 of Examples/Brain


Ignore:
Timestamp:
04/11/17 14:07:18 (7 years ago)
Author:
Herwig Zilken
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Examples/Brain

    v10 v11  
    283283=== Animation of Color and Opacity
    284284As seen above, the color and opacity maps are stored in Python as lists.
    285 Given a start and a end color/opacity list, it is very easy to implement a small python funtion to calculate a linear interpolation. In the following example, images for interpolated opacity values are rendered.
     285Given a start and a end color/opacity list, it is very easy to implement a small python function to calculate a linear interpolation. In the following example, images of interpolated opacity values are rendered in 30 steps.
    286286{{{
    287287#!python
     
    318318[raw-attachment:opacity.wmv Animation of opacity]
    319319
     320=== Rendering a Subset of the Grid (Animated Volume of Interest)
     321Not only the data source, but also the output of !ParaView filters can be visualized. In this example we will use the !ExtractSubset filter to visualize a smaller part of the whole grid.
     322The input of the !ExtractSubset has to be connected to the output of the XDMF reader.
     323Then the scripts animates the volume of interest in 81 steps, fading away slices from the top and bottom side of the grid. At the end about 70 slices located at the middle of the grid are visible.
     324
     325{{{
     326#!python
     327extractSubset = ExtractSubset(Input=vervet)
     328extractSubset.VOI = [0, 7759, 0, 7179, 0, 233] # we are using the subsampled data
     329Hide(vervet, renderView)
     330print "generating extract subset"
     331extractSubsetDisplay = Show(extractSubset, renderView)
     332# Properties modified on extractSubset1Display
     333extractSubsetDisplay.VolumeRenderingMode = 'OSPRay Based'
     334ColorBy(extractSubsetDisplay, ('POINTS', 'PLI'))
     335extractSubsetDisplay.RescaleTransferFunctionToDataRange(True, True)
     336extractSubsetDisplay.SetRepresentationType('Volume')
     337
     338camera.SetPosition(0.0, 0.0, 1.488)
     339camera.SetFocalPoint(0.0, 0.0, 0.0)
     340camera.SetViewUp(-1.0, 0.0, 0.0)
     341
     342imageNum = 0
     343for i in range(1, 82):
     344  extractSubset.VOI = [0, 7759, 0, 7179, i, 233-i]
     345  print ("VOI change state: rendering image %04d" % (imageNum))
     346  Render()
     347  WriteImage("voi_image_%04d.png" % (imageNum))
     348  imageNum = imageNum + 1
     349}}}
     350
     351Resulting movie snippet:
     352[raw-attachment:voi.wmv Animation of volume of interest]