<div dir="ltr">Hello,<div><br></div><div>the Python VTK script below gives results, like a expect. Now I'm trying to reproduce it in Paraview and I fail.</div><div><br></div><div>I get rather confused as soon I give it a source with more than one scalar component. </div><div>Paraview creates one color map; I would expect 3 color maps, 1 for every component.</div><div>What ever I do effective opacity is always 1. That is I see a black cube with it's surface the images</div><div>of the data on its surface (so far correct), however no effective volume rendering -- I selected Volume, "Ray Cast Only"</div><div>which should be vtkFixedPointVolumeRayCastMapper as far I understood.</div><div><br></div><div>I tried creating 3 readers with the different scalar components extracted first, but doesn't give</div><div>correct rendering -- neither in VTK nor in paraview, since multiple renderer seem to compete which gets to</div><div>draw a pixel instead of composing them together</div><div>like a red transparent + a green transparent should give a yellow transparent impression.</div><div><br></div><div>How can I achieve the same result with Paraview?</div><div><br></div><div>Kind regards, Axel</div><div><br></div><div><div>--------------------------</div><div>#!/usr/bin/env python</div><div><br></div><div>import vtk</div><div><br></div><div># Create the standard renderer, render window and interactor</div><div>ren = vtk.vtkRenderer( )</div><div>renWin = vtk.vtkRenderWindow( )</div><div>renWin.AddRenderer( ren )</div><div>iren = vtk.vtkRenderWindowInteractor( )</div><div>iren.SetRenderWindow( renWin )</div><div><br></div><div>reader = vtk.vtkImageReader2( )</div><div>reader.SetFileName( "./data.raw" );</div><div>reader.SetDataScalarTypeToUnsignedChar( );</div><div>reader.SetNumberOfScalarComponents( 3 );</div><div>reader.SetFileDimensionality( 3 );</div><div>reader.SetDataExtent( 0, 261, 0, 511, 0, 21 );</div><div>reader.SetDataSpacing( 1, 1, 3.5 );</div><div><br></div><div># Create transfer mapping scalar value to opacity</div><div>opacityTransferFunction = vtk.vtkPiecewiseFunction( )</div><div>opacityTransferFunction.AddPoint(   0, 0.0 )</div><div>opacityTransferFunction.AddPoint(  20, 0.0 )</div><div>opacityTransferFunction.AddPoint(  40, 0.1 )</div><div>opacityTransferFunction.AddPoint( 255, 0.1 )</div><div><br></div><div># Create transfer mapping scalar value to color</div><div><br></div><div>colorRedTransferFunction = vtk.vtkColorTransferFunction( )</div><div>colorRedTransferFunction.AddRGBPoint(   0.0, 0.2, 0.0, 0.0 )</div><div>colorRedTransferFunction.AddRGBPoint( 255.0, 1.0, 0.0, 0.0 )</div><div><br></div><div>colorGreenTransferFunction = vtk.vtkColorTransferFunction( )</div><div>colorGreenTransferFunction.AddRGBPoint(   0.0, 0.0, 0.2, 0.0 )</div><div>colorGreenTransferFunction.AddRGBPoint( 255.0, 0.0, 1.0, 0.0 )</div><div><br></div><div>colorBlueTransferFunction = vtk.vtkColorTransferFunction( )</div><div>colorBlueTransferFunction.AddRGBPoint(   0.0, 0.0, 0.0, 0.0 )</div><div>colorBlueTransferFunction.AddRGBPoint( 255.0, 0.0, 0.0, 1.0 )</div><div><br></div><div>volumeProperty = vtk.vtkVolumeProperty( )</div><div>volumeProperty.SetColor( 0, colorRedTransferFunction )</div><div>volumeProperty.SetColor( 1, colorGreenTransferFunction )</div><div>volumeProperty.SetColor( 2, colorBlueTransferFunction )</div><div><br></div><div>volumeProperty.SetScalarOpacity( 0, opacityTransferFunction )</div><div>volumeProperty.SetScalarOpacity( 1, opacityTransferFunction )</div><div>volumeProperty.SetScalarOpacity( 2, opacityTransferFunction )</div><div>volumeProperty.SetInterpolationTypeToLinear( )</div><div><br></div><div>volumeMapper = vtk.vtkFixedPointVolumeRayCastMapper( )</div><div>volumeMapper.SetInputConnection( reader.GetOutputPort( ) )</div><div>volumeMapper.SetNumberOfThreads( 1 )</div><div><br></div><div>volume = vtk.vtkVolume( )</div><div>volume.SetMapper( volumeMapper )</div><div>volume.SetProperty( volumeProperty )</div><div><br></div><div>ren.AddVolume( volume )</div><div>ren.SetBackground( 1, 1, 1 )</div><div>renWin.SetSize( 600, 600 )</div><div><br></div><div>def CheckAbort( obj, event ):</div><div>    if obj.GetEventPending( ) != 0:</div><div>        obj.SetAbortRender( 1 )</div><div><br></div><div>renWin.AddObserver( "AbortCheckEvent", CheckAbort )</div><div><br></div><div>iren.Initialize( )</div><div>renWin.Render( )</div><div>iren.Start( )</div></div><div>--------------------------</div></div>