Skip to content
Merged
51 changes: 51 additions & 0 deletions .github/workflows/traffic_log.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Log traffic stats

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

run-name: ${{ github.event_name }} - logging traffic stats

on:
schedule:
- cron: 0 6 * * * # daily at 06:00 UTC
workflow_dispatch:

permissions:
contents: write

jobs:
log-traffic:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout logging repo
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
repository: markmikkelsen/gannet-traffic-log
token: ${{ secrets.TRAFFIC_LOG_TOKEN }}
path: log-repo

- name: Fetch traffic data
env:
GH_TOKEN: ${{ secrets.TRAFFIC_LOG_TOKEN }}
run: |
set -euo pipefail
mkdir -p log-repo/clones log-repo/views log-repo/releases
DATE=$(date -u +%Y-%m-%d)
gh api "repos/${{ github.repository }}/traffic/clones" \
> log-repo/clones/clones_$DATE.json
gh api "repos/${{ github.repository }}/traffic/views" \
> log-repo/views/views_$DATE.json
gh api "repos/${{ github.repository }}/releases" \
> log-repo/releases/releases_$DATE.json

- name: Commit and push
working-directory: log-repo
run: |
set -euo pipefail
git config user.name "traffic-bot"
git config user.email "actions@github.com"
git add .
git diff --quiet --cached || git commit -m "Traffic snapshot $(date -u +%Y-%m-%d)"
git push
4 changes: 2 additions & 2 deletions .github/workflows/update_dependencies.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: Update dependencies - bids-matlab, dicm2nii, etc.
name: Update dependencies

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

run-name: ${{ github.event_name }} - ${{ github.actor }} is updating dependencies
run-name: ${{ github.event_name }} - updating dependencies

on:
schedule:
Expand Down
6 changes: 4 additions & 2 deletions GEDeIdentify.m
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,8 @@ function GEDeIdentify(fnames)
fseek(pfile_fid, 1500, 'bof');
hdr.series_offset = fread(pfile_fid, 1, 'integer*4');
elseif rdbm_rev_num > 11.0
chkRev = {'14.3','16','20.006','20.007','24','26.002','27','27.001','28.002','28.003','30','30.1'};
chkRev = {'14.3','16','20.006','20.007','24','26.002','27', ...
'27.001','28.002','28.003','30','30.1','31'};
if ~any(strcmp(num2str(rdbm_rev_num), chkRev))
fclose(pfile_fid);
fclose(pfile_fid_noID);
Expand All @@ -254,7 +255,8 @@ function GEDeIdentify(fnames)
rdb_hdr_da_yres = 53;
rdb_hdr_dab_start_rcv = 101;
rdb_hdr_dab_stop_rcv = 102;
case {'26.002','27','27.001','28.002','28.003','30','30.1'}
case {'26.002','27','27.001','28.002','28.003','30','30.1', ...
'31'}
rdb_hdr_off_image = 11;
rdb_hdr_off_data = 2;
rdb_hdr_off_exam = 9;
Expand Down
8 changes: 5 additions & 3 deletions GERead.m
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,12 @@
end

MRS_struct.p.GE.rdbm_rev_num(ii) = rdbm_rev_num;
chkRev = {'14.3','16','20.006','20.007','24','26.002','27','27.001','28.002','28.003','30','30.1'};
chkRev = {'14.3','16','20.006','20.007','24','26.002','27','27.001', ...
'28.002','28.003','30','30.1','31'};
assert(any(strcmp(num2str(rdbm_rev_num), chkRev)), ...
sprintf(['GERead.m is not fully functional with P-file header revision number %g. ' ...
'Please contact the Gannet developers (mam4041@med.cornell.edu) for assistance.'], ...
'Please open an issue on the Gannet GitHub repo ' ...
'for assistance: https://github.com/markmikkelsen/Gannet/issues'], ...
rdbm_rev_num));

% RTN 2018
Expand Down Expand Up @@ -175,7 +177,7 @@
image_user22 = 112;
image_user24 = 116;

case {'26.002','27','27.001','28.002','28.003','30','30.1'}
case {'26.002','27','27.001','28.002','28.003','30','30.1','31'}

% int
rdb_hdr_off_image = 11;
Expand Down
2 changes: 1 addition & 1 deletion GannetLoad.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

