Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fit linear flip angle dependence when estimating R2*#114

Open
lukeje wants to merge 29 commits into
masterfrom
add_r2s-fa-dep
Open

Fit linear flip angle dependence when estimating R2*#114
lukeje wants to merge 29 commits into
masterfrom
add_r2s-fa-dep

Conversation

@lukeje

@lukeje lukeje commented Feb 3, 2025

Copy link
Copy Markdown
Member

Milotta, et al. (2023, "Mitigating the impact of flip angle and orientation dependence in single compartment R2* estimates via 2-pool modeling". Magn Reson Med. doi:10.1002/mrm.29428) showed that the current R2* ESTATICS algorithm has some bias due to the presence of multiple water pools, and that this can be corrected by including a linear flip angle-dependence of R2* in the fitting. This pull request makes this model available to users of the hMRI toolbox.

Caveats

  • This model cannot be used with MT-weighted data; MTsat maps must therefore be generated with a separate run of the hMRI toolbox
  • Fitting an additional parameter means that the resulting quantitative maps are more noisy. This can be mitigated in part by using the denoising module and weighted least squares fitting ('WLS1'). If noise is an issue, the original ESTATICS algorithm can still be used, which represents a good compromise between SNR and bias (Milotta, et al. (2023))
  • Testing with the demo dataset didn't show much difference to normal ESTATICS. This might reflect that the model was developed for 7T data, where MT contributions are larger, whereas the demo data was recorded at 3T. It would be good if we could test this implementation with some of the original data used in Milotta, et al. (2023)

@lukeje lukeje added the enhancement New feature or request label Feb 3, 2025
@Barisevrenugur

Copy link
Copy Markdown
Contributor

as reviewers are also possibly working on it, I took a general look at the code and have the following point-outs for now:

@lukeje

lukeje commented Mar 14, 2025

Copy link
Copy Markdown
Member Author

I don't know if it is being reviewed; I didn't hear from Martina or Giorgia.

Please feel free to fix the typo in Giorgia's name; sorry about that.

While you're right that the image description saying just "ESTATICS" could be misleading, I don't think using "Milotta" as a label would be best as a replacement, as it isn't very descriptive. How about something like "ESTATICS with linear flip angle modelling"?

@Barisevrenugur

Copy link
Copy Markdown
Contributor

Perhaps you can send them a reminder then.

no problem I will fix it.

an even better and more descriptive one is pehaps ""ESTATICS (Weiskopf et al. 2014) with linear flip angle modelling (Milotta et al. 2023)" but then please feel free to choose the one you like. as far as I looked into mtprot code now, any change will require adding and reading off the field famethod within the mtprot to set up the proper conditional on this line

mpm_params.output(coutput).descrip{end+1} = '- ESTATICS model (R2* map calculation)';

in order to write the correct message depending on the fit method

I don't know if it is being reviewed; I didn't hear from Martina or Giorgia.

Please feel free to fix the typo in Giorgia's name; sorry about that.

While you're right that the image description saying just "ESTATICS" could be misleading, I don't think using "Milotta" as a label would be best as a replacement, as it isn't very descriptive. How about something like "ESTATICS with linear flip angle modelling"?

@Barisevrenugur

Copy link
Copy Markdown
Contributor

aah the field is already there, disregard my comment below : mpm_params.R2s_fit_method

Perhaps you can send them a reminder then.

no problem I will fix it.

an even better and more descriptive one is pehaps ""ESTATICS (Weiskopf et al. 2014) with linear flip angle modelling (Milotta et al. 2023)" but then please feel free to choose the one you like. as far as I looked into mtprot code now, any change will require adding and reading off the field famethod within the mtprot to set up the proper conditional on this line

mpm_params.output(coutput).descrip{end+1} = '- ESTATICS model (R2* map calculation)';

in order to write the correct message depending on the fit method

I don't know if it is being reviewed; I didn't hear from Martina or Giorgia.
Please feel free to fix the typo in Giorgia's name; sorry about that.
While you're right that the image description saying just "ESTATICS" could be misleading, I don't think using "Milotta" as a label would be best as a replacement, as it isn't very descriptive. How about something like "ESTATICS with linear flip angle modelling"?

@Barisevrenugur

Copy link
Copy Markdown
Contributor

I think this is a bug, you are feeding mpm_params.R2s_fit_method in place of the argument famethod on this line

R2s = hmri_calc_R2s(struct('data',data,'TE',TE_pdw),mpm_params.R2s_fit_method);

