[vtkusers] AW: vtkusers digest, Vol 1 #2156 - 7 msgs

Bernhard Pfeifer bernhard.pfeifer at umit.at
Wed Oct 22 06:32:43 EDT 2003


Komm erst jetzt dazu . spiel ich heute noch ein

Lg bernhard

-----------------------------------------------------------------
Dipl.-Ing. Bernhard Pfeifer
Private Universität für Medizinische Informatik und Technik Tirol
Institut für Medizinische Signalverarbeitung und Bildgebung
Innrain 98
A-6020 Innsbruck
Österreich
Tel: +43-512-586734-817 (Sekretariat) 
EMail: bernhard.pfeifer at umit.at
-----------------------------------------------------------------


-----Ursprüngliche Nachricht-----
Von: vtkusers-admin at vtk.org [mailto:vtkusers-admin at vtk.org] Im Auftrag
von vtkusers-request at vtk.org
Gesendet: Mittwoch, 22. Oktober 2003 09:55
An: vtkusers at vtk.org
Betreff: vtkusers digest, Vol 1 #2156 - 7 msgs

Send vtkusers mailing list submissions to
	vtkusers at vtk.org

To subscribe or unsubscribe via the World Wide Web, visit
	http://www.vtk.org/mailman/listinfo/vtkusers
or, via email, send a message with subject or body 'help' to
	vtkusers-request at vtk.org

You can reach the person managing the list at
	vtkusers-admin at vtk.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of vtkusers digest..."


Today's Topics:

   1. lookup table with imageviewer and floatarray (alan .)
   2. lookup table with imageviewer and floatarray (2) (alan .)
   3. RE: lookup table with imageviewer and floatarray (2) (Xianjin
Yang)
   4. Re: vtkusers digest, Vol 1 #2153 - 1 msg (Paul Tait)
   5. RE: lookup table with imageviewer and floatarray (2) (alan .)
   6. Solution: Bug in SetRenderWindow(NULL) (de Boer Ingo)
   7. HELP vtkPointPicker question (xiaofeng qi)

--__--__--

Message: 1
From: "alan ." <lost_bits1110 at hotmail.com>
To: vtkusers at vtk.org
Date: Tue, 21 Oct 2003 21:54:44 +0000
Subject: [vtkusers] lookup table with imageviewer and floatarray

<html><div style='background-color:'><DIV>Hi, </DIV>
<DIV>&nbsp;</DIV>
<DIV>Trying once again - but does anyone know if its possible
to&nbsp;use a&nbsp;lookup table with vtkFloatArray, vtkImageData, and
vtkImageViewer..?</DIV>
<DIV>&nbsp;</DIV>
<DIV>basically the vtkFloatArray sets up the lookup table, and the float
array goes into the image data, and the image data is displayed by the
image viewer..</DIV>
<DIV>&nbsp;</DIV>
<DIV>for some reason i implemented it and i dont see any colors</DIV>
<DIV>&nbsp;</DIV>
<DIV>thanks</DIV>
<DIV>&nbsp;</DIV>
<DIV>alan</DIV></div><br clear=all><hr> <a
href="http://g.msn.com/8HMAENUS/2743??PS=">Enjoy MSN 8 patented spam
control and more with MSN 8 Dial-up Internet Service.  Try it FREE for
one month!  </a> </html>

--__--__--

Message: 2
From: "alan ." <lost_bits1110 at hotmail.com>
To: vtkusers at vtk.org
Date: Tue, 21 Oct 2003 21:59:12 +0000
Subject: [vtkusers] lookup table with imageviewer and floatarray (2)

<html><div style='background-color:'><DIV>Or if theres another way to
execute the pipeline..</DIV>
<DIV>&nbsp;</DIV>
<DIV>At the moment&nbsp;I use vtkFloatArray -&gt; &nbsp;vtkImageData
-&gt;&nbsp;vtkImageViewer..</DIV>
<DIV>(and FloatArray sets up the lookup table)</DIV>
<DIV>&nbsp;</DIV>
<DIV>but maybe the vtkImageViewer is the problem, so i can create a
vtkDataSetMapper, which takes in the vtkImageData</DIV>
<DIV>but then how do I render this..? I dont have any actors - just a
bunch of points (which came from a file of numbers)</DIV>
<DIV>&nbsp;</DIV>
<DIV>okay thank u again vtkusers</DIV>
<DIV>&nbsp;</DIV>
<DIV>one day i'll be the expert..!</DIV>
<DIV>&nbsp;</DIV>
<DIV>-alan.</DIV></div><br clear=all><hr> <a
href="http://g.msn.com/8HMAENUS/2728??PS=">Never get a busy signal
because you are always connected  with high-speed Internet access. Click
here to comparison-shop providers.</a> </html>

--__--__--

Message: 3
From: Xianjin Yang <Yang at AGIUSA.COM>
To: vtkusers at vtk.org
Cc: "'alan .'" <lost_bits1110 at hotmail.com>
Subject: RE: [vtkusers] lookup table with imageviewer and floatarray (2)
Date: Tue, 21 Oct 2003 17:21:49 -0500

