Skip to content

Commit

Permalink
finished setting up matlab version
Browse files Browse the repository at this point in the history
  • Loading branch information
bendhouseart committed Aug 12, 2024
1 parent 400fec2 commit 5903752
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
3 changes: 1 addition & 2 deletions matlab/dcm2niix4pet.m
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,7 @@ function dcm2niix4pet(FolderList,MetaList,varargin)
elseif strcmpi(varargin{var},'o')
outputdir = varargin{var+1};
elseif strcmpi(varargin{var},'notrack')
notrack = varargin{var+1};
if notrack; setenv('TELEMETRY_ENABLED', 'False'); end
setenv('TELEMETRY_ENABLED', 'False')
else
error('unknown option %s',varargin{var})
end
Expand Down
3 changes: 1 addition & 2 deletions matlab/ecat2nii.m
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,7 @@
elseif strcmpi(varargin{v},'savemat')
savemat = varargin{v+1};
elseif strcmpi(varargin{v},'notrack')
notrack = varargin{v+1};
if notrack; setenv('TELEMETRY_ENABLED', 'False'); end
setenv('TELEMETRY_ENABLED', 'False')
end
end

Expand Down
6 changes: 3 additions & 3 deletions matlab/telemetry.m
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,16 @@ function telemetry(telemetry_data, input_path, output_path)
% checks to see if the telemetry is enabled or disabled
environment = getenv();
% check environment too before loading the config file
if isfield(environment, 'PET2BIDS_TELEMETRY_ENABLED')
disable_telemetry_env = strcmpi(getenv("PET2BIDS_TELEMETRY_ENABLED"), 'false');
if isfield(environment, 'TELEMETRY_ENABLED')
disable_telemetry_env = strcmpi(getenv("TELEMETRY_ENABLED"), 'false');
else
disable_telemetry_env = false;
end

home_dir = environment("HOME");
loadenv(fullfile(home_dir, '.pet2bidsconfig'), FileType='env');
% convert string to boolean/logical
disable_telemetry = strcmpi(getenv("PET2BIDS_TELEMETRY_ENABLED"), 'false');
disable_telemetry = strcmpi(getenv("TELEMETRY_ENABLED"), 'false');

if disable_telemetry | disable_telemetry_env
e = false;
Expand Down

0 comments on commit 5903752

Please sign in to comment.