[IGSTK-Users] Get time stamp

Patrick Cheng cheng at isis.georgetown.edu
Mon Apr 20 15:19:46 EDT 2009


Hi Eric,

There are several ways to check the validity of a time stamp without 
actually converting it to a human readable format.

You can try:
timeStamp2->IsValidAtTime( timeStamp1->GetStartTime() );

RealTimeClock is a chip on the computer mother board that keeps ticking. 
We need to know the frequency and the origin (year 1970) to convert the 
number of ticks into date and seconds.

The StartTime and ExpirationTime is essentially the number of ticks from 
the counter, but has a unit in millisecond (adjusted for RealTimeClock's 
requency).

Patrick


Eric L. B. wrote:
> 
>  
> Hi all!!!!
> I'm trying to get the time stamp of a transformation with a NDI Polaris 
> tracker.
> I use this code:
> *                        TT1 = T1Observer->GetTransform();*
> *                        timeT1= TT1.GetStartTime();*
>  
> According with igstkTransform.h:
>              /** Returns the time at which the validity of this 
> information starts. The
>              * data in this transform should not be used for scenes to 
> be rendered
>              * before that validity time. *The time is returned in 
> milliseconds.*
>              *
>              * \sa TimeStamp
>              *
>              * */
>              TimePeriodType GetStartTime() const;
>  
> Then, what i get is a time expressed in milliseconds, but i need this 
> time in format DDMMYYYY or similar in order to compare and evaluate this 
> time with the timestamp of an extern image attached to the tool beign 
> tracked. (I get this image from a frame grabber).
> When I try to convert to a DDMMYYYY, i get that the year is 777 (at 
> least is not 666 ja ja ja).
>  
> I've used the function  *void** RealTimeClock::Print(std::ostream& os, 
> itk::Indent indent)*   to view the realtimeclock settings.
> There are three parameters initialized by  *void** 
> RealTimeClock::Initialize()*: frecuency, difference and origin.
> My question is what this variables mean???????? In particular the 
> difference and origin variables. This variables have effect on the 
> result of GetStarTime()?????????????
> How can i compare my two times with a same format time????
>  
> I hope someone can help me please, I can't found the way :(
> Thanks!!!!!
>  
>  
> Eric LB
> 
>  
> 
> ------------------------------------------------------------------------
> Hotmail es más seguro y crece de acuerdo a tus necesidades 
> <www.windowslive-hotmail.com/protectyourself/es/default.htm>
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
> 
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/cgi-bin/mailman/listinfo/igstk-users



More information about the IGSTK-Users mailing list