str2time {DICOM} | R Documentation |
The DICOM time entry (TM) is converted into two alternative formats: a text version of the original format and a number in seconds. The DICOM date entry (DA) is converted into a simple alternative format.
str2time(tt) str2date(dd)
tt |
TM field from a DICOM header. |
dd |
DA field from a DICOM header. |
DICOM "TM" format consists of a string of characters of the format
hhmmss.frac
; where hh
contains hours (range "00" -
"23"), mm
contains minutes (range "00" - "59"), ss
contains seconds (range "00" - "59"), and frac
contains a
fractional part of a second as small as 1 millionth of a second (range
000000 - 999999). A 24 hour clock is assumed. Midnight can be
represented by only 0000 since 2400 would violate the hour
range. The string may be padded with trailing spaces. Leading and
embedded spaces are not allowed. One or more of the components
mm
, ss
, or frac
may be unspecified as long as
every component to the right of an unspecified component is also
unspecified. If frac
is unspecified the preceding "." may not
be included. Frac
shall be held to six decimal places or less
to ensure its format conforms to the ANSI HISPP MSDS Time common data
type. Examples:
hh:mm:ss.frac
for
this VR.
DICOM "DA" format A string of characters of the format yyyymmdd; where yyyy shall contain year, mm shall contain the month, and dd shall contain the day. This conforms to the ANSI HISPP MSDS Date common data type. Example:
For "TM", a list structure containing two fields
txt |
A text version of the time where colons have been inserted for readability. |
time |
Time in seconds from midnight. |
for "DA", a simple character string.
B. Whitcher
Digital Imaging and Communications in Medicine (DICOM) http://medical.nema.org http://en.wikipedia.org/wiki/Digital_Imaging_and_Communications_in_Medicine