<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 12 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0in;
        margin-right:0in;
        margin-bottom:0in;
        margin-left:.5in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
span.EmailStyle18
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.EmailStyle19
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:176165576;
        mso-list-type:hybrid;
        mso-list-template-ids:717011890 1512203220 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
@list l0:level1
        {mso-level-number-format:bullet;
        mso-level-text:-;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:"Calibri","sans-serif";
        mso-fareast-font-family:Calibri;}
@list l0:level2
        {mso-level-tab-stop:1.0in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level3
        {mso-level-tab-stop:1.5in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level4
        {mso-level-tab-stop:2.0in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level5
        {mso-level-tab-stop:2.5in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level6
        {mso-level-tab-stop:3.0in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level7
        {mso-level-tab-stop:3.5in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level8
        {mso-level-tab-stop:4.0in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level9
        {mso-level-tab-stop:4.5in;
        mso-level-number-position:left;
        text-indent:-.25in;}
ol
        {margin-bottom:0in;}
ul
        {margin-bottom:0in;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='color:#1F497D'>Hi Sean,<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Thanks for the reply. Did you see that I set all opacity values to 1.0, i.e. there should be no transparent colors at all.<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>I am using Python in the example I sent. Unfortunately, I cannot help with Activiz.NET&#8230;<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Bryn<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><div style='border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt'><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> Sean Larkin [mailto:sean.larkin@lickenbrocktech.com] <br><b>Sent:</b> Monday, November 07, 2011 4:27 PM<br><b>To:</b> 'Bryn Lloyd'<br><b>Cc:</b> vtkusers@vtk.org<br><b>Subject:</b> RE: [vtkusers] Volume rendering not visible (vtkVolumeTextureMapper3D)<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal><span style='color:#1F497D'>I&#8217;ve seen this phenomenon as well.&nbsp; It might have something to do with the opacity.&nbsp; When I see this it&#8217;s almost like the texture mapper is clipping the intensity values, so that values below &#8220;x&#8221; are set to zero.&nbsp; I also seem to remember that the texture mapper has few bits of precision than vtkVolumeRayCastMapper, i.e. only 16, rather than 32 bits.&nbsp; I&#8217;ve adjusted the contrast through a lookup table and adjusted the opacity when this problem occurs, which yields a visible still image.&nbsp; But when I do this I notice that the number of gray levels in the image is small, so the image has a lot of flat regions where it should not.&nbsp; Has anyone else seen this?<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Bryn, it looks like you&#8217;re using Activiz.NET.&nbsp; Is this correct?&nbsp; If so, where did you get the v5.8.0 build?<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Sean<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> vtkusers-bounces@vtk.org [mailto:vtkusers-bounces@vtk.org] <b>On Behalf Of </b>Bryn Lloyd<br><b>Sent:</b> Monday, November 07, 2011 4:08 AM<br><b>To:</b> 'vtk'<br><b>Subject:</b> [vtkusers] Volume rendering not visible (vtkVolumeTextureMapper3D)<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>Hi<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>I am trying to figure out why for a specific dataset the volume rendering is not visible UNLESS I am interacting with the window.<o:p></o:p></p><p class=MsoNormal>In other words, the still render is not visible. For other example datasets (head from VTK_DATA), the still render is visible.<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>I am using the vtkVolumeTextureMapper3D (from vtk 5.8.0). The same thing happens on OSX and Win7 installations with different hardware.<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>Additional information:<o:p></o:p></p><p class=MsoListParagraph style='text-indent:-.25in;mso-list:l0 level1 lfo2'><![if !supportLists]><span style='mso-list:Ignore'>-<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><![endif]>vtkGPUVolumeRayCastMapper works fine for the dataset<o:p></o:p></p><p class=MsoListParagraph style='text-indent:-.25in;mso-list:l0 level1 lfo2'><![if !supportLists]><span style='mso-list:Ignore'>-<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><![endif]>For whatever reason, if use the vtkSmartVolumeMapper, the still render is visible even if I set the render mode to texture. <o:p></o:p></p><p class=MsoListParagraph style='text-indent:-.25in;mso-list:l0 level1 lfo2'><![if !supportLists]><span style='mso-list:Ignore'>-<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><![endif]>The image data is 64x64x64, unsigned char, scaled to fit in 0-255.<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>Thanks for any ideas what might be going wrong. Below is the script I am using to visualize the data.<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>Thanks,<o:p></o:p></p><p class=MsoNormal>Bryn<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>reader = vtk.vtkDataSetReader()<o:p></o:p></p><p class=MsoNormal>reader.SetFileName(&quot;C:/Temp/debug_imagedata.vtk&quot;)<o:p></o:p></p><p class=MsoNormal>reader.Update()<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>input = reader.GetStructuredPointsOutput()<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>bounds = [0,0,0,0,0,0]<o:p></o:p></p><p class=MsoNormal>input.GetBounds(bounds)<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>resample = vtk.vtkImageResample()<o:p></o:p></p><p class=MsoNormal>resample.SetInputConnection(reader.GetOutputPort())<o:p></o:p></p><p class=MsoNormal>resample.SetAxisOutputSpacing(0, (bounds[1]-bounds[0])/63.0)<o:p></o:p></p><p class=MsoNormal>resample.SetAxisOutputSpacing(1, (bounds[3]-bounds[2])/63.0)<o:p></o:p></p><p class=MsoNormal>resample.SetAxisOutputSpacing(2, (bounds[5]-bounds[4])/63.0)<o:p></o:p></p><p class=MsoNormal>resample.Update()<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>dims = [0,0,0]<o:p></o:p></p><p class=MsoNormal>resample.GetOutput().GetDimensions(dims)<o:p></o:p></p><p class=MsoNormal>print &quot;Dimensions: &quot;,dims<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>srange = [0,0]<o:p></o:p></p><p class=MsoNormal>resample.GetOutput().GetPointData().GetScalars().GetRange(srange)<o:p></o:p></p><p class=MsoNormal>print &quot;Scalar range: &quot;, srange<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>scale = vtk.vtkImageShiftScale()<o:p></o:p></p><p class=MsoNormal>scale.SetInputConnection(resample.GetOutputPort())<o:p></o:p></p><p class=MsoNormal>scale.SetShift(-srange[0])<o:p></o:p></p><p class=MsoNormal>scale.SetScale(255.0/(srange[1]-srange[0]))<o:p></o:p></p><p class=MsoNormal>scale.ClampOverflowOn()<o:p></o:p></p><p class=MsoNormal>scale.SetOutputScalarTypeToUnsignedChar()<o:p></o:p></p><p class=MsoNormal>scale.Update()<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>volumeMapper = vtk.vtkVolumeTextureMapper3D()<o:p></o:p></p><p class=MsoNormal>volumeMapper.SetInputConnection(scale.GetOutputPort())<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>volumeColor = vtk.vtkColorTransferFunction()<o:p></o:p></p><p class=MsoNormal>volumeColor.RemoveAllPoints()<o:p></o:p></p><p class=MsoNormal>volumeColor.AddRGBPoint(0.00, 0.0,0.0,1.0)<o:p></o:p></p><p class=MsoNormal>volumeColor.AddRGBPoint(100, 1.0,1.0,0.0)<o:p></o:p></p><p class=MsoNormal>volumeColor.AddRGBPoint(255, 1.0,0.0,0.0)<o:p></o:p></p><p class=MsoNormal>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <o:p></o:p></p><p class=MsoNormal>volumeScalarOpacity = vtk.vtkPiecewiseFunction()<o:p></o:p></p><p class=MsoNormal>volumeScalarOpacity.RemoveAllPoints()<o:p></o:p></p><p class=MsoNormal>volumeScalarOpacity.AddPoint(&nbsp; 0, 1.0)<o:p></o:p></p><p class=MsoNormal>volumeScalarOpacity.AddPoint( 50, 1.0)<o:p></o:p></p><p class=MsoNormal>volumeScalarOpacity.AddPoint(150, 1.0)<o:p></o:p></p><p class=MsoNormal>volumeScalarOpacity.AddPoint(200, 1.0)<o:p></o:p></p><p class=MsoNormal>volumeScalarOpacity.AddPoint(255, 1.0)<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>volumeProperty = vtk.vtkVolumeProperty()<o:p></o:p></p><p class=MsoNormal>volumeProperty.SetColor(volumeColor)<o:p></o:p></p><p class=MsoNormal>volumeProperty.SetScalarOpacity(volumeScalarOpacity)<o:p></o:p></p><p class=MsoNormal>volumeProperty.SetInterpolationTypeToLinear()<o:p></o:p></p><p class=MsoNormal>volumeProperty.ShadeOn()<o:p></o:p></p><p class=MsoNormal>volumeProperty.SetAmbient(0.6)<o:p></o:p></p><p class=MsoNormal>volumeProperty.SetDiffuse(0.6)<o:p></o:p></p><p class=MsoNormal>volumeProperty.SetSpecular(0.5)<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>volume = vtk.vtkVolume()<o:p></o:p></p><p class=MsoNormal>volume.SetMapper(volumeMapper)<o:p></o:p></p><p class=MsoNormal>volume.SetProperty(volumeProperty)<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>#-----------------------------------------------------<o:p></o:p></p><p class=MsoNormal># Create the standard renderer, render window and interactor<o:p></o:p></p><p class=MsoNormal><span lang=DE-CH>ren = vtk.vtkRenderer()<o:p></o:p></span></p><p class=MsoNormal><span lang=DE-CH>renWin = vtk.vtkRenderWindow()<o:p></o:p></span></p><p class=MsoNormal><span lang=DE-CH>renWin.AddRenderer(ren)<o:p></o:p></span></p><p class=MsoNormal><span lang=DE-CH>iren = vtk.vtkRenderWindowInteractor()<o:p></o:p></span></p><p class=MsoNormal><span lang=DE-CH>iren.SetRenderWindow(renWin)<o:p></o:p></span></p><p class=MsoNormal><span lang=DE-CH><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span lang=DE-CH>ren.SetBackground(0.5,0.5,0.5)<o:p></o:p></span></p><p class=MsoNormal>ren.AddVolume(volume)<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>renWin.Render()<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>def CheckAbort(obj, event):<o:p></o:p></p><p class=MsoNormal>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if obj.GetEventPending() != 0:<o:p></o:p></p><p class=MsoNormal>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; obj.SetAbortRender(1)<o:p></o:p></p><p class=MsoNormal>&nbsp; <o:p></o:p></p><p class=MsoNormal>renWin.AddObserver(&quot;AbortCheckEvent&quot;, CheckAbort)<o:p></o:p></p><p class=MsoNormal>iren.Initialize()<o:p></o:p></p><p class=MsoNormal>renWin.Render()<o:p></o:p></p><p class=MsoNormal>iren.Start()<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p></div></div></body></html>