Skip to content

ENH: Add GQI to available models #143

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

ENH: Add GQI to available models #143

wants to merge 2 commits into from

Conversation

oesteban
Copy link
Member

Enables Generalized Q-Imaging to the portfolio of DIPY supported models.

I'm hitting the issue that this model does not have a predict() implementation (cc/ @yasseraleman).

NotImplementedError: This model does not have prediction implemented yet

@arokem, would it be very hard to write?

Copy link

codecov bot commented May 24, 2025

Codecov Report

Attention: Patch coverage is 30.70866% with 88 lines in your changes missing coverage. Please review.

Project coverage is 67.43%. Comparing base (fb8f3f3) to head (47e926d).

Files with missing lines Patch % Lines
src/nifreeze/model/gqi.py 30.00% 84 Missing ⚠️
src/nifreeze/model/dmri.py 50.00% 3 Missing ⚠️
src/nifreeze/model/base.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #143      +/-   ##
==========================================
- Coverage   71.35%   67.43%   -3.93%     
==========================================
  Files          23       24       +1     
  Lines        1138     1262     +124     
  Branches      139      145       +6     
==========================================
+ Hits          812      851      +39     
- Misses        283      368      +85     
  Partials       43       43              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@arokem
Copy link
Contributor

arokem commented May 24, 2025 via email

@oesteban
Copy link
Member Author

Yes. IIUC, GQI is not really a model in the sense that parameters are fit to data according to some equation. Rather, much like DSI from which it was derived, it’s a way to compute an ODF from diffusion data. So in some sense the model “prediction” would identical to the data.

If I understood @yasseraleman correctly yesterday, you can "reconstruct" the data from the ODF by calculating a kernel. In our leave-one-out framework, this would not make sense in "single fit mode" (i.e., fit with ALL the data once and then predict individual orientations so the model plays the role of "regularizing" that particular orientation and therefore you would get something different from the original training data). However, it could be useful in the standard operation mode where QBI would be "fit" on all the data except the orientation you are about to "predict".

The "model" situation you describe would be the same for the Gaussian Process: if you "predict" on an orientation that went into "fitting" then you get exactly the training data point (therefore useless for our framework).

Is there a particular reason to implement it for nifreeze?

Yes, I've been tryining to fine tune DTI to work on a multi-shell dataset and it doesn't really work. If you use all b-values the fit is far from great (reasonably) and if you only use b < 1500, then the predictions beyond that b value are not usable as registration target (reasonably, too).

Talking with @yasseraleman, he suggested QBI as a good candidate for basically any multi-b scheme (multishell, DSI) with high b-values where DTI and DKI run very very short. He mentioned it because he actually does this prediction it in his code.

@arokem
Copy link
Contributor

arokem commented May 24, 2025

Gotcha, yes, that does seem like an interesting option. But doesn't that push the problem to fitting an adequate kernel? In particular, you'd have to define how the kernel behaves at higher b-values (presumably something non-Gaussian). So, you'd have to fit a kernel to data (or maybe I am missing something? @yasseraleman: how do you do this?) The conceptual issues aside, I think this would not be too hard to implement, maybe first as a sub-class here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants