From 293740018d87b037193eaf81208310b5a4237e0b Mon Sep 17 00:00:00 2001 From: Kwok-Shing Chan Date: Tue, 10 Oct 2023 01:14:39 +0200 Subject: [PATCH] fix bug for imcompartible B0 direction between SEPIA and LPCNN --- addons/bfr/BFRnet/setup_BFRnet_environment.m | 4 ++-- addons/qsm/LPCNN/Wrapper_QSM_LPCNN.m | 2 ++ addons/qsm/LPCNN/setup_LPCNN_environment.m | 4 ++-- addons/qsm/QSMnet/setup_qsmnet_environment.m | 4 ++-- addons/qsm/xQSM/setup_xQSM_environment.m | 2 +- sepia.m | 1 + sepia_universal_variables.m | 2 +- 7 files changed, 11 insertions(+), 8 deletions(-) diff --git a/addons/bfr/BFRnet/setup_BFRnet_environment.m b/addons/bfr/BFRnet/setup_BFRnet_environment.m index d83827c..f5de5cf 100644 --- a/addons/bfr/BFRnet/setup_BFRnet_environment.m +++ b/addons/bfr/BFRnet/setup_BFRnet_environment.m @@ -1,8 +1,8 @@ %% This file specifies the Checkpoint of xQSM % Specify the directory of the xQSM code from Github -deepMRI_HOME = '/project/3015069.05/bids/code/deepMRI/'; +deepMRI_HOME = '/home/common/matlab/sepia/external/deepMRI/'; % If you have your own trained network, specify the file that contains the trained parameters % otherwise, uses the one provided with the tool -checkpoints = '/project/3015069.05/bids/code/deepMRI/BFRNet_data/checkpoints/BFRnet_L2_64PS_24BS_45Epo_NewHCmix.mat'; +checkpoints = '/home/common/matlab/sepia/external/deepMRI/BFRNet_data/checkpoints/BFRnet_L2_64PS_24BS_45Epo_NewHCmix.mat'; diff --git a/addons/qsm/LPCNN/Wrapper_QSM_LPCNN.m b/addons/qsm/LPCNN/Wrapper_QSM_LPCNN.m index cfb2efd..0474202 100644 --- a/addons/qsm/LPCNN/Wrapper_QSM_LPCNN.m +++ b/addons/qsm/LPCNN/Wrapper_QSM_LPCNN.m @@ -80,6 +80,8 @@ mask_pad = mask; end +% 20231009: fix mismatch of B0dir between SEPIA and LPCNN +b0dir = [b0dir(2), -b0dir(1), b0dir(3)]; [C,~] = DipoleKernel(size(localField_pad),voxelSize,b0dir); diff --git a/addons/qsm/LPCNN/setup_LPCNN_environment.m b/addons/qsm/LPCNN/setup_LPCNN_environment.m index 16f4dce..11bef8f 100644 --- a/addons/qsm/LPCNN/setup_LPCNN_environment.m +++ b/addons/qsm/LPCNN/setup_LPCNN_environment.m @@ -3,9 +3,9 @@ % dir_net = fullfile(qsmnet_dir,'Checkpoints/'); % Specify LPCNN_HOME corresponding to the code from Github -LPCNN_HOME = '/project/3015069.05/bids/code/LPCNN/'; +LPCNN_HOME = '/home/common/matlab/sepia/external/LPCNN/LPCNN_v1.0'; % Specify the Python environment that has QSMnet+ installed -python_interpreter = '/project/3015069.05/bids/code/LPCNN/lpcnn-env/bin/python'; +python_interpreter = '/home/common/matlab/sepia/external/LPCNN/LPCNN_v1.0/lpcnn-env/bin/python'; % Specify the directory that contains the training parameters checkpoint_fn = fullfile(LPCNN_HOME,'checkpoints','lpcnn_test_Bmodel.pkl'); % checkpoint_fn = '/project/3015069.05/bids/code/LPCNN/checkpoints/lpcnn_test_Bmodel.pkl'; diff --git a/addons/qsm/QSMnet/setup_qsmnet_environment.m b/addons/qsm/QSMnet/setup_qsmnet_environment.m index 5a82606..1ec8474 100644 --- a/addons/qsm/QSMnet/setup_qsmnet_environment.m +++ b/addons/qsm/QSMnet/setup_qsmnet_environment.m @@ -1,8 +1,8 @@ %% This file specifies the Python environment and Checkpoint of QSMnet+ % Specify the directory of the QSMnet+ code from Github -QSMnet_HOME = '/project/3015069.05/bids/code/QSMnet/'; +QSMnet_HOME = '/home/common/matlab/sepia/external/QSMnet/QSMnet-9ca283a'; % Specify the Python environment that has QSMnet+ installed -python_interpreter = '/project/3015069.05/bids/code/QSMnet/qsmnet/bin/python'; +python_interpreter = '/home/common/matlab/sepia/external/QSMnet/QSMnet-9ca283a/qsmnet/bin/python'; % Specify the directory that contains the trained parameters dir_net = fullfile(QSMnet_HOME,'Checkpoints/'); diff --git a/addons/qsm/xQSM/setup_xQSM_environment.m b/addons/qsm/xQSM/setup_xQSM_environment.m index ac4bf48..b3ffb76 100644 --- a/addons/qsm/xQSM/setup_xQSM_environment.m +++ b/addons/qsm/xQSM/setup_xQSM_environment.m @@ -1,7 +1,7 @@ %% This file specifies the Checkpoint of xQSM % Specify the directory of the xQSM code from Github -deepMRI_HOME = '/project/3015069.05/bids/code/deepMRI/'; +deepMRI_HOME = '/home/common/matlab/sepia/external/deepMRI/'; % If you have your own trained network, specify the file that contains the trained parameters % otherwise, uses the one provided with the tool checkpoint_dir = fullfile(deepMRI_HOME, 'xQSM_data','checkpoints'); diff --git a/sepia.m b/sepia.m index b3864c7..19d5475 100644 --- a/sepia.m +++ b/sepia.m @@ -45,6 +45,7 @@ % Date modified: 12 June 2021 (v1.0) % Date modified: 3 August 2022 (v1.1) % Date modified: 3 April 2023 (v1.2.2.4) +% Date modified: 9 October 2023 (v1.2.2.5) % function sepia diff --git a/sepia_universal_variables.m b/sepia_universal_variables.m index 315e452..5cc9533 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.4'; +SEPIA_version = 'v1.2.2.5'; %% PATH SEPIA_HOME = fileparts(mfilename('fullpath'));