<div dir="ltr">
<div class="gmail-adn gmail-ads"><div class="gmail-gs"><div class="gmail-"><div id="gmail-:mt" class="gmail-ii gmail-gt"><div id="gmail-:mu" class="gmail-a3s gmail-aXjCH" tabindex="-1"><div dir="ltr"><div dir="ltr"><div>Hi all <br></div><div>I am using VTK with Activiz.net to reconstruct a series of JPEG ultrasound images, I have used raycasting technique and applied transfer function as here, <br></div><div>The problem is that the Opacity transfer function isn't working with the vtkJPEG reader output, the black regions was not filtered, the code is working fine with vtkDICOMReader? so, any solutions for this ??? <br></div><div><br></div><div>The code:</div><div><br></div><div><br></div><div>vtkJPEGReader jpegReader = vtkJPEGReader.New();<br> jpegReader.SetDataByteOrderToLittleEndian();<br> jpegReader.SetFilePattern("%s%d.jpg");<br> jpegReader.SetFilePrefix(@"C:\Users\DilenyTech\Desktop\test\TestC#\Series_004\CIM_0001_Frame");<br> jpegReader.SetDataExtent(0, 176, 0, 510,1, 243);<br> jpegReader.SetDataScalarTypeToFloat();<br> jpegReader.SetDataSpacing(1, 1, 1);<br> jpegReader.SetDataOrigin(0, 0, 0);<br> <br><br><br> vtkImageThreshold SelectTissue = vtkImageThreshold.New();<br> SelectTissue.SetInput(jpegReader.GetOutput());<br> SelectTissue.ThresholdBetween(0, 10);<br> <br> vtkFixedPointVolumeRayCastMapper volumeMapper = vtkFixedPointVolumeRayCastMapper.New();<br> volumeMapper.SetInput(SelectTissue.GetOutput());<br> <br> vtkColorTransferFunction volumeColor = vtkColorTransferFunction.New();<br> volumeColor.AddRGBPoint(1, 1, 0, 0);<br> volumeColor.AddRGBPoint(100, 1, 0, 0.4);<br> volumeColor.AddRGBPoint(160, 1.0, 0.5, 0.1);<br> volumeColor.AddRGBPoint(255, 1.0, 0.5, 0.1);<br><br><br> vtkPiecewiseFunction volumeScalarOpacity = vtkPiecewiseFunction.New();<br> volumeScalarOpacity.AddPoint(0, 0.00);<br> volumeScalarOpacity.AddPoint(20, 0.00);<br> volumeScalarOpacity.AddPoint(30, 0.20);<br> volumeScalarOpacity.AddPoint(100, 0.7);<br> <br><br> vtkPiecewiseFunction volumeGradientOpacity = vtkPiecewiseFunction.New();<br> volumeGradientOpacity.AddPoint(0, 1.0);<br> volumeGradientOpacity.AddPoint(255, 1.0);<br><br> vtkVolumeProperty volumeProperty = vtkVolumeProperty.New();<br> volumeProperty.SetColor(volumeColor);<br> volumeProperty.SetScalarOpacity(volumeScalarOpacity);<br> volumeProperty.SetGradientOpacity(volumeGradientOpacity);<br> volumeProperty.SetInterpolationTypeToLinear();<br> volumeProperty.ShadeOn();<br> volumeProperty.SetAmbient(0.1);<br> volumeProperty.SetDiffuse(0.9);<br> volumeProperty.SetSpecular(0.2);<br> <br> vtkVolume volume = vtkVolume.New();<br> volume.SetMapper(volumeMapper);<br> volume.SetProperty(volumeProperty);<br><br><br> vtkRenderWindow renderWindow = renderWindowControl1.RenderWindow;<br> vtkRenderer renderer = renderWindow.GetRenderers().GetFirstRenderer();<br> renderer.AddViewProp(volume);<br> renderer.SetBackground(0.2, 0.3, 0.4);</div><div class="gmail-adL"><br></div></div></div><div class="gmail-adL">
</div></div></div></div></div></div><div class="gmail-gA gmail-gt gmail-acV"><div class="gmail-gB gmail-xu"><div class="gmail-ip gmail-iq"><div id="gmail-:ms"><table class="gmail-cf gmail-wS"><tbody><tr><td class="gmail-amq"><img id="gmail-:0_6" name=":0" src="https://plus.google.com/u/0/_/focus/photos/public/AIbEiAIAAABDCJ7lms6E3P7-EyILdmNhcmRfcGhvdG8qKDZkNTg2YWU2OGVlYjBlYjZmM2RmYjE0ODA0MzVmNjM1ZmNiMjU2ZDEwAWraQjHnNdHSr9q55DlzSIfL7AHr?sz=32" class="gmail-ajn gmail-bofPge"></td><td class="gmail-amr"><br></td></tr></tbody></table></div></div></div></div>
</div>