This message is in MIME format. Since your mail reader does not
understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C39821.B8D62310
Content-Type: text/plain

Hi Alan,
 
To become an expert vtkuser, Check out this post
http://public.kitware.com/pipermail/vtkusers/2003-September/020191.html
<http://public.kitware.com/pipermail/vtkusers/2003-September/020191.html
> 
 
As a beginning vtkuser, I rendered colored points with this kind of
pipeline.
 
.....

  vtkPoints * pts = vtkPoints::New();
  vtkCellArray * ca = vtkCellArray::New();
  vtkPolyData * pd = vtkPolyData::New();
  vtkFloatArray * scalars = vtkFloatArray ::New();
vtkPolyDataMapper * m = vtkPolyDataMapper::New();
 vtkLookupTable *lut = vtkLookupTable::New();
vtkRenderer* ren = vtkRenderer::New();
  vtkActor  * a = vtkActor::New();

    lut->SetNumberOfColors(N);
    lut->Build();
    for (i=0; i<N; ++i)  lut->SetTableValue(i, R[i], G[i], B[i], A[i]);


  for (i=0;i<n;i++)
  {
      pts->InsertNextPoint(x[i], y[i], z[i]);
      ca->InsertNextCell(1);
      ca->InsertCellPoint(i);
      scalars->InsertNextTuple1(f[i]);
  }
  pd->SetPoints(pts);
  pd->SetVerts(ca);
  pd->GetPointData()->SetScalars(scalars);

   m->SetLookupTable(lut);
  m->SetInput(pd);
  m->SetScalarRange(ScalarMin, ScalarMax);

    a->SetMapper(m);
  a->GetProperty()->SetPointSize(8);
  ren->AddActor(a);
...

HTH
 
Yang
 
 
 
-----Original Message-----
From: alan . [mailto:lost_bits1110 at hotmail.com] 
Sent: Tuesday, October 21, 2003 4:59 PM
To: vtkusers at vtk.org
Subject: [vtkusers] lookup table with imageviewer and floatarray (2)


Or if theres another way to execute the pipeline..
 
At the moment I use vtkFloatArray ->  vtkImageData -> vtkImageViewer..
(and FloatArray sets up the lookup table)
 
but maybe the vtkImageViewer is the problem, so i can create a
vtkDataSetMapper,
which takes in the vtkImageData
but then how do I render this..? I dont have any actors - just a bunch
of points
(which came from a file of numbers)
 
okay thank u again vtkusers
 
one day i'll be the expert..!
 
-alan.

  _____  

Never get a busy signal because  <http://g.msn.com/8HMAENUS/2728??PS=>
you are
always connected with high-speed Internet access. Click here to
comparison-shop
providers. _______________________________________________ This is the
private
VTK discussion list. Please keep messages on-topic. Check the FAQ at:
Follow
this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers

------_=_NextPart_001_01C39821.B8D62310
Content-Type: text/html
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">
<TITLE>Message</TITLE>

<META content=3D"MSHTML 6.00.2800.1264" name=3DGENERATOR></HEAD>
<BODY>
<DIV><SPAN class=3D355490422-21102003><FONT face=3DArial =
color=3D#008000>Hi=20
Alan,</FONT></SPAN></DIV>
<DIV><SPAN class=3D355490422-21102003><FONT face=3DArial=20
color=3D#008000></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D355490422-21102003><FONT face=3DArial =
color=3D#008000>To become an=20
expert vtkuser, Check out this post</FONT></SPAN></DIV>
<DIV><SPAN class=3D355490422-21102003><FONT face=3DArial =
color=3D#008000><A=20
href=3D"http://public.kitware.com/pipermail/vtkusers/2003-September/0201
=
91.html">http://public.kitware.com/pipermail/vtkusers/2003-September/020
=
191.html</A></FONT></SPAN></DIV>
<DIV><SPAN class=3D355490422-21102003><FONT face=3DArial=20
color=3D#008000></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D355490422-21102003><FONT face=3DArial =
color=3D#008000>As a=20
beginning vtkuser, I rendered colored points with this kind of=20
pipeline.</FONT></SPAN></DIV>
<DIV><SPAN class=3D355490422-21102003><FONT face=3DArial=20
color=3D#008000></FONT></SPAN>&nbsp;</DIV>
<DIV><FONT face=3DArial color=3D#008000><SPAN=20
class=3D355490422-21102003>......</SPAN></FONT></DIV><FONT face=3DArial
=

