vzachari / IronSmithQSM

Ironsmith is a comprehensive, fully automated pipeline for creating and processing Quantitative Susceptibility Maps (QSM), extracting QSM based iron concentrations from subcortical and cortical brain regions and evaluating the quality of QSM data using SNR measures and assessment of outlier regions on phase images.
Other
18 stars 6 forks source link

error when running MEDI_New_Ref.m #9

Closed epongpipat closed 10 months ago

epongpipat commented 11 months ago

I ran into the following issue when trying to run the IronSmith pipeline (i.e., MEDI_QSM_New_Ref.{sh,m}) If you have any ideas on why this might be happening or how to debug the following, it would be greatly appreciated. We're very interested in using IronSmith for our data!

matlab command:

QSM_New_CSF = MEDI_L1('lambda',1000,'lambda_CSF',100,'merit','smv',5);

matlab output:

CSF regularization used
Using gaussnewton
Warning: *ERROR*ERROR*ERROR* 
Array dimensions must match for binary array op.

Error in MEDI_L1>@(x)Mask_CSF.*(x-mean(x(Mask_CSF))) (line 91)
            LT_reg = @(x) Mask_CSF.*(x - mean(x(Mask_CSF)));

Error in MEDI_L1>@(dx)lam_CSF.*LT_reg(LT_reg(real(dx))) (line 113)
                reg_CSF = @(dx) lam_CSF.*LT_reg(LT_reg(real(dx)));

Error in MEDI_L1>@(dx)reg(dx)+reg_CSF(dx) (line 114)
                reg = @(dx) reg(dx) + reg_CSF(dx);

Error in MEDI_L1/gaussnewton (line 119)
            b = reg(x) + 2*lambda*Dconv( real(conj(w).*conj(1i).*(w-b0)) );

Error in MEDI_L1 (line 85)
        [x, cost_reg_history, cost_data_history] = gaussnewton();

I gathered so far that the prior commands are swapping the dimensions using the permute function, and our actual dimensions of 512x512x72 and are now 512x72x512 after the Mask_CSF_New_Rot_* set of commands. I believe this MEDI_L1 command does not like these new dimensions, but am not certain and am not sure what the next step should be.

Thanks in advance!

epongpipat commented 10 months ago

Sorry, I just noticed that this issue was addressed in issue #7 and is implemented in the v1.3 beta (I had downloaded the v1.2).