High angular resolution diffusion imaging
In this example we will compute the signal using the same gradient sequence in many different directions.
Building a biological model
We start by loading SpinDoctor and a Makie plotting backend.
using SpinDoctor
using LinearAlgebra
if haskey(ENV, "GITHUB_ACTIONS")
using CairoMakie
else
using GLMakie
end
Here we create a recipe for five stacked plates with isotropic diffusion tensors. They should allow for free diffusion in the horizontal direction, but a rather restricted vertical diffusion with the permeable membranes.
ncell = 5
setup = PlateSetup(;
name = "Plates",
width = 50.0,
depth = 50.0,
heights = fill(5.0, ncell),
bend = 0.0,
twist = 0.0,
)
coeffs = coefficients(
setup;
D = [0.002 * I(3) for _ = 1:ncell],
T₂ = fill(Inf, ncell),
ρ = fill(1.0, ncell),
κ = (; interfaces = fill(1e-4, ncell - 1), boundaries = fill(0.0, ncell)),
γ = 2.67513e-4,
)
(D = StaticArrays.SMatrix{3, 3, Float64, 9}[[0.002 0.0 0.0; 0.0 0.002 0.0; 0.0 0.0 0.002], [0.002 0.0 0.0; 0.0 0.002 0.0; 0.0 0.0 0.002], [0.002 0.0 0.0; 0.0 0.002 0.0; 0.0 0.0 0.002], [0.002 0.0 0.0; 0.0 0.002 0.0; 0.0 0.0 0.002], [0.002 0.0 0.0; 0.0 0.002 0.0; 0.0 0.0 0.002]], T₂ = [Inf, Inf, Inf, Inf, Inf], κ = [0.0001, 0.0001, 0.0001, 0.0001, 0.0, 0.0, 0.0, 0.0, 0.0], ρ = ComplexF64[1.0 + 0.0im, 1.0 + 0.0im, 1.0 + 0.0im, 1.0 + 0.0im, 1.0 + 0.0im], γ = 0.000267513)
We then proceed to build the geometry and finite element mesh.
mesh, = create_geometry(setup; recreate = true)
plot_mesh(mesh)
The mesh looks good, so we may then proceed to assemble the biological model and the associated finite element matrices.
model = Model(; mesh, coeffs...)
matrices = assemble_matrices(model);
We may also compute some useful quantities, including a scalar diffusion coefficient from the diffusion tensors.
volumes = get_cmpt_volumes(model.mesh)
D_avg = 1 / 3 * tr.(model.D)' * volumes / sum(volumes)
ncompartment = length(model.mesh.points)
5
The gradient pulse sequence will be a PGSE with both vertical and horizontal components. This allows for both restricted vertical diffusion and almost unrestricted horizontal diffusion. The different approaches should hopefully confirm this behaviour.
directions = unitsphere(200)
profile = PGSE(2500.0, 4000.0)
b = 1000
g = √(b / int_F²(profile)) / model.γ
gradients = [ScalarGradient(d, profile, g) for d ∈ eachcol(directions)]
200-element Vector{ScalarGradient{Float64}}:
ScalarGradient{Float64}([0.09987492177719094, 0.0, 0.995], PGSE{Float64}(2500.0, 4000.0), 0.8402604538082508)
ScalarGradient{Float64}([-0.12723619955312943, -0.11655878140782122, 0.985], PGSE{Float64}(2500.0, 4000.0), 0.8402604538082508)
ScalarGradient{Float64}([0.01942642095897662, 0.2213540471026556, 0.975], PGSE{Float64}(2500.0, 4000.0), 0.8402604538082508)
ScalarGradient{Float64}([0.1595630187894423, -0.20812170245988318, 0.965], PGSE{Float64}(2500.0, 4000.0), 0.8402604538082508)
ScalarGradient{Float64}([-0.2920717300973464, 0.051663376563509125, 0.955], PGSE{Float64}(2500.0, 4000.0), 0.8402604538082508)
ScalarGradient{Float64}([0.2759673217251014, 0.17554782066398444, 0.945], PGSE{Float64}(2500.0, 4000.0), 0.8402604538082508)
ScalarGradient{Float64}([-0.09206807289524455, -0.3424886420793481, 0.935], PGSE{Float64}(2500.0, 4000.0), 0.8402604538082508)
ScalarGradient{Float64}([-0.17512950731951155, 0.33720120946702586, 0.925], PGSE{Float64}(2500.0, 4000.0), 0.8402604538082508)
ScalarGradient{Float64}([0.37897278281913344, -0.13840025246480533, 0.915], PGSE{Float64}(2500.0, 4000.0), 0.8402604538082508)
ScalarGradient{Float64}([-0.3932272900331072, -0.16231850902844852, 0.905], PGSE{Float64}(2500.0, 4000.0), 0.8402604538082508)
⋮
ScalarGradient{Float64}([0.38779157933629155, 0.11132246402170842, -0.915], PGSE{Float64}(2500.0, 4000.0), 0.8402604538082508)
ScalarGradient{Float64}([-0.19847966401151332, -0.32400744277543486, -0.925], PGSE{Float64}(2500.0, 4000.0), 0.8402604538082508)
ScalarGradient{Float64}([-0.06767932075740114, 0.34813001815674643, -0.9350000000000002], PGSE{Float64}(2500.0, 4000.0), 0.8402604538082508)
ScalarGradient{Float64}([0.26289658667602694, -0.19457745171035143, -0.9450000000000002], PGSE{Float64}(2500.0, 4000.0), 0.8402604538082508)
ScalarGradient{Float64}([-0.2949885227072603, -0.03093172272907189, -0.9550000000000001], PGSE{Float64}(2500.0, 4000.0), 0.8402604538082508)
ScalarGradient{Float64}([0.1738465895841933, 0.19634755738217066, -0.9650000000000001], PGSE{Float64}(2500.0, 4000.0), 0.8402604538082508)
ScalarGradient{Float64}([0.0037635501177745454, -0.22217298596028903, -0.9750000000000002], PGSE{Float64}(2500.0, 4000.0), 0.8402604538082508)
ScalarGradient{Float64}([-0.11869709900898746, 0.12524375707735075, -0.9850000000000001], PGSE{Float64}(2500.0, 4000.0), 0.8402604538082508)
ScalarGradient{Float64}([0.0996261233000393, -0.007045250613366899, -0.9950000000000001], PGSE{Float64}(2500.0, 4000.0), 0.8402604538082508)
We may solve the BTPDE for each gradient.
btpde = BTPDE(; model, matrices)
solver = IntervalConstantSolver(; timestep = 10.0)
ξ, = solve_multigrad(btpde, gradients, solver)
(Vector{ComplexF64}[[0.6227896975801076 - 0.4564425067098879im, 0.6983070659930033 - 0.29076853753509563im, 0.7003953243215352 - 0.3068226527476778im, 0.6401711994884943 - 0.44850059257598957im, 0.6383540038931967 + 0.12784091220660632im, 0.5932565277244367 + 0.27239216272169225im, 0.5986966449565657 + 0.22676375724628559im, 0.632178137520047 + 0.10160080030107833im, 0.6242891768982607 + 0.24032277651105907im, 0.6289561810692751 - 0.39568141618346797im … 0.6318126783580558 - 0.23924159083310462im, 0.6495905622048437 + 0.3675569969504086im, 0.6090617897184404 - 0.3441784144307195im, 0.6646909984807126 + 0.34183071820827626im, 0.6397885593914696 + 0.3710115349488386im, 0.6544471426963221 + 0.36300772049946095im, 0.6327838807055977 + 0.37685175749137384im, 0.6358778846067753 + 0.37273095432938486im, 0.6251721210375201 - 0.22436755941787914im, 0.6611719194485911 + 0.36178899774626005im], [0.7132975597579255 - 0.16746886657870858im, 0.6490416466325573 - 0.3693038153085283im, 0.5923891812699583 - 0.5079702114626293im, 0.6787782627265776 - 0.35653027315149155im, 0.5410875370929192 + 0.37190311362459866im, 0.6086119588325961 + 0.1878919610388424im, 0.6376725079183548 + 0.017222647802301053im, 0.6176318514332971 + 0.18030553564166465im, 0.5997155572087136 + 0.2390532764548255im, 0.6061539702821032 - 0.3662162735056656im … 0.6113369625870807 - 0.2172486866850558im, 0.6160515137864452 + 0.3434245549956195im, 0.6499200718662483 - 0.16016275333702068im, 0.5542444808479084 + 0.49354545858766413im, 0.6125735511451 + 0.36189020321888254im, 0.6254821117131677 + 0.36809469282491436im, 0.6125941195811804 + 0.3674408069314028im, 0.6355211928265884 + 0.3434112732225985im, 0.6389206279526212 - 0.11494311334220125im, 0.579511428360091 + 0.4645368720059136im], [0.537972599328422 - 0.5489806230077615im, 0.575262729663313 - 0.5148800527263189im, 0.7302032747214996 - 0.17581873341387436im, 0.7183409953843376 - 0.19280497845061312im, 0.6397322670850423 + 0.005061269384757599im, 0.645597339801615 + 0.033262254413200985im, 0.559048629578336 + 0.3219252612933423im, 0.5636699317043565 + 0.3117056036520808im, 0.5861870424502027 + 0.21567320784036395im, 0.5916586937636947 - 0.36557073480918106im … 0.5959788904601145 - 0.21374754805868584im, 0.6244013360966744 + 0.3287302044413086im, 0.5680929685213159 - 0.2746163548575457im, 0.6236423886797783 + 0.35354584089830055im, 0.6512719836582298 + 0.31972156690767817im, 0.6555547975994124 + 0.3217060628813358im, 0.5952166903215866 + 0.34577613708701976im, 0.630207754869736 + 0.328011145870069im, 0.582676951083178 - 0.365684050655821im, 0.7031734548920785 + 0.185167368561487im], [0.6642437210283817 - 0.3018906881097828im, 0.7212592811515095 - 0.034821081108112155im, 0.6378554156773861 - 0.3948622239460097im, 0.5046054734506524 - 0.6208128723822052im, 0.5925528579155126 + 0.22917754896219172im, 0.48386322758241035 + 0.44126937150886775im, 0.6173010384567007 + 0.10791861198189731im, 0.6304832007207731 - 0.11433258981409364im, 0.5674944160375692 + 0.20320952699440997im, 0.5645272801698779 - 0.34811216796271793im … 0.5754119882726049 - 0.21174652726624435im, 0.5837922591690777 + 0.31186131387122024im, 0.5880392188999628 - 0.3451801750043798im, 0.6227746363116933 + 0.27999488933318206im, 0.5584904131709764 + 0.35110372797185496im, 0.5706250697551737 + 0.3396342344341213im, 0.5747474160215584 + 0.32419920332658714im, 0.5682454093363358 + 0.35017959345412825im, 0.6263374179185873 - 0.055040023208598333im, 0.5813479538200659 + 0.4753142008797741im], [0.6710003540433271 - 0.16596494744091242im, 0.4897032967055044 - 0.5981449461204639im, 0.5974587762880856 - 0.4319455622086633im, 0.7397648561375375 - 0.05137920147564603im, 0.5298935155360046 + 0.33126742007454724im, 0.6384223843415527 - 0.07635158033199435im, 0.6210190206185463 + 0.04453501039678482im, 0.518230584508096 + 0.413344584242647im, 0.5457015271916825 + 0.21190328465559652im, 0.5492427069879582 - 0.30285995259560283im … 0.5451942953233889 - 0.190056396190085im, 0.5745248808554975 + 0.29786670797422204im, 0.6427074273089218 - 0.035228055547711155im, 0.5049734299731664 + 0.5507444251348184im, 0.569599858677217 + 0.2928901147078503im, 0.5764992090520311 + 0.29928753846301437im, 0.5487946161416766 + 0.3165087171891312im, 0.62675797830819 + 0.28785197608808555im, 0.5712727723247215 - 0.2016988856538354im, 0.5655238316605934 + 0.32218274816549336im], [0.41841623311378917 - 0.6720931860662702im, 0.6558077818117453 - 0.25893186998491724im, 0.7419686949031586 - 0.021937814952657585im, 0.6267391645238336 - 0.3982156619452188im, 0.6256118160218133 - 0.17351072726897732im, 0.5675266334496913 + 0.23315428396521082im, 0.5095187612099257 + 0.4277391862651534im, 0.6218400901009103 + 0.0874052092552663im, 0.5287287810196276 + 0.18878676402986858im, 0.5254278776526001 - 0.3025714201927166im … 0.5393191388459839 - 0.19460035814426754im, 0.5381083237898915 + 0.2778043177961944im, 0.5172144384913664 - 0.4264504307553235im, 0.6877074265425049 + 0.15674757741810524im, 0.5692698238052745 + 0.2701832508040882im, 0.5716869482091287 + 0.2695892300013857im, 0.532864026321412 + 0.29692877056483385im, 0.549696914597617 + 0.32019212115613443im, 0.5304439497316863 - 0.3076578210762587im, 0.6646310392711213 + 0.16017133667809133im], [0.6912063144675462 + 0.03850046657290629im, 0.6622295666025727 - 0.12352599279020389im, 0.4966356945624556 - 0.5983562834457898im, 0.5600634948586524 - 0.503246394421743im, 0.4385204558002439 + 0.4743223670169023im, 0.5098359280325635 + 0.32662368124502056im, 0.6254487519663445 - 0.1442356909782552im, 0.6267160432269026 - 0.030467593835711976im, 0.5115662980423247 + 0.18440068446765776im, 0.5083608864834718 - 0.2916365202605392im … 0.5246608374777879 - 0.1733126685276699im, 0.5082033055326151 + 0.25656949967735443im, 0.5914322777577475 - 0.12952161555901695im, 0.4780351295026514 + 0.40902417432789734im, 0.5192189051706255 + 0.32875501903855703im, 0.534189243192031 + 0.3225394249883208im, 0.5244956396144771 + 0.28992522309060775im, 0.5301559920489336 + 0.28688151055246575im, 0.6227577140705763 + 0.0757601658126276im, 0.48556151909439005 + 0.5630383501743411im], [0.5328740572228351 - 0.43904705315511167im, 0.366297268640806 - 0.6863912586756119im, 0.6876561964840935 - 0.1827036992634708im, 0.7187865140058436 + 0.10617967276643053im, 0.5909060822193083 + 0.04169234210481061im, 0.5988491149857469 - 0.23711428027282183im, 0.5613553089352532 + 0.2575047454168628im, 0.437266884045564 + 0.5020272834726868im, 0.4956376349735632 + 0.17283087623079205im, 0.5021276327891984 - 0.2755520530375927im … 0.49653906260933345 - 0.1511735610111313im, 0.5385335305030275 + 0.2537916794992469im, 0.5385191895388806 - 0.10418055310119896im, 0.5103381698637128 + 0.4126472196115325im, 0.5761740268801603 + 0.2449014595921847im, 0.5748044841890932 + 0.2571261016626153im, 0.4936806766436337 + 0.279905213498603im, 0.5839437880323686 + 0.2453464425292123im, 0.5298533082552208 - 0.38923270254466186im, 0.6546248855973699 + 0.08825070164706132im], [0.5378945846792843 - 0.46340788260426724im, 0.6767157172486755 + 0.11645984886879135im, 0.668424425607036 - 0.18746360538020015im, 0.42333537178306435 - 0.6659177743643333im, 0.6066207137327798 + 0.0051433704499299045im, 0.39927476750467944 + 0.49871997628484016im, 0.5632909484227041 + 0.24807194992063714im, 0.5978245829611037 - 0.2374068598220101im, 0.4643106354943262 + 0.15641420064684877im, 0.45192129817829685 - 0.25644973716517644im … 0.47691690821840504 - 0.16721012051454306im, 0.4809917869378319 + 0.24322712429964727im, 0.521920383896142 - 0.4527705266368608im, 0.6561555540843015 + 0.09480918060230989im, 0.4581677950710207 + 0.28056307440707035im, 0.4662846639072057 + 0.2682254838045459im, 0.47311642932423964 + 0.2523376612216798im, 0.48876257376260573 + 0.31808097634662125im, 0.534016119284958 - 0.07577144283906459im, 0.5528749729164758 + 0.35293933463863675im], [0.6522611111384863 + 0.13845286124512887im, 0.5086369263922268 - 0.4499864866697367im, 0.4849800949206132 - 0.5509530115868745im, 0.6966078387220738 - 0.11604498441921073im, 0.38288191517109704 + 0.5155424921088452im, 0.5820003641667574 + 0.002311937940624708im, 0.6212160710472157 - 0.15714721234322315im, 0.5540300080950623 + 0.31199314799971306im, 0.4582417890183105 + 0.17852821613221254im, 0.45580134722442955 - 0.20972569870338986im … 0.46574272327536176 - 0.1497131179900403im, 0.4484439779222525 + 0.21375675403785302im, 0.6254496157276956 + 0.09125520953575536im, 0.4207871286306045 + 0.5629306790381535im, 0.43848296899450073 + 0.2606195007317075im, 0.4549201119267745 + 0.25301860637025525im, 0.4701218193344439 + 0.24780496982133257im, 0.5306971671936412 + 0.24267262881640458im, 0.528218015110175 - 0.022646060885586957im, 0.429127135999974 + 0.40971479532440386im] … [0.5542700007011317 + 0.4164838942168589im, 0.6592911331451531 - 0.17391433454581995im, 0.6525266252802786 + 0.21392048272873224im, 0.3848080874111018 + 0.6888990247148113im, 0.5961863448146922 - 0.03933032150959174im, 0.3649519878942525 - 0.5281707919203902im, 0.5694585729001103 - 0.21307826109960806im, 0.5785182457692014 + 0.27906361992573453im, 0.44581914965102776 - 0.14224184630183423im, 0.4314752936224698 + 0.24771746781978873im … 0.45787121753217336 + 0.15823532813665656im, 0.46644963657336724 - 0.23066351742797225im, 0.514658319084919 + 0.44043316700190416im, 0.6354134859146865 - 0.0890690508072233im, 0.43867266787428283 - 0.2766004492100013im, 0.44656001058986355 - 0.26298581436102775im, 0.4542108442763459 - 0.2382090054328536im, 0.47398244438225173 - 0.3107841310008559im, 0.5336571920542917 + 0.03787079039919516im, 0.53465999398023 - 0.3776874455748185im], [0.6645071242734106 - 0.07971665555661923im, 0.49685632539641356 + 0.49320914296401264im, 0.5095271426349308 + 0.5255812327004037im, 0.7082712389208977 + 0.0847776160746777im, 0.4169793656530858 - 0.4828873251783457im, 0.5949485884339266 + 0.027091075254067693im, 0.6259468539868327 + 0.11449256110584746im, 0.5402708314619584 - 0.3479018695473554im, 0.4757809839194 - 0.18503149485824286im, 0.47433774995096534 + 0.2258685502367983im … 0.4806991967834314 + 0.15821925036120854im, 0.4721074421425309 - 0.23121728000654068im, 0.63552533816686 - 0.0749336224816427im, 0.436884041558867 - 0.5705199912185943im, 0.46260414531133665 - 0.26642641967210384im, 0.47501120880721287 - 0.2592079489945576im, 0.48587008528312803 - 0.2597164074679524im, 0.5518977784023475 - 0.25048279193422723im, 0.5347307348788675 + 0.06119493517568128im, 0.45350340297467806 - 0.388515896992815im], [0.3525899343071177 + 0.7061093930663743im, 0.5703555778482476 + 0.39976696606753787im, 0.7381018401531898 - 0.06072297436804019im, 0.6764118182947567 + 0.21714713361148508im, 0.5953616709811439 + 0.24470815145140196im, 0.5945942218390944 - 0.07019875550292907im, 0.47217577485458967 - 0.47667199507745517im, 0.5759647559595992 - 0.23481498801479955im, 0.48501673383214605 - 0.16269436265014098im, 0.48324867051086856 + 0.27602595629572696im … 0.5052656826970308 + 0.16966445202563712im, 0.5018358496652077 - 0.24216675678971508im, 0.47780047647943646 + 0.3492082334065426im, 0.6284162469416121 - 0.1777865152388543im, 0.5674829999153586 - 0.23563779411392247im, 0.5708608495363848 - 0.24520690491960065im, 0.4986590893949627 - 0.2690591768204741im, 0.5327135666476244 - 0.2828852019109917im, 0.5121296750547107 + 0.400335037219407im, 0.6854661340040556 - 0.037643899578427106im], [0.6860361486527202 + 0.09160223017156659im, 0.6845940892998104 - 0.024001746169575226im, 0.5530944143339804 + 0.5166816758546438im, 0.47055516048152113 + 0.6164112226354345im, 0.5065477700273295 - 0.3721638500002202im, 0.44991800837447604 - 0.44466955978596884im, 0.6249543589596783 + 0.05141962871014195im, 0.6120384550702452 + 0.15459733210517046im, 0.5143678556481526 - 0.17236302006103119im, 0.5095953766275109 + 0.30428669717042045im … 0.5242211975301054 + 0.1821467698467395im, 0.5217492546608236 - 0.2620559655742129im, 0.5700350477108435 + 0.24430883252883384im, 0.5317351776478888 - 0.30855296608741245im, 0.5200536740971229 - 0.32756185206163246im, 0.527347136825711 - 0.3154735530740113im, 0.5228339219430284 - 0.280751276253294im, 0.5167986607352876 - 0.3036627575291097im, 0.623953858028967 - 0.06653738616939954im, 0.5147916394978556 - 0.551292858515848im], [0.6180335050278557 + 0.29285611633619885im, 0.41416144327716725 + 0.6792592261767597im, 0.6420206690869227 + 0.32561592874254097im, 0.7385947279263443 - 0.0543647633464433im, 0.5667715472683434 - 0.2061418340881425im, 0.6286944463749756 + 0.18467655125199445im, 0.596446334415941 - 0.13853474345724115im, 0.466161789099297 - 0.4849378168815975im, 0.530324344597915 - 0.197242165998351im, 0.5351437680976011 + 0.294047772580608im … 0.5254159757992272 + 0.17757896584358232im, 0.5722690823312465 - 0.28340867620957777im, 0.6044128167363507 + 0.0578420117891617im, 0.5110427263074179 - 0.504858880157038im, 0.5773504462230374 - 0.2661471327451509im, 0.5815941523778279 - 0.276138838914887im, 0.5259971917281009 - 0.30241653980057004im, 0.6223796223277351 - 0.2691377557520824im, 0.5509843038821877 + 0.29673400507347353im, 0.6109663129753066 - 0.21185767474065337im], [0.5040761666227278 + 0.5814956723105118im, 0.7005595871906342 + 0.13237932748743067im, 0.7222707500122707 + 0.13409429181266386im, 0.5667715165246635 + 0.5280819386258276im, 0.6374554160187658 + 0.05943814504709944im, 0.5238114191780721 - 0.35470874956544im, 0.5507237352965032 - 0.33947161878849147im, 0.6370259859945322 + 0.03137545147420391im, 0.5477202016410999 - 0.20232647178982796im, 0.5437837335055206 + 0.3166696273984776im … 0.555020846386222 + 0.20481921766892544im, 0.5580498633797704 - 0.2989401428554332im, 0.5465436389053192 + 0.4463986366999199im, 0.6982426436158068 - 0.167047766515604im, 0.5591258081865583 - 0.3067470006367223im, 0.5650727879157409 - 0.2961511448791973im, 0.5506708869246842 - 0.3111823622787455im, 0.5564517195462276 - 0.342768748587264im, 0.5565873930657628 + 0.21535701272968075im, 0.6345634105020276 - 0.27774146052999793im], [0.7137083875609627 + 0.04055417520925893im, 0.6394706237744546 + 0.3250053316569722im, 0.5403488029015432 + 0.5656562870543911im, 0.6605206742224291 + 0.36460401270489345im, 0.4815208240977944 - 0.4487589580275995im, 0.5858645483535193 - 0.1983048119228695im, 0.640438830341729 + 0.0719248612165816im, 0.6203362633593248 - 0.1488977781845841im, 0.5653001807715604 - 0.2217444719186741im, 0.568083688506261 + 0.3287364058510568im … 0.5757836284032508 + 0.19562844055593576im, 0.5665766370249252 - 0.30516596849684985im, 0.6416334085201179 + 0.10354049945968931im, 0.507486301254325 - 0.5005668698244999im, 0.5673124254794181 - 0.3467134448638474im, 0.5817412767638354 - 0.34803811155259295im, 0.5767747592431689 - 0.33804639654279606im, 0.5997791353432677 - 0.31722187651570066im, 0.6270061690096884 + 0.03969870623009619im, 0.5262683520411079 - 0.5018518688764545im], [0.5473528620971385 + 0.5316561433533749im, 0.5640582598755552 + 0.5339839656349713im, 0.7251813506625753 + 0.19039416180056243im, 0.723803606369304 + 0.17291244066139919im, 0.6368062237755597 - 0.022323672657837725im, 0.6484783892556333 - 0.014319588290418602im, 0.5631265504439725 - 0.3083633416830933im, 0.5567979106252223 - 0.3290756916348262im, 0.5857899727927388 - 0.21633827485217988im, 0.591865347110738 + 0.3650244845167184im … 0.5954313778109367 + 0.2125270680442337im, 0.625929449130294 - 0.3291204979147826im, 0.5723023410956419 + 0.2584858667335464im, 0.615473950838031 - 0.36897870230476437im, 0.651158143969197 - 0.31934791623704273im, 0.6558667425447717 - 0.3225366516369314im, 0.5948053366284012 - 0.3463374644723721im, 0.6335930922144098 - 0.3256244662804734im, 0.583618983574176 + 0.36498871841538466im, 0.7005805320034956 - 0.18783936139944302im], [0.6616801649701123 + 0.3574896233369517im, 0.7220210134460894 + 0.1599314208954im, 0.6616324069553904 + 0.3787318192132904im, 0.5743728152523977 + 0.5517147638708105im, 0.612927582392989 - 0.20657273264312023im, 0.540581675025806 - 0.3680234286863338im, 0.6154855821530985 - 0.14752242561228274im, 0.6406095793585455 + 0.013420392985532105im, 0.6042829628618209 - 0.22826561155501046im, 0.6060375985733911 + 0.37877882651588884im … 0.6130822780459051 + 0.22914661471059808im, 0.6235337032081133 - 0.34644048688231455im, 0.6086603475373935 + 0.33995250426802953im, 0.643603848812018 - 0.32614293438111097im, 0.6026082247883218 - 0.3692086904544658im, 0.6177349743999994 - 0.36106990404092604im, 0.6135551740941748 - 0.35912518862409465im, 0.6086328537328475 - 0.3672328874347923im, 0.635626687953568 + 0.1263879974603503im, 0.6172908692788677 - 0.4420066244344221im], [0.6794297652867738 + 0.3068119740774909im, 0.627258237998434 + 0.4574216968681612im, 0.6478368540004769 + 0.415908632363714im, 0.7111234107165516 + 0.28557952560323663im, 0.5922462182011581 - 0.2645553803976207im, 0.6405115127932395 - 0.12285608257388596im, 0.6207912981435839 - 0.12083069774786201im, 0.5969846437411257 - 0.2560305639400476im, 0.6171457450304515 - 0.2460276965107748im, 0.6259607934345834 + 0.3871353162301133im … 0.6283114531262124 + 0.2307744255959057im, 0.6514650115768585 - 0.3663738106328092im, 0.6443169405635023 + 0.19846448742739262im, 0.59116036598735 - 0.4795021125273081im, 0.6460391149690589 - 0.3609452035633085im, 0.6595626959536548 - 0.3689767426994434im, 0.6302517266233955 - 0.38075030164624174im, 0.6614720552390643 - 0.35345319833786054im, 0.6310267193960227 + 0.21626708929273492im, 0.6348993196620568 - 0.38138389128636885im]], [0.6656320095062256, 0.6760590076446533, 0.7542200088500977, 0.659343957901001, 0.6497371196746826, 0.769740104675293, 0.6709699630737305, 0.6787419319152832, 0.6809990406036377, 0.7444407939910889 … 0.6734509468078613, 0.6848981380462646, 0.7439870834350586, 0.6766178607940674, 0.6704549789428711, 0.6996140480041504, 0.726125955581665, 0.6869330406188965, 0.6922049522399902, 0.7191159725189209])
The signals are computed from the magnetization field through quadrature.
signal = [abs(compute_signal(matrices.M, ξ)) for ξ ∈ ξ]
200-element Vector{Float64}:
37005.69382048703
35966.4960565195
35014.66774308326
34024.49860540044
33010.40745768582
32061.884305437685
31014.29472338982
30046.387818877425
29121.30322784354
28132.295633439513
⋮
29100.968567566288
30066.695930583362
31061.488707143013
32018.717464737216
33064.13621779007
33958.6314170913
35013.12923302178
36013.28738028371
36978.95607169844
We may plot the directionalized signal.
plot_hardi(directions, signal)
The signal attenuates the most in the horizontal direction, as that is where diffusion is restricted the least.
This page was generated using Literate.jl.