Hi,<br><br>Maybe this will help a bit: <a href="http://www.vtk.org/pipermail/vtk-developers/2010-March/007459.html">http://www.vtk.org/pipermail/vtk-developers/2010-March/007459.html</a><br><br>I believe that ATI drivers (or the GLSL compiler) are buggy, and not supported.<br>
<br>Shash<br><br><div class="gmail_quote">2011/4/11 landscapemoon <span dir="ltr">&lt;<a href="mailto:landscapemoon@126.com">landscapemoon@126.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div>Hi:</div>
<div> I am a beginner.Now I do a CT series Image processing(DICOM).</div>
<div>Source codes as follow:</div>
<div>*************************************************************</div>
<div>#if defined(_MSC_VER)<br>#pragma warning ( disable : 4786 )<br>#endif</div>
<div>#ifdef __BORLANDC__<br>#define ITK_LEAN_AND_MEAN<br>#endif</div>
<div>// ITK include<br>#include &quot;itkBinaryThresholdImageFilter.h&quot;<br>#include &quot;itkCannySegmentationLevelSetImageFilter.h&quot;<br>#include &quot;itkCastImageFilter.h&quot;<br>#include &quot;itkConfidenceConnectedImageFilter.h&quot;<br>
#include &quot;itkCurvatureAnisotropicDiffusionImageFilter.h&quot;<br>#include &quot;itkFastMarchingImageFilter.h&quot;<br>#include &quot;itkGDCMImageIO.h&quot;<br>#include &quot;itkGDCMSeriesFileNames.h&quot;<br>#include &quot;itkGradientMagnitudeRecursiveGaussianImageFilter.h&quot;<br>
#include &quot;itkImageFileWriter.h&quot;<br>#include &quot;itkImageSeriesReader.h&quot;<br>#include &quot;itkImageToVTKImageFilter.h&quot;<br>#include &quot;itkImportImageFilter.h&quot;<br>#include &quot;itkIntensityWindowingImageFilter.h&quot;<br>
#include &quot;itkOrientedImage.h&quot;<br>#include &quot;itkRescaleIntensityImageFilter.h&quot;<br>#include &quot;itkSigmoidImageFilter.h&quot;</div>
<div>// VTK include<br>#include &quot;vtkActor.h&quot;<br>#include &quot;vtkBoxWidget.h&quot;<br>#include &quot;vtkCamera.h&quot;<br>#include &quot;vtkCommand.h&quot;<br>#include &quot;vtkColorTransferFunction.h&quot;<br>
#include &quot;vtkContourFilter.h&quot;<br>#include &quot;vtkDataSetMapper.h&quot;<br>#include &quot;vtkDICOMImageReader.h&quot;<br>#include &quot;vtkGeometryFilter.h&quot;<br>#include &quot;vtkGPUVolumeRayCastMapper.h&quot;<br>
#include &quot;vtkImageData.h&quot;<br>#include &quot;vtkImageResample.h&quot;<br>#include &quot;vtkImageViewer.h&quot;<br>#include &quot;vtkMetaImageReader.h&quot;<br>#include &quot;vtkPiecewiseFunction.h&quot;<br>#include &quot;vtkPlanes.h&quot;<br>
#include &quot;vtkPolyData.h&quot;<br>#include &quot;vtkPolyDataMapper.h&quot;<br>#include &quot;vtkProperty.h&quot;<br>#include &quot;vtkRenderer.h&quot;<br>#include &quot;vtkRenderWindow.h&quot;<br>#include &quot;vtkRenderWindowInteractor.h&quot;<br>
#include &quot;vtkVolume.h&quot;<br>#include &quot;vtkVolumeProperty.h&quot;<br>#include &quot;vtkXMLImageDataReader.h&quot;</div>
<div>//#include &quot;vvITKFilterModuleBase.h&quot;<br>//#include &quot;vtkVVPluginAPI.h&quot;<br>//#include &quot;vvITKCannySegmentationLevelSetModule.cxx&quot;</div>
<div>#define VTI_FILETYPE 1<br>#define MHA_FILETYPE 2</div>
<div>class vtkBoxWidgetCallback : public vtkCommand<br>{<br>public:<br> static vtkBoxWidgetCallback *New()<br>    { <br>  return new vtkBoxWidgetCallback; <br> }<br> <br> virtual void Execute(vtkObject *caller, unsigned long, void*)<br>
    {<br>  vtkBoxWidget *widget = reinterpret_cast&lt;vtkBoxWidget*&gt;(caller);<br>  if (this-&gt;Mapper)<br>        {<br>   vtkPlanes *planes = vtkPlanes::New();<br>   widget-&gt;GetPlanes(planes);<br>   this-&gt;Mapper-&gt;SetClippingPlanes(planes);<br>
   planes-&gt;Delete();<br>        }<br>    }<br> <br> void SetMapper(vtkGPUVolumeRayCastMapper* m) <br>    { <br>  this-&gt;Mapper = m; <br> }</div>
<div>protected:<br> vtkBoxWidgetCallback() <br>    { <br>  this-&gt;Mapper = 0; <br> }</div>
<div> vtkGPUVolumeRayCastMapper *Mapper;<br>};</div>
<div>int main(int argc, char *argv[])<br>{<br> // reader and connector<br> typedef signed short    PixelType;<br> const unsigned int      Dimension = 3;<br> typedef itk::OrientedImage&lt; PixelType, Dimension &gt;    ImageType;<br>
 typedef itk::ImageSeriesReader&lt; ImageType &gt;           ReaderType;<br> typedef itk::ImageToVTKImageFilter&lt; ImageType &gt;       ConnectType;<br> <br> ReaderType::Pointer reader = ReaderType::New();<br>    ConnectType::Pointer connector = ConnectType::New();</div>

<div> // set reader to DICOM <br> typedef itk::GDCMImageIO       ImageIOType;<br> ImageIOType::Pointer dicomIO = ImageIOType::New();<br> reader-&gt;SetImageIO( dicomIO );</div>
<div> typedef itk::GDCMSeriesFileNames NamesGeneratorType;<br> NamesGeneratorType::Pointer nameGenerator = NamesGeneratorType::New();</div>
<div> nameGenerator-&gt;SetUseSeriesDetails( true );<br> nameGenerator-&gt;AddSeriesRestriction( &quot;0008|0021&quot; );</div>
<div> nameGenerator-&gt;SetDirectory( &quot;dicom4&quot; );<br>  <br>/*  <br>    //typedef unsigned char MaskPixelType;<br> typedef signed short MaskPixelType;<br>    typedef itk::OrientedImage&lt; MaskPixelType, Dimension &gt; MaskImageType;<br>
 typedef itk::ConfidenceConnectedImageFilter&lt; ImageType, MaskImageType &gt; SegmentationFilterType;<br> SegmentationFilterType::Pointer filter = SegmentationFilterType::New(); <br>*/ <br> try<br> {<br>  std::cout &lt;&lt; std::endl &lt;&lt; &quot;The directory: &quot; &lt;&lt; std::endl;<br>
  std::cout &lt;&lt; std::endl &lt;&lt; &quot;dicom4&quot; &lt;&lt; std::endl &lt;&lt; std::endl;<br>  std::cout &lt;&lt; &quot;Contains the following DICOM Series: &quot;;<br>  std::cout &lt;&lt; std::endl &lt;&lt; std::endl;</div>

<div>  typedef std::vector&lt; std::string &gt;    SeriesIdContainer;    <br>  const SeriesIdContainer &amp; seriesUID = nameGenerator-&gt;GetSeriesUIDs();   <br>  SeriesIdContainer::const_iterator seriesItr = seriesUID.begin();<br>
  SeriesIdContainer::const_iterator seriesEnd = seriesUID.end();<br>  <br>  while( seriesItr != seriesEnd )<br>  {<br>   std::cout &lt;&lt; seriesItr-&gt;c_str() &lt;&lt; std::endl;<br>   seriesItr++;<br>  }</div>
<div>  std::string seriesIdentifier;<br>  seriesIdentifier = seriesUID.begin()-&gt;c_str();</div>
<div>  std::cout &lt;&lt; std::endl &lt;&lt; std::endl;<br>  std::cout &lt;&lt; &quot;Now reading series: &quot; &lt;&lt; std::endl &lt;&lt; std::endl;<br>  std::cout &lt;&lt; seriesIdentifier &lt;&lt; std::endl;<br>  std::cout &lt;&lt; std::endl &lt;&lt; std::endl;</div>

<div>  typedef std::vector&lt; std::string &gt;   FileNamesContainer;<br>  FileNamesContainer fileNames;<br>  fileNames = nameGenerator-&gt;GetFileNames( seriesIdentifier ); <br>  reader-&gt;SetFileNames( fileNames );</div>

<div>  try<br>  {<br>   reader-&gt;Update();<br>  }<br>  catch (itk::ExceptionObject &amp;ex)<br>  {<br>   std::cout &lt;&lt; ex &lt;&lt; std::endl;<br>   return EXIT_FAILURE;<br>  }<br>  <br>////////////////////////////////////////////////////////////</div>

<div>/*   filter-&gt;SetInput( reader-&gt;GetOutput() );<br>  filter-&gt;SetNumberOfIterations(0);<br>  filter-&gt;SetReplaceValue(255);<br>  filter-&gt;SetMultiplier(2.5);<br>  ImageType::IndexType seed;<br>  seed[0]=50;<br>
  seed[1]=50;<br>  seed[2]=50;<br>  filter-&gt;SetSeed(seed); */<br>  //filter-&gt;Update();<br>  <br>  // Fast Marching started...<br>  typedef float RealPixelType;<br>  typedef itk::OrientedImage&lt; RealPixelType,3 &gt;    RealImageType;<br>
  typedef unsigned char                            OutputPixelType;<br>  typedef itk::OrientedImage&lt; OutputPixelType, 3 &gt; OutputImageType;</div>
<div>  typedef itk::BinaryThresholdImageFilter&lt; RealImageType, RealImageType&gt;    ThresholdingFilterType;<br>  ThresholdingFilterType::Pointer thresholder = ThresholdingFilterType::New();</div>
<div>  const PixelType  timeThreshold = 130;<br>  <br>  // Threshold setting<br>  thresholder-&gt;SetLowerThreshold(           0.0  );<br>  thresholder-&gt;SetUpperThreshold( timeThreshold  );</div>
<div>  // Value setting<br>  thresholder-&gt;SetOutsideValue(  0  );<br>  thresholder-&gt;SetInsideValue(  255 );</div>
<div>  typedef itk::ImageFileReader&lt; ImageType &gt; ReaderType;<br>  typedef itk::ImageFileWriter&lt;  OutputImageType  &gt; WriterType;<br>  typedef itk::RescaleIntensityImageFilter&lt; <br>            ImageType, <br>
            OutputImageType &gt;   CastFilterType;<br>  typedef itk::CurvatureAnisotropicDiffusionImageFilter&lt; <br>            RealImageType, <br>            RealImageType &gt;  SmoothingFilterType; <br>  SmoothingFilterType::Pointer smoothing = SmoothingFilterType::New();</div>

<div>  typedef itk::GradientMagnitudeRecursiveGaussianImageFilter&lt; <br>            RealImageType, <br>            RealImageType &gt;  GradientFilterType;<br>  typedef itk::SigmoidImageFilter&lt;  RealImageType, <br>            RealImageType &gt;  SigmoidFilterType;</div>

<div>  GradientFilterType::Pointer  gradientMagnitude = GradientFilterType::New();<br>  SigmoidFilterType::Pointer sigmoid = SigmoidFilterType::New();</div>
<div>  sigmoid-&gt;SetOutputMinimum( 0 );<br>  sigmoid-&gt;SetOutputMaximum( 1 );</div>
<div>  typedef  itk::FastMarchingImageFilter&lt; RealImageType, <br>                              RealImageType &gt;    FastMarchingFilterType;<br>  FastMarchingFilterType::Pointer fastMarching = FastMarchingFilterType::New();</div>

<div>  typedef itk::CastImageFilter&lt; ImageType,RealImageType&gt; Image_to_Real_Type;<br>  Image_to_Real_Type::Pointer image_to_real_Filter = Image_to_Real_Type::New();</div>
<div>  image_to_real_Filter-&gt;SetInput(reader-&gt;GetOutput() );<br>  smoothing-&gt;SetInput( image_to_real_Filter-&gt;GetOutput());<br>  //real_to_image_Filter-&gt;SetInput(smoothing-&gt;GetOutput());<br>  gradientMagnitude-&gt;SetInput( smoothing-&gt;GetOutput() );<br>
  sigmoid-&gt;SetInput( gradientMagnitude-&gt;GetOutput() );<br>  fastMarching-&gt;SetInput( sigmoid-&gt;GetOutput() );<br>  //fastMarching-&gt;SetInput( gradientMagnitude-&gt;GetOutput() );<br>  thresholder-&gt;SetInput( fastMarching-&gt;GetOutput() );</div>

<div>  smoothing-&gt;SetTimeStep( 0.0625 );<br>  smoothing-&gt;SetNumberOfIterations(  3 );<br>  smoothing-&gt;SetConductanceParameter( 3 );</div>
<div>  const double sigma = 3;</div>
<div>  gradientMagnitude-&gt;SetSigma(  sigma  );</div>
<div>  sigmoid-&gt;SetAlpha( 20 );<br>  sigmoid-&gt;SetBeta( 170 );</div>
<div>  typedef FastMarchingFilterType::NodeContainer           NodeContainer;<br>  typedef FastMarchingFilterType::NodeType                NodeType;<br>  NodeContainer::Pointer seeds = NodeContainer::New();</div>
<div>  ImageType::IndexType  seedPosition;<br>  <br>  seedPosition[0] = 250;<br>  seedPosition[1] = 250;<br>  seedPosition[2] = 50;</div>
<div>  NodeType node;<br>  const double seedValue = 0.0;<br>  <br>  node.SetValue( seedValue );<br>  node.SetIndex( seedPosition );</div>
<div>  seeds-&gt;Initialize();<br>  seeds-&gt;InsertElement( 0, node );</div>
<div>  fastMarching-&gt;SetTrialPoints(  seeds  );<br>  fastMarching-&gt;SetOutputSize( reader-&gt;GetOutput()-&gt;GetBufferedRegion().GetSize() );<br>  reader-&gt;Update();<br>  fastMarching-&gt;SetStoppingValue(  100  );<br>
  </div>
<div>  typedef itk::CastImageFilter&lt; RealImageType,ImageType&gt; Real_to_Image_Type;<br>  Real_to_Image_Type::Pointer real_to_image_Filter = Real_to_Image_Type::New();<br>  real_to_image_Filter-&gt;SetInput(fastMarching-&gt;GetOutput());<br>
  //connector-&gt;SetInput(real_to_image_Filter-&gt;GetOutput());<br>  //connector-&gt;SetInput(thresholder-&gt;GetOutput());<br>  connector-&gt;SetInput(reader-&gt;GetOutput());<br>  connector-&gt;Update();<br>  // Fast Marching Ends.</div>

<div>  <br>/*<br> image_to_real_Filter-&gt;SetInput( reader-&gt;GetOutput() );</div>
<div> typedef itk::FastMarchingImageFilter&lt; RealImageType,RealImageType &gt;  FastMarchingFilterType;<br> FastMarchingFilterType::Pointer m_FastMarchingImageFilter          = FastMarchingFilterType::New();<br> m_FastMarchingImageFilter-&gt;SetSpeedConstant( 1.0 );<br>
 m_FastMarchingImageFilter-&gt;SetInput(image_to_real_Filter-&gt;GetOutput());<br> typedef  itk::CannySegmentationLevelSetImageFilter&lt;itk::Image&lt; RealPixelType,   3 &gt;,itk::Image&lt; RealPixelType,   3 &gt;&gt; CannySegmentationLevelSetFilterType;<br>
 CannySegmentationLevelSetFilterType::Pointer m_CannySegmentationLevelSetFilter  = CannySegmentationLevelSetFilterType::New();</div>
<div> m_CannySegmentationLevelSetFilter-&gt;SetInput( m_FastMarchingImageFilter-&gt;GetOutput() );<br> <br> m_CannySegmentationLevelSetFilter-&gt;SetFeatureImage(  image_to_real_Filter -&gt;GetOutput() );<br> real_to_image_Filter-&gt;SetInput(m_CannySegmentationLevelSetFilter-&gt;GetOutput());<br>
 connector-&gt;SetInput(real_to_image_Filter-&gt;GetOutput());<br>*/ <br> }<br> catch (itk::ExceptionObject &amp;ex)<br> {<br>  std::cout &lt;&lt; ex &lt;&lt; std::endl;<br>  return EXIT_FAILURE;<br>    }</div>
<div> // Parse the parameters<br> int count = 1;<br> char *dirname = NULL;<br> double opacityWindow = 4096;<br> double opacityLevel = 2048;<br> int blendType = 0;<br> int clip = 0;<br> double reductionFactor = 1.0;<br> double frameRate = 10.0;<br>
 char *fileName = 0;<br> int fileType = 0; </div>
<div> bool independentComponents = true;<br>  <br> // Create the renderer, render window and interactor<br> vtkRenderer *renderer = vtkRenderer::New();<br> vtkRenderWindow *renWin = vtkRenderWindow::New();<br> renWin-&gt;AddRenderer(renderer);</div>

<div> // Connect it all. Note that funny arithmatic on the <br> // SetDesiredUpdateRate - the vtkRenderWindow divides it<br> // allocated time across all renderers, and the renderer<br> // divides it time across all props. If clip is<br>
 // true then there are two props<br> vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();<br> iren-&gt;SetRenderWindow(renWin);<br> iren-&gt;SetDesiredUpdateRate(frameRate / (1+clip)); </div>
<div> iren-&gt;GetInteractorStyle()-&gt;SetDefaultRenderer(renderer);</div>
<div> // Read the data<br>   //typedef itk::VTKImageExport&lt; MaskImageType  &gt; ExportFilter2Type;<br> //ExportFilter2Type::Pointer itkExporter2 = ExportFilter2Type::New();<br> //itkExporter2-&gt;SetInput( filter-&gt;GetOutput() );<br>
    vtkDataSetMapper* geom = vtkDataSetMapper::New();<br> geom-&gt;SetInput(connector-&gt;GetOutput());<br>    geom-&gt;Update();<br>    vtkContourFilter * contour = vtkContourFilter::New();<br>    contour-&gt;SetInput( connector-&gt;GetOutput() );<br>
    contour-&gt;SetValue(0, 128); // edges of a binary image with values 0,255<br> vtkPolyDataMapper * polyMapper = vtkPolyDataMapper::New();<br>    vtkActor          * polyActor  = vtkActor::New();</div>
<div>    //polyActor-&gt;SetMapper( polyMapper );<br> <br>    //polyMapper-&gt;SetInput( contour-&gt;GetOutput() );<br> //polyMapper-&gt;SetInput( geom-&gt;GetOutput() );<br>    //polyMapper-&gt;ScalarVisibilityOff();<br>
 <br> // Set the scene<br> polyActor-&gt;SetMapper( geom );<br>    vtkProperty * vtkproperty = vtkProperty::New();<br>    vtkproperty-&gt;SetAmbient(0.5);<br>    vtkproperty-&gt;SetDiffuse(0.1);<br>    vtkproperty-&gt;SetSpecular(0.5);<br>
    vtkproperty-&gt;SetColor(0.5,0.4,0.0);<br>    vtkproperty-&gt;SetLineWidth(2.0);<br>    vtkproperty-&gt;SetRepresentationToWireframe();<br> vtkproperty-&gt;SetOpacity(0.1);</div>
<div>    polyActor-&gt;SetProperty( vtkproperty );<br>  <br>    //renderer-&gt;AddActor( polyActor );</div>
<div> vtkImageData *input = 0;<br> input = connector-&gt;GetOutput();</div>
<div>    vtkImageResample *resample = vtkImageResample::New();<br> if ( reductionFactor &lt; 1.0 )<br>    {<br>  resample-&gt;SetInput(input);<br>  resample-&gt;SetAxisMagnificationFactor(0, reductionFactor);<br>  resample-&gt;SetAxisMagnificationFactor(1, reductionFactor);<br>
  resample-&gt;SetAxisMagnificationFactor(2, reductionFactor);<br>    }</div>
<div> // Create our volume and mapper<br> vtkVolume *volume = vtkVolume::New();<br> vtkGPUVolumeRayCastMapper *mapper = vtkGPUVolumeRayCastMapper::New();<br>  <br> // Add a box widget if the clip option was selected<br> vtkBoxWidget *box = vtkBoxWidget::New();<br>
 if (clip)<br>    {<br>  box-&gt;SetInteractor(iren);<br>  box-&gt;SetPlaceFactor(1.01);<br>  if ( reductionFactor &lt; 1.0 )<br>  {      <br>   box-&gt;SetInput(resample-&gt;GetOutput());<br>  }<br>  else<br>  {<br>   box-&gt;SetInput(input);<br>
  }<br>    <br>  box-&gt;SetDefaultRenderer(renderer);<br>  box-&gt;InsideOutOn();<br>  box-&gt;PlaceWidget();<br>  vtkBoxWidgetCallback *callback = vtkBoxWidgetCallback::New();<br>  callback-&gt;SetMapper(mapper);<br> &amp;nbsp
 ;box-&gt;AddObserver(vtkCommand::InteractionEvent, callback);<br>  callback-&gt;Delete();<br>  box-&gt;EnabledOn();<br>  box-&gt;GetSelectedFaceProperty()-&gt;SetOpacity(0.0);<br>    }</div>
<div> if ( reductionFactor &lt; 1.0 )<br>    {<br>  mapper-&gt;SetInputConnection( resample-&gt;GetOutputPort() );<br>    }<br> else<br>    {<br>  mapper-&gt;SetInput(input);<br>  //mapper-&gt;SetInputConnection( read-&gt;GetOutputPort() );<br>
    }<br>     <br> // Set the sample distance on the ray to be 1/2 the average spacing<br> double spacing[3];<br> if ( reductionFactor &lt; 1.0 )<br>    {<br>  resample-&gt;GetOutput()-&gt;GetSpacing(spacing);<br>    }<br>
 else<br>    {<br>  input-&gt;GetSpacing(spacing);<br>    }<br>  <br>//  mapper-&gt;SetSampleDistance( (spacing[0]+spacing[1]+spacing[2])/6.0 );<br>//  mapper-&gt;SetMaximumImageSampleDistance(10.0);<br>  <br> // Create our transfer function<br>
 vtkColorTransferFunction *co
 lorFun = vtkColorTransferFunction::New();<br> vtkPiecewiseFunction *opacityFun = vtkPiecewiseFunction::New();<br>  <br> // Create the property and attach the transfer functions<br> vtkVolumeProperty *property = vtkVolumeProperty::New();<br>
 property-&gt;SetIndependentComponents(independentComponents);<br> property-&gt;SetColor( colorFun );<br> property-&gt;SetScalarOpacity( opacityFun );<br> property-&gt;SetInterpolationTypeToLinear();</div>
<div> // connect up the volume to the property and the mapper<br> volume-&gt;SetProperty( property );<br> volume-&gt;SetMapper( mapper );</div>
<div> // Depending on the blend type selected as a command line option, <br> // adjust the transfer function<br> switch ( blendType )<br>    {<br>    // MIP<br>    // Create an opacity ramp from the window and level values.<br>
    // Color is white. Blending is MIP.<br>    case 0:<br>  colorFun-&gt;AddRGBSegment(0.0, 1.0, 1.0, 1.0, 255.0, 1.0, 1.0, 1.0 );<br>  opacityFun-&gt;AddSegment( opacityLevel - 0.5*opacityWindow, 0.0, <br>                                opacityLevel + 0.5*opacityWindow, 1.0 );<br>
  mapper-&gt;SetBlendModeToMaximumIntensity();<br>  break;<br>      <br>    // CompositeRamp<br>    // Create a ramp from the window and leve
 l values. Use compositing<br>    // without shading. Color is a ramp from black to white.<br>    case 1:<br>  colorFun-&gt;AddRGBSegment( opacityLevel - 0.5*opacityWindow, 0.0, 0.0, 0.0, <br>                                 opacityLevel + 0.5*opacityWindow, 1.0, 1.0, 1.0 );<br>
  opacityFun-&gt;AddSegment( opacityLevel - 0.5*opacityWindow, 0.0, <br>                                opacityLevel + 0.5*opacityWindow, 1.0 );<br>  mapper-&gt;SetBlendModeToComposite();<br>  property-&gt;ShadeOff();<br>
  break;<br>      <br>    // CompositeShadeRamp<br>&amp;nbs
 p;   // Create a ramp from the window and level values. Use compositing<br>    // with shading. Color is white.<br>    case 2:<br>  colorFun-&gt;AddRGBSegment( 0.0, 1.0, 1.0, 1.0, 255.0, 1.0, 1.0, 1.0 );<br>  opacityFun-&gt;AddSegment( opacityLevel - 0.5*opacityWindow, 0.0, <br>
                                opacityLevel + 0.5*opacityWindow, 1.0 );<br>  mapper-&gt;SetBlendModeToComposite();<br>  property-&gt;ShadeOn();<br>  break;</div>