color=3D#008000></FONT>
<DIV><FONT face=3DArial color=3D#008000></FONT><BR>&nbsp; vtkPoints * =
pts =3D=20
vtkPoints::New();<BR>&nbsp; vtkCellArray * ca =3D =
vtkCellArray::New();<BR>&nbsp;=20
vtkPolyData * pd =3D vtkPolyData::New();<BR>&nbsp; vtk<SPAN=20
class=3D355490422-21102003>Float</SPAN>Array * scalars =3D vtk<SPAN=20
class=3D355490422-21102003>Float</SPAN>Array =
::New();<BR>vtkPolyDataMapper * m =3D=20
vtkPolyDataMapper::New();<BR>&nbsp;vtkLookupTable *lut =3D=20
vtkLookupTable::New();</DIV>
<DIV>vtkRenderer* ren =3D vtkRenderer::New();<BR>&nbsp; vtkActor&nbsp; =
* a =3D=20
vtkActor::New();<BR><BR>&nbsp;&nbsp;&nbsp; =
lut-&gt;SetNumberOfColors(<SPAN=20
class=3D355490422-21102003>N</SPAN>);<BR>&nbsp;&nbsp;&nbsp;=20
lut-&gt;Build();<BR>&nbsp;&nbsp;&nbsp; for (i=3D0; i&lt;<SPAN=20
class=3D355490422-21102003>N</SPAN>; ++i)&nbsp;=20
lut-&gt;SetTableValue(i,&nbsp;<SPAN=20
class=3D355490422-21102003>R</SPAN>[i],&nbsp;<SPAN=20
class=3D355490422-21102003>G</SPAN>[i],&nbsp;<SPAN=20
class=3D355490422-21102003>B</SPAN>[i],&nbsp;<SPAN=20
class=3D355490422-21102003>A[i]</SPAN>);<BR></DIV>
<DIV><FONT face=3DArial color=3D#008000></FONT><BR>&nbsp; for =
(i=3D0;i&lt;<SPAN=20
class=3D355490422-21102003>n</SPAN>;i++)<BR>&nbsp;=20
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pts-&gt;InsertNextPoint(<SPAN=20
class=3D355490422-21102003>x</SPAN>[i],<SPAN =
class=3D355490422-21102003>=20
</SPAN><SPAN class=3D355490422-21102003>y</SPAN>[i],<SPAN=20
class=3D355490422-21102003> </SPAN><SPAN=20
class=3D355490422-21102003>z</SPAN>[i]);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbs
=
p;=20
ca-&gt;InsertNextCell(1);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
ca-&gt;InsertCellPoint(i);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
scalars-&gt;InsertNextTuple1(<SPAN=20
class=3D355490422-21102003>f[i]</SPAN>);<BR>&nbsp; }<BR>&nbsp;=20
pd-&gt;SetPoints(pts);<BR>&nbsp; pd-&gt;SetVerts(ca);<BR>&nbsp;=20
pd-&gt;GetPointData()-&gt;SetScalars(scalars);<BR><BR>&nbsp;&nbsp;=20
m-&gt;SetLookupTable(lut);<BR>&nbsp; m-&gt;SetInput(pd);<BR>&nbsp;=20
m-&gt;SetScalarRange(<SPAN =
class=3D355490422-21102003>ScalarMin</SPAN>,&nbsp;<SPAN=20
class=3D355490422-21102003>ScalarMax</SPAN>);<BR><BR>&nbsp;&nbsp;&nbsp;
=

a-&gt;SetMapper(m);<BR>&nbsp; =
a-&gt;GetProperty()-&gt;SetPointSize(8);<BR>&nbsp;=20
ren-&gt;AddActor(a);</DIV>
<DIV><SPAN class=3D355490422-21102003></SPAN>.<SPAN=20
class=3D355490422-21102003>...</SPAN><BR></DIV>
<DIV><SPAN class=3D355490422-21102003><FONT face=3DArial=20
color=3D#008000>HTH</FONT></SPAN></DIV>
<DIV><SPAN class=3D355490422-21102003><FONT face=3DArial=20
color=3D#008000></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D355490422-21102003><FONT face=3DArial=20
color=3D#008000>Yang</FONT></SPAN></DIV>
<DIV><SPAN class=3D355490422-21102003><FONT face=3DArial=20
color=3D#008000></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D355490422-21102003><FONT face=3DArial=20
color=3D#008000></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D355490422-21102003><FONT face=3DArial=20
color=3D#008000></FONT></SPAN>&nbsp;</DIV>
<DIV></DIV>
<DIV class=3DOutlookMessageHeader lang=3Den-us dir=3Dltr =
align=3Dleft><FONT face=3DTahoma=20
size=3D2>-----Original Message-----<BR><B>From:</B> alan .=20
[mailto:lost_bits1110 at hotmail.com] <BR><B>Sent:</B> Tuesday, October =
21, 2003=20
4:59 PM<BR><B>To:</B> vtkusers at vtk.org<BR><B>Subject:</B> [vtkusers] =
lookup=20
table with imageviewer and floatarray (2)<BR><BR></FONT></DIV>
<DIV>
<DIV>Or if theres another way to execute the pipeline..</DIV>
<DIV>&nbsp;</DIV>
<DIV>At the moment&nbsp;I use vtkFloatArray -&gt; &nbsp;vtkImageData=20
-&gt;&nbsp;vtkImageViewer..</DIV>
<DIV>(and FloatArray sets up the lookup table)</DIV>
<DIV>&nbsp;</DIV>
<DIV>but maybe the vtkImageViewer is the problem, so i can create a=20
vtkDataSetMapper, which takes in the vtkImageData</DIV>
<DIV>but then how do I render this..? I dont have any actors - just a =
bunch of=20
points (which came from a file of numbers)</DIV>
<DIV>&nbsp;</DIV>
<DIV>okay thank u again vtkusers</DIV>
<DIV>&nbsp;</DIV>
<DIV>one day i'll be the expert..!</DIV>
<DIV>&nbsp;</DIV>
<DIV>-alan.</DIV></DIV><BR clear=3Dall>
<HR>
<A href=3D"http://g.msn.com/8HMAENUS/2728??PS=3D">Never get a busy =
signal because=20
you are always connected with high-speed Internet access. Click here to
=

