Skip to content

Commit

Permalink
Merge pull request #54 from kschan0214/dev1.2.2
Browse files Browse the repository at this point in the history
Dev1.2.2
  • Loading branch information
kschan0214 authored Jan 27, 2023
2 parents 941cd5b + 99d8103 commit d6bb60e
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 8 deletions.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,12 @@ 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.1.1 (current master)
### 1.2.2 (current master)
* Fix bug for non-double type input for MATLAB's strel function
* Make sure all holes inside the ROI mask are filled after the background field removal step
* ROI (brain) mask is applied on the fieldmap regardless of what method is chosen

### 1.2.1.1 (current 941cd5b)
* Enable option of GPU processing for FANSI and NDI

### 1.2.1 (current 190dd44)
Expand Down
2 changes: 1 addition & 1 deletion sepia_universal_variables.m
Original file line number Diff line number Diff line change
Expand Up @@ -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.1.1';
SEPIA_version = 'v1.2.2';

%% PATH
SEPIA_HOME = fileparts(mfilename('fullpath'));
Expand Down
8 changes: 4 additions & 4 deletions utils/refine_brain_mask_using_r2s.m
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@
open_radius_voxel = min(round(open_radius_mm ./ voxelSize));
close_radius_voxel = min(round(close_radius_mm ./ voxelSize));

% remove disconnected voxels
mask_r2s_morph = imopen(mask_r2s, strel('sphere', open_radius_voxel));
% remove disconnected voxels, 20230124 v1.2.2: second input of strel has to be double
mask_r2s_morph = imopen(mask_r2s, strel('sphere', double(open_radius_voxel)));
% get the largest single object
mask_r2s_morph = getLargestObject(mask_r2s_morph);
% reconnect voxels
mask_r2s_morph = imclose(mask_r2s_morph, strel('sphere', close_radius_voxel));
% reconnect voxels, 20230124 v1.2.2: second input of strel has to be double
mask_r2s_morph = imclose(mask_r2s_morph, strel('sphere', double(close_radius_voxel)));
% make sure no holes in the centre of the brain
mask_r2s_morph = imfill(mask_r2s_morph,'holes');

Expand Down
4 changes: 3 additions & 1 deletion wrapper/BackgroundRemovalMacroIOWrapper.m
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,9 @@
clear totalField maskLocalfield % clear variables that no longer be needed

% generate new mask based on backgroudn field removal result
mask_QSM = localField ~= 0;
% mask_QSM = localField ~=0;
% 20230124 v1.2.2: make sure no holes inide ROIs
mask_QSM = imfill(localField ~= 0, 'holes');

% save results
fprintf('Saving local field map...');
Expand Down
7 changes: 6 additions & 1 deletion wrapper/SepiaIOWrapper.m
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,9 @@
% core of temporo-spatial phase unwrapping
[totalField,fieldmapSD,fieldmapUnwrapAllEchoes,mask] = estimateTotalField(fieldMap,mask,matrixSize,voxelSize,algorParam,headerAndExtraData);

% 20230124 v1.2.2: apply mask on derived map
totalField = totalField .* double(mask);

% save unwrapped phase if chosen
if ~isempty(fieldmapUnwrapAllEchoes) && isSaveUnwrappedEcho
% save the output
Expand Down Expand Up @@ -292,7 +295,9 @@
clear totalField maskLocalfield % clear variables that no longer be needed

% generate new mask based on backgroudn field removal result
mask_QSM = localField ~=0;
% mask_QSM = localField ~=0;
% 20230124 v1.2.2: make sure no holes inide ROIs
mask_QSM = imfill(localField ~= 0, 'holes');

fprintf('Saving local field map...');
save_nii_quick(outputNiftiTemplate,localField, outputFileList.localField);
Expand Down
3 changes: 3 additions & 0 deletions wrapper/UnwrapPhaseMacroIOWrapper.m
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,9 @@
% core of temporo-spatial phase unwrapping
[totalField,fieldmapSD,fieldmapUnwrapAllEchoes,mask] = estimateTotalField(fieldMap,mask,matrixSize,voxelSize,algorParam,headerAndExtraData);

% 20230124 v1.2.2: apply mask on derived map
totalField = totalField .* double(mask);

% save unwrapped phase if chosen
if ~isempty(fieldmapUnwrapAllEchoes) && isSaveUnwrappedEcho
% save the output
Expand Down

0 comments on commit d6bb60e

Please sign in to comment.