<div>    // CT_Skin<br>    // Use compositing and functions set to highlight skin in CT data<br>    // Not for use on RGB data<br>    case 3:<br>  colorFun-&gt;AddRGBPoint( -3024, 0, 0, 0, 0.5, 0.0 );<br>  colorFun-&gt;AddRGBPoint( -1000, .62, .36, .18, 0.5, 0.0 );<br>
  colorFun-&gt;AddRGBPoint( -500, .88, .60, .29, 0.33, 0.45 );<br>  colorFun-&gt;AddRGBPoint( 3071, .83, .66, 1, 0.5, 0.0 );<br>      <br>  opacityFun-&gt;AddPoint(-3024, 0, 0.5, 0.0 );<br>  opacityFun-&gt;AddPoint(-1000, 0, 0.5, 0.0 );<br>
  opacityFun-&gt;AddPoint(-500, 1.0, 0.33, 0.45 );<br>  opacityFun-&gt;AddPoint(3071, 1.0, 0.5, 0.0);</div>
<div>  mapper-&gt;SetBlendModeToComposite();<br>  property-&gt;ShadeOn();<br>  property-&gt;SetAmbient(0.1);<br>  property-&gt;SetDiffuse(0.9);<br>  property-&gt;SetSpecular(0.2);<br>  property-&gt;SetSpecularPower(10.0);<br>
  property-&gt;SetScalarOpacityUnitDistance(0.8919);<br>  break;<br>      <br>    // CT_Bone<br>    // Use compositing and functions set to highlight bone in CT data<br>    // Not for use on RGB data<br>    case 4:<br>  colorFun-&gt;AddRGBPoint( -3024, 0, 0, 0, 0.5, 0.0 );<br>
  colorFun-&gt;AddRGBPoint( -16, 0.73, 0.25, 0.30, 0.49, .61 );<br>  colorFun-&gt;AddRGBPoint( 641, .90, .82, .56, .5, 0.0 );<br>  colorFun-&gt;AddRGBPoint( 3071, 1, 1, 1, .5, 0.0 );<br>      <br>  opacityFun-&gt;AddPoint( -3024, 0, 0.5, 0.0 );<br>

   opacityFun-&gt;AddPoint( -16, 0, .49, .61 );<br>  opacityFun-&gt;AddPoint( 641, .72, .5, 0.0 );<br>  opacityFun-&gt;AddPoint( 3071, .71, 0.5, 0.0 );</div>