comparison-shop providers.</A> =
_______________________________________________=20
This is the private VTK discussion list. Please keep messages on-topic.
=
Check=20
the FAQ at: <HTTP: vtkfaq cgi-bin public.kitware.com>Follow this link =
to=20
subscribe/unsubscribe:=20
http://www.vtk.org/mailman/listinfo/vtkusers</BODY></HTML>

------_=_NextPart_001_01C39821.B8D62310--

--__--__--

Message: 4
From: "Paul Tait" <paul at opes.com.au>
To: <vtkusers at vtk.org>
Date: Wed, 22 Oct 2003 08:52:44 +0800
Subject: [vtkusers] Re: vtkusers digest, Vol 1 #2153 - 1 msg

> I try to use vtk to generate brain contours from MRI scan image and
try to
make the brain surface transparent. But once I set the surface to
transparent, there is some white matters apears in the scene. And I can
not
make it transparent as well. See the picture in the attachment.
>
> Does anyone know how to eliminate those white materials?
>

Sorry can't resist this one ;-)

Thats what the brain is made from -- white and grey matter. To eliminate
white matter try a lobotomy


--__--__--

Message: 5
From: "alan ." <lost_bits1110 at hotmail.com>
To: vtkusers at vtk.org
Subject: RE: [vtkusers] lookup table with imageviewer and floatarray (2)
Date: Wed, 22 Oct 2003 01:17:22 +0000

<html><div style='background-color:'><DIV>
<P>okay so I just realized that by using vtkFloatArray, vtkImageData and
vtkImageViewer to view my 2D data, it automatically seems to scale the
numbers to gray scale intensity (provided that i set my imageViewer's
SetColorWindow( ) to something non-zero).&nbsp; So for the below
example, what it would do is:</P>
<P>1 1&nbsp;1 </P>
<P>0 0 0</P>
<P>0.2 0.5 0.7 </P>
<P>it will give darkness in the center, brightness at the top, and
gradually go dark to bright on the bottom...</P>
<P>But still, when I try to use the lookuptable to show actual color
(instead of black/white/gray), it doesnt work =( </P>
<P>sigh.......!&nbsp; here is part of the code.......</P>
<P>vtkImageViewer *viewer = vtkImageViewer::New();<BR>vtkImageData
*imageData = vtkImageData::New();<BR>vtkFloatArray *fltarray =
vtkFloatArray::New();<BR>vtkLookupTable *lut=vtkLookupTable::New();</P>
<P>fltarray-&gt;SetNumberOfComponents(80*3);
<BR>fltarray-&gt;SetNumberOfTuples(70);&nbsp; </P>
<P>lut-&gt;SetHueRange(0.0, 1.0);<BR>lut-&gt;SetSaturationRange(0.0,
1.0);<BR>lut-&gt;SetValueRange(1.0,
1.0);<BR>lut-&gt;SetRange(0.0,1.0);<BR>lut-&gt;SetAlphaRange(1.0,
1.0);<BR>lut-&gt;SetNumberOfColors(256);</P>
<P>lut-&gt;Build();</P>
<P>fltarray-&gt;SetLookupTable(lut);</P>
<P>imageData-&gt;GetPointData()-&gt;SetScalars(fltarray);
<BR>imageData-&gt;SetDimensions(80*3,70,1);&nbsp;
<BR>imageData-&gt;SetScalarType(VTK_FLOAT);</P>
<P>viewer-&gt;SetInput(imageData);<BR>viewer-&gt;SetColorWindow(50.0);<B
R>viewer-&gt;SetColorLevel(0.0);<BR>viewer-&gt;SetSize(240,100);</P>
<P>&nbsp;viewer-&gt;Render();<BR><BR>shouldnt i see at least some
color??&nbsp; and i cant SetScalarRange anywhere because ImageViewer
doesnt contain this method... </P>
<P>Or is there another way to represent this 2D data which will wokr
better with the lookuptable..? there must be a way..!</P>
<P>thank u vtkusers for your responses....</P>
<P>=)</P></DIV>
<DIV></DIV>&gt;From: Xianjin Yang <YANG at AGIUSA.COM>
<DIV></DIV>&gt;To: "'alan .'" <LOST_BITS1110 at HOTMAIL.COM>
<DIV></DIV>&gt;Subject: RE: [vtkusers] lookup table with imageviewer and
floatarray (2) 
<DIV></DIV>&gt;Date: Tue, 21 Oct 2003 18:07:59 -0500 
<DIV></DIV>&gt;MIME-Version: 1.0 
<DIV></DIV>&gt;Received: from exchngsvr.agiusa.com ([209.194.230.204])
by mc5-f20.hotmail.com with Microsoft SMTPSVC(5.0.2195.5600); Tue, 21
Oct 2003 16:12:36 -0700 
<DIV></DIV>&gt;Received: by mail.exchngsvr.agiusa.com with Internet Mail
Service (5.5.2653.19)id <VL3B3272>; Tue, 21 Oct 2003 18:08:11 -0500 
<DIV></DIV>&gt;X-Message-Info: JGTYoYF78jF4KkBuPcVLyPfJe4vxU+dS 
<DIV></DIV>&gt;Message-ID:
&lt;6AC51773FA304E469DEE9569AF903E5B16882C at mail.exchngsvr.agiusa.com&gt;

