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"><<a href="mailto:landscapemoon@126.com">landscapemoon@126.com</a>></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 "itkBinaryThresholdImageFilter.h"<br>#include "itkCannySegmentationLevelSetImageFilter.h"<br>#include "itkCastImageFilter.h"<br>#include "itkConfidenceConnectedImageFilter.h"<br>
#include "itkCurvatureAnisotropicDiffusionImageFilter.h"<br>#include "itkFastMarchingImageFilter.h"<br>#include "itkGDCMImageIO.h"<br>#include "itkGDCMSeriesFileNames.h"<br>#include "itkGradientMagnitudeRecursiveGaussianImageFilter.h"<br>
#include "itkImageFileWriter.h"<br>#include "itkImageSeriesReader.h"<br>#include "itkImageToVTKImageFilter.h"<br>#include "itkImportImageFilter.h"<br>#include "itkIntensityWindowingImageFilter.h"<br>
#include "itkOrientedImage.h"<br>#include "itkRescaleIntensityImageFilter.h"<br>#include "itkSigmoidImageFilter.h"</div>
<div>// VTK include<br>#include "vtkActor.h"<br>#include "vtkBoxWidget.h"<br>#include "vtkCamera.h"<br>#include "vtkCommand.h"<br>#include "vtkColorTransferFunction.h"<br>
#include "vtkContourFilter.h"<br>#include "vtkDataSetMapper.h"<br>#include "vtkDICOMImageReader.h"<br>#include "vtkGeometryFilter.h"<br>#include "vtkGPUVolumeRayCastMapper.h"<br>
#include "vtkImageData.h"<br>#include "vtkImageResample.h"<br>#include "vtkImageViewer.h"<br>#include "vtkMetaImageReader.h"<br>#include "vtkPiecewiseFunction.h"<br>#include "vtkPlanes.h"<br>
#include "vtkPolyData.h"<br>#include "vtkPolyDataMapper.h"<br>#include "vtkProperty.h"<br>#include "vtkRenderer.h"<br>#include "vtkRenderWindow.h"<br>#include "vtkRenderWindowInteractor.h"<br>
#include "vtkVolume.h"<br>#include "vtkVolumeProperty.h"<br>#include "vtkXMLImageDataReader.h"</div>
<div>//#include "vvITKFilterModuleBase.h"<br>//#include "vtkVVPluginAPI.h"<br>//#include "vvITKCannySegmentationLevelSetModule.cxx"</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<vtkBoxWidget*>(caller);<br> if (this->Mapper)<br> {<br> vtkPlanes *planes = vtkPlanes::New();<br> widget->GetPlanes(planes);<br> this->Mapper->SetClippingPlanes(planes);<br>
planes->Delete();<br> }<br> }<br> <br> void SetMapper(vtkGPUVolumeRayCastMapper* m) <br> { <br> this->Mapper = m; <br> }</div>
<div>protected:<br> vtkBoxWidgetCallback() <br> { <br> this->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< PixelType, Dimension > ImageType;<br>
typedef itk::ImageSeriesReader< ImageType > ReaderType;<br> typedef itk::ImageToVTKImageFilter< ImageType > 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->SetImageIO( dicomIO );</div>
<div> typedef itk::GDCMSeriesFileNames NamesGeneratorType;<br> NamesGeneratorType::Pointer nameGenerator = NamesGeneratorType::New();</div>
<div> nameGenerator->SetUseSeriesDetails( true );<br> nameGenerator->AddSeriesRestriction( "0008|0021" );</div>
<div> nameGenerator->SetDirectory( "dicom4" );<br> <br>/* <br> //typedef unsigned char MaskPixelType;<br> typedef signed short MaskPixelType;<br> typedef itk::OrientedImage< MaskPixelType, Dimension > MaskImageType;<br>
typedef itk::ConfidenceConnectedImageFilter< ImageType, MaskImageType > SegmentationFilterType;<br> SegmentationFilterType::Pointer filter = SegmentationFilterType::New(); <br>*/ <br> try<br> {<br> std::cout << std::endl << "The directory: " << std::endl;<br>
std::cout << std::endl << "dicom4" << std::endl << std::endl;<br> std::cout << "Contains the following DICOM Series: ";<br> std::cout << std::endl << std::endl;</div>
<div> typedef std::vector< std::string > SeriesIdContainer; <br> const SeriesIdContainer & seriesUID = nameGenerator->GetSeriesUIDs(); <br> SeriesIdContainer::const_iterator seriesItr = seriesUID.begin();<br>
SeriesIdContainer::const_iterator seriesEnd = seriesUID.end();<br> <br> while( seriesItr != seriesEnd )<br> {<br> std::cout << seriesItr->c_str() << std::endl;<br> seriesItr++;<br> }</div>
<div> std::string seriesIdentifier;<br> seriesIdentifier = seriesUID.begin()->c_str();</div>
<div> std::cout << std::endl << std::endl;<br> std::cout << "Now reading series: " << std::endl << std::endl;<br> std::cout << seriesIdentifier << std::endl;<br> std::cout << std::endl << std::endl;</div>
<div> typedef std::vector< std::string > FileNamesContainer;<br> FileNamesContainer fileNames;<br> fileNames = nameGenerator->GetFileNames( seriesIdentifier ); <br> reader->SetFileNames( fileNames );</div>
<div> try<br> {<br> reader->Update();<br> }<br> catch (itk::ExceptionObject &ex)<br> {<br> std::cout << ex << std::endl;<br> return EXIT_FAILURE;<br> }<br> <br>////////////////////////////////////////////////////////////</div>
<div>/* filter->SetInput( reader->GetOutput() );<br> filter->SetNumberOfIterations(0);<br> filter->SetReplaceValue(255);<br> filter->SetMultiplier(2.5);<br> ImageType::IndexType seed;<br> seed[0]=50;<br>
seed[1]=50;<br> seed[2]=50;<br> filter->SetSeed(seed); */<br> //filter->Update();<br> <br> // Fast Marching started...<br> typedef float RealPixelType;<br> typedef itk::OrientedImage< RealPixelType,3 > RealImageType;<br>
typedef unsigned char OutputPixelType;<br> typedef itk::OrientedImage< OutputPixelType, 3 > OutputImageType;</div>
<div> typedef itk::BinaryThresholdImageFilter< RealImageType, RealImageType> ThresholdingFilterType;<br> ThresholdingFilterType::Pointer thresholder = ThresholdingFilterType::New();</div>
<div> const PixelType timeThreshold = 130;<br> <br> // Threshold setting<br> thresholder->SetLowerThreshold( 0.0 );<br> thresholder->SetUpperThreshold( timeThreshold );</div>
<div> // Value setting<br> thresholder->SetOutsideValue( 0 );<br> thresholder->SetInsideValue( 255 );</div>
<div> typedef itk::ImageFileReader< ImageType > ReaderType;<br> typedef itk::ImageFileWriter< OutputImageType > WriterType;<br> typedef itk::RescaleIntensityImageFilter< <br> ImageType, <br>
OutputImageType > CastFilterType;<br> typedef itk::CurvatureAnisotropicDiffusionImageFilter< <br> RealImageType, <br> RealImageType > SmoothingFilterType; <br> SmoothingFilterType::Pointer smoothing = SmoothingFilterType::New();</div>
<div> typedef itk::GradientMagnitudeRecursiveGaussianImageFilter< <br> RealImageType, <br> RealImageType > GradientFilterType;<br> typedef itk::SigmoidImageFilter< RealImageType, <br> RealImageType > SigmoidFilterType;</div>
<div> GradientFilterType::Pointer gradientMagnitude = GradientFilterType::New();<br> SigmoidFilterType::Pointer sigmoid = SigmoidFilterType::New();</div>
<div> sigmoid->SetOutputMinimum( 0 );<br> sigmoid->SetOutputMaximum( 1 );</div>
<div> typedef itk::FastMarchingImageFilter< RealImageType, <br> RealImageType > FastMarchingFilterType;<br> FastMarchingFilterType::Pointer fastMarching = FastMarchingFilterType::New();</div>
<div> typedef itk::CastImageFilter< ImageType,RealImageType> 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->SetInput(reader->GetOutput() );<br> smoothing->SetInput( image_to_real_Filter->GetOutput());<br> //real_to_image_Filter->SetInput(smoothing->GetOutput());<br> gradientMagnitude->SetInput( smoothing->GetOutput() );<br>
sigmoid->SetInput( gradientMagnitude->GetOutput() );<br> fastMarching->SetInput( sigmoid->GetOutput() );<br> //fastMarching->SetInput( gradientMagnitude->GetOutput() );<br> thresholder->SetInput( fastMarching->GetOutput() );</div>
<div> smoothing->SetTimeStep( 0.0625 );<br> smoothing->SetNumberOfIterations( 3 );<br> smoothing->SetConductanceParameter( 3 );</div>
<div> const double sigma = 3;</div>
<div> gradientMagnitude->SetSigma( sigma );</div>
<div> sigmoid->SetAlpha( 20 );<br> sigmoid->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->Initialize();<br> seeds->InsertElement( 0, node );</div>
<div> fastMarching->SetTrialPoints( seeds );<br> fastMarching->SetOutputSize( reader->GetOutput()->GetBufferedRegion().GetSize() );<br> reader->Update();<br> fastMarching->SetStoppingValue( 100 );<br>
</div>
<div> typedef itk::CastImageFilter< RealImageType,ImageType> Real_to_Image_Type;<br> Real_to_Image_Type::Pointer real_to_image_Filter = Real_to_Image_Type::New();<br> real_to_image_Filter->SetInput(fastMarching->GetOutput());<br>
//connector->SetInput(real_to_image_Filter->GetOutput());<br> //connector->SetInput(thresholder->GetOutput());<br> connector->SetInput(reader->GetOutput());<br> connector->Update();<br> // Fast Marching Ends.</div>
<div> <br>/*<br> image_to_real_Filter->SetInput( reader->GetOutput() );</div>
<div> typedef itk::FastMarchingImageFilter< RealImageType,RealImageType > FastMarchingFilterType;<br> FastMarchingFilterType::Pointer m_FastMarchingImageFilter = FastMarchingFilterType::New();<br> m_FastMarchingImageFilter->SetSpeedConstant( 1.0 );<br>
m_FastMarchingImageFilter->SetInput(image_to_real_Filter->GetOutput());<br> typedef itk::CannySegmentationLevelSetImageFilter<itk::Image< RealPixelType, 3 >,itk::Image< RealPixelType, 3 >> CannySegmentationLevelSetFilterType;<br>
CannySegmentationLevelSetFilterType::Pointer m_CannySegmentationLevelSetFilter = CannySegmentationLevelSetFilterType::New();</div>
<div> m_CannySegmentationLevelSetFilter->SetInput( m_FastMarchingImageFilter->GetOutput() );<br> <br> m_CannySegmentationLevelSetFilter->SetFeatureImage( image_to_real_Filter ->GetOutput() );<br> real_to_image_Filter->SetInput(m_CannySegmentationLevelSetFilter->GetOutput());<br>
connector->SetInput(real_to_image_Filter->GetOutput());<br>*/ <br> }<br> catch (itk::ExceptionObject &ex)<br> {<br> std::cout << ex << 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->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->SetRenderWindow(renWin);<br> iren->SetDesiredUpdateRate(frameRate / (1+clip)); </div>
<div> iren->GetInteractorStyle()->SetDefaultRenderer(renderer);</div>
<div> // Read the data<br> //typedef itk::VTKImageExport< MaskImageType > ExportFilter2Type;<br> //ExportFilter2Type::Pointer itkExporter2 = ExportFilter2Type::New();<br> //itkExporter2->SetInput( filter->GetOutput() );<br>
vtkDataSetMapper* geom = vtkDataSetMapper::New();<br> geom->SetInput(connector->GetOutput());<br> geom->Update();<br> vtkContourFilter * contour = vtkContourFilter::New();<br> contour->SetInput( connector->GetOutput() );<br>
contour->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->SetMapper( polyMapper );<br> <br> //polyMapper->SetInput( contour->GetOutput() );<br> //polyMapper->SetInput( geom->GetOutput() );<br> //polyMapper->ScalarVisibilityOff();<br>
<br> // Set the scene<br> polyActor->SetMapper( geom );<br> vtkProperty * vtkproperty = vtkProperty::New();<br> vtkproperty->SetAmbient(0.5);<br> vtkproperty->SetDiffuse(0.1);<br> vtkproperty->SetSpecular(0.5);<br>
vtkproperty->SetColor(0.5,0.4,0.0);<br> vtkproperty->SetLineWidth(2.0);<br> vtkproperty->SetRepresentationToWireframe();<br> vtkproperty->SetOpacity(0.1);</div>
<div> polyActor->SetProperty( vtkproperty );<br> <br> //renderer->AddActor( polyActor );</div>
<div> vtkImageData *input = 0;<br> input = connector->GetOutput();</div>
<div> vtkImageResample *resample = vtkImageResample::New();<br> if ( reductionFactor < 1.0 )<br> {<br> resample->SetInput(input);<br> resample->SetAxisMagnificationFactor(0, reductionFactor);<br> resample->SetAxisMagnificationFactor(1, reductionFactor);<br>
resample->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->SetInteractor(iren);<br> box->SetPlaceFactor(1.01);<br> if ( reductionFactor < 1.0 )<br> { <br> box->SetInput(resample->GetOutput());<br> }<br> else<br> {<br> box->SetInput(input);<br>
}<br> <br> box->SetDefaultRenderer(renderer);<br> box->InsideOutOn();<br> box->PlaceWidget();<br> vtkBoxWidgetCallback *callback = vtkBoxWidgetCallback::New();<br> callback->SetMapper(mapper);<br> &nbsp
;box->AddObserver(vtkCommand::InteractionEvent, callback);<br> callback->Delete();<br> box->EnabledOn();<br> box->GetSelectedFaceProperty()->SetOpacity(0.0);<br> }</div>
<div> if ( reductionFactor < 1.0 )<br> {<br> mapper->SetInputConnection( resample->GetOutputPort() );<br> }<br> else<br> {<br> mapper->SetInput(input);<br> //mapper->SetInputConnection( read->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 < 1.0 )<br> {<br> resample->GetOutput()->GetSpacing(spacing);<br> }<br>
else<br> {<br> input->GetSpacing(spacing);<br> }<br> <br>// mapper->SetSampleDistance( (spacing[0]+spacing[1]+spacing[2])/6.0 );<br>// mapper->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->SetIndependentComponents(independentComponents);<br> property->SetColor( colorFun );<br> property->SetScalarOpacity( opacityFun );<br> property->SetInterpolationTypeToLinear();</div>
<div> // connect up the volume to the property and the mapper<br> volume->SetProperty( property );<br> volume->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->AddRGBSegment(0.0, 1.0, 1.0, 1.0, 255.0, 1.0, 1.0, 1.0 );<br> opacityFun->AddSegment( opacityLevel - 0.5*opacityWindow, 0.0, <br> opacityLevel + 0.5*opacityWindow, 1.0 );<br>
mapper->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->AddRGBSegment( opacityLevel - 0.5*opacityWindow, 0.0, 0.0, 0.0, <br> opacityLevel + 0.5*opacityWindow, 1.0, 1.0, 1.0 );<br>
opacityFun->AddSegment( opacityLevel - 0.5*opacityWindow, 0.0, <br> opacityLevel + 0.5*opacityWindow, 1.0 );<br> mapper->SetBlendModeToComposite();<br> property->ShadeOff();<br>
break;<br> <br> // CompositeShadeRamp<br>&nbs
p; // Create a ramp from the window and level values. Use compositing<br> // with shading. Color is white.<br> case 2:<br> colorFun->AddRGBSegment( 0.0, 1.0, 1.0, 1.0, 255.0, 1.0, 1.0, 1.0 );<br> opacityFun->AddSegment( opacityLevel - 0.5*opacityWindow, 0.0, <br>
opacityLevel + 0.5*opacityWindow, 1.0 );<br> mapper->SetBlendModeToComposite();<br> property->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->AddRGBPoint( -3024, 0, 0, 0, 0.5, 0.0 );<br> colorFun->AddRGBPoint( -1000, .62, .36, .18, 0.5, 0.0 );<br>
colorFun->AddRGBPoint( -500, .88, .60, .29, 0.33, 0.45 );<br> colorFun->AddRGBPoint( 3071, .83, .66, 1, 0.5, 0.0 );<br> <br> opacityFun->AddPoint(-3024, 0, 0.5, 0.0 );<br> opacityFun->AddPoint(-1000, 0, 0.5, 0.0 );<br>
opacityFun->AddPoint(-500, 1.0, 0.33, 0.45 );<br> opacityFun->AddPoint(3071, 1.0, 0.5, 0.0);</div>
<div> mapper->SetBlendModeToComposite();<br> property->ShadeOn();<br> property->SetAmbient(0.1);<br> property->SetDiffuse(0.9);<br> property->SetSpecular(0.2);<br> property->SetSpecularPower(10.0);<br>
property->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->AddRGBPoint( -3024, 0, 0, 0, 0.5, 0.0 );<br>
colorFun->AddRGBPoint( -16, 0.73, 0.25, 0.30, 0.49, .61 );<br> colorFun->AddRGBPoint( 641, .90, .82, .56, .5, 0.0 );<br> colorFun->AddRGBPoint( 3071, 1, 1, 1, .5, 0.0 );<br> <br> opacityFun->AddPoint( -3024, 0, 0.5, 0.0 );<br>
opacityFun->AddPoint( -16, 0, .49, .61 );<br> opacityFun->AddPoint( 641, .72, .5, 0.0 );<br> opacityFun->AddPoint( 3071, .71, 0.5, 0.0 );</div>
<div> mapper->SetBlendModeToComposite();<br> property->ShadeOn();<br> property->SetAmbient(0.1);<br> property->SetDiffuse(0.9);<br> property->SetSpecular(0.2);<br> property->SetSpecularPower(10.0);<br>
property->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->AddRGBPoint(-3024, 0, 0, 0, 0.5, 0.0);<br> colorFun->AddRGBPoint(-155, .55, .25, .15, 0.5, .92);<br> colorFun->AddRGBPoint(217, .88, .60, .29, 0.33, 0.45);<br> colorFun->AddRGBPoint(420, 1, .94, .95, 0.5, 0.0);<br>
colorFun->AddRGBPoint(3071, .83, .66, 1, 0.5, 0.0);<br> &nb
sp; <br> opacityFun->AddPoint(-3024, 0, 0.5, 0.0);<br> opacityFun->AddPoint(-155, 0, 0.5, 0.92);<br> opacityFun->AddPoint(217, .68, 0.33, 0.45);<br> opacityFun->AddPoint(420,.83, 0.5, 0.0);<br> opacityFun->AddPoint(3071, .80, 0.5, 0.0);</div>
<div> mapper->SetBlendModeToComposite();<br> property->ShadeOn();<br> property->SetAmbient(0.1);<br> property->SetDiffuse(0.9);<br> property->SetSpecular(0.2);<br> property->SetSpecularPower(10.0);<br>
property->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->AddPoint(0, 0.0);<br> opacityFun->AddPoint(5.0, 0.0);<br> opacityFun->AddPoint(30.0, 0.05);<br> opacityFun->AddPoint(31.0, 0.0);<br> opacityFun->AddPoint(90.0, 0.0);<br> opacityFun->AddPoint(100.0, 0.3);<br>
opacityFun->AddPoint(110
.0, 0.0);<br> opacityFun->AddPoint(190.0, 0.0);<br> opacityFun->AddPoint(200.0, 0.4);<br> opacityFun->AddPoint(210.0, 0.0);<br> opacityFun->AddPoint(245.0, 0.0);<br> opacityFun->AddPoint(255.0, 0.5);</div>
<div> mapper->SetBlendModeToComposite();<br> property->ShadeOff();<br> property->SetScalarOpacityUnitDistance(1.0);<br> break;<br> default:<br> vtkGenericWarningMacro("Unknown blend type.");<br>
break;<br> }<br> <br> // Set the default window size<br> renWin->SetSize(600,600);<br> renWin->Render();</div>
<div> if ( !mapper->IsRenderSupported(renWin, property) )<br> {<br> cout << "This mapper is unsupported on this platform" << endl;<br> exit(EXIT_FAILURE);<br> }<br> </div>
<div> // Add the volume to the scene<br> renderer->AddVolume( volume );</div>
<div> renderer->ResetCamera();<br> // interact with data<br> renWin->Render();</div>
<div> iren->Start();</div>
<div> opacityFun->Delete();<br> colorFun->Delete();<br> property->Delete();<br> <br> box->Delete();<br> volume->Delete();<br> mapper->Delete();<br> //reader->Delete();<br> resample->Delete();<br>
renderer->Delete();<br> renWin->Delete();<br> iren->Delete();<br> contour->Delete();<br> geom->Delete();<br> polyMapper->Delete();<br> polyActor->Delete();<br> vtkproperty->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:<This mapper is unsurpported on this paltform></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>