<div>  mapper-&gt;SetBlendModeToComposite();<br>  property-&gt;ShadeOn();<br>  property-&gt;SetAmbient(0.1);<br>  property-&gt;SetDiffuse(0.9);<br>  property-&gt;SetSpecular(0.2);<br>  property-&gt;SetSpecularPower(10.0);<br>
  property-&gt;SetScalarOpacityUnitDistance(0.8919);<br>  break;<br>      <br>    // CT_Muscle<br>    // Use compositing and functions set to highlight muscle in CT data<br>    // Not for use on RGB data<br>    case 5:<br>
  colorFun-&gt;AddRGBPoint(-3024, 0, 0, 0, 0.5, 0.0);<br>  colorFun-&gt;AddRGBPoint(-155, .55, .25, .15, 0.5, .92);<br>  colorFun-&gt;AddRGBPoint(217, .88, .60, .29, 0.33, 0.45);<br>  colorFun-&gt;AddRGBPoint(420, 1, .94, .95, 0.5, 0.0);<br>
  colorFun-&gt;AddRGBPoint(3071, .83, .66, 1, 0.5, 0.0);<br>    &amp;nb
 sp; <br>  opacityFun-&gt;AddPoint(-3024, 0, 0.5, 0.0);<br>  opacityFun-&gt;AddPoint(-155, 0, 0.5, 0.92);<br>  opacityFun-&gt;AddPoint(217, .68, 0.33, 0.45);<br>  opacityFun-&gt;AddPoint(420,.83, 0.5, 0.0);<br>  opacityFun-&gt;AddPoint(3071, .80, 0.5, 0.0);</div>