<DIV></DIV>&gt;X-Mailer: Internet Mail Service (5.5.2653.19) 
<DIV></DIV>&gt;Return-Path: Yang at AGIUSA.COM 
<DIV></DIV>&gt;X-OriginalArrivalTime: 21 Oct 2003 23:12:37.0587 (UTC)
FILETIME=[D167F230:01C39828] 
<DIV></DIV>&gt; 
<DIV></DIV>&gt;You did not set the scalar range which is critical for
color mapping using 
<DIV></DIV>&gt;lookup table. Your points may have the background color
of your imageviewer. 
<DIV></DIV>&gt;change the image viewer color from black to white or from
white to black to 
<DIV></DIV>&gt;prove it. 
<DIV></DIV>&gt; 
<DIV></DIV>&gt;Yang 
<DIV></DIV>&gt; 
<DIV></DIV>&gt; 
<DIV></DIV>&gt;-----Original Message----- 
<DIV></DIV>&gt;From: alan . [mailto:lost_bits1110 at hotmail.com] 
<DIV></DIV>&gt;Sent: Tuesday, October 21, 2003 6:05 PM 
<DIV></DIV>&gt;To: Yang at AGIUSA.COM 
<DIV></DIV>&gt;Subject: RE: [vtkusers] lookup table with imageviewer and
floatarray (2) 
<DIV></DIV>&gt; 
<DIV></DIV>&gt; 
<DIV></DIV>&gt; 
<DIV></DIV>&gt;Hi..!! 
<DIV></DIV>&gt; 
<DIV></DIV>&gt;Thanks so much for your response, 
<DIV></DIV>&gt; 
<DIV></DIV>&gt;Your code makes sense, and thank u for the link.. However
in my code, i am using 
<DIV></DIV>&gt;imageViewer - the reason is because I have 2D image data,
(a double subscripted 
<DIV></DIV>&gt;array of floats) and I want to map the value of these
numbers to a gray scale 
<DIV></DIV>&gt;value (i.e. the higher the number the brighter - the
lower the number, the 
<DIV></DIV>&gt;darker) 
<DIV></DIV>&gt; 
<DIV></DIV>&gt;So my code is very very simple, here is part of it below:

