Skip to content

Commit

Permalink
Merge branch 'master' into docker-github-action
Browse files Browse the repository at this point in the history
  • Loading branch information
Barisevrenugur committed Jun 21, 2024
2 parents cb48b8a + 18b3c01 commit 28a4417
Show file tree
Hide file tree
Showing 12 changed files with 818 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@ Most recent version numbers *should* follow the [Semantic Versioning](https://se
- set default WM percent value in hmri_defaults.
- spatial processing: add explicit mask creation and fix implicit mask (0 to NaN in float images)
- update FIL seste seq parameters in get_metadata_val_classic
- denoising module-first part: Java-Matlab interface for LCPCA denoising

### Fixed
- replace `datestr(now)` with `datetime('now')` in line with [MATLAB recommendation](https://mathworks.com/help/matlab/matlab_prog/replace-discouraged-instances-of-serial-date-numbers-and-date-strings.html)
- fix crash if input images have different matrix sizes, and warn
- make B1-map creation using 3DEPI SE/STE and AFI methods fall back to defaults without sidecar files, rather than crash
- Modify the filenames as files are copied to RFsensCalc to prevent overwriting in further processing
- batch interface now enforces the number of B1 input images correctly for B1 mapping methods which only need two images.
- fix error if optimization toolbox not present during NLLS R2* calculation

## [v0.6.1]
### Fixed
Expand Down
19 changes: 19 additions & 0 deletions config/hmri_denoising_defaults.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
function hmri_denoising_defaults

%init the global variable which carries the params
global hmri_def;

%Enter denoising default values as: hmri_def.denoising.(denoising-protocol).(default-value)

%The default values for lcpca denoising protocol
%all optional parameters turned off
hmri_def.denoising.lcpca_denoise.mag_input = {}; %%required-null initialize here input with GUI
hmri_def.denoising.lcpca_denoise.phase_input = {}; %%optional-null initialize here input with GUI
hmri_def.denoising.lcpca_denoise.output_path=''; %%required-null initialize here input with GUI
hmri_def.denoising.lcpca_denoise.min_dimension= 0; %%required-initialize here
hmri_def.denoising.lcpca_denoise.max_dimension = -1; %%required-initialize here
hmri_def.denoising.lcpca_denoise.unwrap = false; %%optional
hmri_def.denoising.lcpca_denoise.rescale_phs = false; %%optional
hmri_def.denoising.lcpca_denoise.process_2d=false; %%optional
hmri_def.denoising.lcpca_denoise.use_rmt=false; %%optional
end
16 changes: 16 additions & 0 deletions config/local/hmri_local_denoising_defaults.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
%init the global variable which carries the params
global hmri_def;

%Enter denoising default values as: hmri_def.denoising.(denoising-protocol).(default-value)

%The default values for lcpca denoising protocol
%all optional parameters turned off
hmri_def.denoising.lcpca_denoise.mag_input = {}; %%required-null initialize here input with GUI
hmri_def.denoising.lcpca_denoise.phase_input = {}; %%optional-null initialize here input with GUI
hmri_def.denoising.lcpca_denoise.output_path=''; %%required-null initialize here input with GUI
hmri_def.denoising.lcpca_denoise.min_dimension= 0; %%required-initialize here
hmri_def.denoising.lcpca_denoise.max_dimension = -1; %%required-initialize here
hmri_def.denoising.lcpca_denoise.unwrap = false; %%optional
hmri_def.denoising.lcpca_denoise.rescale_phs = false; %%optional
hmri_def.denoising.lcpca_denoise.process_2d=false; %%optional
hmri_def.denoising.lcpca_denoise.use_rmt=false; %%optional
14 changes: 13 additions & 1 deletion hmri_calc_R2s.m
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,18 @@
beta(2:end,:)=exp(beta(2:end,:));

case {'nlls_ols','nlls_wls1','nlls_wls2','nlls_wls3'}
%lsqcurvefit uses optimization toolbox
%Check both for the toolbox and/or an active license for it
%Error if one of them is missing
versionStruct = ver;
versionCell = {versionStruct.Name};
ver_status = any(ismember(versionCell, 'Optimization Toolbox'));
[license_status,~] = license('checkout', 'Optimization_toolbox');
if ver_status==0 || license_status==0
error('hmri:NoOptimToolbox', "The methods 'nlls_ols','nlls_wls1','nlls_wls2','nlls_wls3' require Optimization Toolbox: either this toolbox and/or its license is missing." + ...
" Please use another method which does not need the Optimization Toolbox such as 'ols','wls1','wls2','wls3'. ")
end

% Check for NLLS case, where specification of the log-linear
% initialisation method is in the method string following a hyphen
r=regexp(lower(method),'^nlls_(.*)$','tokens');
Expand All @@ -167,7 +179,7 @@
end

expDecay=@(x,D) (D(:,2:end)*x(2:end)).*exp(x(1)*D(:,1));

% Loop over voxels
parfor n=1:size(y,2)
beta(:,n)=lsqcurvefit(@(x,D)expDecay(x,D),beta0(:,n),D,y(:,n),[],[],opt);
Expand Down
Loading

0 comments on commit 28a4417

Please sign in to comment.