[vtkusers] vtkImageViewer and vtkLine
Stefano Sclaverano
hellowskyfal at gmail.com
Wed May 14 05:09:43 EDT 2008
Hi all,
Finally I drew the line in this way, but it's not very correct :
. . .
// The line definition
seeds = vtkLineSource::New();
seeds->SetPoint1(0.0,0.0,0.0);
seeds->SetPoint2(0.0,0.1,0.0);
seeds->SetResolution(20);
// The Line Mapper
seedsMapper = vtkPolyDataMapper::New();
seedsMapper->SetInputConnection(seeds->GetOutputPort());
// The line Actor
seedsActor = vtkActor::New();
seedsActor->SetMapper(seedsMapper);
seedsActor->GetProperty()->SetColor(1.0,1.0,1.0);
seedsActor->GetProperty()->SetRepresentationToPoints();
seedsActor->GetProperty()->SetOpacity(0.95);
// The line Render
seedsRen = vtkRenderer::New();
seedsRen->AddActor(seedsActor);
seedsRen->SetViewport(0.499,0.0,0.501,1.0);
// The ImageViewer Render
ren = vtkRenderer::New();
// The general RenderWindow
renWindow = vtkRenderWindow::New();
renWindow->AddRenderer(ren);
renWindow->AddRenderer(seedsRen);
// The Actor2D of ImageViewer
ren->AddActor2D(viewer->GetActor2D());
// Render the entire world
this->GetInteractor()->Render();
. . .
All better ideas are welcome!
Thanks
2008/5/13 Romuald BERTRAND <beromuald at wanadoo.fr>:
> Hi Stefano,
>
> I think you have to draw your line at +0.01 on the image, because the line
> is draw under your image.
>
> Bye
>
>
>
>
> > Message du 13/05/08 15:53
> > De : "Stefano Sclaverano"
> > A : vtkusers at vtk.org
> > Copie à :
> > Objet : [vtkusers] vtkImageViewer and vtkLine
>
> >
> >
>
> Hi all,
>
>
>
> I think it could be a stupid question but I would know if it's possible
> and if someone has just done it...
>
> I'm tring to render an image Analyze 7.5 with vtkImageViewer and I want to
> put over this image a line to indicate me where I am with
>
> my cursor in the differents views (CORONAL, AXIAL, SAGITTAL).
>
> Not Problem with the visualisation but I cant arrive to render the line
> over the images...
>
>
>
> Someone knows how I can do it?
>
>
>
> Thanks.
>
> Stefano
>
> >
> > [ (pas de nom de fichier) (0.3 Ko) ]
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20080514/b736080e/attachment.htm>
More information about the vtkusers
mailing list