<DIV></DIV>&gt; 
<DIV></DIV>&gt;But the lookup table doesnt seem to have any affect... do
u see anything i'm 
<DIV></DIV>&gt;missing? Do u think maybe its not possible with this
pipeline i'm using? How 
<DIV></DIV>&gt;else can i display this array of numbers then so that i
can use a lookup table?? 
<DIV></DIV>&gt; 
<DIV></DIV>&gt;thanks again!!!!!!!! 
<DIV></DIV>&gt; 
<DIV></DIV>&gt;---------------------------------------------------------
---------------------- 
<DIV></DIV>&gt; 
<DIV></DIV>&gt;vtkImageViewer *viewer = vtkImageViewer::New(); 
<DIV></DIV>&gt;vtkImageData *imageData = vtkImageData::New(); 
<DIV></DIV>&gt;vtkFloatArray *fltarray = vtkFloatArray::New(); 
<DIV></DIV>&gt;vtkLookupTable *lut=vtkLookupTable::New(); 
<DIV></DIV>&gt; 
<DIV></DIV>&gt; 
<DIV></DIV>&gt;fltarray-&gt;SetNumberOfComponents(80*3); 
<DIV></DIV>&gt;fltarray-&gt;SetNumberOfTuples(70); 
<DIV></DIV>&gt; 
<DIV></DIV>&gt;lut-&gt;SetHueRange(0.0, 0.0); 
<DIV></DIV>&gt;lut-&gt;SetSaturationRange(0.0, 0.0); 
<DIV></DIV>&gt;lut-&gt;SetValueRange(0.0, 1.0); 
<DIV></DIV>&gt; 
<DIV></DIV>&gt;fltarray-&gt;SetLookupTable(lut); 
<DIV></DIV>&gt; 
<DIV></DIV>&gt;imageData-&gt;GetPointData()-&gt;SetScalars(fltarray); 
<DIV></DIV>&gt;imageData-&gt;SetDimensions(80*3,70,1); 
<DIV></DIV>&gt;imageData-&gt;SetScalarType(VTK_FLOAT); 
<DIV></DIV>&gt; 
<DIV></DIV>&gt;imageData-&gt;SetSpacing(1, 1, 1); 
<DIV></DIV>&gt;imageData-&gt;SetOrigin(0.0, 0.0, 0.0); 
<DIV></DIV>&gt; 
<DIV></DIV>&gt;viewer-&gt;SetInput(imageData); 
<DIV></DIV>&gt; viewer-&gt;Render(); 
<DIV></DIV>&gt; 
<DIV></DIV>&gt; 
<DIV></DIV>&gt; 
<DIV></DIV>&gt; 
<DIV></DIV>&gt; &gt;From: Xianjin Yang 
<DIV></DIV>&gt; &gt;To: vtkusers at vtk.org 
<DIV></DIV>&gt; &gt;CC: "'alan .'" 
<DIV></DIV>&gt; &gt;Subject: RE: [vtkusers] lookup table with
imageviewer and floatarray (2) 
<DIV></DIV>&gt; &gt;Date: Tue, 21 Oct 2003 17:21:49 -0500 
<DIV></DIV>&gt; &gt;MIME-Version: 1.0 
<DIV></DIV>&gt; &gt;Received: from mc3-f36.hotmail.com ([64.4.50.172])
by mc3-s14.hotmail.com with 
<DIV></DIV>&gt;Microsoft SMTPSVC(5.0.2195.6713); Tue, 21 Oct 2003
15:32:32 -0700 
<DIV></DIV>&gt; &gt;Received: from public.kitware.com ([24.97.130.19])
by mc3-f36.hotmail.com with 
<DIV></DIV>&gt;Microsoft SMTPSVC(5.0.2195.6713); Tue, 21 Oct 2003
15:32:09 -0700 
<DIV></DIV>&gt; &gt;Received: from public.kitware.com (localhost
[127.0.0.1])by public.kitware.com 
<DIV></DIV>&gt;(Postfix) with ESMTPid B1F9E1ACA8; Tue, 21 Oct 2003
18:28:05 -0400 (EDT) 
<DIV></DIV>&gt; &gt;Received: from exchngsvr.agiusa.com (unknown
[209.194.230.204])by 
<DIV></DIV>&gt;public.kitware.com (Postfix) with ESMTP id 23AD01AAE9for
; Tue, 21 Oct 2003 
<DIV></DIV>&gt;18:27:02 -0400 (EDT) 
<DIV></DIV>&gt; &gt;Received: by mail.exchngsvr.agiusa.com with Internet
Mail Service 
<DIV></DIV>&gt;(5.5.2653.19)id ; Tue, 21 Oct 2003 17:22:41 -0500 
<DIV></DIV>&gt; &gt;X-Message-Info:
o8IIVuzO8A1vIokZwM2wZaK5XIw4RzjZ2ZKB4CpIVko= 
<DIV></DIV>&gt; &gt;Delivered-To: vtkusers at vtk.org 
<DIV></DIV>&gt; &gt;Message-ID:
&lt;6AC51773FA304E469DEE9569AF903E5B16882B at mail.exchngsvr.agiusa.com&gt;

