From e85023d044ae2c40bb14429039a72c9d45a655bc Mon Sep 17 00:00:00 2001 From: Kwok-Shing Chan Date: Thu, 9 Feb 2023 12:57:15 +0100 Subject: [PATCH] fix bug when using BIDS compartible directory input, loading the magnitude images does not take the rescale slope and intercept into account --- README.md | 5 ++++- sepia_universal_variables.m | 2 +- utils/read_bids_to_filelist.m | 6 ++++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 5326331..3cac60e 100755 --- a/README.md +++ b/README.md @@ -41,7 +41,10 @@ If you have a more general question regarding the usage of SEPIA and/or other QS For full update log, please visit https://sepia-documentation.readthedocs.io/en/latest/getting_started/Release-note.html. -### 1.2.2.1 (current master) +### 1.2.2.2 (current master) +* Fix bug when using BIDS compatible directory input where magnitude images did not utilise the rescale slope and intercept to obtain the true values + +### 1.2.2.1 (current 1f04298) * Fix bug when using optimum weight total field computation with odd matrix size data ### 1.2.2 (current d6bb60e) diff --git a/sepia_universal_variables.m b/sepia_universal_variables.m index a932e9c..df85bd1 100755 --- a/sepia_universal_variables.m +++ b/sepia_universal_variables.m @@ -14,7 +14,7 @@ % DO NOT change the order of the entities, add a new one at the end instead % %% Version -SEPIA_version = 'v1.2.2.1'; +SEPIA_version = 'v1.2.2.2'; %% PATH SEPIA_HOME = fileparts(mfilename('fullpath')); diff --git a/utils/read_bids_to_filelist.m b/utils/read_bids_to_filelist.m index a583afe..cb7e178 100644 --- a/utils/read_bids_to_filelist.m +++ b/utils/read_bids_to_filelist.m @@ -15,7 +15,7 @@ % Kwok-shing Chan @ DCCN % k.chan@donders.ru.nl % Date created: 11 August 2021 (v1.0) -% Date modified: +% Date modified: 9 February 2023 (v1.2.2.2) % % function inputNIFTIList = read_bids_to_filelist(inputDir,outputPrefix) @@ -182,7 +182,9 @@ function save_nifti_as_4d(fileList, outputFilename, isPhase) if (abs(max(nii.img(:))-pi)>1e-4 || abs(min(nii.img(:))-(-pi))>1e-4) && isPhase % allow small differences possibly due to data stype conversion img = cat(4, img, DICOM2Phase(nii)); else - img = cat(4, img, nii.img); +% img = cat(4, img, nii.img); + % 20230209: bug fix applying rescale slope and intercept + img = cat(4, img, load_nii_img_only(fileList(k).name)); end numFileLoaded = numFileLoaded + 1;