Laplacian Unwrapping Issue

36 views
Skip to first unread message

Matthew Hoch

unread,
Apr 16, 2024, 1:31:44 PM4/16/24
to medi-users
Hello All, 

Does anyone else have the issue of the Laplacian unwrapping function producing an iFreq matrix of all zeros? I am not sure how to mitigate this? Looking at the code: 

if matrix_size(3)>1
h=( (X==0) & (Y==0)&(Z==0) ) .*1;
k=6 * del2(h,voxel_size(1), voxel_size(2), voxel_size(3));
kernel=fftn(fftshift(k));
else


It looks like it sets all of the h values to 0 before calculating the kernel, is this correct? Any help would be greatly appreciated. 

Thank you, 
Matt

 

spince...@gmail.com

unread,
Apr 16, 2024, 2:02:48 PM4/16/24
to medi-users
Matt,

What is your matrix_size and voxel_size?

Pascal

Matthew Hoch

unread,
Apr 16, 2024, 2:05:04 PM4/16/24
to medi-users
Thank you for your help! 

matrix_size= [188, 186, 81]
voxel_size=[0.2606, 0.2606, 0.2606] (mm) 

spince...@gmail.com

unread,
Apr 16, 2024, 2:19:07 PM4/16/24
to medi-users
This is indeed a bug triggered by the odd number of slices. Add a slice of zeros to your iField after you read it with Read_DICOM to make it even. Something like

iField=padarray(iField, [ 0 0 1 0], 'post');
matrix_size(3)= matrix_size(3)+1;

You can remove the extra slice after the MEDI_L1 call to compute QSM.

Matthew Hoch

unread,
Apr 16, 2024, 3:11:03 PM4/16/24
to medi-users
That worked! Thank you very much!
Reply all
Reply to author
Forward
0 new messages