[vtkusers] Re: vtkusers Digest, Vol 30, Issue 29

St st at fidohiptop.ca
Wed Oct 25 11:12:47 EDT 2006


Fuck you ! Je ne veux pas recevoir aucun email de vous sur mon 
cellullaire si vous voullez en envoyer envoyer les sur mon ordinateure a 
stephanethifault20002000 at yahoo.fr
Sa me coute $ les recevoir sur mon cellulaire a st at fidohiptop.ca et je 
les jette mais a chaque fois je payes 45¢ recevoir email
Veuiller respecter ma vie privé et je ne veux pas recevoir aucun 
courrier sur mon cellulaire
Envoyer vos email a stephanethifault20002000 at yahoo.fr qui est mon 
adresse sur mon ordinateure si vous aimé ca envoyer email pour que je 
les jette a la corbeille mais jamais me renvoyer email sur mon 
cellulaire car je vais metre avocat apres vous et se message est 
crypté.
Le mercredi 25 octobre 2006 10:33, vtkusers-request at vtk.org a écrit :
> 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-owner 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. Re: Error in Compilation of Gui\Qt\Events  Example
>       (clinton at elemtech.com)
>    2. Re: Finite element data (Jo?o Cunha)
>    3. Re: How set render-background as color-gradient (Jens)
>    4. Re: CellLocator, Octrees and Segfaults... (Radu Bogdan Rusu)
>    5. Re: Dynamically connected points (Obada Mahdi)
>    6. volume rendering in C++ (Jill Lin)
>    7. Re: volume rendering in C++ (Amy Squillacote)
>    8. Re: volume rendering in C++ (Amy Squillacote)
>    9. Re: kernel32.dll error with VTK 5.0 and 5.0.2 in
>       vtkInformationStringKey::Set (Andres Barrera)
>   10. Re: How set render-background as color-gradient (Goodwin Lawlor)
>   11. Re: How set render-background as color-gradient (Goodwin Lawlor)
>   12. Re: CellLocator, Octrees and Segfaults... (Obada Mahdi)
>   13. Re: Changing Opacity real time (Sharwari Mavalankar)
>   14. vtkVolumeShearWarpMapper problem in VTK-5.0.2
>       (zhou13 at netscape.net)
>   15. Re: vtkVolumeShearWarpMapper problem in VTK-5.0.2
>       (John Biddiscombe)
>   16. Re: CellLocator, Octrees and Segfaults... (Philipp Kemmeter)
>   17. Re: CellLocator, Octrees and Segfaults... (Obada Mahdi)
>   18. vtkPolyData to be used with vtkImageStencil. (Anja Ende)
>   19. vtkGraph - examples and when will it be included in a	vtk
>       release? (Uffe Damgaard Pedersen)
>   20. Re: vtkPolyData to be used with vtkImageStencil. (Anja Ende)
>   21. Re: Re: [vtkusers] vtkVolumeShearWarpMapper problem in
>       VTK-5.0.2 (David Cole)
>   22. Re: vtkPolyData to be used with vtkImageStencil. (Dean Inglis)
>   23. Re: vtkPolyData to be used with vtkImageStencil. (Dean Inglis)
>   24. Re: Dynamically connected points (Obada Mahdi)
>   25. Re: vtkPolyData to be used with vtkImageStencil. (Anja Ende)
>   26. Re: vtkPolyData to be used with vtkImageStencil. (Anja Ende)
>   27. RE: vtkPolyData to be used with vtkImageStencil. (Dean Inglis)
>   28. Re: vtkPolyData to be used with vtkImageStencil. (Anja Ende)
>   29. Re: vtkPolyData to be used with vtkImageStencil. (Anja Ende)
>   30. RE: vtkPolyData to be used with vtkImageStencil. (Dean Inglis)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Tue, 24 Oct 2006 10:07:45 -0600
> From: clinton at elemtech.com
> Subject: Re: [vtkusers] Error in Compilation of Gui\Qt\Events  Example
> To: vtkusers at vtk.org, eryanvtk at yahoo.com
> Message-ID: <200610241007.45614.clinton at elemtech.com>
> Content-Type: text/plain;  charset="iso-8859-1"
>
>>  I get the following error when trying to compile the QtVtk examples 
>> from
>>  the GUI\Qt directory.  Except for the init function (which I dont see 
>> in
>>  the .ui.h file) , all the otehr errors should not be present.  The
>>  variables are declared in the gui.h file. Nevertheless I get the 
>> following
>>  error.
>>
>>  Any clue as to what I should do ?  Or what may be the problem ?
>>
>>  Thanks in advance,
>>  Emma
>>
>>  :\netprograms\VTK\Examples\GUI\Qt\Events\GUI.ui.h(39) : error C2039: 
>> 'init'
>>  : : is not a member of 'Form1'
>>
>>          C:/netprograms/VTK/Examples/GUI/Qt/Events/GUI.h(30) : see
>>  declaration of 'Form1'
>
> That Qt example requires Qt 3.3.  You can still look at the code and 
> see how
> to use the QVTKWidget in Qt 3.0.
>
> Clint
>
>
> ------------------------------
>
> Message: 2
> Date: Tue, 24 Oct 2006 17:32:54 +0100
> From: Jo?o Cunha <jdc at lnec.pt>
> Subject: Re: [vtkusers] Finite element data
> To: Burlen <burlen at apollo.sr.unh.edu>
> Cc: vtkusers at vtk.org
> Message-ID: <453E4036.3050909 at lnec.pt>
> Content-Type: text/plain; charset="utf-8"
>
> Burlen wrote:
>
> Thanks, Burlen.
> I expect to get some time to think about it next weekend and I will 
> come
> back to the list with
> solutions or more questions.
> João
>
>> Hi Joao, VTK does have the quadratic hexahedra cell type so you will 
>> be able
>> to visualize data at the nodes of your cells easily. As far as your 
>> other
>> data, there are a few options that I can think of. If have the 
>> situation
>> where you can find one value(maybe anaverage) per cell, you can 
>> associate
>> that value with its respective quadratic hexahedra cell. Alternatively 
>> you
>> could interpolate your vector and or scalar data to quadratic 
>> hexahedral
>> nodal locations. Alternatively you could add points and associate 
>> either
>> vector data or scalar data with those points. To do this you'd need to
>> transform your local coordinates into global coordinates. I hope this 
>> gives
>> you some ideas, or sparks some further discussion.
>> Burlen
>>
>>
>>
>>
>> On Tuesday 24 October 2006 04:45 am, João Cunha wrote:
>>
>>
>>> I'm working with data from finite element calculations of concrete 
>>> dams:
>>> unstructured grid with quadratic hexahedra cells. Vector displacements
>>> are known at the nodes but tensor data are calculated at 8
>>> points within each cell ( +/- 0.577 in each direction, in local
>>> coordinates).
>>> I couldn´t find appropriate methods to deal with this situation, 
>>> either
>>> calculate tensors at nodes or
>>> visualizing them directly as provided.
>>> I would appreciate any help.
>>> Thanks
>>> João Cunha
>>>
>>>
>>
>>
>>
>
>
> --
> João Duarte Cunha
> Investigador-Coordenador
> Director do Centro da Qualidade na Construção
> jdc at lnec.pt
>
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: jdc.vcf
> Type: text/x-vcard
> Size: 271 bytes
> Desc: not available
> Url : 
> http://public.kitware.com/pipermail/vtkusers/attachments/20061024/f0b01c80/jdc-0001.vcf
>
> ------------------------------
>
> Message: 3
> Date: Tue, 24 Oct 2006 18:54:23 +0200
> From: Jens <jens-devel at gmx.de>
> Subject: Re: [vtkusers] How set render-background as color-gradient
> Cc: vtkusers at vtk.org
> Message-ID: <453E453F.9030302 at gmx.de>
> Content-Type: text/plain; charset=ISO-8859-1
>
> I only found this on the net - who recommends to use a vtkImageActor 
> for
> a color-gradient-background in VTK.
> (http://public.kitware.com/pipermail/vtkusers/2005-February/078369.html)
>
> But (1) using a vtkImageActor to create a color-gradient-background is
> not very satisfying, because by changing the camera-position the user
> could reach it and move through it.
> And (2) a pixel-based image looks kind of rough in a rendered world.
>
> Any others ideas for a color-gradient-background in a render-window?
>
> Greetings
> 	Jens
>
>
> Jens schrieb:
>>  Hi,
>>
>>  does anyone knows how to set the render-background to be a
>>  color-gradient. That way I could make sure that an actor is always
>>  recognised by the user - beside, it would look kind of nice :)
>>
>>  Greetings
>>  Jens
>>  _______________________________________________
>>  This is the private VTK discussion list.
>>  Please keep messages on-topic. Check the FAQ at: 
>> http://www.vtk.org/Wiki/VTK_FAQ
>>  Follow this link to subscribe/unsubscribe:
>>  http://www.vtk.org/mailman/listinfo/vtkusers
>>
>>
>
>
> ------------------------------
>
> Message: 4
> Date: Tue, 24 Oct 2006 19:19:16 +0200
> From: Radu Bogdan Rusu <rusu at cs.tum.edu>
> Subject: Re: [vtkusers] CellLocator, Octrees and Segfaults...
> To: vtkusers at vtk.org
> Message-ID: <453E4B14.8080804 at cs.tum.edu>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
>
> Yeah, what I don't understand is why:
>
> this->MarkParents((void*)VTK_CELL_INSIDE,i,j,k,ndivs,this->Level);
>
> ...in: void vtkCellLocator::BuildLocator()
> ...where: #define VTK_CELL_INSIDE 1
> ...because: void vtkCellLocator::MarkParents(void* a, int i, int j, int 
> k, int ndivs, int
> level)
> ...contains: this->Tree[parentIdx] = (vtkIdList *)a;
>
> I would really appreciate if someone could shed some light on the 
> matter. :-/ Thanks!
>
> Cheers,
> Radu.
>
> Philipp Kemmeter wrote:
>>  Heya!
>>
>>  Thanks, Mahdi for your help. This is quite intersting and good to 
>> know :)
>>
>>  @Radu: Got the same question here: Is it possible to iterate through
>>  the flattened octree directly? And how to access the points after
>>  getting the the idlist ?
>>
>>  Phil
>>
>>  2006/10/23, Radu Bogdan Rusu <rusu at cs.tum.edu>:
>>>  Heya,
>>>
>>>  Obada Mahdi wrote:
>>>  > The problem is that only leaf nodes point to actual instances of
>>>  > "vtkIdList".  Inner nodes are marked with an internally defined
>>>  > constant (1), causing a segfault when being dereferenced (leaf nodes
>>>  > are probably NULL if the corresponding octant is empty, I am not 
>>> sure
>>>  > about that).
>>>
>>>  I noticed that myself. Is there any other way of actually "iterating"
>>>  through the octants,
>>>  then ?
>>>
>>>  I'm thinking something along the lines:
>>>  for (int i = 0; i < locator->GetNumberOfBuckets (); i++)
>>>  {
>>>     vtkIdList *l = locator->GetCells (i);
>>>     if (l != (vtkIdList*)NULL)
>>>       for (int j = 0; j < l->GetNumberOfIds ();j++)
>>>         // access l->GetId (j)... dataset->GetCell
>>>      ...etc
>>>  }
>>>
>>>  Of course, locator::GetCells (int octantId) looks like
>>>     if (this->Tree[octantId] == (vtkIdList*)1)
>>>       return NULL;
>>>     else
>>>       return this->Tree[octantId];
>>>
>>>  I'm not sure how healthy that is yet.
>>>
>>>  Cheers,
>>>  Radu.
>
>
> ------------------------------
>
> Message: 5
> Date: Tue, 24 Oct 2006 19:26:15 +0200
> From: "Obada Mahdi" <omahdi at gmx.de>
> Subject: Re: [vtkusers] Dynamically connected points
> To: vtkusers at vtk.org
> Message-ID:
> 	<737abb390610241026w5ab0f02bh5f24b3f0f690c37c at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Hi Nelson!
>
> On 10/24/06, nelson - <nelson1977 at gmail.com> wrote:
>>  hi all,
>>    i'm coding an interactive geomertry program in python using VTK. I
>>  can't figure out how to make a Point that is dependant from the
>>  position of the other points. I can to explain myself by an example.
>>
>>  If i wanto conconstruct the middle point of two points in the space i
>>  have to build the middle point that change its position when i move
>>  the two points... can i make it in vtl. I see vtkAssembly but i don't
>>  understand if it is the right choice.
>
> If I understand your problem correctly, you want to construct a middle
> point from two other points that can be moved independently; in other
> words, have an object whose position is given implicitly by two other
> objects and some kind of operation.
>
> vtkAssembly is useful for compound geometry, i.e. objects consisting
> of multiple parts, organized in a hierarchical tree, that should be
> affected simultaneously by transformations.  It does not, however,
> provide a means to express and maintain object properties that are
> calculated from other data sources and a given operation.
>
> I guess there are two possible approaches to your problem--here are 
> some ideas:
> (1) Event-driven design: Monitor interactions that change positions
> and update the "middle point" accordingly.  I suppose this is what you
> already had in mind:
>
> On 10/19/06, nelson - <nelson1977 at gmail.com> wrote:
>>  I can do it implementing my own observer pattern like
>>  framework or there is something already esisting in VTK i can use?
>
> An observer like vtkCallbackCommand can be used to have a custom
> function called on an event like "InteractionEvent" or
> "EndInteractionEvent" for a given object, which can in turn
> re-calculate point positions.  If modifications are not only initiated
> by keyboard or mouse interaction but also programmatically, observing
> the less specific "Modified" event instead might help.
>
> The advantage of this approach is simplicity--the whole update logic
> is part of an event handler, and there is no need for affected objects
> (like vtkActor) to know about how their properties depend on other
> objects.
>
> (2) Demand-driven design: If you would rather like to have a more
> general way of expressing dependencies for calculated properties, as
> opposed to hard-coding the information flow into an event handler, you
> could create a custom subclass of e.g. vtkCoordinate that knows how to
> compute its position as "middle point" from other positions given upon
> initialization, maybe as instances of vtkCoordinate or vtkActor.  This
> custom class could then be used to maintain the calculated position,
> by checking its own modification time against the input when being
> accessed, and re-calculating theposition if needed.
>
> In order to automatically update an actor's position based on such a
> computed coordinate, one would either have to use a customized
> vtkActor that maintains its position as a vtkCoordinate-compatible
> class, or link them by observing the "Modified" event of the
> coordinate object.
>
> I apologize for not being more specific--I have not done something
> like this before, so this is all more of a wild guess, and the details
> of such an implementation largely depend on the specifics of your
> application.
>
>
> Hope it helps (and does not cause too much confusion :-)
>
> Obada
>
>
> ------------------------------
>
> Message: 6
> Date: Tue, 24 Oct 2006 19:23:10 +0000
> From: "Jill Lin" <hjlin2177 at hotmail.com>
> Subject: [vtkusers] volume rendering in C++
> To: vtkusers at vtk.org
> Message-ID: <BAY101-F9040D4E1D4595A1DFFA75A5010 at phx.gbl>
> Content-Type: text/plain; format=flowed
>
>
> Can someone provide me an example (i.e. code) for volume rendering in 
> C++?
> Thanx.
>
> _________________________________________________________________
> Stay in touch with old friends and meet new ones with Windows Live 
> Spaces
> http://clk.atdmt.com/MSN/go/msnnkwsp0070000001msn/direct/01/?href=http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mkt=en-us
>
>
>
> ------------------------------
>
> Message: 7
> Date: Tue, 24 Oct 2006 15:30:09 -0400
> From: Amy Squillacote <amy.squillacote at kitware.com>
> Subject: Re: [vtkusers] volume rendering in C++
> To: Jill Lin <hjlin2177 at hotmail.com>
> Cc: vtkusers at vtk.org
> Message-ID: <453E69C1.7020909 at kitware.com>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Hi Jill,
>
> There are several C++ code examples in the
> VTK/VolumeRendering/Testing/Cxx directory. Also there are several Tcl
> and Python examples in VTK/Examples/VolumeRendering/Tcl and
> VTK/Examples/VolumeRendering/Python, respectively; the conversion of 
> the
> examples from either of these languages to C++ is very straightforward.
>
> - Amy
>
> Jill Lin wrote:
>>
>>  Can someone provide me an example (i.e. code) for volume rendering in
>>  C++? Thanx.
>>
>>  _________________________________________________________________
>>  Stay in touch with old friends and meet new ones with Windows Live
>>  Spaces
>>  http://clk.atdmt.com/MSN/go/msnnkwsp0070000001msn/direct/01/?href=http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mkt=en-us
>>
>>
>>  _______________________________________________
>>  This is the private VTK discussion list. Please keep messages
>>  on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>>  Follow this link to subscribe/unsubscribe:
>>  http://www.vtk.org/mailman/listinfo/vtkusers
>>
>
>
> ------------------------------
>
> Message: 8
> Date: Tue, 24 Oct 2006 16:12:54 -0400
> From: Amy Squillacote <amy.squillacote at kitware.com>
> Subject: Re: [vtkusers] volume rendering in C++
> To: Jill Lin <hjlin2177 at hotmail.com>
> Cc: VTK Users <vtkusers at vtk.org>
> Message-ID: <453E73C6.7080206 at kitware.com>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Hi Jill,
>
> Please keep the discussion on the vtkusers list. That way more people
> can help answer your questions, and the answers are archived for future 
> use.
>
> The examples I mentioned are available in the VTK source tree. 
> (Download
> Source from http://www.vtk.org/get-software.php#latest.)
>
> Alternatively, you can browse for the examples on the web at
> http://public.kitware.com/cgi-bin/viewcvs.cgi/?cvsroot=VTK.
>
> - Amy
>
> Jill Lin wrote:
>>
>>  Hi Amy,
>>
>>  Sorry for a stupid question. How do I get to the directory that you
>>  are talking about?
>>
>>  Thanx,
>>  Jill
>>
>>>  From: Amy Squillacote <amy.squillacote at kitware.com>
>>>  To: Jill Lin <hjlin2177 at hotmail.com>
>>>  CC: vtkusers at vtk.org
>>>  Subject: Re: [vtkusers] volume rendering in C++
>>>  Date: Tue, 24 Oct 2006 15:30:09 -0400
>>>
>>>  Hi Jill,
>>>
>>>  There are several C++ code examples in the
>>>  VTK/VolumeRendering/Testing/Cxx directory. Also there are several Tcl
>>>  and Python examples in VTK/Examples/VolumeRendering/Tcl and
>>>  VTK/Examples/VolumeRendering/Python, respectively; the conversion of
>>>  the examples from either of these languages to C++ is very
>>>  straightforward.
>>>
>>>  - Amy
>>>
>>>  Jill Lin wrote:
>>>>
>>>>  Can someone provide me an example (i.e. code) for volume rendering
>>>>  in C++? Thanx.
>>>>
>>>>  _________________________________________________________________
>>>>  Stay in touch with old friends and meet new ones with Windows Live
>>>>  Spaces
>>>>  http://clk.atdmt.com/MSN/go/msnnkwsp0070000001msn/direct/01/?href=http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mkt=en-us
>>>>
>>>>
>>>>
>>>>  _______________________________________________
>>>>  This is the private VTK discussion list. Please keep messages
>>>>  on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>>>>  Follow this link to subscribe/unsubscribe:
>>>>  http://www.vtk.org/mailman/listinfo/vtkusers
>>>>
>>
>>  _________________________________________________________________
>>  Add a Yahoo! contact to Windows Live Messenger for a chance to win a
>>  free trip!
>>  http://www.imagine-windowslive.com/minisites/yahoo/default.aspx?locale=en-us&hmtagline
>>
>>
>>
>
>
> ------------------------------
>
> Message: 9
> Date: Tue, 24 Oct 2006 15:40:30 -0500
> From: "Andres Barrera" <andresba at hotmail.com>
> Subject: Re: [vtkusers] kernel32.dll error with VTK 5.0 and 5.0.2 in
> 	vtkInformationStringKey::Set
> To: omahdi at gmx.de, vtkusers at vtk.org
> Cc: lintworm2 at yahoo.co.uk
> Message-ID: <BAY110-F40A733D17D33F7B409CBFCC3010 at phx.gbl>
> Content-Type: text/plain; format=flowed
>
> Hello Obada,
>
>     Thank you very much for your e-mail. Today I got everything 
> working! I
> downloaded the latest version of CMake and re-compile VTK 5.0.2 in 
> 'Debug'
> mode. Although the VTK headers were OK in my application, I edited my 
> Win
> Environmental Variables (I had declared the dir where my VTK 4.2 
> libraries
> live at 'PATH').  I don't know what made it, but it is working now :-)  
> I
> know you are not supposed to change so many things at the same time if 
> you
> want to catch where the problem is... I probably combined all your
> suggestions together!
>
>    Thanks again
>
>           Cheers
>
>                 Andres
>
>
>
>> From: "Obada Mahdi" <omahdi at gmx.de>
>> To: "Andres Barrera" <andresba at hotmail.com>
>> CC: lintworm2 at yahoo.co.uk, vtkusers at vtk.org
>> Subject: Re: [vtkusers] kernel32.dll error with VTK 5.0 and 5.0.2 in
>> vtkInformationStringKey::Set
>> Date: Mon, 23 Oct 2006 22:24:56 +0200
>
>>
>> Hi Andres!
>>
>> On 10/23/06, Andres Barrera <andresba at hotmail.com> wrote:
>>>          Thank you very much for your help. Regarding to the error, 
>>> I'll
>>> try
>>> modifying the original vtk implementation for 
>>> vtkInformationStringValue,
>>> but
>>> I don't keep too much hope on it.... The construction looked weird to 
>>> me
>>> too, but this class is being used by many people... Therefore somebody
>>> else
>>> should have fixed it before, but I didn't find anything on the users
>>> list...
>>> I addition, it is crashing 2 lines before it reaches 'v->Delete();'...
>>
>> Just to be sure:
>> - Did you build VTK in "Debug" mode, or as "Release" or
>> "RelWithDebInfo" (something that involves optimization flags)?  WIth
>> compiler optimizations, references to lines in the original source
>> code can be inaccurate.
>> - Is the value of "v" non-NULL just before executing the offending 
>> line?
>>
>> Regarding Han's comment:
>>>  >vtkInformationStringValue* v = new vtkInformationStringValue;
>> [...]
>>>  >Shouldn't this be:
>>>  >
>>>  >vtkInformationStringValue* v = vtkInformationStringValue::New();
>>
>> vtkInformationStringValue is defined only locally inside
>> "vtkInformationStringKey.cxx" and does not adapt the construction
>> scheme that involves protected constructors and a static New() method,
>> yet it supports the reference counting mechanism inherited from
>> vtkObjectBase, so calling Delete() should work just fine.
>>
>>>  >I am not sure, i don't have documentation on me right now, so if i'm
>>> saying
>>>  >stupid things: Sorry for that... :)
>>
>> I don't think it is a stupid thing to mention at all.  I suppose that
>> mixing up construction conventions for custom VTK classes could indeed
>> cause trouble :-)
>>
>>>  > >  Any ideas/suggestions?
>>
>> Headers and libraries: Any chance that the VTK headers used for
>> building the example do not match the version of the libraries used
>> for linking?  This can cause weird problems, for example if you
>> compile using the "right" headers, but the linker uses libraries from
>> a different VTK build.
>>
>> CMake version: You seem to use a relatively old version of CMake--try
>> using a more recent version.
>>
>> I am not familiar with "C++ Builder", but you can check the dashboard
>> (go to www.vtk.org and select "Quality Dashboard") if the combination
>> of your system/compiler is actively being tested--if it is, it should
>> give you an idea whether it should work or not ;)
>>
>>
>> Regards
>>
>> Obada
>
> _________________________________________________________________
> Try the next generation of search with Windows Live Search today!
> http://imagine-windowslive.com/minisites/searchlaunch/?locale=en-us&source=hmtagline
>
>
>
> ------------------------------
>
> Message: 10
> Date: Tue, 24 Oct 2006 21:31:05 +0000
> From: Goodwin Lawlor <goodwin.lawlor at ucd.ie>
> Subject: [vtkusers] Re: How set render-background as color-gradient
> To: Jens <jens-devel at gmx.de>
> Cc: vtkusers at vtk.org
> Message-ID: <453E8619.5060800 at ucd.ie>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Jens wrote:
>>  I only found this on the net - who recommends to use a vtkImageActor 
>> for
>>  a color-gradient-background in VTK.
>>  (http://public.kitware.com/pipermail/vtkusers/2005-February/078369.html)
>>
>>  But (1) using a vtkImageActor to create a color-gradient-background is
>>  not very satisfying, because by changing the camera-position the user
>>  could reach it and move through it.
>>  And (2) a pixel-based image looks kind of rough in a rendered world.
>>
>>  Any others ideas for a color-gradient-background in a render-window?
> Hi Jens,
>
> Have a look here at a tcl example:
> http://www.bioengineering-research.com/vtk/BackgroundGradient.tcl
>
> hth
>
> Goodwin
>
>
> ------------------------------
>
> Message: 11
> Date: Tue, 24 Oct 2006 21:31:05 +0000
> From: Goodwin Lawlor <goodwin.lawlor at ucd.ie>
> Subject: [vtkusers] Re: How set render-background as color-gradient
> To: vtkusers at public.kitware.com
> Cc: vtkusers at vtk.org
> Message-ID: <453E8619.5060800 at ucd.ie>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Jens wrote:
>>  I only found this on the net - who recommends to use a vtkImageActor 
>> for
>>  a color-gradient-background in VTK.
>>  (http://public.kitware.com/pipermail/vtkusers/2005-February/078369.html)
>>
>>  But (1) using a vtkImageActor to create a color-gradient-background is
>>  not very satisfying, because by changing the camera-position the user
>>  could reach it and move through it.
>>  And (2) a pixel-based image looks kind of rough in a rendered world.
>>
>>  Any others ideas for a color-gradient-background in a render-window?
> Hi Jens,
>
> Have a look here at a tcl example:
> http://www.bioengineering-research.com/vtk/BackgroundGradient.tcl
>
> hth
>
> Goodwin
>
>
>
> ------------------------------
>
> Message: 12
> Date: Wed, 25 Oct 2006 01:55:14 +0200
> From: "Obada Mahdi" <omahdi at gmx.de>
> Subject: Re: [vtkusers] CellLocator, Octrees and Segfaults...
> To: rusu at cs.tum.edu
> Cc: vtkusers at vtk.org
> Message-ID:
> 	<737abb390610241655r33e8d2eaw8baf9be36d9b28c4 at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Hi Radu!
>
> On 10/24/06, Radu Bogdan Rusu <rusu at cs.tum.edu> wrote:
>>  Yeah, what I don't understand is why:
>>
>>  this->MarkParents((void*)VTK_CELL_INSIDE,i,j,k,ndivs,this->Level);
>>
>>  ...in: void vtkCellLocator::BuildLocator()
>>  ...where: #define VTK_CELL_INSIDE 1
>>  ...because: void vtkCellLocator::MarkParents(void* a, int i, int j, 
>> int k, int ndivs, int
>>  level)
>>  ...contains: this->Tree[parentIdx] = (vtkIdList *)a;
>
> I am not sure that I understand the question :-)  Here is what I think
> is going on, please excuse the traffic if I am just repeating what you
> already know:
>
> When the locator is built, cells are distributed over 8^l leaf nodes
> of an octree, where l is the height of the tree (which is computed
> automatically, based on the number of cells, unless given explicitly).
>  These leaf nodes contain either NULL if they are empty, or hold a
> pointer to an instance of vtkIdList otherwise.  These are the only
> nodes that can carry cell IDs.
>
> In addition, inner nodes of the octree are marked as empty (NULL,
> value from initialization) or non-empty (VTK_CELL_INSIDE), depending
> on whether at least one child (leaf) node contains cells or not.  This
> is done by MarkParents(), by tagging every node on the path towards
> the root node.  This is required for e.g. speeding up intersection
> tests (eliminating parts of the tree by top-down testing intersection
> with bounding boxes).
>
> The octree maintained by vtkCellLocator is quite simple and has a very
> specific structure--maybe that is why there is no more elaborate
> interface for navigating through the tree, but frankly, I do not
> understand that interface, too.  It is also not picked up by
> vtkOBBTree, which directly inherits from vtkCellLocator and does not
> provide methods for accessing tree nodes at all (as far as I can see).
>  Maybe the best thing is to follow the suggestion from the
> documentation of vtkCellLocator, which states that it is meant to be
> subclassed.
>
>>  Is there any other way of actually "iterating" through the octants, 
>> then ?
>
> If you want to exploit the structure of the flattened octree
> representation to iterate just over leaf nodes, you can use something
> like:
>
> // fetch total number of nodes (inner+leaf)
> int numNodes = locator->GetNumberOfBuckets();
> // compute 8^(tree height), which is the number of leaf nodes
> int numLeafNodes = ( 2 << (3 * locator->GetLevel()) );
> for ( int i = numNodes - numLeafNodes; i < numNodes; i++ ) {
>   idList = locator->GetCells(i);
>   if ( idList != NULL ) ...
> }
>
>
> HTH,
>
> Obada
>
>
> ------------------------------
>
> Message: 13
> Date: Tue, 24 Oct 2006 22:46:56 -0400
> From: "Sharwari Mavalankar" <sharwari at gmail.com>
> Subject: Re: [vtkusers] Changing Opacity real time
> To: "Andinet Enquobahrie" <andinet.enqu at kitware.com>
> Cc: VTK <vtkusers at vtk.org>
> Message-ID:
> 	<2462f9f80610241946y4565db80mde46b903cdc1c177 at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> hi Andinet,
> Thanks for your email.
> I tried to look into the tour example but I still couldnt get a hang of 
> it.
> Is there any other example I can look at?
> Thanks
> Sharwari
>
>
> On 10/18/06, Andinet Enquobahrie <andinet.enqu at kitware.com> wrote:
>>
>>  Hi Sharwari,
>>
>>  > hi all,
>>  > I am reading 2D BMP slices to build a 3D volume and rendering it 
>> using
>>  > vtk.
>>  > I am using KWWidgets to build a UI for my application.
>>  > For this purpose I need to change opacity the 3D volume in real time
>>  > (interactively)
>>  > Can someone suggest possible ways that I can do this?
>>  > Does the vtkKWPiecewiseFunction have to be used along with a check
>>  > button for this purpose ?
>>  > Thanks!
>>  > Sharwari
>>  >
>>  >
>>  >
>>  Essentially "vtkKWVolumePropertyWidget" does what you are trying to 
>> do.
>>  Take a look at
>>  WidgetsTour example in KWWidgets to have some idea on how to use this
>>  widget.
>>
>>  hth
>>  -Andinet
>>
>>  >------------------------------------------------------------------------
>>  >
>>  >_______________________________________________
>>  >This is the private VTK discussion list.
>>  >Please keep messages on-topic. Check the 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://public.kitware.com/pipermail/vtkusers/attachments/20061024/4646f0ee/attachment-0001.htm
>
> ------------------------------
>
> Message: 14
> Date: Tue, 24 Oct 2006 23:39:03 -0400
> From: zhou13 at netscape.net
> Subject: [vtkusers] vtkVolumeShearWarpMapper problem in VTK-5.0.2
> To: vtkusers at vtk.org
> Message-ID: <8C8C5FE3FFA4168-284-2768 at WEBMAIL-DC10.sysops.aol.com>
> Content-Type: text/plain; charset="utf-8"
>
>  Dear list,
>
>  I can't use vtkVolumeShearWarpMapper.
>
>  LNK2019: 无法解�的外部符� 
> "__declspec(dllimport) public: static class vtkVolumeShearWarpMapper * 
> __cdecl vtkVolumeShearWarpMapper::New(void)" 
> (__imp_?New at vtkVolumeShearWarpMapper@@SAPAV1 at XZ) 
> ,该符�在函数 _main 
> 中被引用
>
>  The VTK version is 5.0.2 and compiler is VS2003 (Simplified Chinese 
> Edition).
>
>  Thanks.
>
>
>
>
>
>
> ________________________________________________________________________
> Check Out the new free AIM(R) Mail -- 2 GB of storage and 
> industry-leading spam and email virus protection.
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: 
> http://public.kitware.com/pipermail/vtkusers/attachments/20061024/f51d3b75/attachment-0001.html
>
> ------------------------------
>
> Message: 15
> Date: Wed, 25 Oct 2006 09:34:30 +0200
> From: John Biddiscombe <biddisco at cscs.ch>
> Subject: Re: [vtkusers] vtkVolumeShearWarpMapper problem in VTK-5.0.2
> To: zhou13 at netscape.net
> Cc: vtkusers at vtk.org
> Message-ID: <453F1386.7040906 at cscs.ch>
> Content-Type: text/plain; charset=UTF-8; format=flowed
>
>
>>  I can't use vtkVolumeShearWarpMapper.
> It is not supported and should be removed. I would recommend the
> TextureMapper3D instead.
>
> JB
>
>>
>>  LNK2019: 无法解�的外部符� 
>> "__declspec(dllimport) public: static
>>  class vtkVolumeShearWarpMapper * __cdecl
>>  vtkVolumeShearWarpMapper::New(void)"
>>  (__imp_?New at vtkVolumeShearWarpMapper@@SAPAV1 at XZ) 
>> ,该符�在函数 _main
>>  中被引用
>>
>>  The VTK version is 5.0.2 and compiler is VS2003 (Simplified Chinese
>>  Edition).
>>
>>  Thanks.
>>
>>
>>
>>
>>
>>  ------------------------------------------------------------------------
>>  *Check Out the new free AIM(R) Mail*
>>  <http://pr.atwola.com/promoclk/100122638x1081283466x1074645346/aol?redir=http%3A%2F%2Fwww%2Eaim%2Ecom%2Ffun%2Fmail%2F>
>>  -- 2 GB of storage and industry-leading spam and email virus 
>> protection.
>>  ------------------------------------------------------------------------
>>
>>  _______________________________________________
>>  This is the private VTK discussion list.
>>  Please keep messages on-topic. Check the FAQ at: 
>> http://www.vtk.org/Wiki/VTK_FAQ
>>  Follow this link to subscribe/unsubscribe:
>>  http://www.vtk.org/mailman/listinfo/vtkusers
>>
>
>
> --
> John Biddiscombe,                            email:biddisco @ cscs.ch
> http://www.cscs.ch/about/BJohn.php
> CSCS, Swiss National Supercomputing Centre  | Tel:  +41 (91) 610.82.07
> Via Cantonale, 6928 Manno, Switzerland      | Fax:  +41 (91) 610.82.82
>
>
>
>
> ------------------------------
>
> Message: 16
> Date: Wed, 25 Oct 2006 09:57:55 +0200
> From: "Philipp Kemmeter" <gildedfalcon at googlemail.com>
> Subject: Re: [vtkusers] CellLocator, Octrees and Segfaults...
> To: "Obada Mahdi" <omahdi at gmx.de>
> Cc: vtkusers at vtk.org
> Message-ID:
> 	<ddae32f90610250057i7da3f0dbqc490772eefef8cd3 at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Ahaa !
>
> That's helpful! Cool, I'll try it. Thanks a lot :)
>
> Phil
>
> 2006/10/25, Obada Mahdi <omahdi at gmx.de>:
>>  Hi Radu!
>>
>>  On 10/24/06, Radu Bogdan Rusu <rusu at cs.tum.edu> wrote:
>>  > Yeah, what I don't understand is why:
>>  >
>>  > this->MarkParents((void*)VTK_CELL_INSIDE,i,j,k,ndivs,this->Level);
>>  >
>>  > ...in: void vtkCellLocator::BuildLocator()
>>  > ...where: #define VTK_CELL_INSIDE 1
>>  > ...because: void vtkCellLocator::MarkParents(void* a, int i, int j, 
>> int k, int ndivs, int
>>  > level)
>>  > ...contains: this->Tree[parentIdx] = (vtkIdList *)a;
>>
>>  I am not sure that I understand the question :-)  Here is what I think
>>  is going on, please excuse the traffic if I am just repeating what you
>>  already know:
>>
>>  When the locator is built, cells are distributed over 8^l leaf nodes
>>  of an octree, where l is the height of the tree (which is computed
>>  automatically, based on the number of cells, unless given explicitly).
>>   These leaf nodes contain either NULL if they are empty, or hold a
>>  pointer to an instance of vtkIdList otherwise.  These are the only
>>  nodes that can carry cell IDs.
>>
>>  In addition, inner nodes of the octree are marked as empty (NULL,
>>  value from initialization) or non-empty (VTK_CELL_INSIDE), depending
>>  on whether at least one child (leaf) node contains cells or not.  This
>>  is done by MarkParents(), by tagging every node on the path towards
>>  the root node.  This is required for e.g. speeding up intersection
>>  tests (eliminating parts of the tree by top-down testing intersection
>>  with bounding boxes).
>>
>>  The octree maintained by vtkCellLocator is quite simple and has a very
>>  specific structure--maybe that is why there is no more elaborate
>>  interface for navigating through the tree, but frankly, I do not
>>  understand that interface, too.  It is also not picked up by
>>  vtkOBBTree, which directly inherits from vtkCellLocator and does not
>>  provide methods for accessing tree nodes at all (as far as I can see).
>>   Maybe the best thing is to follow the suggestion from the
>>  documentation of vtkCellLocator, which states that it is meant to be
>>  subclassed.
>>
>>  > Is there any other way of actually "iterating" through the octants, 
>> then ?
>>
>>  If you want to exploit the structure of the flattened octree
>>  representation to iterate just over leaf nodes, you can use something
>>  like:
>>
>>  // fetch total number of nodes (inner+leaf)
>>  int numNodes = locator->GetNumberOfBuckets();
>>  // compute 8^(tree height), which is the number of leaf nodes
>>  int numLeafNodes = ( 2 << (3 * locator->GetLevel()) );
>>  for ( int i = numNodes - numLeafNodes; i < numNodes; i++ ) {
>>    idList = locator->GetCells(i);
>>    if ( idList != NULL ) ...
>>  }
>>
>>
>>  HTH,
>>
>>  Obada
>>  _______________________________________________
>>  This is the private VTK discussion list.
>>  Please keep messages on-topic. Check the FAQ at: 
>> http://www.vtk.org/Wiki/VTK_FAQ
>>  Follow this link to subscribe/unsubscribe:
>>  http://www.vtk.org/mailman/listinfo/vtkusers
>>
>
>
> --
> www.project-virus.de - das einzigarte Browsergame
>
>
> ------------------------------
>
> Message: 17
> Date: Wed, 25 Oct 2006 11:00:08 +0200
> From: "Obada Mahdi" <omahdi at gmx.de>
> Subject: Re: [vtkusers] CellLocator, Octrees and Segfaults...
> To: gildedfalcon at project-virus.com
> Cc: vtkusers at vtk.org
> Message-ID:
> 	<737abb390610250200u5001d96ey5bc9b2f0ef800696 at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Hi again,
>
> On 10/25/06, Philipp Kemmeter <gildedfalcon at googlemail.com> wrote:
>>  That's helpful! Cool, I'll try it. Thanks a lot :)
>
> You're welcome!
>
>>  2006/10/25, Obada Mahdi <omahdi at gmx.de>:
> [...]
>>  > int numLeafNodes = ( 2 << (3 * locator->GetLevel()) );
>
> that should read "( 1 << (3 * locator->GetLevel()) )".  Watch out, it
> might not be the only mistake... ;)
>
> Obada
>
>
> ------------------------------
>
> Message: 18
> Date: Wed, 25 Oct 2006 10:22:16 +0100
> From: "Anja Ende" <anja.ende at googlemail.com>
> Subject: [vtkusers] vtkPolyData to be used with vtkImageStencil.
> To: vtkusers at vtk.org
> Message-ID:
> 	<1f5d2b4f0610250222j4bdc5d27h926644e28d925151 at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hi everyone,
>
> I had asked this question a while back but did not get much response. I 
> hope
> I have better luck this time.
>
> I am trying to create a vtkPolyData object that can be used with
> vtkPolyDataToImageStencil and vtkImageStencil. Basically, I want to 
> extract
> a 2D region from my image.
>
> I tried the following after looking at some of the test files:
>
> //----------------------------------------------------------------------------------
>
>              float pts[4][3] = {{-55.7812, 9.375, 0.0},
>                 {-18.2812, 49.6875, 0.0},
>                 {21.0938, 14.0625, 0.0},
>                 {5.15625, -29.0625, 0.0}};
>
>              vtkFloatArray* pcoords = vtkFloatArray::New();
>              pcoords->SetNumberOfComponents(3);
>              pcoords->SetNumberOfTuples(4);
>              for (int i=0; i<4; i++)
>              {
>                  pcoords->SetTuple(i, pts[i]);
>              }
>              // Create vtkPoints and assign pcoords as the internal 
> data
> array.
>              vtkPoints* points = vtkPoints::New();
>              points->SetData(pcoords);
>              vtkPolyData* polydata = vtkPolyData::New();
>              polydata->SetPoints(points);
>
>              vtkPolyDataToImageStencil* dataToStencil =
> vtkPolyDataToImageStencil::New();
>              dataToStencil->SetInput(polydata);
>
>              vtkImageStencil* stencil = vtkImageStencil::New();
>              stencil->SetInput(myviewer->GetOutput());
>              stencil->SetStencil(dataToStencil->GetOutput());
>              stencil->ReverseStencilOff();
>              stencil->SetBackgroundValue(128);
>
>              stencil->Update();
>
>              stencil->Delete();
>              dataToStencil->Delete();
>              points->Delete();
>              pcoords->Delete();
>
> //----------------------------------------------------------------------------
>
> When I run this, it fails with the error: Can't build OBB tree- no data
> available.
>
> I guess this is because of the way I have set up the vtkPolyData. Can
> someone tell me how to set it up so this primitive example is working.
>
> Another question, for the vtkImageStencil to work, is it necessary that 
> the
> input polydata is 'closed' or does it close the path by itself.
>
> I hope someone can help me with this.
>
> Best,
>
> Anja
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: 
> http://public.kitware.com/pipermail/vtkusers/attachments/20061025/f43dd1b3/attachment.htm
>
> ------------------------------
>
> Message: 19
> Date: Wed, 25 Oct 2006 11:47:22 +0200
> From: Uffe Damgaard Pedersen <udp at atomistix.com>
> Subject: [vtkusers] vtkGraph - examples and when will it be included
> 	in a	vtk release?
> To: vtkusers at vtk.org
> Message-ID: <453F32AA.7040202 at atomistix.com>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
>
> I think vtkGraph looks very interesting
>
> 1) Will it be included in the next release and when would that be?
> 2) Does anyone have any example code?
>
>
> Best regards,
> Uffe Damgaard Pedersen
>
>
>
>
> ------------------------------
>
> Message: 20
> Date: Wed, 25 Oct 2006 11:18:08 +0100
> From: "Anja Ende" <anja.ende at googlemail.com>
> Subject: Re: [vtkusers] vtkPolyData to be used with vtkImageStencil.
> To: "Hendrik Belitz" <hendrik at darkon.info>
> Cc: VTK <vtkusers at vtk.org>
> Message-ID:
> 	<1f5d2b4f0610250318k7b3fdbb5j7c9cc4bb878591a9 at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hey Hendrik,
>
> Ya, I just managed to figure that out but I do not know how to set the 
> cell
> data.
>
> So, my code is as follows:
>
> float pts[4][3] = {{-55.7812, 9.375, 0.0},
>                 {-18.2812, 49.6875, 0.0},
>                 {21.0938, 14.0625, 0.0},
>                 {5.15625, -29.0625, 0.0}};
>
>              vtkFloatArray* pcoords = vtkFloatArray::New();
>              pcoords->SetNumberOfComponents(3);
>              pcoords->SetNumberOfTuples(4);
>              for (int i=0; i<4; i++)
>              {
>                  pcoords->SetTuple(i, pts[i]);
>              }
>              // Create vtkPoints and assign pcoords as the internal 
> data
> array.
>              vtkPoints* points = vtkPoints::New();
>              points->SetData(pcoords);
>              vtkPolyData* polydata = vtkPolyData::New();
>                polydata->SetPoints(points);
>
>             // Cell data.
>             vtkCellArray* strips = vtkCellArray::New();
>             strips->InsertNextCell(4);
>             strips->InsertCellPoint(0);
>             strips->InsertCellPoint(1);
>             strips->InsertCellPoint(2);
>             strips->InsertCellPoint(3);
>
>             polydata->SetStrips(strips);
>
>              vtkLinearExtrusionFilter* extrude =
> vtkLinearExtrusionFilter::New();
>              extrude->SetInput(polydata);
>              extrude->SetScaleFactor(1);
>              extrude->SetExtrusionTypeToNormalExtrusion();
>              extrude->SetVector(1, 0, 0);
>
>              vtkPolyDataToImageStencil* dataToStencil =
> vtkPolyDataToImageStencil::New();
>              dataToStencil->SetInput(extrude->GetOutput());
>
>              vtkImageStencil* stencil = vtkImageStencil::New();
>              stencil->SetInput(m_viewer->GetOutput());
>              stencil->SetStencil(dataToStencil->GetOutput());
>              stencil->ReverseStencilOff();
>              stencil->SetBackgroundValue(128);
>
>              stencil->Update();
>
> Now, the output from the stencil is basically the original image. So,
> nothing seems to be getting done :(
>
>>>  image voxels corresponding to your point cloud directly in the image 
>>> data
> array.
>
> This could be an option. I have to figure out how I can access the
> underlying image data, make a copy and manipulate it myself.
>
> Cheers,
> Anja
>
> On 25/10/06, Hendrik Belitz <hendrik at darkon.info> wrote:
>>
>>  Hi Anja,
>>
>>  sorry for contacting you directly, but I only have read-only access 
>> to the
>>  vtk list from my office computer. I assume your stencil operation 
>> fails
>>  because your PolyData is lacking cell data which is AFAIK needed to 
>> build
>>  the stencil. I'm not absolutely sure what to do here, maybe the best 
>> way is
>>  not to use PolyDataToImageStencil at all, but to set the image voxels
>>  corresponding to your point cloud directly in the image data array.
>>
>>  Regards
>>   Hendrik
>>
>>   Hi everyone,
>>
>>  I had asked this question a while back but did not get much response. 
>> I
>>  hope I have better luck this time.
>>
>>  I am trying to create a vtkPolyData object that can be used with
>>  vtkPolyDataToImageStencil and vtkImageStencil. Basically, I want to 
>> extract
>>  a 2D region from my image.
>>
>>  I tried the following after looking at some of the test files:
>>
>>
>>  //----------------------------------------------------------------------------------
>>
>>               float pts[4][3] = {{-55.7812, 9.375, 0.0 },
>>                  {-18.2812, 49.6875, 0.0},
>>                  {21.0938, 14.0625, 0.0},
>>                  {5.15625, -29.0625, 0.0}};
>>
>>               vtkFloatArray* pcoords = vtkFloatArray::New();
>>               pcoords->SetNumberOfComponents(3);
>>               pcoords->SetNumberOfTuples(4);
>>               for (int i=0; i<4; i++)
>>               {
>>                   pcoords->SetTuple(i, pts[i]);
>>               }
>>               // Create vtkPoints and assign pcoords as the internal 
>> data
>>  array.
>>               vtkPoints* points = vtkPoints::New();
>>               points->SetData(pcoords);
>>               vtkPolyData* polydata = vtkPolyData::New();
>>               polydata->SetPoints(points);
>>
>>               vtkPolyDataToImageStencil* dataToStencil =
>>  vtkPolyDataToImageStencil::New();
>>               dataToStencil->SetInput(polydata);
>>
>>               vtkImageStencil* stencil = vtkImageStencil::New();
>>               stencil->SetInput(myviewer->GetOutput());
>>               stencil->SetStencil(dataToStencil->GetOutput());
>>               stencil->ReverseStencilOff();
>>               stencil->SetBackgroundValue(128);
>>
>>               stencil->Update();
>>
>>               stencil->Delete();
>>               dataToStencil->Delete();
>>               points->Delete();
>>               pcoords->Delete();
>>
>>
>>  //----------------------------------------------------------------------------
>>
>>  When I run this, it fails with the error: Can't build OBB tree- no 
>> data
>>  available.
>>
>>  I guess this is because of the way I have set up the vtkPolyData. Can
>>  someone tell me how to set it up so this primitive example is working.
>>
>>  Another question, for the vtkImageStencil to work, is it necessary 
>> that
>>  the input polydata is 'closed' or does it close the path by itself.
>>
>>  I hope someone can help me with this.
>>
>>  Best,
>>
>>  Anja
>>
>>
>>
>>  --
>>  program (pro'-gram) [n] A magic spell cast over a computer allowing
>>  it to turn one's input into error messages.
>>  tr.v. To engage in a pastime similar to banging one's head against a
>>  wall, but with fewer opportunities for reward.
>>
>
>
>
> --
> Cheers,
>
> Anja
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: 
> http://public.kitware.com/pipermail/vtkusers/attachments/20061025/cba429ed/attachment.html
>
> ------------------------------
>
> Message: 21
> Date: Wed, 25 Oct 2006 07:44:06 -0400
> From: "David Cole" <david.cole at kitware.com>
> Subject: Re: Re: [vtkusers] vtkVolumeShearWarpMapper problem in
> 	VTK-5.0.2
> To: "John Biddiscombe" <biddisco at cscs.ch>
> Cc: vtkusers at vtk.org, zhou13 at netscape.net
> Message-ID:
> 	<f435c2c50610250444r7ca3df1dt3c306ae9e028c79c at mail.gmail.com>
> Content-Type: text/plain; charset=GB2312; format=flowed
>
> The VolumeShearWarp classes were contributed but never polished off
> and made to conform to VTK's coding standards. They have been removed
> from the CVS HEAD revision of VTK and I will put it on my list to make
> sure we remove them from the VTK-5-0 branch also...
>
> David Cole
> Kitware, Inc.
>
> On 10/25/06, John Biddiscombe <biddisco at cscs.ch> wrote:
>>
>>  > I can't use vtkVolumeShearWarpMapper.
>>  It is not supported and should be removed. I would recommend the
>>  TextureMapper3D instead.
>>
>>  JB
>>
>>  >
>>  > LNK2019: ÎÞ·¨½âÎöµÄÍⲿ·ûºÅ 
>> "__declspec(dllimport) public: static
>>  > class vtkVolumeShearWarpMapper * __cdecl
>>  > vtkVolumeShearWarpMapper::New(void)"
>>  > (__imp_?New at vtkVolumeShearWarpMapper@@SAPAV1 at XZ) 
>> £¬¸Ã·ûºÅÔÚº¯Êý _main
>>  > Öб»ÒýÓÃ
>>  >
>>  > The VTK version is 5.0.2 and compiler is VS2003 (Simplified Chinese
>>  > Edition).
>>  >
>>  > Thanks.
>>  >
>>  >
>>  >
>>  >
>>  >
>>  > 
>> ------------------------------------------------------------------------
>>  > *Check Out the new free AIM(R) Mail*
>>  > 
>> <http://pr.atwola.com/promoclk/100122638x1081283466x1074645346/aol?redir=http%3A%2F%2Fwww%2Eaim%2Ecom%2Ffun%2Fmail%2F>
>>  > -- 2 GB of storage and industry-leading spam and email virus 
>> protection.
>>  > 
>> ------------------------------------------------------------------------
>>  >
>>  > _______________________________________________
>>  > This is the private VTK discussion list.
>>  > Please keep messages on-topic. Check the FAQ at: 
>> http://www.vtk.org/Wiki/VTK_FAQ
>>  > Follow this link to subscribe/unsubscribe:
>>  > http://www.vtk.org/mailman/listinfo/vtkusers
>>  >
>>
>>
>>  --
>>  John Biddiscombe,                            email:biddisco @ cscs.ch
>>  http://www.cscs.ch/about/BJohn.php
>>  CSCS, Swiss National Supercomputing Centre  | Tel:  +41 (91) 610.82.07
>>  Via Cantonale, 6928 Manno, Switzerland      | Fax:  +41 (91) 610.82.82
>>
>>
>>  _______________________________________________
>>  This is the private VTK discussion list.
>>  Please keep messages on-topic. Check the FAQ at: 
>> http://www.vtk.org/Wiki/VTK_FAQ
>>  Follow this link to subscribe/unsubscribe:
>>  http://www.vtk.org/mailman/listinfo/vtkusers
>>
>
> ------------------------------
>
> Message: 22
> Date: Wed, 25 Oct 2006 07:56:39 -0400
> From: "Dean Inglis" <dean.inglis at sympatico.ca>
> Subject: Re: [vtkusers] vtkPolyData to be used with vtkImageStencil.
> To: <vtkusers at vtk.org>
> Cc: anja.ende at googlemail.com
> Message-ID: <DOEOLLCBGDDLNHCJGILPOECJCBAA.dean.inglis at sympatico.ca>
> Content-Type: text/plain;	charset="iso-8859-1"
>
> Hi Anja,
>
> have a look at VTK/Examples/GUI/Tcl/ImageTracerWidget.tcl
>
> you need a closed polydata, and you need to extrude normal
> to the plane of your points, which is the x-y plane so the extrusion
> vector is 0,0,1.  Also, I would back up the z-coord of the
> x-y points by a small amount, say 0.5, then extrude by 1.
> You could then use vtkImageAccumulate to calculate the ROI
> histogram and basic image stats (min,max,mean,stdev).
>
> Dean
>
>
> So, my code is as follows:
>
> /************************************ back up behind the x-y plane a 
> wee bit
>   float zoffset =-0.5;
> /************************************
>
> float pts[4][3] = {{-55.7812, 9.375, zoffset},
>                 {-18.2812, 49.6875,zoffset},
>                 {21.0938, 14.0625, zoffset},
>                 {5.15625, -29.0625, zoffset}};
>
>              vtkFloatArray* pcoords = vtkFloatArray::New();
>              pcoords->SetNumberOfComponents(3);
>              pcoords->SetNumberOfTuples(4);
>              for (int i=0; i<4; i++)
>              {
>                  pcoords->SetTuple(i, pts[i]);
>              }
>              // Create vtkPoints and assign pcoords as the internal 
> data
> array.
>              vtkPoints* points = vtkPoints::New();
>              points->SetData(pcoords);
>              vtkPolyData* polydata = vtkPolyData::New();
>                polydata->SetPoints(points);
>
>             // Cell data.
>             vtkCellArray* strips = vtkCellArray::New();
>             strips->InsertNextCell(4);
>             strips->InsertCellPoint(0);
>             strips->InsertCellPoint(1);
>             strips->InsertCellPoint(2);
>             strips->InsertCellPoint(3);
>
> /********************************************** close the loop
>             strips->InsertCellPoint(0);
> /**********************************************
>
>             polydata->SetStrips(strips);
>
>              vtkLinearExtrusionFilter* extrude =
> vtkLinearExtrusionFilter::New();
>              extrude->SetInput(polydata);
>              extrude->SetScaleFactor(1);
>              extrude->SetExtrusionTypeToNormalExtrusion();
>
> /********************************************** k hat direction
>              extrude->SetVector(0, 0, 1);
> /**********************************************
>
>              vtkPolyDataToImageStencil* dataToStencil =
> vtkPolyDataToImageStencil::New();
>              dataToStencil->SetInput(extrude->GetOutput());
>
>              vtkImageStencil* stencil = vtkImageStencil::New();
>              stencil->SetInput(m_viewer->GetOutput());
>              stencil->SetStencil(dataToStencil->GetOutput());
>              stencil->ReverseStencilOff();
>              stencil->SetBackgroundValue(128);
>
>              stencil->Update();
>
> Now, the output from the stencil is basically the original image. So,
> nothing seems to be getting done :(
>
>
>
> ------------------------------
>
> Message: 23
> Date: Wed, 25 Oct 2006 07:59:51 -0400
> From: "Dean Inglis" <dean.inglis at sympatico.ca>
> Subject: Re: [vtkusers] vtkPolyData to be used with vtkImageStencil.
> To: <vtkusers at vtk.org>
> Cc: anja.ende at googlemail.com
> Message-ID: <DOEOLLCBGDDLNHCJGILPCECKCBAA.dean.inglis at sympatico.ca>
> Content-Type: text/plain;	charset="iso-8859-1"
>
> Anja,
>
> small addition: don't forget to change the expected number of cells:
>
>
>             // Cell data.
>             vtkCellArray* strips = vtkCellArray::New();
>
> /**********************************************
>             strips->InsertNextCell(5);
> /**********************************************
>
>             strips->InsertCellPoint(0);
>             strips->InsertCellPoint(1);
>             strips->InsertCellPoint(2);
>             strips->InsertCellPoint(3);
>
> /********************************************** close the loop
>             strips->InsertCellPoint(0);
> /**********************************************
>
> Dean
>
>
> ------------------------------
>
> Message: 24
> Date: Tue, 24 Oct 2006 19:22:30 +0200
> From: "Obada Mahdi" <omahdi at googlemail.com>
> Subject: Re: [vtkusers] Dynamically connected points
> To: "nelson -" <nelson1977 at gmail.com>
> Cc: vtkusers at vtk.org
> Message-ID:
> 	<737abb390610241022g3c4b893cl9585f1f357ea4d97 at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Hi Nelson!
>
> On 10/24/06, nelson - <nelson1977 at gmail.com> wrote:
>>  hi all,
>>    i'm coding an interactive geomertry program in python using VTK. I
>>  can't figure out how to make a Point that is dependant from the
>>  position of the other points. I can to explain myself by an example.
>>
>>  If i wanto conconstruct the middle point of two points in the space i
>>  have to build the middle point that change its position when i move
>>  the two points... can i make it in vtl. I see vtkAssembly but i don't
>>  understand if it is the right choice.
>
> If I understand your problem correctly, you want to construct a middle
> point from two other points that can be moved independently; in other
> words, have an object whose position is given implicitly by two other
> objects and some kind of operation.
>
> vtkAssembly is useful for compound geometry, i.e. objects consisting
> of multiple parts, organized in a hierarchical tree, that should be
> affected simultaneously by transformations.  It does not, however,
> provide a means to express and maintain object properties that are
> calculated from other data sources and a given operation.
>
> I guess there are two possible approaches to your problem--here are 
> some ideas:
> (1) Event-driven design: Monitor interactions that change positions
> and update the "middle point" accordingly.  I suppose this is what you
> already had in mind:
>
> On 10/19/06, nelson - <nelson1977 at gmail.com> wrote:
>>  I can do it implementing my own observer pattern like
>>  framework or there is something already esisting in VTK i can use?
>
> An observer like vtkCallbackCommand can be used to have a custom
> function called on an event like "InteractionEvent" or
> "EndInteractionEvent" for a given object, which can in turn
> re-calculate point positions.  If modifications are not only initiated
> by keyboard or mouse interaction but also programmatically, observing
> the less specific "Modified" event instead might help.
>
> The advantage of this approach is simplicity--the whole update logic
> is part of an event handler, and there is no need for affected objects
> (like vtkActor) to know about how their properties depend on other
> objects.
>
> (2) Demand-driven design: If you would rather like to have a more
> general way of expressing dependencies for calculated properties, as
> opposed to hard-coding the information flow into an event handler, you
> could create a custom subclass of e.g. vtkCoordinate that knows how to
> compute its position as "middle point" from other positions given upon
> initialization, maybe as instances of vtkCoordinate or vtkActor.  This
> custom class could then be used to maintain the calculated position,
> by checking its own modification time against the input when being
> accessed, and re-calculating theposition if needed.
>
> In order to automatically update an actor's position based on such a
> computed coordinate, one would either have to use a customized
> vtkActor that maintains its position as a vtkCoordinate-compatible
> class, or link them by observing the "Modified" event of the
> coordinate object.
>
> I apologize for not being more specific--I have not done something
> like this before, so this is all more of a wild guess, and the details
> of such an implementation largely depend on the specifics of your
> application.
>
>
> Hope it helps (and does not cause too much confusion :-)
>
> Obada
>
>
> ------------------------------
>
> Message: 25
> Date: Wed, 25 Oct 2006 14:14:08 +0100
> From: "Anja Ende" <anja.ende at googlemail.com>
> Subject: Re: [vtkusers] vtkPolyData to be used with vtkImageStencil.
> To: "Dean's business account" <dean.inglis at camris.ca>
> Cc: vtkusers at vtk.org
> Message-ID:
> 	<1f5d2b4f0610250614g569e8ff6m1a014b098abff831 at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Skipped content of type multipart/alternative-------------- next part 
> --------------
> A non-text attachment was scrubbed...
> Name: screen grab stencil output.png
> Type: image/png
> Size: 5549 bytes
> Desc: not available
> Url : 
> http://public.kitware.com/pipermail/vtkusers/attachments/20061025/d9c69025/screengrabstenciloutput-0001.png
>
> ------------------------------
>
> Message: 26
> Date: Wed, 25 Oct 2006 14:15:39 +0100
> From: "Anja Ende" <anja.ende at googlemail.com>
> Subject: Re: [vtkusers] vtkPolyData to be used with vtkImageStencil.
> To: "Dean's business account" <dean.inglis at camris.ca>
> Cc: vtkusers at vtk.org
> Message-ID:
> 	<1f5d2b4f0610250615g41b59122k67d2d0c7d4f89466 at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Another question that I wanted to ask is why do we set the z offset?
> Clearly, this is needed as the output is completely different... But 
> what
> does it actually do?
>
> Thanks,
> Anja
>
> On 25/10/06, Anja Ende <anja.ende at googlemail.com> wrote:
>>
>>  Hi Dean,
>>
>>  Thanks for the reply and code fragmant. This really helps!
>>
>>  Your suggestiosn were completely on the money (as usual!). It was the
>>  problem with not closing the loop and the extrusion vector just being 
>> copied
>>  and pasted from example code without bothering to understand what it 
>> meant!
>>
>>  However, there seems to be a problem with the stencil output:
>>
>>  The points I have chosen are:
>>
>>  float pts[4][3] = {{-55.7812, 9.375, -0.5},
>>                  {-18.2812, 49.6875, -0.5},
>>                  { 21.0938, 14.0625, -0.5},
>>                  {-55.7812, 9.375, -0.5}};
>>
>>  which should form a triangle.
>>
>>  However, the output looks very weird. The triangle is too small and 
>> very
>>  jagged. Also, the dimensions of the triangle seem wrong. There is a
>>  screenshot attached with this message. Please mail me if you cannot 
>> see it
>>  on the website and I will send you the screenshot immediately.
>>
>>  Also, here is the latest code now:
>>
>>  float pts[4][3] = {{-55.7812, 9.375, -0.5},
>>                  {-18.2812, 49.6875, -0.5},
>>                  {21.0938, 14.0625, -0.5},
>>                  {-55.7812, 9.375, - 0.5}};
>>
>>  vtkFloatArray* pcoords = vtkFloatArray::New();
>>  pcoords->SetNumberOfComponents(3);
>>  pcoords->SetNumberOfTuples(4);
>>  for (int i=0; i<4; i++)
>>  {
>>       pcoords->SetTuple(i, pts[i]);
>>  }
>>  // Create vtkPoints and assign pcoords as the internal data array.
>>  vtkPoints* points = vtkPoints::New();
>>  points->SetData(pcoords);
>>  vtkPolyData* polydata = vtkPolyData::New();
>>  polydata->SetPoints(points);
>>
>>
>>   vtkCellArray* strips = vtkCellArray::New();
>>   strips->InsertNextCell(4);
>>   strips->InsertCellPoint(0);
>>   strips->InsertCellPoint(1);
>>   strips->InsertCellPoint(2);
>>   strips->InsertCellPoint(3); // same coordinates as the first one..
>>
>>  polydata->SetStrips(strips);
>>
>>  vtkLinearExtrusionFilter* extrude = vtkLinearExtrusionFilter::New();
>>  extrude->SetInput(polydata);
>>  extrude->SetScaleFactor(1);
>>  extrude->SetExtrusionTypeToNormalExtrusion();
>>  extrude->SetVector(0, 0, 1);
>>
>>  vtkPolyDataToImageStencil* dataToStencil =
>>  vtkPolyDataToImageStencil::New();
>>  dataToStencil->SetInput(extrude->GetOutput());
>>
>>  vtkImageStencil* stencil = vtkImageStencil::New();
>>  stencil->SetInput(m_viewer->GetOutput());
>>  stencil->SetStencil(dataToStencil->GetOutput());
>>  stencil->ReverseStencilOn();
>>  stencil->SetBackgroundValue(0);
>>
>>  stencil->Update();
>>
>>  Also, when I add more points, so instead of a triangle have a
>>  quadrilateral. I see a triangle shape being stencilled and the 
>> outside the
>>  loop some lines through the image... but they are completely outside 
>> the
>>  loop. However, I can see that the shape is completely closed....
>>
>>  Thanks for all the help!
>>
>>  Anja
>>
>>
>
>
> --
> Cheers,
>
> Anja
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: 
> http://public.kitware.com/pipermail/vtkusers/attachments/20061025/4c005db9/attachment-0001.htm
>
> ------------------------------
>
> Message: 27
> Date: Wed, 25 Oct 2006 09:42:18 -0400
> From: "Dean Inglis" <dean.inglis at camris.ca>
> Subject: RE: [vtkusers] vtkPolyData to be used with vtkImageStencil.
> To: "Anja Ende" <anja.ende at googlemail.com>
> Cc: vtkusers at vtk.org
> Message-ID: <FBEIKIAGJCCFIBIPBIGMGEOCCGAA.dean.inglis at camris.ca>
> Content-Type: text/plain;	charset="iso-8859-1"
>
> Anja,
>
> sorry, I didn't look closely at your points: I thought
> they formed a square/rectangle.  So the code for vtkCellArray
> really should be as you show below.  The z offset is
> necessary for the vtkPolyDataToImageStencil to work:
> it does not work with polylines, but needs surfaces,
> so the extrusion makes a "ribbon".  If you pass the polyData
> output of the extrusion filter to a vtkPolyDataMapper/vtkActor
> and visualize it you will see what I mean.  This will also
> help with unserstanding possible errors: make sure your image
> actor can be manipulated with a interactorStyleTrackballCamera
> and not interactorStyleImage.  Also, I would change the background 
> color
> of your renerwindow to something other than black. If your 2D (?) image
> has z-thickness, you may have to change the z offset and
> extrusion scale.  Also, if the triangle is too acute relative
> to the pixel dimensions, or if your closed polydata loops back on
> itself or has "knots", you can get erroneous results.
>
> Dean
>
>
> -----Original Message-----
> From: Anja Ende [mailto:anja.ende at googlemail.com]
> Sent: Wednesday, October 25, 2006 9:16 AM
> To: Dean's business account
> Cc: vtkusers at vtk.org
> Subject: Re: [vtkusers] vtkPolyData to be used with vtkImageStencil.
>
>
> Another question that I wanted to ask is why do we set the z offset?
> Clearly, this is needed as the output is completely different... But 
> what
> does it actually do?
>
> Thanks,
> Anja
>
>
> On 25/10/06, Anja Ende <anja.ende at googlemail.com> wrote:
> Hi Dean,
>
> Thanks for the reply and code fragmant. This really helps!
>
> Your suggestiosn were completely on the money (as usual!). It was the
> problem with not closing the loop and the extrusion vector just being 
> copied
> and pasted from example code without bothering to understand what it 
> meant!
>
> However, there seems to be a problem with the stencil output:
>
> The points I have chosen are:
>
> float pts[4][3] = {{-55.7812, 9.375, -0.5},
>                 {-18.2812, 49.6875, -0.5},
>                 { 21.0938, 14.0625, -0.5},
>                 {-55.7812, 9.375, -0.5}};
>
> which should form a triangle.
>
> However, the output looks very weird. The triangle is too small and 
> very
> jagged. Also, the dimensions of the triangle seem wrong. There is a
> screenshot attached with this message. Please mail me if you cannot see 
> it
> on the website and I will send you the screenshot immediately.
>
> Also, here is the latest code now:
>
> float pts[4][3] = {{-55.7812, 9.375, -0.5},
>                 {-18.2812, 49.6875, -0.5},
>                 {21.0938, 14.0625, -0.5},
>                 {-55.7812, 9.375 , - 0.5}};
>
> vtkFloatArray* pcoords = vtkFloatArray::New();
> pcoords->SetNumberOfComponents(3);
> pcoords->SetNumberOfTuples(4);
> for (int i=0; i<4; i++)
> {
>      pcoords->SetTuple(i, pts[i]);
> }
> // Create vtkPoints and assign pcoords as the internal data array.
> vtkPoints* points = vtkPoints::New();
> points->SetData(pcoords);
> vtkPolyData* polydata = vtkPolyData::New();
> polydata->SetPoints(points);
>
>
>  vtkCellArray* strips = vtkCellArray::New();
>  strips->InsertNextCell(4);
>  strips->InsertCellPoint(0);
>  strips->InsertCellPoint(1);
>  strips->InsertCellPoint(2);
>  strips->InsertCellPoint(3); // same coordinates as the first one..
>
> polydata->SetStrips(strips);
>
> vtkLinearExtrusionFilter* extrude = vtkLinearExtrusionFilter::New();
> extrude->SetInput(polydata);
> extrude->SetScaleFactor(1);
> extrude->SetExtrusionTypeToNormalExtrusion();
> extrude->SetVector(0, 0, 1);
>
> vtkPolyDataToImageStencil* dataToStencil = 
> vtkPolyDataToImageStencil::New();
> dataToStencil->SetInput(extrude->GetOutput());
>
> vtkImageStencil* stencil = vtkImageStencil::New();
> stencil->SetInput(m_viewer->GetOutput());
> stencil->SetStencil(dataToStencil->GetOutput());
> stencil->ReverseStencilOn();
> stencil->SetBackgroundValue(0);
>
> stencil->Update();
>
> Also, when I add more points, so instead of a triangle have a 
> quadrilateral.
> I see a triangle shape being stencilled and the outside the loop some 
> lines
> through the image... but they are completely outside the loop. However, 
> I
> can see that the shape is completely closed....
>
> Thanks for all the help!
>
> Anja
>
>
>
>
>
> --
> Cheers,
>
> Anja
>
>
> ------------------------------
>
> Message: 28
> Date: Wed, 25 Oct 2006 14:53:36 +0100
> From: "Anja Ende" <anja.ende at googlemail.com>
> Subject: Re: [vtkusers] vtkPolyData to be used with vtkImageStencil.
> To: "Dean Inglis" <dean.inglis at camris.ca>
> Cc: vtkusers at vtk.org
> Message-ID:
> 	<1f5d2b4f0610250653i71e96d1duf7441c1d76be4101 at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hi,
>
> Thanks. Ya, I will try to visualize this. Hopefully this will provide 
> some
> clues.
>
> There is something very weird going on... For simple triangle data, the
> lines seem to become parallel.... and I am getting a really screwy 
> stenciled
> shape. I will look into it and try to figure it out. Will keep the list
> updated.
>
> Cheers and thanks again,
> Anja
>
> On 25/10/06, Dean Inglis <dean.inglis at camris.ca> wrote:
>>
>>  Anja,
>>
>>  sorry, I didn't look closely at your points: I thought
>>  they formed a square/rectangle.  So the code for vtkCellArray
>>  really should be as you show below.  The z offset is
>>  necessary for the vtkPolyDataToImageStencil to work:
>>  it does not work with polylines, but needs surfaces,
>>  so the extrusion makes a "ribbon".  If you pass the polyData
>>  output of the extrusion filter to a vtkPolyDataMapper/vtkActor
>>  and visualize it you will see what I mean.  This will also
>>  help with unserstanding possible errors: make sure your image
>>  actor can be manipulated with a interactorStyleTrackballCamera
>>  and not interactorStyleImage.  Also, I would change the background 
>> color
>>  of your renerwindow to something other than black. If your 2D (?) 
>> image
>>  has z-thickness, you may have to change the z offset and
>>  extrusion scale.  Also, if the triangle is too acute relative
>>  to the pixel dimensions, or if your closed polydata loops back on
>>  itself or has "knots", you can get erroneous results.
>>
>>  Dean
>>
>>
>>  -----Original Message-----
>>  From: Anja Ende [mailto:anja.ende at googlemail.com]
>>  Sent: Wednesday, October 25, 2006 9:16 AM
>>  To: Dean's business account
>>  Cc: vtkusers at vtk.org
>>  Subject: Re: [vtkusers] vtkPolyData to be used with vtkImageStencil.
>>
>>
>>  Another question that I wanted to ask is why do we set the z offset?
>>  Clearly, this is needed as the output is completely different... But 
>> what
>>  does it actually do?
>>
>>  Thanks,
>>  Anja
>>
>>
>>  On 25/10/06, Anja Ende <anja.ende at googlemail.com> wrote:
>>  Hi Dean,
>>
>>  Thanks for the reply and code fragmant. This really helps!
>>
>>  Your suggestiosn were completely on the money (as usual!). It was the
>>  problem with not closing the loop and the extrusion vector just being
>>  copied
>>  and pasted from example code without bothering to understand what it
>>  meant!
>>
>>  However, there seems to be a problem with the stencil output:
>>
>>  The points I have chosen are:
>>
>>  float pts[4][3] = {{-55.7812, 9.375, -0.5},
>>                  {-18.2812, 49.6875, -0.5},
>>                  { 21.0938, 14.0625, -0.5},
>>                  {-55.7812, 9.375, -0.5}};
>>
>>  which should form a triangle.
>>
>>  However, the output looks very weird. The triangle is too small and 
>> very
>>  jagged. Also, the dimensions of the triangle seem wrong. There is a
>>  screenshot attached with this message. Please mail me if you cannot 
>> see it
>>  on the website and I will send you the screenshot immediately.
>>
>>  Also, here is the latest code now:
>>
>>  float pts[4][3] = {{-55.7812, 9.375, -0.5},
>>                  {-18.2812, 49.6875, -0.5},
>>                  {21.0938, 14.0625, -0.5},
>>                  {-55.7812, 9.375 , - 0.5}};
>>
>>  vtkFloatArray* pcoords = vtkFloatArray::New();
>>  pcoords->SetNumberOfComponents(3);
>>  pcoords->SetNumberOfTuples(4);
>>  for (int i=0; i<4; i++)
>>  {
>>       pcoords->SetTuple(i, pts[i]);
>>  }
>>  // Create vtkPoints and assign pcoords as the internal data array.
>>  vtkPoints* points = vtkPoints::New();
>>  points->SetData(pcoords);
>>  vtkPolyData* polydata = vtkPolyData::New();
>>  polydata->SetPoints(points);
>>
>>
>>  vtkCellArray* strips = vtkCellArray::New();
>>  strips->InsertNextCell(4);
>>  strips->InsertCellPoint(0);
>>  strips->InsertCellPoint(1);
>>  strips->InsertCellPoint(2);
>>  strips->InsertCellPoint(3); // same coordinates as the first one..
>>
>>  polydata->SetStrips(strips);
>>
>>  vtkLinearExtrusionFilter* extrude = vtkLinearExtrusionFilter::New();
>>  extrude->SetInput(polydata);
>>  extrude->SetScaleFactor(1);
>>  extrude->SetExtrusionTypeToNormalExtrusion();
>>  extrude->SetVector(0, 0, 1);
>>
>>  vtkPolyDataToImageStencil* dataToStencil =
>>  vtkPolyDataToImageStencil::New();
>>  dataToStencil->SetInput(extrude->GetOutput());
>>
>>  vtkImageStencil* stencil = vtkImageStencil::New();
>>  stencil->SetInput(m_viewer->GetOutput());
>>  stencil->SetStencil(dataToStencil->GetOutput());
>>  stencil->ReverseStencilOn();
>>  stencil->SetBackgroundValue(0);
>>
>>  stencil->Update();
>>
>>  Also, when I add more points, so instead of a triangle have a
>>  quadrilateral.
>>  I see a triangle shape being stencilled and the outside the loop some
>>  lines
>>  through the image... but they are completely outside the loop. 
>> However, I
>>  can see that the shape is completely closed....
>>
>>  Thanks for all the help!
>>
>>  Anja
>>
>>
>>
>>
>>
>>  --
>>  Cheers,
>>
>>  Anja
>>
>
>
>
> --
> Cheers,
>
> Anja
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: 
> http://public.kitware.com/pipermail/vtkusers/attachments/20061025/de957d0d/attachment-0001.html
>
> ------------------------------
>
> Message: 29
> Date: Wed, 25 Oct 2006 15:11:37 +0100
> From: "Anja Ende" <anja.ende at googlemail.com>
> Subject: Re: [vtkusers] vtkPolyData to be used with vtkImageStencil.
> To: "Dean Inglis" <dean.inglis at camris.ca>
> Cc: vtkusers at vtk.org
> Message-ID:
> 	<1f5d2b4f0610250711v388924nd682492989aebf72 at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Skipped content of type multipart/alternative-------------- next part 
> --------------
> A non-text attachment was scrubbed...
> Name: Screen shot without closed loop.png
> Type: image/png
> Size: 9719 bytes
> Desc: not available
> Url : 
> http://public.kitware.com/pipermail/vtkusers/attachments/20061025/36fb186b/Screenshotwithoutclosedloop-0001.png
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: Screen shot with closed loop.png
> Type: image/png
> Size: 7982 bytes
> Desc: not available
> Url : 
> http://public.kitware.com/pipermail/vtkusers/attachments/20061025/36fb186b/Screenshotwithclosedloop-0001.png
>
> ------------------------------
>
> Message: 30
> Date: Wed, 25 Oct 2006 10:37:05 -0400
> From: "Dean Inglis" <dean.inglis at camris.ca>
> Subject: RE: [vtkusers] vtkPolyData to be used with vtkImageStencil.
> To: "Anja Ende" <anja.ende at googlemail.com>
> Cc: vtkusers at vtk.org
> Message-ID: <FBEIKIAGJCCFIBIPBIGMIEODCGAA.dean.inglis at camris.ca>
> Content-Type: text/plain;	charset="iso-8859-1"
>
> Yes, you have 3 tuples but you set pcoords to have
> 4, so vtkPoints might think you have an extra point
> (undefined or 0,0,0).  A useful filter to use is
> vtkIdFilter and vtkLabeledDataFilter to visualize
> exactly what point id's make up your polydata.
>
> Dean
>
> -----Original Message-----
> From: Anja Ende [mailto:anja.ende at googlemail.com]
> Sent: Wednesday, October 25, 2006 10:12 AM
> To: Dean Inglis
> Cc: vtkusers at vtk.org
> Subject: Re: [vtkusers] vtkPolyData to be used with vtkImageStencil.
>
>
> Ok, another step closer.
>
> First off, something very bizarre happens when I close the loop in the 
> input
> points.
>
> So, the first time off, I tried without closing the loop as follows:
>
> float pts[3][3] = {{-49.2188 , -19.6875, zOffset},
>                 {42.6542, 58.125, zOffset},
>                 {57.6562, -0.9375, zOffset},
>
> vtkFloatArray* pcoords = vtkFloatArray::New();
> pcoords->SetNumberOfComponents(3);
> pcoords->SetNumberOfTuples(4);
> for (int i=0; i<3; i++)
> {
>       pcoords->SetTuple(i, pts[i]);
> }
> // Create vtkPoints and assign pcoords as the internal data array.
>   vtkPoints* points = vtkPoints::New();
>   points->SetData(pcoords);
>   vtkPolyData* polydata = vtkPolyData::New();
>   polydata->SetPoints(points);
>
>
>  vtkCellArray* strips = vtkCellArray::New();
>  strips->InsertNextCell(3);
>  strips->InsertCellPoint(0);
>  strips->InsertCellPoint(1);
>  strips->InsertCellPoint(2);
>
> polydata->SetStrips(strips);
>
> I am attaching a screenshot here that displays what happens. At least 
> the
> triangle part looks ok!
>
> Now, when I close the loop, the output goes completely bonkers!
>
> Here is a screenshot of the output with the same points when the loop 
> is
> closed.
>
> As you can see from the points, it is a simple triable with no cross 
> overs
> or anything but it seems to mess up the shape completely...
>
> Any idea what is happening here?
>
> Cheers,
> Anja
>
>
> ------------------------------
>
> _______________________________________________
> vtkusers mailing list
> vtkusers at vtk.org
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
> End of vtkusers Digest, Vol 30, Issue 29
> ****************************************
St


More information about the vtkusers mailing list