[Insight-users] [how to interrupt an registration process]
Miller, James V (Research)
millerjv@crd.ge.com
Tue, 29 Apr 2003 12:53:17 -0400
In your command/observer, you would have to peek at the stdin buffer to see
if a key had been pressed. Note that cannot just
do a "cin >> keypress" type call because your app would block
at every iteration (waiting for you to press the enter key).
But you should be able to peek into the queue to see if a
key was pressed. Or maybe do a read/timeout type operation.
In any case, this code would be standard C++ standard library
calls or OS specific calls. This capability is not ITK specific.
> -----Original Message-----
> From: J Mst [mailto:gave_edgar@hotmail.com]
> Sent: Tuesday, April 29, 2003 12:39 PM
> To: insight-users@public.kitware.com
> Subject: Re: [Insight-users] [how to interrupt an
> registration process]
>
>
> Hi Luis,
>
> I've an command/observer which passes the current position etc. And i
> understand that i have to interrupt this execute() method. I
> am working
> within the command line but I don't know how i can do this.
>
> It would be great if I could stop the process by pressing a
> button eg. the
> enter button.
>
> A practical example would be great
>
> thanx in advance
>
> Joris
>
>
>
>
>
> >From: Luis Ibanez <luis.ibanez@kitware.com>
> >To: J Mst <gave_edgar@hotmail.com>
> >CC: insight-users@public.kitware.com
> >Subject: Re: [Insight-users] [how to interrupt an
> registration process]
> >Date: Tue, 29 Apr 2003 08:52:34 -0400
> >
> >Hi Joris,
> >
> >The registration process invokes iteration events.
> >You probably have defined already a Command/Observer
> >that receives these events and print out the current
> >parameters of the transform.
> >
> >In order to interrupt the registration, simply add
> >a "Cancel" button in your GUI, and during the Execute()
> >method of the Command/Observer check for the state of
> >this new button.
> >
> >
> >Regards,
> >
> >
> > Luis
> >
> >
> >----------------------
> >
> >J Mst wrote:
> >>hi all,
> >>
> >>I'm working on a project which includes registration and
> now I reached the
> >>testing stage. I am constantly testing my code with
> different images. All
> >>is going well, but one thing anoys me.
> >>
> >>When I see that the registration process is going in the
> wrong direction,
> >>I cannot interrupt the process in any way. I read in the
> SoftwareGuide
> >>that this can be done.. but I don't know how to do this.
> >>
> >>Is there a simple way to interrupt the registration process
> so I can
> >>change the parameters of the registration an I don't have
> to wait till the
> >>maximum number of iterations is reached.
> >>
> >>Thanx in advance for any reactions.
> >>
> >>ps: I am using a code based on the imageregistration4 example.
> >>
> >>Joris
> >>
> >>
> >>_________________________________________________________________
> >>MSN Zoeken, voor duidelijke zoekresultaten! http://search.msn.nl
> >>
> >>_______________________________________________
> >>Insight-users mailing list
> >>Insight-users@public.kitware.com
> >>http://public.kitware.com/mailman/listinfo/insight-users
> >>
> >
> >
> >
>
>
> _________________________________________________________________
> MSN Zoeken, voor duidelijke zoekresultaten! http://search.msn.nl
>
> _______________________________________________
> Insight-users mailing list
> Insight-users@public.kitware.com
> http://public.kitware.com/mailman/listinfo/insight-users
>