<div>  mapper-&gt;SetBlendModeToComposite();<br>  property-&gt;ShadeOn();<br>  property-&gt;SetAmbient(0.1);<br>  property-&gt;SetDiffuse(0.9);<br>  property-&gt;SetSpecular(0.2);<br>  property-&gt;SetSpecularPower(10.0);<br>
  property-&gt;SetScalarOpacityUnitDistance(0.8919);<br>  break;<br>      <br>    // RGB_Composite<br>    // Use compositing and functions set to highlight red/green/blue regions<br>    // in RGB data. Not for use on single component data<br>
    case 6:<br>  opacityFun-&gt;AddPoint(0, 0.0);<br>  opacityFun-&gt;AddPoint(5.0, 0.0);<br>  opacityFun-&gt;AddPoint(30.0, 0.05);<br>  opacityFun-&gt;AddPoint(31.0, 0.0);<br>  opacityFun-&gt;AddPoint(90.0, 0.0);<br>  opacityFun-&gt;AddPoint(100.0, 0.3);<br>
  opacityFun-&gt;AddPoint(110
 .0, 0.0);<br>  opacityFun-&gt;AddPoint(190.0, 0.0);<br>  opacityFun-&gt;AddPoint(200.0, 0.4);<br>  opacityFun-&gt;AddPoint(210.0, 0.0);<br>  opacityFun-&gt;AddPoint(245.0, 0.0);<br>  opacityFun-&gt;AddPoint(255.0, 0.5);</div>