but value of mpm_params.R2s_fit_method is really OLS but famethod can only accept none or linear.

aah the field is already there, disregard my comment below : mpm_params.R2s_fit_method

Perhaps you can send them a reminder then.
no problem I will fix it.
an even better and more descriptive one is pehaps ""ESTATICS (Weiskopf et al. 2014) with linear flip angle modelling (Milotta et al. 2023)" but then please feel free to choose the one you like. as far as I looked into mtprot code now, any change will require adding and reading off the field famethod within the mtprot to set up the proper conditional on this line

mpm_params.output(coutput).descrip{end+1} = '- ESTATICS model (R2* map calculation)';

in order to write the correct message depending on the fit method

I don't know if it is being reviewed; I didn't hear from Martina or Giorgia.
Please feel free to fix the typo in Giorgia's name; sorry about that.
While you're right that the image description saying just "ESTATICS" could be misleading, I don't think using "Milotta" as a label would be best as a replacement, as it isn't very descriptive. How about something like "ESTATICS with linear flip angle modelling"?

@Barisevrenugur

Barisevrenugur commented Mar 14, 2025

Copy link
Copy Markdown
Contributor

I think my confusion was due to calling of the function with fitmethod versus famethod as last argument, the below point is probably fine, it is not a bug, I will look closer.

I think this is a bug, you are feeding mpm_params.R2s_fit_method in place of the argument famethod on this line

R2s = hmri_calc_R2s(struct('data',data,'TE',TE_pdw),mpm_params.R2s_fit_method);

but value of mpm_params.R2s_fit_method is really OLS but famethod can only accept none or linear.

aah the field is already there, disregard my comment below : mpm_params.R2s_fit_method

Perhaps you can send them a reminder then.
no problem I will fix it.
an even better and more descriptive one is pehaps ""ESTATICS (Weiskopf et al. 2014) with linear flip angle modelling (Milotta et al. 2023)" but then please feel free to choose the one you like. as far as I looked into mtprot code now, any change will require adding and reading off the field famethod within the mtprot to set up the proper conditional on this line

mpm_params.output(coutput).descrip{end+1} = '- ESTATICS model (R2* map calculation)';

in order to write the correct message depending on the fit method

I don't know if it is being reviewed; I didn't hear from Martina or Giorgia.
Please feel free to fix the typo in Giorgia's name; sorry about that.
While you're right that the image description saying just "ESTATICS" could be misleading, I don't think using "Milotta" as a label would be best as a replacement, as it isn't very descriptive. How about something like "ESTATICS with linear flip angle modelling"?

@Barisevrenugur Barisevrenugur added the createMaps assoc. to create maps module label Apr 23, 2025
@Barisevrenugur

Copy link
Copy Markdown
Contributor

@lukeje as I was reviewing your last commit, it caught my eye that the only piece of code that fDeltaR2s substantially appears outside of the OLS code:

end % OLS code

is this code block:

if ~isempty(fDeltaR2s)
fDeltaR2s_final = fullfile(respath, spm_file(fDeltaR2s,'filename'));
copyfile(fDeltaR2s,fDeltaR2s_final);
try copyfile([spm_str_manip(fDeltaR2s,'r') '.json'],[spm_str_manip(fDeltaR2s_final,'r') '.json']); end
fDeltaR2s = fDeltaR2s_final;
end

@line1134.

Would it make sense to remove the ~isempty(fDeltaR2s) and move it to the end of the conditional of the ols code finishing at:

end % OLS code

because the above code block executes whenever fDeltaR2s is not empty but this is in turn only possible if the ols code block is executed (R2s_ols is True), otherwise it is set to empty anyways as you also commented out here:

% fDeltaR2s was set to empty above; define filename if OLS fit enabled and R2* flip angle dependence is linear

so I thought it might make sense to move it into the ols code without the conditional in order to keep the related code together.

@lukeje

lukeje commented May 2, 2025

Copy link
Copy Markdown
Member Author

That last code block is copying the files from MPMcalc to the Results and Supplementary directories. If you check the code, you can see that this happens at the end of the script for all of the maps. I think it's a good idea to keep all of this copying together rather than doing some of it earlier and some of it later.

Edit: I also just remembered that fDeltaR2s is a returned value, so it always needs to be defined.

@mfcallaghan mfcallaghan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR indicates that this work is correcting an MT effect but it is simply an exchange effect between two distinct, on resonance pools - water in the intra/extracellular space or in the myelin sheath.

Comment thread hmri_create_MTProt.m Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

createMaps assoc. to create maps module enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants