daducci / AMICO

Accelerated Microstructure Imaging via Convex Optimization (AMICO) from diffusion MRI data
Other
104 stars 62 forks source link

OD fine, but ISOVF and ICVF giving weird values #153

Closed weberam2 closed 7 months ago

weberam2 commented 1 year ago

Hello!

I have the following DTI scheme:

-> Loading data:
    * DWI signal
        - dim    = 108 x 129 x 109 x 96
        - pixdim = 1.800 x 1.800 x 1.800
    * Acquisition scheme
        - 96 samples, 2 shells
        - 6 @ b=0 , 60 @ b=2000.0 , 30 @ b=1000.0 
    * Binary mask
        - dim    = 108 x 129 x 109
        - pixdim = 1.800 x 1.800 x 1.800
        - voxels = 206359

And running AMICO works no problem

However, the ISOVF and ICVF look like they are being miscalculated in some regions over others, in a very obvious way. Best way to visualize is with an image:

image

Where I am getting 0.99 values in the upper part of the brain... strange.

Anyone have any idea why this is happening?

weberam2 commented 1 year ago

I read elsewhere that someone else was having a similar issue due to the scheme, so I thought I would share that as well:

VERSION: BVECTOR -0.000000 -0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 -0.999250 -0.033900 0.018700 2000.000000 -0.340707 -0.840272 -0.421736 2000.000000 0.292780 -0.853204 0.431652 2000.000000 -0.862827 0.285760 0.416979 2000.000000 0.309572 0.431331 0.847419 2000.000000 0.757496 -0.298437 0.580634 2000.000000 -0.497758 -0.678168 0.540671 2000.000000 -0.150180 -0.951659 -0.267940 2000.000000 -0.746528 -0.453759 0.486619 2000.000000 -0.101376 0.898132 0.427880 2000.000000 -0.140681 0.985801 0.091681 2000.000000 -0.337038 0.933260 -0.124221 2000.000000 0.479105 0.075699 0.874487 2000.000000 0.490677 -0.859574 -0.142719 2000.000000 0.499646 0.395480 -0.770681 2000.000000 0.807692 0.583498 0.084641 2000.000000 -0.724537 0.532197 -0.437964 2000.000000 -0.512883 0.655310 -0.554544 2000.000000 0.179473 0.983028 -0.038020 2000.000000 0.656727 -0.541623 -0.524742 2000.000000 -0.552551 -0.832590 -0.038480 2000.000000 0.710867 0.151561 -0.686803 2000.000000 -0.966051 0.176460 0.188700 2000.000000 -0.190993 -0.839629 0.508473 2000.000000 -0.013930 0.300264 -0.953754 2000.000000 -0.376762 0.790943 0.482141 2000.000000 -0.828668 0.536902 -0.158261 2000.000000 0.079964 -0.532638 0.842557 2000.000000 0.177614 -0.505880 -0.844120 2000.000000 -0.941412 -0.281081 -0.186380 2000.000000 0.293193 0.202861 -0.934283 2000.000000 0.347122 -0.564591 0.748828 2000.000000 0.248259 0.617592 -0.746289 2000.000000 0.448425 -0.317934 0.835364 2000.000000 0.970331 -0.073559 0.230317 2000.000000 0.898589 -0.317642 0.302722 2000.000000 -0.751559 0.157200 0.640661 2000.000000 0.702545 -0.670881 -0.237380 2000.000000 -0.917244 -0.364038 0.161679 2000.000000 0.666164 -0.084180 0.741040 2000.000000 -0.765280 -0.488178 -0.419558 2000.000000 -0.259479 0.096959 0.960869 2000.000000 0.587254 -0.773910 0.237057 2000.000000 0.031724 -0.955948 0.291816 2000.000000 -0.906186 -0.148579 0.395918 2000.000000 0.236358 0.173680 0.956018 2000.000000 0.541882 0.476531 0.692302 2000.000000 -0.881610 0.459385 0.108300 2000.000000 -0.523791 0.179960 0.832621 2000.000000 -0.007136 -0.329103 -0.944267 2000.000000 0.592916 0.736130 0.326439 2000.000000 -0.697299 -0.231143 -0.678489 2000.000000 -0.703477 -0.671759 0.232080 2000.000000 -0.063071 0.761076 -0.645589 2000.000000 -0.417172 -0.870844 0.259995 2000.000000 -0.436386 0.540273 0.719494 2000.000000 0.876730 0.103238 0.469773 2000.000000 -0.273602 -0.681365 -0.678885 2000.000000 -0.111496 0.067381 -0.991478 2000.000000 0.004508 0.734420 0.678680 2000.000000 -0.000000 -0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 -0.999125 -0.039720 0.013120 1000.000000 -0.136767 -0.882771 -0.449455 1000.000000 0.152200 -0.922987 0.353455 1000.000000 -0.916022 0.386881 0.105960 1000.000000 0.173950 0.182800 0.967639 1000.000000 0.815779 0.177799 0.550357 1000.000000 -0.624448 -0.653258 0.428158 1000.000000 -0.553775 -0.799536 -0.232539 1000.000000 -0.880650 -0.427041 0.205161 1000.000000 -0.707558 0.511057 0.488039 1000.000000 -0.387926 0.870698 0.302320 1000.000000 -0.577230 0.725040 -0.375663 1000.000000 0.535533 0.028620 0.844029 1000.000000 0.668814 -0.743129 -0.021120 1000.000000 0.301507 0.456250 -0.837215 1000.000000 0.510610 0.563366 0.649535 1000.000000 -0.633422 0.396701 -0.664382 1000.000000 -0.256283 0.631006 -0.732223 1000.000000 -0.034852 0.998166 0.049500 1000.000000 0.511325 -0.267360 -0.816741 1000.000000 -0.374944 -0.915839 0.143720 1000.000000 0.661502 0.233099 -0.712798 1000.000000 -0.880701 0.062280 0.469560 1000.000000 -0.223315 -0.789189 0.572112 1000.000000 -0.110978 0.280141 -0.953522 1000.000000 -0.311272 0.656011 0.687575 1000.000000 -0.902071 0.251940 -0.350420 1000.000000 -0.243629 -0.008660 0.969830 1000.000000 -0.074842 -0.548363 -0.832885 1000.000000 -0.848473 -0.470783 -0.241781 1000.000000

