2D image display

luis.uriarte at philips.com luis.uriarte at philips.com
Wed May 17 09:42:17 EDT 2000


Hi Gavin,

I think you should first try playing with the color window and level. I´m using vtkImageWin32Viewer (VTK 2.0) with no problem. I´m using a different kind of input (vtkImageReader) but I don´t think that makes the difference. If you put a window and level 
too high you will get a black screen.
Bye,

Luis.




G.R.Tabor at exeter.ac.uk@SMTP at public.kitware.com on 17/05/2000 08:16:58 AM
Sent by:	owner-vtkusers at public.kitware.com
To:	vtkusers at public.kitware.com@SMTP
cc:	 
Subject:	2D image display
Classification:	Restricted
Hello.

I'm having real problems with displaying 2D images. The following
code I think should display a rectangle and a triangle. All it
does is display a black screen. What am I missing?

    vtkImageCanvasSource2D *F = vtkImageCanvasSource2D::New();
    F->SetScalarType(VTK_FLOAT);
    F->SetExtent(0,255,0,255,0,0);
    F->SetDrawColor(0.0);
    F->FillBox(0,255,0,255);
    F->SetDrawColor(2.0);
    F->FillTriangle(10,100,190,150,40,250);

    vtkImageViewer *viewer = vtkImageViewer::New();
    viewer->SetInput(F);
    viewer->SetColorWindow(2000);
    viewer->SetColorLevel(1000);

    viewer->Render();

Thanks for any assistance rendered.

Gavin

--

Dr. Gavin Tabor
School of Engineering and Computer Science
Department of Engineering
University of Exeter
--------------------------------------------------------------------
This is the private VTK discussion list. Please keep messages on-topic.
Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
<majordomo at public.kitware.com>. For help, send message body containing
"info vtkusers" to the same address.
--------------------------------------------------------------------


--------------------------------------------------------------------
This is the private VTK discussion list. Please keep messages on-topic.
Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
<majordomo at public.kitware.com>. For help, send message body containing
"info vtkusers" to the same address.
--------------------------------------------------------------------



More information about the vtkusers mailing list