MRS_struct.info.datetime.load = datetime('now');
MRS_struct.info.version.Gannet = '3.5.4';
MRS_struct.info.version.load = '260618';
MRS_struct.info.version.load = '260814';
MRS_struct.p.bids = 0;
VersionCheck(0, MRS_struct.info.version.Gannet);
ToolboxCheck;
Expand Down
2 changes: 1 addition & 1 deletion GannetMask_GE.m
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
tlhc = 181;
trhc = 184;
brhc = 187;
case {'26.002','27','27.001','28.002','28.003','30','30.1'}
case {'26.002','27','27.001','28.002','28.003','30','30.1','31'}
rdb_hdr_off_image = 11;
rdb_hdr_ps_mps_freq = 123;
tlhc = 181;
Expand Down
2 changes: 1 addition & 1 deletion GannetMask_GE_nii.m
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
tlhc = 181;
trhc = 184;
brhc = 187;
case {'26.002','27','27.001','28.002','28.003','30','30.1'}
case {'26.002','27','27.001','28.002','28.003','30','30.1','31'}
rdb_hdr_off_image = 11;
rdb_hdr_ps_mps_freq = 123;
tlhc = 181;
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ Gannet uses a form of [semantic versioning](https://semver.org/) in the style 'x

## Lead developer

- Mark Mikkelsen (Weill Cornell Medicine)
- Mark Mikkelsen

## Creator

Expand Down
7 changes: 3 additions & 4 deletions SiemensTWIXRead.m
Original file line number Diff line number Diff line change
Expand Up @@ -415,11 +415,10 @@
% echo maximum in different fields, depending on the origin of the
% sequence:
if strcmp(TwixHeader.seqorig,'CMRR')
if strcmp(TwixHeader.seqtype,'MEGA-PRESS')
try
TwixHeader.pointsBeforeEcho = twix_obj.image.iceParam(5,1);
elseif strcmp(TwixHeader.seqtype,'MEGA-sLASER') % SH 20191213
% TwixHeader.pointsBeforeEcho = twix_obj.image.freeParam(1);
TwixHeader.pointsBeforeEcho = twix_obj.image.iceParam(5,1); % MM (250805): This parameter may actually be the same as for the CMRR MEGA-PRESS WIP
catch
TwixHeader.pointsBeforeEcho = twix_obj.image.freeParam(1);
end
elseif strcmp(TwixHeader.seqorig,'WIP') % Siemens WIP
TwixHeader.pointsBeforeEcho = twix_obj.image.cutOff(1,1);
Expand Down
8 changes: 7 additions & 1 deletion export_fig/crop_borders.m
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
% 23/10/16: Fixed issue #175: there used to be a 1px minimal padding in case of crop, now removed
% 15/05/22: Fixed EPS bounding box (issue #356)
% 26/07/26: Fixed left edge auto-crop in Matlab R2025a+ (issue #408)
% 13/08/26: Fixed bug when using positive (extra) padding parameter (PR #416)
%}

if nargin < 3
Expand Down Expand Up @@ -142,7 +143,12 @@
if padding > 0 % extra padding
% Create an empty image, containing the background color, that has the
% cropped image size plus the padded border
B = repmat(bcol,[(b-t)+1+padding*2,(r-l)+1+padding*2,1,n]); % Fix per Luiz Carvalho
nRows = b-t+1 + padding*2;
nCols = r-l+1 + padding*2;
%B = repmat(bcol, [nRows,nCols,1,n]); % Fix per Luiz Carvalho
B(1:nRows, 1:nCols, 3, 1:n) = bcol(3); % Fix PR #416
B(1:nRows, 1:nCols, 2, 1:n) = bcol(2); % Fix PR #416
B(1:nRows, 1:nCols, 1, 1:n) = bcol(1); % Fix PR #416
% vA - coordinates in A that contain the cropped image
vA = [t b l r];
% vB - coordinates in B where the cropped version of A will be placed
Expand Down
19 changes: 12 additions & 7 deletions export_fig/export_fig.m
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,7 @@
% 01/06/26: (3.55) Fixes for exporting uifigures in Matlab R2025a+ (issue #408)
% 22/07/26: (3.56) Suppress some warnings/alerts if -silent option specified or in parallel/batch mode (issue #415); added default comment in GIF/JPG/PNG/TIF images; try to create export folder if it does not exist
% 26/07/26: (3.57) Fixed unintended figure undock, bgcolor and bad auto-cropping in Matlab R2025a+ (issue #408)
% 13/08/26: (3.58) Fixed TIF export bug; fixed bug when using -p (extra padding/cropping) parameter; improved parsing of parameter-value input pairs
%}

if nargout
Expand Down Expand Up @@ -457,7 +458,7 @@
[fig, options] = parse_args(nargout, fig, argNames, varargin{:});

% Check for newer version and exportgraphics/copygraphics compatibility
currentVersion = 3.57;
currentVersion = 3.58;
if options.version % export_fig's version requested - return it and bail out
imageData = currentVersion;
return
Expand Down Expand Up @@ -1023,7 +1024,7 @@
format_options = getFormatOptions(options, 'tif'); %Issue #269
default_options = {'Resolution',resolution, 'WriteMode',mode, ...
'Description',createdUsing};
imwrite(img, filename, default_options, format_options{:});
imwrite(img, filename, default_options{:}, format_options{:});
end
if options.notify, notify(filename); end
end
Expand Down Expand Up @@ -2106,12 +2107,16 @@ function notify(filename)
case 's', options.fixed_size = vals;
end
else % scalar parameter value
val = str2double(regexpi(thisArg, '(?<=-([mrqp]))-?\d*.?\d+', 'match'));
val = str2double(regexpi(thisArg, '(?<=-([mrqp]))\s*-?\d*.?\d+', 'match'));
if isempty(val) || isnan(val)
% Issue #51: improved processing of input args (accept space between param name & value)
val = str2double(varargin{a+1});
if isscalar(val) && ~isnan(val)
skipNext = 1;
if ~isempty(extra)
val = str2double(extra(2:end));
else
% Issue #51: improved processing of input args (accept space between param name & value)
val = str2double(varargin{a+1});
if isscalar(val) && ~isnan(val)
skipNext = 1;
end
end
end
if ~isscalar(val) || isnan(val)
Expand Down
Loading