eadBIDSJson
read TR MRstart and crate MRend from BIDS style json output
(e.g. created by dcm2niix).
must already have nDcms (number of volumes in 4d) set
=cut
sub readBIDSJson() {
use JSON qw/dec
;
my $jsonfile=shift;
open my $JS, '<', $jsonfile or
croak "could not open BIDS JSON '$jsonfile'";
my $data = decode_json(do{local $/; <$JS>}) or
croak "could not parse JSON in '$jsonfile'"
s($offby) > $maxDiffSec);
return 1;
}
# DICOM Acq Time is fmt like HHMMSS.SS (172745.487500)
# JSON BIDs AcqTime like 2018-06-15T17:27:45.487500
sub getMRAcqSecs {
$_=shift;
m/^(?<HH>\d{2})(?<M