%timePointToImageNumber type is optional
function imgNumber = timePointToImageNumber(timepoint, type)% timepoint in ms
    switch type
        case 's'
            imgNumber = timePointToImageNumber(timepoint*1000,'ms');
            return;
        case 'ms'
            imageTimeResolution   = 2000; %ms
            imgNumber = round(timepoint/imageTimeResolution);
            return;
        case 'image'
            imgNumber = timepoint;
            return;
        otherwise
            imgNumber = timePointToImageNumber(timepoint,'ms');
            return;
    end
end