weberam2 commented 1 year ago

Images were acquired on a GE scanner Two separate sequences were acquired: b=1000 with 30 directions, in one phase direction, then b=2000 with 60 directions in opposite phase direction QSIprep was used to preprocess the images and they are concatenated into one .nii.gz file

weberam2 commented 1 year ago

also, this is the QSIprep recon boilerplate figure image

weberam2 commented 1 year ago

also I have the pickle file:

{'version': '1.4.2', 'study_path': 'study', 'subject': 'subject', 'DATA_path': 'study/subject', 'OUTPUT_path': None, 'peaks_filename': None, 'doNormalizeSignal': True, 'doKeepb0Intact': False, 'doComputeNRMSE': False, 'doSaveCorrectedDWI': False, 'doMergeB0': False, 'doDebiasSignal': False, 'DWI-SNR': None, 'doDirectionalAverage': False, 'parallel_jobs': 7, 'parallel_backend': 'loky', 'verbose': 2, 'dwi_filename': '/scratch/qsirecon_wf/sub-Rett01_amico_noddi/sub_Rett01_space_T1w_desc_preproc_recon_wf/fit_noddi/recon_noddi/study/subject/sub-Rett01_space-T1w_desc-preproc_dwi.nii.gz', 'dim': (108, 129, 109), 'pixdim': (1.8, 1.8, 1.8), 'scheme_filename': '/scratch/qsirecon_wf/sub-Rett01_amico_noddi/sub_Rett01_space_T1w_desc_preproc_recon_wf/fit_noddi/recon_noddi/study/subject/sub-Rett01_space-T1w_desc-preproc_dwi.scheme', 'b0_thr': 50.0, 'ATOMS_path': 'study/kernels/NODDI', 'solver_params': {'mode': 2, 'pos': True, 'lambda1': 0.5, 'lambda2': 0.001}, 'lmax': 12, 'ndirs': 32761, 'fit_time': 5898.684504032135}

daducci commented 1 year ago

Images were acquired on a GE scanner Two separate sequences were acquired: b=1000 with 30 directions, in one phase direction, then b=2000 with 60 directions in opposite phase direction QSIprep was used to preprocess the images and they are concatenated into one .nii.gz file

Hi @weberam2 ,

I cannot tell what is going on here, but every time I see fitting results like the one you posted (i.e. saturated IC maps) is because the model is not compatible with your data, and it usually means either (i) the diffusivity used in the model is not correct (I don't think this is your case, it usually happens when fitting e.g. to rats/mice' data) or (ii) the data itself has some problems in it.

In your case, I understood that you performed two separate acquisitions and then merged the two. I suspect something has happened there (e.g. unwanted scaling between the two separate shells?). Did you try fitting with the original NODDI toolbox?

weberam2 commented 1 year ago

Hi @daducci,

Thank you so much for taking the time to read and respond.

"I understood that you performed two separate acquisitions and then merged the two." Yes, two separate scans are acquired, one after the other. QSIPrep by default combines them (concatenation) during the preprocessing.

"Did you try fitting with the original NODDI toolbox?" I had not, but will do so now.

Hmmm, I seem to get an error when I get to the batch_fitting part:

Error using DT_DesignMatrix Arrays have incompatible sizes for this operation. Error in FitLinearDT (line 31) X = DT_DesignMatrix(protocol); Error in GridSearchRician (line 57) D = FitLinearDT(Epn, protocol); Error in ThreeStageFittingVoxel (line 76) [x0 liks] = GridSearchRician(Epn, modelname, grid, protocol, constantsGD, sig); Error in batch_fitting (line 107) parfor i=split_start:split_end

Just to be sure this error was from my data, I also tried the Matalab NODDI code on a sample NODDI dataset and that ran without error.

Hmmm. What do you recommend I do?:

daducci commented 1 year ago

In principle, it's not a problem to acquire two shells separately and then merging the two (yet, I don't know if qsiprep performs additional operations under the hoods). I am not an expert in acquisition, but it's important to be sure the acquisition setup remains the same between the two scans (no scaling, not different corrections, no changing in TR and TE, etc).

Would it be possible to acquire one dummy dataset as a single acquisition and test?

weberam2 commented 1 year ago

Hi @daducci I have an update! I managed to preprocess my data using MRtrix3 (which I think is basically an FSL wrapper) When I then ran AMICO (python), it worked, I think I'm getting nice images: OD: image ISOVF: image ICVF: image

So ultimately I believe it is something with QSIprep.

I will update the issue I posted on the QSIPrep Github. Thank you so much for your quick responses and the wonderful AMICO code :)

daducci commented 1 year ago

Yes, images look good to me!