<DIV></DIV>&gt; &gt;X-Mailer: Internet Mail Service (5.5.2653.19) 
<DIV></DIV>&gt; &gt;Sender: vtkusers-admin at vtk.org 
<DIV></DIV>&gt; &gt;Errors-To: vtkusers-admin at vtk.org 
<DIV></DIV>&gt; &gt;X-BeenThere: vtkusers at vtk.org 
<DIV></DIV>&gt; &gt;X-Mailman-Version: 2.0.11 
<DIV></DIV>&gt; &gt;Precedence: bulk 
<DIV></DIV>&gt; &gt;List-Help: 
<DIV></DIV>&gt; &gt;List-Post: 
<DIV></DIV>&gt; &gt;List-Subscribe: , 
<DIV></DIV>&gt; &gt;List-Id: 
<DIV></DIV>&gt; &gt;List-Unsubscribe: , 
<DIV></DIV>&gt; &gt;List-Archive: 
<DIV></DIV>&gt; &gt;Return-Path: vtkusers-admin at vtk.org 
<DIV></DIV>&gt; &gt;X-OriginalArrivalTime: 21 Oct 2003 22:32:10.0193
(UTC) 
<DIV></DIV>&gt;FILETIME=[2A910410:01C39823] 
<DIV></DIV>&gt; &gt; 
<DIV></DIV>&gt; &gt;Hi Alan, 
<DIV></DIV>&gt; &gt; 
<DIV></DIV>&gt; &gt;To become an expert vtkuser, Check out this post 
<DIV></DIV>&gt;
&gt;http://public.kitware.com/pipermail/vtkusers/2003-September/020191.h
tml 
<DIV></DIV>&gt; &gt; 
<DIV></DIV>&gt; &gt; 
<DIV></DIV>&gt; &gt;As a beginning vtkuser, I rendered colored points
with this kind of pipeline. 
<DIV></DIV>&gt; &gt; 
<DIV></DIV>&gt; &gt;...... 
<DIV></DIV>&gt; &gt; 
<DIV></DIV>&gt; &gt; vtkPoints * pts = vtkPoints::New(); 
<DIV></DIV>&gt; &gt; vtkCellArray * ca = vtkCellArray::New(); 
<DIV></DIV>&gt; &gt; vtkPolyData * pd = vtkPolyData::New(); 
<DIV></DIV>&gt; &gt; vtkFloatArray * scalars = vtkFloatArray ::New(); 
<DIV></DIV>&gt; &gt;vtkPolyDataMapper * m = vtkPolyDataMapper::New(); 
<DIV></DIV>&gt; &gt; vtkLookupTable *lut = vtkLookupTable::New(); 
<DIV></DIV>&gt; &gt;vtkRenderer* ren = vtkRenderer::New(); 
<DIV></DIV>&gt; &gt; vtkActor * a = vtkActor::New(); 
<DIV></DIV>&gt; &gt; 
<DIV></DIV>&gt; &gt; lut-&gt;SetNumberOfColors(N); 
<DIV></DIV>&gt; &gt; lut-&gt;Build(); 
<DIV></DIV>&gt; &gt; for (i=0; iSetTableValue(i, R[i], G[i], B[i],
A[i]); 
<DIV></DIV>&gt; &gt; 
<DIV></DIV>&gt; &gt; 
<DIV></DIV>&gt; &gt; for (i=0;i&gt; { 
<DIV></DIV>&gt; &gt; pts-&gt;InsertNextPoint(x[i], y[i], z[i]); 
<DIV></DIV>&gt; &gt; ca-&gt;InsertNextCell(1); 
<DIV></DIV>&gt; &gt; ca-&gt;InsertCellPoint(i); 
<DIV></DIV>&gt; &gt; scalars-&gt;InsertNextTuple1(f[i]); 
<DIV></DIV>&gt; &gt; } 
<DIV></DIV>&gt; &gt; pd-&gt;SetPoints(pts); 
<DIV></DIV>&gt; &gt; pd-&gt;SetVerts(ca); 
<DIV></DIV>&gt; &gt; pd-&gt;GetPointData()-&gt;SetScalars(scalars); 
<DIV></DIV>&gt; &gt; 
<DIV></DIV>&gt; &gt; m-&gt;SetLookupTable(lut); 
<DIV></DIV>&gt; &gt; m-&gt;SetInput(pd); 
<DIV></DIV>&gt; &gt; m-&gt;SetScalarRange(ScalarMin, ScalarMax); 
<DIV></DIV>&gt; &gt; 
<DIV></DIV>&gt; &gt; a-&gt;SetMapper(m); 
<DIV></DIV>&gt; &gt; a-&gt;GetProperty()-&gt;SetPointSize(8); 
<DIV></DIV>&gt; &gt; ren-&gt;AddActor(a); 
<DIV></DIV>&gt; &gt;.... 
<DIV></DIV>&gt; &gt; 
<DIV></DIV>&gt; &gt;HTH 
<DIV></DIV>&gt; &gt; 
<DIV></DIV>&gt; &gt;Yang 
<DIV></DIV>&gt; &gt; 
<DIV></DIV>&gt; &gt; 
<DIV></DIV>&gt; &gt; 
<DIV></DIV>&gt; &gt;-----Original Message----- 
<DIV></DIV>&gt; &gt;From: alan . [mailto:lost_bits1110 at hotmail.com] 
<DIV></DIV>&gt; &gt;Sent: Tuesday, October 21, 2003 4:59 PM 
<DIV></DIV>&gt; &gt;To: vtkusers at vtk.org 
<DIV></DIV>&gt; &gt;Subject: [vtkusers] lookup table with imageviewer
and floatarray (2) 
<DIV></DIV>&gt; &gt; 
<DIV></DIV>&gt; &gt; 
<DIV></DIV>&gt; &gt;Or if theres another way to execute the pipeline.. 
<DIV></DIV>&gt; &gt; 
<DIV></DIV>&gt; &gt;At the moment I use vtkFloatArray -&gt; vtkImageData
-&gt; vtkImageViewer.. 
<DIV></DIV>&gt; &gt;(and FloatArray sets up the lookup table) 
<DIV></DIV>&gt; &gt; 
<DIV></DIV>&gt; &gt;but maybe the vtkImageViewer is the problem, so i
can create a 
<DIV></DIV>&gt;vtkDataSetMapper, 
<DIV></DIV>&gt; &gt;which takes in the vtkImageData 
<DIV></DIV>&gt; &gt;but then how do I render this..? I dont have any
actors - just a bunch of 
<DIV></DIV>&gt;points 
<DIV></DIV>&gt; &gt;(which came from a file of numbers) 
<DIV></DIV>&gt; &gt; 
<DIV></DIV>&gt; &gt;okay thank u again vtkusers 
<DIV></DIV>&gt; &gt; 
<DIV></DIV>&gt; &gt;one day i'll be the expert..! 
<DIV></DIV>&gt; &gt; 
<DIV></DIV>&gt; &gt;-alan. 
<DIV></DIV>&gt; &gt; 
<DIV></DIV>&gt; &gt; _____ 
<DIV></DIV>&gt; &gt; 
<DIV></DIV>&gt; &gt;Never get a busy signal because you are 
<DIV></DIV>&gt; &gt;always connected with high-speed Internet access.
Click here to comparison-shop 
<DIV></DIV>&gt; 
<DIV></DIV>&gt; &gt;providers.
_______________________________________________ This is the private 
<DIV></DIV>&gt; &gt;VTK discussion list. Please keep messages on-topic.
Check the FAQ at: Follow 
<DIV></DIV>&gt; &gt;this link to subscribe/unsubscribe: 
<DIV></DIV>&gt;http://www.vtk.org/mailman/listinfo/vtkusers 
<DIV></DIV>&gt; 
<DIV></DIV>&gt; _____ 
<DIV></DIV>&gt; 
<DIV></DIV>&gt;Surf and talk on the phone at the <HTTP: 8HMAENUS
g.msn.com 2731??PS="">same 
<DIV></DIV>&gt;time with broadband Internet access. Get high-speed for
as low as $29.95/month.* 
<DIV></DIV>&gt; 
<DIV></DIV>&gt;*Depending on the local service providers in your area. 
<DIV></DIV></div><br clear=all><hr> <a
href="http://g.msn.com/8HMBENUS/2728??PS=">Never get a busy signal
because you are always connected  with high-speed Internet access. Click
here to comparison-shop providers.</a> </html>

--__--__--

Message: 6
Date: Wed, 22 Oct 2003 09:48:12 +0200
From: "de Boer Ingo" <I.deBoer at polytec.de>
To: <vtkusers at vtk.org>
Subject: [vtkusers] Solution: Bug in SetRenderWindow(NULL)


Hi,

I guess I found the solution for the
bug/problem in SetRenderWindow(NULL).
The lines in vtkWin32OpenGLRenderWindow should be:

vtkWin32OpenGLRenderWindow::~vtkWin32OpenGLRenderWindow()
{
..
  if (this->WindowId)
    {
      this->Clean();
      ReleaseDC(this->WindowId, this->DeviceContext);
      // can't set WindowId=3DNULL, needed for DestroyWindow
      this->DeviceContext =3D NULL;
   =20
      // clear the extra data before calling destroy
      vtkSetWindowLong(this->WindowId,4,(LONG)0);
      if (this->OwnWindow)
        DestroyWindow(this->WindowId);
    }
..
}

Could anybody of the developers check on that ?

> the memory is free, but you get the error=20
> "wglMakeCurrent failed in MakeCurrent()"
> in vtkWin32OpenGLRenderWindow::MakeCurrent()
That was my own bug.. ;)

greets
  Ingo

---
Dr.-Ing. Ingo H. de Boer

Polytec GmbH
Polytec-Platz 1-7, 76337 Waldbronn, Germany
phone: ++49 7243 604 106
fax  : ++49 7243 604 255

--__--__--

Message: 7
Date: Wed, 22 Oct 2003 15:54:3 +0800
From: "xiaofeng qi" <xiaofeng_qi at sina.com>
To: vtkusers at vtk.org <vtkusers at vtk.org>
Subject: [vtkusers] HELP vtkPointPicker question

Hi,vtkusers

  I am using vtk+java to develop a application to visualize
some CFD data.I use vtkPointPicker to pick the  point 
from a section plane,then i use the point's coordinate
as start point of a streamline , but something cause me annoyed,
The point's coordinate i got from vtkPointPicker is not
the same  to the start point of the streamline,when I 
press the mouse ,and the streamline do not start from the
cursor'position, it starts from some place else.
here is some of my codes,
     

    vtkPointPicker picker=3Dnew vtkPointPicker();
       picker.InitializePickList();
       picker.AddPickList(sectionActor);
       picker.PickFromListOn();
       picker.SetTolerance(0.01);
       picker.Pick(lastX, lastY, 0, renWin.GetRenderer());
      
      
   if(picker.GetPointId()<0){

        System.out.println("Mouse point:=
 ("+lastX+","+lastY+")");
        System.out.println("notok");
         }else{
     
        double []selPt =3D picker.GetSelectionPoint();
        double []pickPos =3D picker.GetPickPosition();
=09
        drawStreamline(pickPos);
        }
       ..............................
=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1
 Do i miss something?Any help will be appreciate.

Thanks !!!

 =09=09=09=09

=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1xiaofeng qi
=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1xiaofeng_qi at sina.com
=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A12003-10-22





--__--__--

_______________________________________________
vtkusers mailing list
vtkusers at vtk.org
http://www.vtk.org/mailman/listinfo/vtkusers


End of vtkusers Digest






More information about the vtkusers mailing list