Add periodic FlowPath magnetization remapping - #935
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #935 +/- ##
==========================================
- Coverage 91.38% 88.96% -2.43%
==========================================
Files 137 137
Lines 7255 7293 +38
==========================================
- Hits 6630 6488 -142
- Misses 625 805 +180
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
Here is an example of the issue being solved for a spoiled GRE sequence. The artifact presents itself as a flash at the start the of the cycle, most noticeable at the outlet region. NN remapping performs nearest neighbor remapping of magnetization. The magnitude of this issue is very sequence dependent, so it may be more or less present depending on sequence. @cncastillo |
|
I have come across an issue that needs some investigation here. Currently this implementation requires block splitting at periodic boundaries. This is fine for precession blocks, however for excitation blocks this requires splitting the RF pulse. I am not entirely sure how this will affect the simulation accuracy, especially for more advanced methods like BlochMagnus. Unfortunately I believe this is required, as this requires communication of magnetization between spins, which conflicts directly with the kernel architecture which is one spin per thread. One upside, even if this somewhat breaks the calculation of the RF pulse, it likely will not break it as much as the current implementation where particles can teleport across the entire phantom, resulting in crazy state mixing. Basically, the end result would mean that sometimes a single RF pulse may split into two excitation blocks with non-zero start/end strength. And in-between them there is a re-mixing of magnetization. @cncastillo @pvillacorta curious what you think. |
|
Hi! Sorry for the delay in replying. I think this RF-splitting is worthwhile, as long as this behavior in the simulation is isolated to the FlowPath case. I still need to fully understand this specific issue and see how it fits into some of the other issues we have already addressed. If I understand correctly, in #620 we identified two related problems involving periodic motion and flow:
I want to reiterate that I think this solution is worthwhile because it simulates the behavior much more accurately. Just to clarify one more point:
The particles are still going to teleport, right? It's just that their magnetization will be able to acquire more accurate values when the period is reset. So, just to make sure I understand the proposed solution correctly. Thanks! |
|
Yes, this directly addresses #620.
And to your final comment, yes the spins will still teleport, and thanks to your changes in #638 the teleport is over
There are a few minor fixes I still need to add, but otherwise this seems to be functional on my end. |
…e, remapping is no longer GPU only

Summary
Adds GPU magnetization remapping for periodic, non-closed
FlowPathmotion.cycle_mapKoma does not calculate the mapping; it must be supplied with the phantom.
Testing
KomaMRIBase: 775 tests passedKomaMRICoreCPU: 437 tests passedKomaMRIFiles: 24,450 tests passedCloses #930