Posted on 2009-11-19 11:31:55-08 by exiftool in response to 11775
Re: change dicom field from float acquisition time to human readable format
The option here is to create a user-defined tag to do the required formatting:

%Image::ExifTool::UserDefined = ( 'Image::ExifTool::DICOM::Main' => { '0018,605A' => { Name => 'AcquisitionDuration', VR => 'FL', ValueConv => '$val * 1e6', PrintConv => 'ConvertDuration($val)', }, }, ); 1; #end

My example above assumes that the units are microseconds, so I multiply by 1e6 in the ValueConv to convert to seconds. If the value is already in seconds, the ValueConv line can be removed. (What are the units for this stored value?) The PrintConv calls an exiftool function to format the duration in a more readable way.

- Phil
Direct Responses: 11782 | Write a response
Perl Weekly newsletter
A free weekly newsletter for people who are busy to read all the blogs. click here to check it out.