[vtkusers] vtkX3DExporter

Sebastien Jourdain sebastien.jourdain at kitware.com
Mon Dec 9 09:31:21 EST 2013


I think the X3d exporter only export surface mesh and not volume rendered
data.



On Mon, Dec 9, 2013 at 1:34 AM, Emptystack <wulihouxiaoshuai at 163.com> wrote:

> Hello,everyone! I want to export the MIP volume rendering to a X3D file,but
> something unexpected happened.The bug is "vtkX3DExporter (05C64BA0): no
> actors found for writing X3D file." But from the
> following code,we can see that I attach the volume to the render. I don't
> know where I am wrong,
> could anyone give me some help?
>
> Many thanks!
>
>
>
> int main( int argc, char *argv[] )
> {
>         vtkRenderer *renderer = vtkRenderer::New();
>
>
>         vtkRenderWindow *renWin = vtkRenderWindow::New();
>         renWin->AddRenderer(renderer);
>
>         vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();
>         iren->SetRenderWindow(renWin);
>
>         vtkDICOMImageReader*reader=vtkDICOMImageReader::New();
>         reader->SetDirectoryName("D:/image/CT");
>         reader->Update();
>
>         vtkColorTransferFunction*
> colorTransforFunction=vtkColorTransferFunction::New();
>         colorTransforFunction->AddRGBSegment(0,1,1,1,255,1,1,1);
>
>         vtkPiecewiseFunction* opacityFun=vtkPiecewiseFunction::New();
>         opacityFun->AddSegment(-3024,0,1694,1);
>
>         vtkVolumeProperty* volumeProperty=vtkVolumeProperty::New();
>         volumeProperty->SetColor(colorTransforFunction);
>         volumeProperty->SetScalarOpacity(opacityFun);
>         volumeProperty->SetInterpolationTypeToLinear();
>
>         vtkGPUVolumeRayCastMapper* mapper=vtkGPUVolumeRayCastMapper::New();
>         mapper->SetInput(reader->GetOutput());
>         mapper->SetBlendModeToMaximumIntensity();
>         mapper->Update();
>
>         vtkVolume* volume=vtkVolume::New();
>         volume->SetMapper(mapper);
>         volume->SetProperty(volumeProperty);
>
>      renderer->AddVolume(volume);
>
>
>
>   renWin->Render();
>
>
>   vtkX3DExporter *exporter = vtkX3DExporter::New();
>   exporter->SetInput(renWin);
>   exporter->SetFileName("testX3DExporter.x3d");
>   exporter->Update();
>   exporter->Write();
>
>   iren->Start();
> }
>
>
>
> --
> View this message in context:
> http://vtk.1045678.n5.nabble.com/vtkX3DExporter-tp5724920.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20131209/86aeba2f/attachment.htm>


More information about the vtkusers mailing list