<div>  mapper-&gt;SetBlendModeToComposite();<br>  property-&gt;ShadeOff();<br>  property-&gt;SetScalarOpacityUnitDistance(1.0);<br>  break;<br>    default:<br>  vtkGenericWarningMacro(&quot;Unknown blend type.&quot;);<br>
  break;<br>    }<br>   <br> // Set the default window size<br> renWin-&gt;SetSize(600,600);<br> renWin-&gt;Render();</div>
<div> if ( !mapper-&gt;IsRenderSupported(renWin, property) )<br>    {<br>  cout &lt;&lt; &quot;This mapper is unsupported on this platform&quot; &lt;&lt; endl;<br>  exit(EXIT_FAILURE);<br>    }<br>  </div>
<div> // Add the volume to the scene<br> renderer-&gt;AddVolume( volume );</div>
<div> renderer-&gt;ResetCamera();<br> // interact with data<br> renWin-&gt;Render();</div>
<div> iren-&gt;Start();</div>
<div> opacityFun-&gt;Delete();<br> colorFun-&gt;Delete();<br> property-&gt;Delete();<br>  <br> box-&gt;Delete();<br> volume-&gt;Delete();<br> mapper-&gt;Delete();<br> //reader-&gt;Delete();<br> resample-&gt;Delete();<br>
 renderer-&gt;Delete();<br> renWin-&gt;Delete();<br> iren-&gt;Delete();<br> contour-&gt;Delete();<br> geom-&gt;Delete();<br> polyMapper-&gt;Delete();<br> polyActor-&gt;Delete();<br> vtkproperty-&gt;Delete();<br> <br> return 0; <br>
}<br></div>
<div>***********************************************************************************************</div>
<div> </div>
<div>But when I do the <span>executable program( Navogation.exe )</span></div>
<div><span>
<p>Picture a flash,then disappear.</p>
<p>system prompt:&lt;This mapper is unsurpported on this paltform&gt;</p>
<p>my graphics card as:ATI Radeon HD 4350</p>
<p>Need I change my  graphics card ?</p>
<p>thanks.</p>
<p><span></span> </p></span></div><br><br><span title="neteasefooter"><span></span></span><br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><br>