[vtkusers] How to implement corsshair!

蔡广杰 caigis at 163.com
Mon Sep 7 09:56:03 EDT 2009


 Hi All,I am a new vtker,I want to implement corsshair like in slicer3.Anyone who can help me !thanks!



在2009-09-07,vtkusers-request at vtk.org 写道:
>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: vtkSpline (Ho Ngoc Ha)
>   2. Re: vtkSpline (Bill Lorensen)
>   3. Re: vtkSpline (Kenneth Sloan)
>   4. Re: vtkSpline (Ho Ngoc Ha)
>   5. Re: vtkSpline (Bill Lorensen)
>   6. Re: no VTK binary (Bill Lorensen)
>   7. vtkCaptionWidget (Helvin Lui)
>   8. Re: vtkCaptionWidget (Karthik Krishnan)
>   9. Re: vtkCaptionWidget (Helvin Lui)
>  10. How to implement that (Ali Habib)
>
>
>----------------------------------------------------------------------
>
>Message: 1
>Date: Sat, 5 Sep 2009 09:03:01 -0700 (PDT)
>From: Ho Ngoc Ha <ha_lennon at yahoo.com>
>Subject: Re: [vtkusers] vtkSpline
>To: Bill Lorensen <bill.lorensen at gmail.com>
>Cc: vtkusers at vtk.org
>Message-ID: <885185.23211.qm at web52311.mail.re2.yahoo.com>
>Content-Type: text/plain; charset="iso-8859-1"
>
>Hi, these are the result
>t: 0
>t: 0.42105
>t: 0.84210
>t: 1.26316
>t: 1.68421
>t: 2.10526
>t: 2.52632
>t: 2.94737
>t: 3.36842
>t: 3.78947
>t: 4.21053
>t: 4.63158
>t: 5.05263
>t: 5.47368
>t: 5.89474
>t: 6.31579
>t: 6.73684
>t: 7.15789
>t: 7.57895
>t: 8
>
>i don't know what's wrong with it. Please help me :(
>
>--- On Sat, 9/5/09, Bill Lorensen <bill.lorensen at gmail.com> wrote:
>
>From: Bill Lorensen <bill.lorensen at gmail.com>
>Subject: Re: [vtkusers] vtkSpline
>To: "Ho Ngoc Ha" <ha_lennon at yahoo.com>
>Cc: vtkusers at vtk.org
>Date: Saturday, September 5, 2009, 7:17 PM
>
>Your code look OK. What is the resulting output of the std::cout <<
>"t: " << t << std::endl;
>
>Bill
>
>On Sat, Sep 5, 2009 at 1:45 AM, Ho Ngoc Ha<ha_lennon at yahoo.com> wrote:
>> Hi,
>>
>> I have a set of points, I just need to find a spline that pass through all
>> of those points and generate a number of output points.
>>
>> Here is what I did
>>
>> int numberOfInputPoints = points->GetNumberOfPoints();
>>
>> ? ? vtkCardinalSpline* aSplineX;
>> ? ? vtkCardinalSpline* aSplineY;
>> ? ? vtkCardinalSpline* aSplineZ;
>>
>> ? ? aSplineX = vtkCardinalSpline::New();
>> ? ? aSplineY = vtkCardinalSpline::New();
>> ? ? aSplineZ = vtkCardinalSpline::New();
>>
>> ? ? for (int i=0; i<numberOfInputPoints; i++)
>> ??? {
>> ??? ? double x = points->GetPoint(i)[0];
>> ??? ? double y = points->GetPoint(i)[1];
>> ??? ? double z = points->GetPoint(i)[2];
>> ? ? ? ? ? aSplineX->AddPoint(i, x);
>> ? ? ? ? ? aSplineY->AddPoint(i, y);
>> ? ? ? ? ? aSplineZ->AddPoint(i, z);
>>
>> ??? }
>>
>> ??? vtkPoints* polypoints = vtkPoints::New();
>>
>>
>> ??? int numberOfOutputPoints = 20;
>>
>> ? ? ???double t;
>> ? ? ???for (int i=0; i<numberOfOutputPoints; i++)
>> ??? {
>> ? ? ? t
>> =(double)(numberOfInputPoints-1)/(double)(numberOfOutputPoints-1)*(double)i;
>> ??? ? std::cout << "t: " << t << std::endl;
>> ? ? ? polypoints->InsertNextPoint(aSplineX->Evaluate(t),
>> aSplineY->Evaluate(t),
>> ? ? ? ? ? ? ? ? ? ? ???aSplineZ->Evaluate(t));
>> ? ? }
>>
>>
>> I thought the newly generated points will be stored in polypoints? But when
>> I checked it, it only contains the first and the last point of my input
>> points.
>>
>> I am new to vtk so please help me. Thank you very much
>>
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the VTK FAQ at:
>> http://www.vtk.org/Wiki/VTK_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtkusers
>>
>>
>
>
>
>      
>-------------- next part --------------
>An HTML attachment was scrubbed...
>URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20090905/947458a4/attachment-0001.htm>
>
>------------------------------
>
>Message: 2
>Date: Sat, 5 Sep 2009 12:52:05 -0400
>From: Bill Lorensen <bill.lorensen at gmail.com>
>Subject: Re: [vtkusers] vtkSpline
>To: Ho Ngoc Ha <ha_lennon at yahoo.com>
>Cc: vtkusers at vtk.org
>Message-ID:
>	<4db4735c0909050952v423be411u4024afb39ae1d1d9 at mail.gmail.com>
>Content-Type: text/plain; charset=ISO-8859-1
>
>Please print:
>std::cout << "x: " << aSplineX->Evaluate(t) << ", y:  " <<
>aSplineY->Evaluate(t) << ", z: " << aSplineZ->Evaluate(t) <<
>std::endl;
>
>
>On Sat, Sep 5, 2009 at 12:03 PM, Ho Ngoc Ha<ha_lennon at yahoo.com> wrote:
>> Hi, these are the result
>> t: 0
>> t: 0.42105
>> t: 0.84210
>> t: 1.26316
>> t: 1.68421
>> t: 2.10526
>> t: 2.52632
>> t: 2.94737
>> t: 3.36842
>> t: 3.78947
>> t: 4.21053
>> t: 4.63158
>> t: 5.05263
>> t: 5.47368
>> t: 5.89474
>> t: 6.31579
>> t: 6.73684
>> t: 7.15789
>> t: 7.57895
>> t: 8
>>
>> i don't know what's wrong with it. Please help me :(
>>
>> --- On Sat, 9/5/09, Bill Lorensen <bill.lorensen at gmail.com> wrote:
>>
>> From: Bill Lorensen <bill.lorensen at gmail.com>
>> Subject: Re: [vtkusers] vtkSpline
>> To: "Ho Ngoc Ha" <ha_lennon at yahoo.com>
>> Cc: vtkusers at vtk.org
>> Date: Saturday, September 5, 2009, 7:17 PM
>>
>> Your code look OK. What is the resulting output of the std::cout <<
>> "t: " << t << std::endl;
>>
>> Bill
>>
>> On Sat, Sep 5, 2009 at 1:45 AM, Ho Ngoc Ha<ha_lennon at yahoo.com> wrote:
>>> Hi,
>>>
>>> I have a set of points, I just need to find a spline that pass through all
>>> of those points and generate a number of output points.
>>>
>>> Here is what I did
>>>
>>> int numberOfInputPoints = points->GetNumberOfPoints();
>>>
>>> ? ? vtkCardinalSpline* aSplineX;
>>> ? ? vtkCardinalSpline* aSplineY;
>>> ? ? vtkCardinalSpline* aSplineZ;
>>>
>>> ? ? aSplineX = vtkCardinalSpline::New();
>>> ? ? aSplineY = vtkCardinalSpline::New();
>>> ? ? aSplineZ = vtkCardinalSpline::New();
>>>
>>> ? ? for (int i=0; i<numberOfInputPoints; i++)
>>> ??? {
>>> ??? ? double x = points->GetPoint(i)[0];
>>> ??? ? double y = points->GetPoint(i)[1];
>>> ??? ? double z = points->GetPoint(i)[2];
>>> ? ? ? ? ? aSplineX->AddPoint(i, x);
>>> ? ? ? ? ? aSplineY->AddPoint(i, y);
>>> ? ? ? ? ? aSplineZ->AddPoint(i, z);
>>>
>>> ??? }
>>>
>>> ??? vtkPoints* polypoints = vtkPoints::New();
>>>
>>>
>>> ??? int numberOfOutputPoints = 20;
>>>
>>> ? ? ???double t;
>>> ? ? ???for (int i=0; i<numberOfOutputPoints; i++)
>>> ??? {
>>> ? ? ? t
>>>
>>> =(double)(numberOfInputPoints-1)/(double)(numberOfOutputPoints-1)*(double)i;
>>> ??? ? std::cout << "t: " << t << std::endl;
>>> ? ? ? polypoints->InsertNextPoint(aSplineX->Evaluate(t),
>>> aSplineY->Evaluate(t),
>>> ? ? ? ? ? ? ? ? ? ? ???aSplineZ->Evaluate(t));
>>> ? ? }
>>>
>>>
>>> I thought the newly generated points will be stored in polypoints? But
>>> when
>>> I checked it, it only contains the first and the last point of my input
>>> points.
>>>
>>> I am new to vtk so please help me. Thank you very much
>>>
>>> _______________________________________________
>>> Powered by www.kitware.com
>>>
>>> Visit other Kitware open-source projects at
>>> http://www.kitware.com/opensource/opensource.html
>>>
>>> Please keep messages on-topic and check the VTK FAQ at:
>>> http://www.vtk.org/Wiki/VTK_FAQ
>>>
>>> Follow this link to subscribe/unsubscribe:
>>> http://www.vtk.org/mailman/listinfo/vtkusers
>>>
>>>
>>
>>
>
>
>------------------------------
>
>Message: 3
>Date: Sat, 5 Sep 2009 11:29:40 -0500
>From: Kenneth Sloan <kennethrsloan at gmail.com>
>Subject: Re: [vtkusers] vtkSpline
>To: vtkusers <vtkusers at vtk.org>
>Message-ID: <9F99B77F-7302-4A4D-8CB9-CF4C9315ADEF at gmail.com>
>Content-Type: text/plain; charset="us-ascii"; Format="flowed";
>	DelSp="yes"
>
>May I suggest that it would be helpful to add a section of code that  
>*interrogates* the final "polypoints" and shows us why you think
>that it includes only the first and last points.
>
>
>On Sep 5, 2009, at 11:03 , Ho Ngoc Ha wrote:
>
>> Hi, these are the result
>> t: 0
>> t: 0.42105
>> t: 0.84210
>> t: 1.26316
>> t: 1.68421
>> t: 2.10526
>> t: 2.52632
>> t: 2.94737
>> t: 3.36842
>> t: 3.78947
>> t: 4.21053
>> t: 4.63158
>> t: 5.05263
>> t: 5.47368
>> t: 5.89474
>> t: 6.31579
>> t: 6.73684
>> t: 7.15789
>> t: 7.57895
>> t: 8
>>
>> i don't know what's wrong with it. Please help me :(
>>
>> --- On Sat, 9/5/09, Bill Lorensen <bill.lorensen at gmail.com> wrote:
>>
>> From: Bill Lorensen <bill.lorensen at gmail.com>
>> Subject: Re: [vtkusers] vtkSpline
>> To: "Ho Ngoc Ha" <ha_lennon at yahoo.com>
>> Cc: vtkusers at vtk.org
>> Date: Saturday, September 5, 2009, 7:17 PM
>>
>> Your code look OK. What is the resulting output of the std::cout <<
>> "t: " << t << std::endl;
>>
>> Bill
>>
>> On Sat, Sep 5, 2009 at 1:45 AM, Ho Ngoc Ha<ha_lennon at yahoo.com> wrote:
>> > Hi,
>> >
>> > I have a set of points, I just need to find a spline that pass  
>> through all
>> > of those points and generate a number of output points.
>> >
>> > Here is what I did
>> >
>> > int numberOfInputPoints = points->GetNumberOfPoints();
>> >
>> >     vtkCardinalSpline* aSplineX;
>> >     vtkCardinalSpline* aSplineY;
>> >     vtkCardinalSpline* aSplineZ;
>> >
>> >     aSplineX = vtkCardinalSpline::New();
>> >     aSplineY = vtkCardinalSpline::New();
>> >     aSplineZ = vtkCardinalSpline::New();
>> >
>> >     for (int i=0; i<numberOfInputPoints; i++)
>> >     {
>> >       double x = points->GetPoint(i)[0];
>> >       double y = points->GetPoint(i)[1];
>> >       double z = points->GetPoint(i)[2];
>> >           aSplineX->AddPoint(i, x);
>> >           aSplineY->AddPoint(i, y);
>> >           aSplineZ->AddPoint(i, z);
>> >
>> >     }
>> >
>> >     vtkPoints* polypoints = vtkPoints::New();
>> >
>> >
>> >     int numberOfOutputPoints = 20;
>> >
>> >        double t;
>> >        for (int i=0; i<numberOfOutputPoints; i++)
>> >     {
>> >       t
>> > =(double)(numberOfInputPoints-1)/(double)(numberOfOutputPoints-1)* 
>> (double)i;
>> >       std::cout << "t: " << t << std::endl;
>> >       polypoints->InsertNextPoint(aSplineX->Evaluate(t),
>> > aSplineY->Evaluate(t),
>> >                        aSplineZ->Evaluate(t));
>> >     }
>> >
>> >
>> > I thought the newly generated points will be stored in polypoints?  
>> But when
>> > I checked it, it only contains the first and the last point of my  
>> input
>> > points.
>> >
>> > I am new to vtk so please help me. Thank you very much
>> >
>> > _______________________________________________
>> > Powered by www.kitware.com
>> >
>> > Visit other Kitware open-source projects at
>> > http://www.kitware.com/opensource/opensource.html
>> >
>> > Please keep messages on-topic and check the VTK FAQ at:
>> > http://www.vtk.org/Wiki/VTK_FAQ
>> >
>> > Follow this link to subscribe/unsubscribe:
>> > http://www.vtk.org/mailman/listinfo/vtkusers
>> >
>> >
>>
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtkusers
>
>--
>Kenneth Sloan
>KennethRSloan at gmail.com
>
>
>
>
>-------------- next part --------------
>An HTML attachment was scrubbed...
>URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20090905/22fb68a2/attachment-0001.htm>
>
>------------------------------
>
>Message: 4
>Date: Sat, 5 Sep 2009 09:57:05 -0700 (PDT)
>From: Ho Ngoc Ha <ha_lennon at yahoo.com>
>Subject: Re: [vtkusers] vtkSpline
>To: Bill Lorensen <bill.lorensen at gmail.com>
>Cc: vtkusers at vtk.org
>Message-ID: <120921.52634.qm at web52310.mail.re2.yahoo.com>
>Content-Type: text/plain; charset="iso-8859-1"
>
>
>
>Hi, I picked another set of points and here are the results. Thanks a lot!
>
>t: 0
>x: 519.751, y:? 1513.14, z: 0
>
>t: 0.473684
>x: 519.726, y:? 1500.95, z: 0
>
>t: 0.947368
>x: 519.741, y:? 1475.55, z: 0
>
>t: 1.42105
>x: 519.87, y:? 1452.08, z: 0
>
>t: 1.89474
>x: 519.826, y:? 1436.93, z: 0
>
>t: 2.36842
>x: 519.203, y:? 1430.78, z: 0
>
>t: 2.84211
>x: 517.644, y:? 1413.63, z: 0
>
>t: 3.31579
>x: 515.1, y:? 1358.18, z: 0
>
>t: 3.78947
>x: 514.835, y:? 1267.1, z: 0
>
>t: 4.26316
>x: 521.848, y:? 1162.43, z: 0
>
>t: 4.73684
>x: 534.034, y:? 1066.13, z: 0
>
>t: 5.21053
>x: 543.353, y:? 999.33, z: 0
>
>t: 5.68421
>x: 548.978, y:? 967.812, z: 0
>
>t: 6.15789
>x: 558.516, y:? 959.351, z: 0
>
>t: 6.63158
>x: 572.076, y:? 943.877, z: 0
>
>t: 7.10526
>x: 577.448, y:? 865.487, z: 0
>
>t: 7.57895
>x: 568.835, y:? 714.475, z: 0
>
>t: 8.05263
>x: 556.11, y:? 582.674, z: 0
>
>t: 8.52632
>x: 548.223, y:? 536.911, z: 0
>
>t: 9
>x: 545.789, y:? 535.286, z: 0
>
>--- On Sat, 9/5/09, Bill Lorensen <bill.lorensen at gmail.com> wrote:
>
>From: Bill Lorensen <bill.lorensen at gmail.com>
>Subject: Re: [vtkusers] vtkSpline
>To: "Ho Ngoc Ha" <ha_lennon at yahoo.com>
>Cc: vtkusers at vtk.org
>Date: Saturday, September 5, 2009, 11:52 PM
>
>Please print:
>std::cout << "x: " << aSplineX->Evaluate(t) << ", y:? " <<
>aSplineY->Evaluate(t) << ", z: " << aSplineZ->Evaluate(t) <<
>std::endl;
>
>
>On Sat, Sep 5, 2009 at 12:03 PM, Ho Ngoc Ha<ha_lennon at yahoo.com> wrote:
>> Hi, these are the result
>> t: 0
>> t: 0.42105
>> t: 0.84210
>> t: 1.26316
>> t: 1.68421
>> t: 2.10526
>> t: 2.52632
>> t: 2.94737
>> t: 3.36842
>> t: 3.78947
>> t: 4.21053
>> t: 4.63158
>> t: 5.05263
>> t: 5.47368
>> t: 5.89474
>> t: 6.31579
>> t: 6.73684
>> t: 7.15789
>> t: 7.57895
>> t: 8
>>
>> i don't know what's wrong with it. Please help me :(
>>
>> --- On Sat, 9/5/09, Bill Lorensen <bill.lorensen at gmail.com> wrote:
>>
>> From: Bill Lorensen <bill.lorensen at gmail.com>
>> Subject: Re: [vtkusers] vtkSpline
>> To: "Ho Ngoc Ha" <ha_lennon at yahoo.com>
>> Cc: vtkusers at vtk.org
>> Date: Saturday, September 5, 2009, 7:17 PM
>>
>> Your code look OK. What is the resulting output of the std::cout <<
>> "t: " << t << std::endl;
>>
>> Bill
>>
>> On Sat, Sep 5, 2009 at 1:45 AM, Ho Ngoc Ha<ha_lennon at yahoo.com> wrote:
>>> Hi,
>>>
>>> I have a set of points, I just need to find a spline that pass through all
>>> of those points and generate a number of output points.
>>>
>>> Here is what I did
>>>
>>> int numberOfInputPoints = points->GetNumberOfPoints();
>>>
>>> ? ? vtkCardinalSpline* aSplineX;
>>> ? ? vtkCardinalSpline* aSplineY;
>>> ? ? vtkCardinalSpline* aSplineZ;
>>>
>>> ? ? aSplineX = vtkCardinalSpline::New();
>>> ? ? aSplineY = vtkCardinalSpline::New();
>>> ? ? aSplineZ = vtkCardinalSpline::New();
>>>
>>> ? ? for (int i=0; i<numberOfInputPoints; i++)
>>> ??? {
>>> ??? ? double x = points->GetPoint(i)[0];
>>> ??? ? double y = points->GetPoint(i)[1];
>>> ??? ? double z = points->GetPoint(i)[2];
>>> ? ? ? ? ? aSplineX->AddPoint(i, x);
>>> ? ? ? ? ? aSplineY->AddPoint(i, y);
>>> ? ? ? ? ? aSplineZ->AddPoint(i, z);
>>>
>>> ??? }
>>>
>>> ??? vtkPoints* polypoints = vtkPoints::New();
>>>
>>>
>>> ??? int numberOfOutputPoints = 20;
>>>
>>> ? ? ???double t;
>>> ? ? ???for (int i=0; i<numberOfOutputPoints; i++)
>>> ??? {
>>> ? ? ? t
>>>
>>> =(double)(numberOfInputPoints-1)/(double)(numberOfOutputPoints-1)*(double)i;
>>> ??? ? std::cout << "t: " << t << std::endl;
>>> ? ? ? polypoints->InsertNextPoint(aSplineX->Evaluate(t),
>>> aSplineY->Evaluate(t),
>>> ? ? ? ? ? ? ? ? ? ? ???aSplineZ->Evaluate(t));
>>> ? ? }
>>>
>>>
>>> I thought the newly generated points will be stored in polypoints? But
>>> when
>>> I checked it, it only contains the first and the last point of my input
>>> points.
>>>
>>> I am new to vtk so please help me. Thank you very much
>>>
>>> _______________________________________________
>>> Powered by www.kitware.com
>>>
>>> Visit other Kitware open-source projects at
>>> http://www.kitware.com/opensource/opensource.html
>>>
>>> Please keep messages on-topic and check the VTK FAQ at:
>>> http://www.vtk.org/Wiki/VTK_FAQ
>>>
>>> Follow this link to subscribe/unsubscribe:
>>> http://www.vtk.org/mailman/listinfo/vtkusers
>>>
>>>
>>
>>
>
>
>
>      
>-------------- next part --------------
>An HTML attachment was scrubbed...
>URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20090905/04ebe574/attachment-0001.htm>
>
>------------------------------
>
>Message: 5
>Date: Sat, 5 Sep 2009 13:39:08 -0400
>From: Bill Lorensen <bill.lorensen at gmail.com>
>Subject: Re: [vtkusers] vtkSpline
>To: Kenneth Sloan <kennethrsloan at gmail.com>
>Cc: vtkusers <vtkusers at vtk.org>
>Message-ID:
>	<4db4735c0909051039q3b0c8ab5t90d1dfd3e4225063 at mail.gmail.com>
>Content-Type: text/plain; charset=ISO-8859-1
>
>I agree with Ken. The interpolation looks good.
>
>Bill
>
>On Sat, Sep 5, 2009 at 12:29 PM, Kenneth Sloan<kennethrsloan at gmail.com> wrote:
>> May I suggest that it would be helpful to add a section of code that
>> *interrogates* the final "polypoints" and shows us why you think
>> that it includes only the first and last points.
>>
>> On Sep 5, 2009, at 11:03 , Ho Ngoc Ha wrote:
>>
>> Hi, these are the result
>> t: 0
>> t: 0.42105
>> t: 0.84210
>> t: 1.26316
>> t: 1.68421
>> t: 2.10526
>> t: 2.52632
>> t: 2.94737
>> t: 3.36842
>> t: 3.78947
>> t: 4.21053
>> t: 4.63158
>> t: 5.05263
>> t: 5.47368
>> t: 5.89474
>> t: 6.31579
>> t: 6.73684
>> t: 7.15789
>> t: 7.57895
>> t: 8
>>
>> i don't know what's wrong with it. Please help me :(
>>
>> --- On Sat, 9/5/09, Bill Lorensen <bill.lorensen at gmail.com> wrote:
>>
>> From: Bill Lorensen <bill.lorensen at gmail.com>
>> Subject: Re: [vtkusers] vtkSpline
>> To: "Ho Ngoc Ha" <ha_lennon at yahoo.com>
>> Cc: vtkusers at vtk.org
>> Date: Saturday, September 5, 2009, 7:17 PM
>>
>> Your code look OK. What is the resulting output of the std::cout <<
>> "t: " << t << std::endl;
>>
>> Bill
>>
>> On Sat, Sep 5, 2009 at 1:45 AM, Ho Ngoc Ha<ha_lennon at yahoo.com> wrote:
>>> Hi,
>>>
>>> I have a set of points, I just need to find a spline that pass through all
>>> of those points and generate a number of output points.
>>>
>>> Here is what I did
>>>
>>> int numberOfInputPoints = points->GetNumberOfPoints();
>>>
>>> ? ? vtkCardinalSpline* aSplineX;
>>> ? ? vtkCardinalSpline* aSplineY;
>>> ? ? vtkCardinalSpline* aSplineZ;
>>>
>>> ? ? aSplineX = vtkCardinalSpline::New();
>>> ? ? aSplineY = vtkCardinalSpline::New();
>>> ? ? aSplineZ = vtkCardinalSpline::New();
>>>
>>> ? ? for (int i=0; i<numberOfInputPoints; i++)
>>> ??? {
>>> ??? ? double x = points->GetPoint(i)[0];
>>> ??? ? double y = points->GetPoint(i)[1];
>>> ??? ? double z = points->GetPoint(i)[2];
>>> ? ? ? ? ? aSplineX->AddPoint(i, x);
>>> ? ? ? ? ? aSplineY->AddPoint(i, y);
>>> ? ? ? ? ? aSplineZ->AddPoint(i, z);
>>>
>>> ??? }
>>>
>>> ??? vtkPoints* polypoints = vtkPoints::New();
>>>
>>>
>>> ??? int numberOfOutputPoints = 20;
>>>
>>> ? ? ???double t;
>>> ? ? ???for (int i=0; i<numberOfOutputPoints; i++)
>>> ??? {
>>> ? ? ? t
>>>
>>> =(double)(numberOfInputPoints-1)/(double)(numberOfOutputPoints-1)*(double)i;
>>> ??? ? std::cout << "t: " << t << std::endl;
>>> ? ? ? polypoints->InsertNextPoint(aSplineX->Evaluate(t),
>>> aSplineY->Evaluate(t),
>>> ? ? ? ? ? ? ? ? ? ? ???aSplineZ->Evaluate(t));
>>> ? ? }
>>>
>>>
>>> I thought the newly generated points will be stored in polypoints? But
>>> when
>>> I checked it, it only contains the first and the last point of my input
>>> points.
>>>
>>> I am new to vtk so please help me. Thank you very much
>>>
>>> _______________________________________________
>>> Powered by www.kitware.com
>>>
>>> Visit other Kitware open-source projects at
>>> http://www.kitware.com/opensource/opensource.html
>>>
>>> Please keep messages on-topic and check the VTK FAQ at:
>>> http://www.vtk.org/Wiki/VTK_FAQ
>>>
>>> Follow this link to subscribe/unsubscribe:
>>> http://www.vtk.org/mailman/listinfo/vtkusers
>>>
>>>
>>
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the VTK FAQ at:
>> http://www.vtk.org/Wiki/VTK_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtkusers
>>
>> --
>> Kenneth Sloan
>> KennethRSloan at gmail.com
>>
>>
>>
>>
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the VTK FAQ at:
>> http://www.vtk.org/Wiki/VTK_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtkusers
>>
>>
>
>
>------------------------------
>
>Message: 6
>Date: Sat, 5 Sep 2009 13:43:05 -0400
>From: Bill Lorensen <bill.lorensen at gmail.com>
>Subject: Re: [vtkusers] no VTK binary
>To: steve.giessler at mail.wvu.edu
>Cc: vtkusers at vtk.org
>Message-ID:
>	<4db4735c0909051043v3dd4354bl20493f9db5ab3030 at mail.gmail.com>
>Content-Type: text/plain; charset=ISO-8859-1
>
>To generate the vtk binary, you have to turn on tcl wrapping when you configure.
>
>On Thu, Sep 3, 2009 at 10:43 AM, Steve
>Giessler<steve.giessler at mail.wvu.edu> wrote:
>> Greetings,
>>
>> I work at West Virginia University. In the Math dept. they have a cluster
>> that they want to run VTK on. I have never installed or used this package. I
>> first installed cmake 2.6 and then compiled and installed VTK according to
>> the instructions. The only problem is, I can't find the vtk binary. I'm
>> assuming it should install under my install path/bin right?
>>
>> The only things it installed in my install path/bin were:
>>
>> -rwxr-xr-x 1 root root ?431171 Sep ?2 16:33 lproj
>> -rwxr-xr-x 1 root root ? 18986 Sep ?2 16:33 vtkEncodeString
>>
>> Where is vtk?
>>
>> It seemed to compile without error.
>>
>> --
>>
>> Steve Giessler, Professional Technologist
>> West Virginia University
>> Eberly College of Arts and Sciences
>> 201 Woodburn Hall
>> Morgantown, WV 26506
>> (304) 293-7405 x5252
>>
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the VTK FAQ at:
>> http://www.vtk.org/Wiki/VTK_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtkusers
>>
>
>
>------------------------------
>
>Message: 7
>Date: Sun, 6 Sep 2009 18:46:22 +1200
>From: Helvin Lui <helvinlui at gmail.com>
>Subject: [vtkusers] vtkCaptionWidget
>To: vtkusers at vtk.org
>Message-ID:
>	<f27262c50909052346i5e955e0amfbf17a7e88875632 at mail.gmail.com>
>Content-Type: text/plain; charset="iso-8859-1"
>
>I actually can't find a SINGLE example online about how to use
>vtkCaptionWidget. Does anyone have any idea how to use it?At the moment, I
>have only initiated it with caption = vtk.vtkCaptionWidget. What else?
>
>Btw, I'm using it to display options that the user can choose related to a
>point that they pick in the display mesh.
>
>Thanks so much!
>-- 
>Helvin
>
>"Though the world may promise me more, I'm just made to be filled with the
>Lord."
>-------------- next part --------------
>An HTML attachment was scrubbed...
>URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20090906/a1e6db3a/attachment-0001.htm>
>
>------------------------------
>
>Message: 8
>Date: Sun, 6 Sep 2009 03:38:20 -0400
>From: Karthik Krishnan <karthik.krishnan at kitware.com>
>Subject: Re: [vtkusers] vtkCaptionWidget
>To: Helvin Lui <helvinlui at gmail.com>
>Cc: vtkusers at vtk.org
>Message-ID:
>	<9ddb27260909060038r1ecf8c91jd075bc4ee37776b1 at mail.gmail.com>
>Content-Type: text/plain; charset="iso-8859-1"
>
>VTK/Widgets/Testing/Cxx/TestCaptionWidget.cxx
>
>On Sun, Sep 6, 2009 at 2:46 AM, Helvin Lui <helvinlui at gmail.com> wrote:
>
>> I actually can't find a SINGLE example online about how to use
>> vtkCaptionWidget. Does anyone have any idea how to use it?At the moment, I
>> have only initiated it with caption = vtk.vtkCaptionWidget. What else?
>>
>> Btw, I'm using it to display options that the user can choose related to a
>> point that they pick in the display mesh.
>>
>> Thanks so much!
>> --
>> Helvin
>>
>> "Though the world may promise me more, I'm just made to be filled with the
>> Lord."
>>
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the VTK FAQ at:
>> http://www.vtk.org/Wiki/VTK_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtkusers
>>
>>
>-------------- next part --------------
>An HTML attachment was scrubbed...
>URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20090906/d21cd5eb/attachment-0001.htm>
>
>------------------------------
>
>Message: 9
>Date: Sun, 6 Sep 2009 23:01:22 +1200
>From: Helvin Lui <helvinlui at gmail.com>
>Subject: Re: [vtkusers] vtkCaptionWidget
>To: Karthik Krishnan <karthik.krishnan at kitware.com>
>Cc: vtkusers at vtk.org
>Message-ID:
>	<f27262c50909060401m7509960en4ba7459e32fb24de at mail.gmail.com>
>Content-Type: text/plain; charset="iso-8859-1"
>
>Oh, I thought VTK/Widgets/Testing/Cxx/TestCaptionWidget.cxx was a testing
>thing, and not an example as such, but I will have a look at it, thanks.
>Though I am coding in python and not C, so if there are any python examples,
>it would be very much appreciated, thanks!
>Helvin
>
>On Sun, Sep 6, 2009 at 7:38 PM, Karthik Krishnan <
>karthik.krishnan at kitware.com> wrote:
>
>> VTK/Widgets/Testing/Cxx/TestCaptionWidget.cxx
>>
>> On Sun, Sep 6, 2009 at 2:46 AM, Helvin Lui <helvinlui at gmail.com> wrote:
>>
>>> I actually can't find a SINGLE example online about how to use
>>> vtkCaptionWidget. Does anyone have any idea how to use it? At the moment,
>>> I have only initiated it with caption = vtk.vtkCaptionWidget. What else?
>>>
>>> Btw, I'm using it to display options that the user can choose related to a
>>> point that they pick in the display mesh.
>>>
>>> Thanks so much!
>>> --
>>> Helvin
>>>
>>> "Though the world may promise me more, I'm just made to be filled with the
>>> Lord."
>>>
>>> _______________________________________________
>>> Powered by www.kitware.com
>>>
>>> Visit other Kitware open-source projects at
>>> http://www.kitware.com/opensource/opensource.html
>>>
>>> Please keep messages on-topic and check the VTK FAQ at:
>>> http://www.vtk.org/Wiki/VTK_FAQ
>>>
>>> Follow this link to subscribe/unsubscribe:
>>> http://www.vtk.org/mailman/listinfo/vtkusers
>>>
>>>
>>
>>
>
>
>-- 
>Helvin
>
>"Though the world may promise me more, I'm just made to be filled with the
>Lord."
>-------------- next part --------------
>An HTML attachment was scrubbed...
>URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20090906/7c1e9e95/attachment-0001.htm>
>
>------------------------------
>
>Message: 10
>Date: Sun, 6 Sep 2009 16:01:51 +0300
>From: Ali Habib <ali.mahmoud.habib at gmail.com>
>Subject: [vtkusers] How to implement that
>To: vtk-developers at vtk.org, vtkusers at vtk.org
>Message-ID:
>	<a065f39a0909060601hdd36445s31c02c3edf4f008a at mail.gmail.com>
>Content-Type: text/plain; charset="iso-8859-1"
>
> Hi All,
>
>I created a 3D of the skull from CT 2d slices, I want to select a part of
>the skull and delete it , as example kindly find attached image , how to
>implement that please
>I tried clipping, but not work as I wish
>
>
>best regards
>-------------- next part --------------
>An HTML attachment was scrubbed...
>URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20090906/4beb6234/attachment-0001.htm>
>-------------- next part --------------
>A non-text attachment was scrubbed...
>Name: skull_quarter_view_PA230104.jpg
>Type: image/jpeg
>Size: 44787 bytes
>Desc: not available
>URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20090906/4beb6234/attachment-0001.jpg>
>
>------------------------------
>
>_______________________________________________
>vtkusers mailing list
>vtkusers at vtk.org
>http://www.vtk.org/mailman/listinfo/vtkusers
>
>
>End of vtkusers Digest, Vol 65, Issue 7
>***************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20090907/215ba510/attachment.htm>


More information about the vtkusers mailing list