func deltaT(tagMap map[dicomtag.Tag][]interface{}) (deltaTMS float64, err error) {

	nominalInterval, cardiacNumberOfImages := 0.0, 0.0

	// nominalInterval
	val, exists := tagMap[dicomtag.NominalInterval]
	if !exists {
		return 0, pfx.Err(fmt.Errorf("NominalInterval not found"))
	}
	for _, v := range val {
		nominalInterval, err = strconv.ParseFloat(v.(string), 64)
		if err != nil {
			return 0, pfx.Err(err)
		}
		break
	}

	// cardiacNumberOfImages
	val, exists = tagMap[dicomtag.CardiacNumberOfImages]
	if !exists {
		return 0, pfx.Err(fmt.Errorf("CardiacNumberOfImages not found"))
	}
	for _, v := range val {
		cardiacNumberOfImages, err = strconv.ParseFloat(v.(string), 64)
		if err != nil {
			return 0, pfx.Err(err)
		}
		break
	}

	// Convert milliseconds to seconds
	return (1 / 1000.0) * nominalInterval / cardiacNumberOfImages, nil
}
// deltaT returns the assumed amount of time (in seconds) belonging to each
// image in a cycle. It is the entire duration that it takes to acquire all
// images (N), divided by N. Here we assume it is the same for every image in a
// sequence - in all inspected images, this seems to be true.
deltaT returns the assumed amount of time (in seconds) belonging to each
image in a cycle. It is the entire duration that it takes to acquire all
images (N), divided by N. Here we assume it is the same for every image in a
sequence - in all inspected images, this seems to be true.
// deltaT returns the assumed amount of time ( in seconds ) belonging to each // image in a cycle . It is the entire duration that it takes to acquire all // images ( N ) divided by N . Here we assume it is the same for every image in a // sequence - in all inspected images this seems to be true .
func deltaT(tagMap map[dicomtag.Tag][]interface{}) (deltaTMS float64, err error) {
	nominalInterval, cardiacNumberOfImages := 0.0, 0.0
	val, exists := tagMap[dicomtag.NominalInterval]
	if !exists {
		return 0, pfx.Err(fmt.Errorf("NominalInterval not found"))
	}
	for _, v := range val {
		nominalInterval, err = strconv.ParseFloat(v.(string), 64)
		if err != nil {
			return 0, pfx.Err(err)
		}
		break
	}
	val, exists = tagMap[dicomtag.CardiacNumberOfImages]
	if !exists {
		return 0, pfx.Err(fmt.Errorf("CardiacNumberOfImages not found"))
	}
	for _, v := range val {
		cardiacNumberOfImages, err = strconv.ParseFloat(v.(string), 64)
		if err != nil {
			return 0, pfx.Err(err)
		}
		break
	}
	return (1 / 1000.0) * nominalInterval / cardiacNumberOfImages, nil
}
func deltaT ( tagMap map [ dicomtag . Tag ] [ ] interface { } ) ( deltaTMS float64 , err error ) { nominalInterval , cardiacNumberOfImages := 0.0 , 0.0 val , exists := tagMap [ dicomtag . NominalInterval ] if ! exists { return 0 , pfx . Err ( fmt . Errorf ( " " ) ) } for _ , v := range val { nominalInterval , err = strconv . ParseFloat ( v . ( string ) , 64 ) if err != nil { return 0 , pfx . Err ( err ) } break } val , exists = tagMap [ dicomtag . CardiacNumberOfImages ] if ! exists { return 0 , pfx . Err ( fmt . Errorf ( " " ) ) } for _ , v := range val { cardiacNumberOfImages , err = strconv . ParseFloat ( v . ( string ) , 64 ) if err != nil { return 0 , pfx . Err ( err ) } break } return ( 1 / 1000.0 ) * nominalInterval / cardiacNumberOfImages , nil }
deltaT returns the assumed amount of time (in seconds) belonging to each
image in a cycle.
deltaT returns the assumed amount of time ( in seconds ) belonging to each image in a cycle .
// nominalInterval // cardiacNumberOfImages // Convert milliseconds to seconds