diff --git a/3 T2 Mapping/1 Monoexponential T2 Mapping/03-Data Fitting/01-T2*.md b/3 T2 Mapping/1 Monoexponential T2 Mapping/03-Data Fitting/01-T2*.md index b586c54..313d9e4 100644 --- a/3 T2 Mapping/1 Monoexponential T2 Mapping/03-Data Fitting/01-T2*.md +++ b/3 T2 Mapping/1 Monoexponential T2 Mapping/03-Data Fitting/01-T2*.md @@ -1,5 +1,5 @@ --- -title: Data Fitting +title: T2* subtitle: Monoexponential T2 Mapping date: 2024-07-25 authors: diff --git a/3 T2 Mapping/1 Monoexponential T2 Mapping/03-Data Fitting/02-Noise.md b/3 T2 Mapping/1 Monoexponential T2 Mapping/03-Data Fitting/02-Noise.md new file mode 100644 index 0000000..7d094e0 --- /dev/null +++ b/3 T2 Mapping/1 Monoexponential T2 Mapping/03-Data Fitting/02-Noise.md @@ -0,0 +1,90 @@ +--- +title: Noise +subtitle: Monoexponential T2 Mapping +date: 2024-07-25 +authors: + - name: Samuelle Stonge + affiliations: + - NeuroPoly Lab, Polytechnique Montreal, Quebec, Canada +numbering: + heading_2: false + figure: + template: Fig. %s +--- +In MRI, noise in the data can make it harder to accurately fit the T2 decay curve, which is problematic given the necessity for highly precise T2 values in clinical contexts. This issue is particularly pronounced when using pixel-wise T2 mapping, as the signal-to-noise (SNR) is much lower compared to region-of-interest (ROI) T2 mapping approaches (Sandino et al., 2015). Figure 4 shows how varying the level of noise in the acquired data can influence the fitting of the T2 relaxation curve and the resulting T2 constant. As observed in this figure, a low SNR can have a considerable impact on the T2 fitting process. + + +:::{figure} #fig3p3cell +:label: t2Plot3 + Impact of noise on T2 relaxometry fitting. The figure shows a single voxel fit with a true T2 relaxation time of 109 ms. As the noise level increases, the accuracy of the T2 fitting decreases, leading to deviations in the estimated T2 relaxation time from the true value. This demonstrates how higher noise levels can adversely affect the reliability of T2 measurements and may result in inaccurate representations of tissue relaxation properties. +::: + + +The number of echoes used in T2 relaxometry is influenced by several factors, including the need for adequate spacing between echoes, the potential risk of heating the sample, and the challenges associated with processing data from samples with low signal-to-noise ratios. Therefore, selecting an optimal number of echoes is crucial for achieving accurate and reliable results while addressing these constraints (Shrager et al., 1998). The Cramer-Rao lower-bound (CRLB) method is a statistical tool that can be used in the context of T2 relaxometry to estimate the smallest possible variance, known as the lower bound, of an unbiased estimator given the noise present in the data (Cavassila et al., 2001). Using the lower bounds, the optimal number of echoes needed to accurately fit the T2 decay curve can be determined, ensuring more robust T2 mapping (Jones et al., 1996). In their work, Shrager et al. (1998) introduced another method for optimizing the selection of echo time points to improve the accuracy of T2 value estimates based on a predetermined range of expected T2 values. Their approach demonstrated superior accuracy compared to conventional methods that use uniformly-spaced echo times, suggesting that these methods are not optimal for T2 curve fitting accuracy. + + +```{admonition} Click here to view the qMRLab (MATLAB/Octave) code that generated Figure 1. +:class: tip, dropdown + +```matlab +%% Requirements +% qMRLab must be installed: git clone https://www.github.com/qMRLab/qMRLab.git +% The mooc chapter branch must be checked out: git checkout mooc-03-T2 +% qMRLab must be added to the path inside the MATLAB session: startup +%% T2 and T2* decay curves + +close all +clear all +clc + +% Define model +Model = mono_t2; + +params.TE = linspace(0, 300, 100); % Echo times (in ms) + +% Define signal parameters for different tissues +x = struct; +x.M0 = 1000; +x.T2 = 109; % (in ms) + +% Define the signal-to-noise ratio +Opt1.SNR = 10; +Opt2.SNR = 50; +Opt3.SNR = 90; +Opt4.SNR = 130; + +% Run the simulation for T2 and T2* decay curves +[FitResult_SNR10, data_SNR10] = Model.Sim_Single_Voxel_Curve(x, Opt1); +[FitResult_SNR50, data_SNR50] = Model.Sim_Single_Voxel_Curve(x, Opt2); +[FitResult_SNR90, data_SNR90] = Model.Sim_Single_Voxel_Curve(x, Opt3); +[FitResult_SNR130, data_SNR130] = Model.Sim_Single_Voxel_Curve(x, Opt4); + +% T2 constants +T2_SNR10 = FitResult_SNR10.T2; +T2_SNR50 = FitResult_SNR50.T2; +T2_SNR90 = FitResult_SNR90.T2; +T2_SNR130 = FitResult_SNR130.T2; + +% T2 decay curves +signal_SNR10 = FitResult_SNR10.M0/1000 * exp(-params.TE / FitResult_SNR10.T2); +signal_SNR50 = FitResult_SNR50.M0/1000 * exp(-params.TE / FitResult_SNR50.T2); +signal_SNR90 = FitResult_SNR90.M0/1000 * exp(-params.TE / FitResult_SNR90.T2); +signal_SNR130 = FitResult_SNR130.M0/1000 * exp(-params.TE / FitResult_SNR130.T2); + +% Noisy data points +EchoTimes = [12.8000; 25.6000; 38.4000; 51.2000; 64.0000; 76.8000; 89.6000; 102.4000; 115.2000; 128.0000; 140.8000; 153.6000; 166.4000; 179.2000; 192.0000; 204.8000; 217.6000; 230.4000; 243.2000; 256.0000; 268.8000; 281.6000; 294.4000; 307.2000; 320.0000; 332.8000; 345.6000; 358.4000; 371.2000; 384.0000]; +SEdata_SNR10 = data_SNR10.SEdata/1000; +SEdata_SNR50 = data_SNR50.SEdata/1000; +SEdata_SNR90 = data_SNR90.SEdata/1000; +SEdata_SNR130 = data_SNR130.SEdata/1000; + +%% Export + +disp(EchoTimes) +disp(params.TE) + +save("t2_noise_simulation.mat", "params", "signal_SNR10", "signal_SNR50", "signal_SNR90", "signal_SNR130", "T2_SNR10", "T2_SNR50", "T2_SNR90", "T2_SNR130", "SEdata_SNR10", "SEdata_SNR50", "SEdata_SNR90", "SEdata_SNR130", "EchoTimes") + +``` + +``` diff --git a/3 T2 Mapping/1 Monoexponential T2 Mapping/04-Benefits and pitfalls.md b/3 T2 Mapping/1 Monoexponential T2 Mapping/04-Benefits and pitfalls.md new file mode 100644 index 0000000..cf06c25 --- /dev/null +++ b/3 T2 Mapping/1 Monoexponential T2 Mapping/04-Benefits and pitfalls.md @@ -0,0 +1,17 @@ +--- +title: Benefits and Pitfalls +subtitle: Monoexponential T2 Mapping +date: 2024-07-25 +authors: + - name: Samuelle Stonge + affiliations: + - NeuroPoly Lab, Polytechnique Montreal, Quebec, Canada +numbering: + heading_2: false + figure: + template: Fig. %s +--- + +The main benefit of mono-exponential T2 mapping is its simplicity and straightforward implementation, making it a convenient and efficient method for T2 fitting. Additionally, as mentioned previously, the use of multi-echo spin echo (MESE) sequences significantly reduces the acquisition time, further enhancing its practicality (Fatemi et al., 2020, (Milford et al., 2015). + +Despite these advantages, mono-exponential methods have certain drawbacks. First, by assuming a single T2 relaxation constant per voxel, the mono-exponential method tends to over-simplify the tissue microstructure, potentially leading to inaccurate T2 estimations. This limitation can be particularly problematic when studying tissues that have a complex microstructure, where a single voxel may contain components with different T2 relaxation times. Furthermore, it has been shown that MESE sequences are sensitive to imperfections in the radiofrequency pulses. For instance, factors such as B1 inhomogeneities and reduced flip angles have been shown to overestimate T2 times when using mono-exponential methods. (Fatemi et al., 2020). \ No newline at end of file diff --git a/binder/data_requirement.json b/binder/data_requirement.json index 42c10ae..f5644b8 100644 --- a/binder/data_requirement.json +++ b/binder/data_requirement.json @@ -3,7 +3,7 @@ "dst": "../data", "projectName": "qmrlab-t1-book" }, - "03-T2":{ "src": "https://github.com/qMRLab/mooc-data/releases/download/v0.1/03-T2.zip", + "03-T2":{ "src": "https://github.com/qMRLab/mooc-data/releases/download/v0.1.2/03-T2.zip", "dst": "../data", "projectName": "03-T2" } diff --git a/figures/3 T2 mapping/fig3p3.ipynb b/figures/3 T2 mapping/fig3p3.ipynb new file mode 100644 index 0000000..19c6b5f --- /dev/null +++ b/figures/3 T2 mapping/fig3p3.ipynb @@ -0,0 +1,2477 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [ + { + "data": { + "application/vnd.plotly.v1+json": { + "config": { + "displayModeBar": false, + "linkText": "Export to plot.ly", + "plotlyServerURL": "https://plot.ly", + "showLink": false + }, + "data": [ + { + "hoverinfo": "x+y+text", + "line": { + "color": "#1f77b4", + "dash": "solid" + }, + "name": "T2 Fitting (T2 = [101.09305])", + "text": "T2 = [101.09305]", + "type": "scatter", + "visible": true, + "x": [ + 0, + 3.0303030303030303, + 6.0606060606060606, + 9.090909090909092, + 12.121212121212121, + 15.151515151515152, + 18.181818181818183, + 21.21212121212121, + 24.242424242424242, + 27.272727272727273, + 30.303030303030305, + 33.333333333333336, + 36.36363636363637, + 39.39393939393939, + 42.42424242424242, + 45.45454545454545, + 48.484848484848484, + 51.515151515151516, + 54.54545454545455, + 57.57575757575758, + 60.60606060606061, + 63.63636363636363, + 66.66666666666667, + 69.6969696969697, + 72.72727272727273, + 75.75757575757575, + 78.78787878787878, + 81.81818181818181, + 84.84848484848484, + 87.87878787878788, + 90.9090909090909, + 93.93939393939394, + 96.96969696969697, + 100, + 103.03030303030303, + 106.06060606060606, + 109.0909090909091, + 112.12121212121212, + 115.15151515151516, + 118.18181818181819, + 121.21212121212122, + 124.24242424242425, + 127.27272727272727, + 130.3030303030303, + 133.33333333333334, + 136.36363636363637, + 139.3939393939394, + 142.42424242424244, + 145.45454545454547, + 148.4848484848485, + 151.5151515151515, + 154.54545454545453, + 157.57575757575756, + 160.6060606060606, + 163.63636363636363, + 166.66666666666666, + 169.6969696969697, + 172.72727272727272, + 175.75757575757575, + 178.78787878787878, + 181.8181818181818, + 184.84848484848484, + 187.87878787878788, + 190.9090909090909, + 193.93939393939394, + 196.96969696969697, + 200, + 203.03030303030303, + 206.06060606060606, + 209.0909090909091, + 212.12121212121212, + 215.15151515151516, + 218.1818181818182, + 221.21212121212122, + 224.24242424242425, + 227.27272727272728, + 230.3030303030303, + 233.33333333333334, + 236.36363636363637, + 239.3939393939394, + 242.42424242424244, + 245.45454545454547, + 248.4848484848485, + 251.5151515151515, + 254.54545454545453, + 257.57575757575756, + 260.6060606060606, + 263.6363636363636, + 266.6666666666667, + 269.6969696969697, + 272.72727272727275, + 275.75757575757575, + 278.7878787878788, + 281.8181818181818, + 284.8484848484849, + 287.8787878787879, + 290.90909090909093, + 293.93939393939394, + 296.969696969697, + 300 + ], + "y": [ + 1.109673179552409, + 1.0769038891418372, + 1.045102294818545, + 1.0142398199577238, + 0.9842887318188118, + 0.9552221166251076, + 0.9270138553792919, + 0.8996386003931338, + 0.8730717525102878, + 0.8472894390017135, + 0.8222684921138588, + 0.7979864282503251, + 0.7744214277683116, + 0.7515523153716819, + 0.7293585410830341, + 0.7078201617776774, + 0.6869178232629208, + 0.6666327428865707, + 0.6469466926590096, + 0.6278419828736895, + 0.6093014462113222, + 0.5913084223134807, + 0.5738467428117529, + 0.5569007167989911, + 0.540455116729606, + 0.5244951647362313, + 0.5090065193504656, + 0.4939752626157597, + 0.47938788758086553, + 0.46523128616261344, + 0.45149273736710605, + 0.4381598958587491, + 0.42522078086684423, + 0.4126637654197771, + 0.4004775658971255, + 0.3886512318903009, + 0.37717413636260966, + 0.3660359660998947, + 0.3552267124431741, + 0.3447366622949509, + 0.3345563893911117, + 0.32467674583057093, + 0.31508885385505, + 0.3057840978716034, + 0.2967541167107259, + 0.28799079611308026, + 0.27948626143809796, + 0.2712328705878981, + 0.2632232071401675, + 0.2554500736838308, + 0.24790648535152224, + 0.2405856635430462, + 0.23348102983418953, + 0.22658620006540836, + 0.21989497860508056, + 0.21340135278216674, + 0.20709948748327903, + 0.20098371990930058, + 0.1950485544868458, + 0.18928865792998767, + 0.18369885444781547, + 0.17827412109351573, + 0.17300958325079768, + 0.16790051025360747, + 0.16294231113519414, + 0.1581305305027086, + 0.1534608445336279, + 0.14892905709040744, + 0.14453109594987, + 0.14026300914394224, + 0.13612096140845265, + 0.1321012307367976, + 0.12820020503537966, + 0.12441437887781341, + 0.1207403503549807, + 0.11717481801810613, + 0.11371457791210483, + 0.1103565206965376, + 0.10709762885158579, + 0.10393497396653496, + 0.10086571410833207, + 0.09788709126784959, + 0.09499642888156375, + 0.09219112942641894, + 0.08946867208571663, + 0.08682661048393256, + 0.08426257048842568, + 0.08177424807606441, + 0.07935940726285165, + 0.07701587809469047, + 0.07474155469748257, + 0.0725343933848091, + 0.07039241082149238, + 0.06831368224138902, + 0.06629633971781233, + 0.06433857048503047, + 0.06243861530933142, + 0.06059476690819163, + 0.058805368416127136, + 0.057068811895849725 + ] + }, + { + "hoverinfo": "x+y+text", + "line": { + "color": "#1f77b4" + }, + "name": "T2 Fitting (T2 = [108.05247632])", + "text": "T2 = [108.05247632]", + "type": "scatter", + "visible": false, + "x": [ + 0, + 3.0303030303030303, + 6.0606060606060606, + 9.090909090909092, + 12.121212121212121, + 15.151515151515152, + 18.181818181818183, + 21.21212121212121, + 24.242424242424242, + 27.272727272727273, + 30.303030303030305, + 33.333333333333336, + 36.36363636363637, + 39.39393939393939, + 42.42424242424242, + 45.45454545454545, + 48.484848484848484, + 51.515151515151516, + 54.54545454545455, + 57.57575757575758, + 60.60606060606061, + 63.63636363636363, + 66.66666666666667, + 69.6969696969697, + 72.72727272727273, + 75.75757575757575, + 78.78787878787878, + 81.81818181818181, + 84.84848484848484, + 87.87878787878788, + 90.9090909090909, + 93.93939393939394, + 96.96969696969697, + 100, + 103.03030303030303, + 106.06060606060606, + 109.0909090909091, + 112.12121212121212, + 115.15151515151516, + 118.18181818181819, + 121.21212121212122, + 124.24242424242425, + 127.27272727272727, + 130.3030303030303, + 133.33333333333334, + 136.36363636363637, + 139.3939393939394, + 142.42424242424244, + 145.45454545454547, + 148.4848484848485, + 151.5151515151515, + 154.54545454545453, + 157.57575757575756, + 160.6060606060606, + 163.63636363636363, + 166.66666666666666, + 169.6969696969697, + 172.72727272727272, + 175.75757575757575, + 178.78787878787878, + 181.8181818181818, + 184.84848484848484, + 187.87878787878788, + 190.9090909090909, + 193.93939393939394, + 196.96969696969697, + 200, + 203.03030303030303, + 206.06060606060606, + 209.0909090909091, + 212.12121212121212, + 215.15151515151516, + 218.1818181818182, + 221.21212121212122, + 224.24242424242425, + 227.27272727272728, + 230.3030303030303, + 233.33333333333334, + 236.36363636363637, + 239.3939393939394, + 242.42424242424244, + 245.45454545454547, + 248.4848484848485, + 251.5151515151515, + 254.54545454545453, + 257.57575757575756, + 260.6060606060606, + 263.6363636363636, + 266.6666666666667, + 269.6969696969697, + 272.72727272727275, + 275.75757575757575, + 278.7878787878788, + 281.8181818181818, + 284.8484848484849, + 287.8787878787879, + 290.90909090909093, + 293.93939393939394, + 296.969696969697, + 300 + ], + "y": [ + 0.9949191102421684, + 0.9674044912062041, + 0.9406507925836692, + 0.9146369710203084, + 0.8893425651185999, + 0.8647476793436654, + 0.8408329683742642, + 0.8175796218865626, + 0.79496934975871, + 0.7729843676845843, + 0.751607383185392, + 0.7308215820081179, + 0.7106106149001289, + 0.6909585847495269, + 0.6718500340811365, + 0.653269932898295, + 0.6352036668608767, + 0.6176370257902569, + 0.6005561924921724, + 0.5839477318886874, + 0.567798580450716, + 0.5520960359227894, + 0.5368277473319871, + 0.5219817052731717, + 0.5075462324628861, + 0.49350997455448586, + 0.47986189120727785, + 0.46659124740264546, + 0.4536876050003256, + 0.44114081452819914, + 0.42894100719913497, + 0.4170785871486101, + 0.40554422388699884, + 0.39432884496059495, + 0.3834236288155943, + 0.37281999785942516, + 0.36250961171396834, + 0.3524843606553598, + 0.34273635923521717, + 0.3332579400782718, + 0.3240416478515279, + 0.3150802334002056, + 0.30636664804585534, + 0.2978940380421584, + 0.28965573918405324, + 0.2816452715659471, + 0.27385633448488983, + 0.26628280148470124, + 0.2589187155371537, + 0.25175828435641984, + 0.24479587584309986, + 0.23802601365424447, + 0.2314433728958901, + 0.225042775934717, + 0.21881918832553696, + 0.21276771485140636, + 0.20688359567325107, + 0.20116220258597345, + 0.19559903537809734, + 0.1901897182920877, + 0.18492999658256054, + 0.17981573316967583, + 0.17484290538508138, + 0.17000760180784813, + 0.16530601918790802, + 0.16073445945457457, + 0.15628932680779306, + 0.15196712488983305, + 0.14776445403519764, + 0.14367800859658694, + 0.1397045743448126, + 0.13584102594061775, + 0.1320843244764144, + 0.12843151508600414, + 0.1248797246204024, + 0.12142615938793826, + 0.11806810295685193, + 0.1148029140186617, + 0.11162802431061981, + 0.10854093659562308, + 0.10553922269798933, + 0.10262052159355467, + 0.09978253755258942, + 0.09702303833407207, + 0.09433985342990034, + 0.09173087235765959, + 0.08919404300060428, + 0.08672736999354777, + 0.08432891315339043, + 0.08199678595305179, + 0.07972915403760635, + 0.07752423378145562, + 0.07538029088540187, + 0.07329563901252031, + 0.07126863846175573, + 0.06929769487820174, + 0.06738125799904665, + 0.06551782043420132, + 0.06370591648064773, + 0.06194412096957819 + ] + }, + { + "hoverinfo": "x+y+text", + "line": { + "color": "#1f77b4" + }, + "name": "T2 Fitting (T2 = [108.50856877])", + "text": "T2 = [108.50856877]", + "type": "scatter", + "visible": false, + "x": [ + 0, + 3.0303030303030303, + 6.0606060606060606, + 9.090909090909092, + 12.121212121212121, + 15.151515151515152, + 18.181818181818183, + 21.21212121212121, + 24.242424242424242, + 27.272727272727273, + 30.303030303030305, + 33.333333333333336, + 36.36363636363637, + 39.39393939393939, + 42.42424242424242, + 45.45454545454545, + 48.484848484848484, + 51.515151515151516, + 54.54545454545455, + 57.57575757575758, + 60.60606060606061, + 63.63636363636363, + 66.66666666666667, + 69.6969696969697, + 72.72727272727273, + 75.75757575757575, + 78.78787878787878, + 81.81818181818181, + 84.84848484848484, + 87.87878787878788, + 90.9090909090909, + 93.93939393939394, + 96.96969696969697, + 100, + 103.03030303030303, + 106.06060606060606, + 109.0909090909091, + 112.12121212121212, + 115.15151515151516, + 118.18181818181819, + 121.21212121212122, + 124.24242424242425, + 127.27272727272727, + 130.3030303030303, + 133.33333333333334, + 136.36363636363637, + 139.3939393939394, + 142.42424242424244, + 145.45454545454547, + 148.4848484848485, + 151.5151515151515, + 154.54545454545453, + 157.57575757575756, + 160.6060606060606, + 163.63636363636363, + 166.66666666666666, + 169.6969696969697, + 172.72727272727272, + 175.75757575757575, + 178.78787878787878, + 181.8181818181818, + 184.84848484848484, + 187.87878787878788, + 190.9090909090909, + 193.93939393939394, + 196.96969696969697, + 200, + 203.03030303030303, + 206.06060606060606, + 209.0909090909091, + 212.12121212121212, + 215.15151515151516, + 218.1818181818182, + 221.21212121212122, + 224.24242424242425, + 227.27272727272728, + 230.3030303030303, + 233.33333333333334, + 236.36363636363637, + 239.3939393939394, + 242.42424242424244, + 245.45454545454547, + 248.4848484848485, + 251.5151515151515, + 254.54545454545453, + 257.57575757575756, + 260.6060606060606, + 263.6363636363636, + 266.6666666666667, + 269.6969696969697, + 272.72727272727275, + 275.75757575757575, + 278.7878787878788, + 281.8181818181818, + 284.8484848484849, + 287.8787878787879, + 290.90909090909093, + 293.93939393939394, + 296.969696969697, + 300 + ], + "y": [ + 0.9902574178526902, + 0.9629852285577477, + 0.9364641291264411, + 0.91067343416468, + 0.8855930279645733, + 0.8612033488149807, + 0.8374853737441649, + 0.8144206036826352, + 0.7919910490346151, + 0.7701792156468797, + 0.7489680911640166, + 0.7283411317594719, + 0.708282249232028, + 0.6887757984576528, + 0.6698065651869292, + 0.6513597541785509, + 0.6334209776596285, + 0.615976244103802, + 0.5990119473184125, + 0.5825148558322167, + 0.5664721025753705, + 0.5508711748436302, + 0.535699904538945, + 0.5209464586788283, + 0.5065993301671059, + 0.4926473288188427, + 0.4790795726324469, + 0.4658854793021449, + 0.45305475796420774, + 0.4405774011704894, + 0.42844367708301906, + 0.41664412188355726, + 0.40516953239219766, + 0.3940109588892551, + 0.3831596981348438, + 0.37260728658069886, + 0.3623454937689481, + 0.35236631591268464, + 0.3426619696533348, + 0.3332248859899497, + 0.3240477043756884, + 0.31512326697688675, + 0.30644461309023363, + 0.2980049737137019, + 0.2897977662669979, + 0.2818165894574133, + 0.2740552182870728, + 0.2665075991976861, + 0.2591678453490144, + 0.25203023202737185, + 0.245089192180578, + 0.23833931207588024, + 0.23177532707745968, + 0.225392117540226, + 0.21918470481669985, + 0.21314824737386717, + 0.20727803701697786, + 0.20156949521734246, + 0.19601816954126344, + 0.19061973017731543, + 0.18536996655926602, + 0.18026478408200286, + 0.17530020090790574, + 0.17047234486117321, + 0.1657774504076805, + 0.1612118557180139, + 0.15677199981139078, + 0.1524544197782373, + 0.14825574807925768, + 0.1441727099188889, + 0.14020212069109106, + 0.1363408834954828, + 0.13258598672188285, + 0.12893450170137497, + 0.12538358042206368, + 0.1219304533077391, + 0.11857242705771866, + 0.11530688254618045, + 0.11213127277935017, + 0.10904312090894815, + 0.10604001830034691, + 0.10311962265393287, + 0.1002796561782064, + 0.09751790381319597, + 0.09483221150280008, + 0.09222048451470988, + 0.08968068580660203, + 0.08721083443732731, + 0.08480900402185601, + 0.08247332122877477, + 0.08020196431916327, + 0.07799316172571094, + 0.07584519067096539, + 0.07375637582363519, + 0.07172508799189856, + 0.06974974285269915, + 0.06782879971603756, + 0.06596076032329483, + 0.06414416767865097, + 0.062377604912686506 + ] + }, + { + "hoverinfo": "x+y+text", + "line": { + "color": "#1f77b4" + }, + "name": "T2 Fitting (T2 = [109.24519802])", + "text": "T2 = [109.24519802]", + "type": "scatter", + "visible": false, + "x": [ + 0, + 3.0303030303030303, + 6.0606060606060606, + 9.090909090909092, + 12.121212121212121, + 15.151515151515152, + 18.181818181818183, + 21.21212121212121, + 24.242424242424242, + 27.272727272727273, + 30.303030303030305, + 33.333333333333336, + 36.36363636363637, + 39.39393939393939, + 42.42424242424242, + 45.45454545454545, + 48.484848484848484, + 51.515151515151516, + 54.54545454545455, + 57.57575757575758, + 60.60606060606061, + 63.63636363636363, + 66.66666666666667, + 69.6969696969697, + 72.72727272727273, + 75.75757575757575, + 78.78787878787878, + 81.81818181818181, + 84.84848484848484, + 87.87878787878788, + 90.9090909090909, + 93.93939393939394, + 96.96969696969697, + 100, + 103.03030303030303, + 106.06060606060606, + 109.0909090909091, + 112.12121212121212, + 115.15151515151516, + 118.18181818181819, + 121.21212121212122, + 124.24242424242425, + 127.27272727272727, + 130.3030303030303, + 133.33333333333334, + 136.36363636363637, + 139.3939393939394, + 142.42424242424244, + 145.45454545454547, + 148.4848484848485, + 151.5151515151515, + 154.54545454545453, + 157.57575757575756, + 160.6060606060606, + 163.63636363636363, + 166.66666666666666, + 169.6969696969697, + 172.72727272727272, + 175.75757575757575, + 178.78787878787878, + 181.8181818181818, + 184.84848484848484, + 187.87878787878788, + 190.9090909090909, + 193.93939393939394, + 196.96969696969697, + 200, + 203.03030303030303, + 206.06060606060606, + 209.0909090909091, + 212.12121212121212, + 215.15151515151516, + 218.1818181818182, + 221.21212121212122, + 224.24242424242425, + 227.27272727272728, + 230.3030303030303, + 233.33333333333334, + 236.36363636363637, + 239.3939393939394, + 242.42424242424244, + 245.45454545454547, + 248.4848484848485, + 251.5151515151515, + 254.54545454545453, + 257.57575757575756, + 260.6060606060606, + 263.6363636363636, + 266.6666666666667, + 269.6969696969697, + 272.72727272727275, + 275.75757575757575, + 278.7878787878788, + 281.8181818181818, + 284.8484848484849, + 287.8787878787879, + 290.90909090909093, + 293.93939393939394, + 296.969696969697, + 300 + ], + "y": [ + 0.9945731582057914, + 0.9673642564597194, + 0.9408997185928845, + 0.9151591807703229, + 0.8901228362579533, + 0.8657714201817652, + 0.842086194703954, + 0.819048934604599, + 0.7966419132577889, + 0.7748478889914019, + 0.7536500918200487, + 0.7330322105409656, + 0.7129783801829292, + 0.6934731697985395, + 0.6745015705904686, + 0.6560489843625482, + 0.6381012122868035, + 0.6206444439777913, + 0.6036652468658347, + 0.5871505558609802, + 0.5710876632997198, + 0.5554642091667451, + 0.5402681715842081, + 0.5254878575611717, + 0.5111118939961289, + 0.49712921892567236, + 0.4835290730125736, + 0.4703009912667296, + 0.4574347949925998, + 0.44492058395694173, + 0.4327487287708151, + 0.4209098634799961, + 0.409394878358097, + 0.39819491289684766, + 0.38730134898814395, + 0.3767058042926182, + 0.3664001257896276, + 0.35637638350369744, + 0.34662686440259355, + 0.33714406646232603, + 0.3279206928945199, + 0.3189496465317096, + 0.31022402436623586, + 0.3017371122385455, + 0.29348237967080476, + 0.28545347484185085, + 0.27764421969961656, + 0.27004860520726504, + 0.2626607867193786, + 0.25547507948464265, + 0.2484859542715638, + 0.24168803311385745, + 0.23507608517223033, + 0.22864502270937323, + 0.22238989717506785, + 0.21630589539839465, + 0.21038833588411174, + 0.20463266521035525, + 0.19903445452488921, + 0.19358939613720821, + 0.18829330020387233, + 0.18314209150452118, + 0.1781318063060887, + 0.1732585893128046, + 0.16851869069963515, + 0.16390846322688213, + 0.15942435943371794, + 0.15506292890849857, + 0.15082081563375394, + 0.14669475540381138, + 0.14268157331306716, + 0.13877818131297165, + 0.13498157583584905, + 0.13128883548372336, + 0.12769711878037177, + 0.12420366198487612, + 0.12080577696498941, + 0.11750084912868218, + 0.11428633541227559, + 0.11115976232361412, + 0.1081187240387722, + 0.10516088055082949, + 0.10228395586929097, + 0.09948573626876638, + 0.09676406858556068, + 0.09411685856086591, + 0.09154206922927836, + 0.08903771935140226, + 0.08660188188933253, + 0.08423268252384532, + 0.08192829821215328, + 0.07968695578511775, + 0.07750693058283671, + 0.07538654512756016, + 0.0733241678329105, + 0.07131821174841567, + 0.0693671333383881, + 0.06746943129421094, + 0.06562364537911618, + 0.06382835530456746 + ] + }, + { + "hoverinfo": "x+y", + "marker": { + "color": "red" + }, + "mode": "markers", + "name": "Data points with SNR = 10", + "type": "scatter", + "visible": true, + "x": [ + 12.8, + 25.6, + 38.4, + 51.2, + 64, + 76.8, + 89.6, + 102.4, + 115.2, + 128, + 140.8, + 153.6, + 166.4, + 179.2, + 192, + 204.8, + 217.6, + 230.4, + 243.2, + 256, + 268.8, + 281.6, + 294.4, + 307.2, + 320, + 332.8, + 345.6, + 358.4, + 371.2, + 384 + ], + "y": [ + 0.9334822145659027, + 1.0386852173982042, + 0.7677695134400612, + 0.5564333200681147, + 0.6302996709624649, + 0.3939812839217607, + 0.31287948465272436, + 0.4546380112223887, + 0.27836669483581084, + 0.33712906094956696, + 0.3998607138803195, + 0.28001302312658366, + 0.299937495489839, + 0.050410377972285855, + 0.2306164210073206, + 0.3429141698802581, + 0.18395104713475366, + -0.01623226960150025, + 0.08933676995245592, + 0.05104350235049924, + 0.11897775261924914, + 0.11214855329828498, + 0.10320035083188105, + 0.02735700989437372, + -0.00019806802726765938, + -0.005219254610400746, + 0.11787362726590538, + -0.12744409941863122, + 0.01475663651638417, + 0.05355474073948683 + ] + }, + { + "hoverinfo": "x+y", + "marker": { + "color": "red" + }, + "mode": "markers", + "name": "Data points with SNR = 50", + "type": "scatter", + "visible": false, + "x": [ + 12.8, + 25.6, + 38.4, + 51.2, + 64, + 76.8, + 89.6, + 102.4, + 115.2, + 128, + 140.8, + 153.6, + 166.4, + 179.2, + 192, + 204.8, + 217.6, + 230.4, + 243.2, + 256, + 268.8, + 281.6, + 294.4, + 307.2, + 320, + 332.8, + 345.6, + 358.4, + 371.2, + 384 + ], + "y": [ + 0.8775927914598302, + 0.7991666774663579, + 0.7018053336504745, + 0.6084875290440914, + 0.5587757504166961, + 0.48954323269435096, + 0.4322544173310592, + 0.37819273187410385, + 0.34863093397000927, + 0.27619991807909505, + 0.26770740155546563, + 0.23467847439515604, + 0.20105471170343683, + 0.2048061957545289, + 0.15873420123682622, + 0.16237282454688912, + 0.15318722620372308, + 0.11799300154954909, + 0.11234065421022223, + 0.10687369190314908, + 0.08347908567732291, + 0.08512915066213612, + 0.044690388626685985, + 0.0794522710465369, + 0.03549088704867973, + 0.014683018151109237, + 0.06659860018738482, + 0.036210156622069625, + 0.04117369697482383, + 0.023052464198592557 + ] + }, + { + "hoverinfo": "x+y", + "marker": { + "color": "red" + }, + "mode": "markers", + "name": "Data points with SNR = 90", + "type": "scatter", + "visible": false, + "x": [ + 12.8, + 25.6, + 38.4, + 51.2, + 64, + 76.8, + 89.6, + 102.4, + 115.2, + 128, + 140.8, + 153.6, + 166.4, + 179.2, + 192, + 204.8, + 217.6, + 230.4, + 243.2, + 256, + 268.8, + 281.6, + 294.4, + 307.2, + 320, + 332.8, + 345.6, + 358.4, + 371.2, + 384 + ], + "y": [ + 0.8791183101190897, + 0.7603184666857072, + 0.7092613330017659, + 0.6223418623483705, + 0.5539563042194494, + 0.49831999486095874, + 0.42552041688559744, + 0.38363598637203783, + 0.3588738060695923, + 0.31493845675381865, + 0.26213228829613416, + 0.2225766604326382, + 0.21162802119818064, + 0.19531287114451718, + 0.18110320799636226, + 0.15368419698027525, + 0.12474437794190545, + 0.12380763532490752, + 0.09581757111752116, + 0.08600612680023524, + 0.07846028717859817, + 0.06336386532722317, + 0.06446674399823596, + 0.05081293226283137, + 0.05026671883030359, + 0.04263836478017759, + 0.03792794614431592, + 0.03235071741481752, + 0.04537506724970117, + 0.03554249220647094 + ] + }, + { + "hoverinfo": "x+y", + "marker": { + "color": "red" + }, + "mode": "markers", + "name": "Data points with SNR = 130", + "type": "scatter", + "visible": false, + "x": [ + 12.8, + 25.6, + 38.4, + 51.2, + 64, + 76.8, + 89.6, + 102.4, + 115.2, + 128, + 140.8, + 153.6, + 166.4, + 179.2, + 192, + 204.8, + 217.6, + 230.4, + 243.2, + 256, + 268.8, + 281.6, + 294.4, + 307.2, + 320, + 332.8, + 345.6, + 358.4, + 371.2, + 384 + ], + "y": [ + 0.8896057475542745, + 0.7806457165254878, + 0.691953169203628, + 0.6117353788180424, + 0.5737256287204496, + 0.5009636625220532, + 0.4413013595589986, + 0.3841791016155908, + 0.33969703807828955, + 0.31277740427645556, + 0.28549656608488455, + 0.23276245989794464, + 0.21419806179022025, + 0.19262202303317222, + 0.15816721952513718, + 0.15851231868419063, + 0.13299656646926974, + 0.1338621321579341, + 0.1047265092451335, + 0.09829930530164731, + 0.07710497788944455, + 0.071236221344754, + 0.05914980506418475, + 0.06238967589703294, + 0.06199390241081271, + 0.04314658095516465, + 0.044961445137631645, + 0.03387584611543931, + 0.033888486662684215, + 0.03769503445500025 + ] + } + ], + "layout": { + "annotations": [ + { + "font": { + "color": "black", + "family": "Times New Roman", + "size": 14 + }, + "showarrow": false, + "text": "True value : T2 = 109 ms ", + "x": 0.2, + "xref": "paper", + "y": 0.96, + "yref": "paper" + }, + { + "font": { + "family": "Times New Roman", + "size": 22 + }, + "showarrow": false, + "text": "Echo Time – TE (ms)", + "x": 0.5004254919715793, + "xref": "paper", + "y": -0.175, + "yref": "paper" + }, + { + "font": { + "family": "Times New Roman", + "size": 22 + }, + "showarrow": false, + "text": "Transverse Magnetization (Mxy)", + "textangle": -90, + "x": -0.15, + "xref": "paper", + "y": 0.5, + "yref": "paper" + }, + { + "font": { + "family": "Times New Roman", + "size": 22 + }, + "showarrow": false, + "text": "SNR:", + "x": 0.15, + "xref": "paper", + "y": -0.35, + "yref": "paper" + } + ], + "height": 470, + "legend": { + "bordercolor": "#000000", + "borderwidth": 2, + "font": { + "color": "#000", + "family": "Times New Roman", + "size": 12 + }, + "traceorder": "normal", + "x": 0.55, + "y": 0.97 + }, + "margin": { + "b": 130, + "l": 100, + "r": 50, + "t": 20 + }, + "template": { + "data": { + "bar": [ + { + "error_x": { + "color": "#2a3f5f" + }, + "error_y": { + "color": "#2a3f5f" + }, + "marker": { + "line": { + "color": "#E5ECF6", + "width": 0.5 + }, + "pattern": { + "fillmode": "overlay", + "size": 10, + "solidity": 0.2 + } + }, + "type": "bar" + } + ], + "barpolar": [ + { + "marker": { + "line": { + "color": "#E5ECF6", + "width": 0.5 + }, + "pattern": { + "fillmode": "overlay", + "size": 10, + "solidity": 0.2 + } + }, + "type": "barpolar" + } + ], + "carpet": [ + { + "aaxis": { + "endlinecolor": "#2a3f5f", + "gridcolor": "white", + "linecolor": "white", + "minorgridcolor": "white", + "startlinecolor": "#2a3f5f" + }, + "baxis": { + "endlinecolor": "#2a3f5f", + "gridcolor": "white", + "linecolor": "white", + "minorgridcolor": "white", + "startlinecolor": "#2a3f5f" + }, + "type": "carpet" + } + ], + "choropleth": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "type": "choropleth" + } + ], + "contour": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "type": "contour" + } + ], + "contourcarpet": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "type": "contourcarpet" + } + ], + "heatmap": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "type": "heatmap" + } + ], + "heatmapgl": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "type": "heatmapgl" + } + ], + "histogram": [ + { + "marker": { + "pattern": { + "fillmode": "overlay", + "size": 10, + "solidity": 0.2 + } + }, + "type": "histogram" + } + ], + "histogram2d": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "type": "histogram2d" + } + ], + "histogram2dcontour": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "type": "histogram2dcontour" + } + ], + "mesh3d": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "type": "mesh3d" + } + ], + "parcoords": [ + { + "line": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "parcoords" + } + ], + "pie": [ + { + "automargin": true, + "type": "pie" + } + ], + "scatter": [ + { + "fillpattern": { + "fillmode": "overlay", + "size": 10, + "solidity": 0.2 + }, + "type": "scatter" + } + ], + "scatter3d": [ + { + "line": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scatter3d" + } + ], + "scattercarpet": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scattercarpet" + } + ], + "scattergeo": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scattergeo" + } + ], + "scattergl": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scattergl" + } + ], + "scattermapbox": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scattermapbox" + } + ], + "scatterpolar": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scatterpolar" + } + ], + "scatterpolargl": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scatterpolargl" + } + ], + "scatterternary": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scatterternary" + } + ], + "surface": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "type": "surface" + } + ], + "table": [ + { + "cells": { + "fill": { + "color": "#EBF0F8" + }, + "line": { + "color": "white" + } + }, + "header": { + "fill": { + "color": "#C8D4E3" + }, + "line": { + "color": "white" + } + }, + "type": "table" + } + ] + }, + "layout": { + "annotationdefaults": { + "arrowcolor": "#2a3f5f", + "arrowhead": 0, + "arrowwidth": 1 + }, + "autotypenumbers": "strict", + "coloraxis": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "colorscale": { + "diverging": [ + [ + 0, + "#8e0152" + ], + [ + 0.1, + "#c51b7d" + ], + [ + 0.2, + "#de77ae" + ], + [ + 0.3, + "#f1b6da" + ], + [ + 0.4, + "#fde0ef" + ], + [ + 0.5, + "#f7f7f7" + ], + [ + 0.6, + "#e6f5d0" + ], + [ + 0.7, + "#b8e186" + ], + [ + 0.8, + "#7fbc41" + ], + [ + 0.9, + "#4d9221" + ], + [ + 1, + "#276419" + ] + ], + "sequential": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "sequentialminus": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ] + }, + "colorway": [ + "#636efa", + "#EF553B", + "#00cc96", + "#ab63fa", + "#FFA15A", + "#19d3f3", + "#FF6692", + "#B6E880", + "#FF97FF", + "#FECB52" + ], + "font": { + "color": "#2a3f5f" + }, + "geo": { + "bgcolor": "white", + "lakecolor": "white", + "landcolor": "#E5ECF6", + "showlakes": true, + "showland": true, + "subunitcolor": "white" + }, + "hoverlabel": { + "align": "left" + }, + "hovermode": "closest", + "mapbox": { + "style": "light" + }, + "paper_bgcolor": "white", + "plot_bgcolor": "#E5ECF6", + "polar": { + "angularaxis": { + "gridcolor": "white", + "linecolor": "white", + "ticks": "" + }, + "bgcolor": "#E5ECF6", + "radialaxis": { + "gridcolor": "white", + "linecolor": "white", + "ticks": "" + } + }, + "scene": { + "xaxis": { + "backgroundcolor": "#E5ECF6", + "gridcolor": "white", + "gridwidth": 2, + "linecolor": "white", + "showbackground": true, + "ticks": "", + "zerolinecolor": "white" + }, + "yaxis": { + "backgroundcolor": "#E5ECF6", + "gridcolor": "white", + "gridwidth": 2, + "linecolor": "white", + "showbackground": true, + "ticks": "", + "zerolinecolor": "white" + }, + "zaxis": { + "backgroundcolor": "#E5ECF6", + "gridcolor": "white", + "gridwidth": 2, + "linecolor": "white", + "showbackground": true, + "ticks": "", + "zerolinecolor": "white" + } + }, + "shapedefaults": { + "line": { + "color": "#2a3f5f" + } + }, + "ternary": { + "aaxis": { + "gridcolor": "white", + "linecolor": "white", + "ticks": "" + }, + "baxis": { + "gridcolor": "white", + "linecolor": "white", + "ticks": "" + }, + "bgcolor": "#E5ECF6", + "caxis": { + "gridcolor": "white", + "linecolor": "white", + "ticks": "" + } + }, + "title": { + "x": 0.05 + }, + "xaxis": { + "automargin": true, + "gridcolor": "white", + "linecolor": "white", + "ticks": "", + "title": { + "standoff": 15 + }, + "zerolinecolor": "white", + "zerolinewidth": 2 + }, + "yaxis": { + "automargin": true, + "gridcolor": "white", + "linecolor": "white", + "ticks": "", + "title": { + "standoff": 15 + }, + "zerolinecolor": "white", + "zerolinewidth": 2 + } + } + }, + "updatemenus": [ + { + "buttons": [ + { + "args": [ + { + "visible": [ + true, + false, + false, + false, + true, + false, + false, + false + ] + } + ], + "label": "10", + "method": "update" + }, + { + "args": [ + { + "visible": [ + false, + true, + false, + false, + false, + true, + false, + false + ] + } + ], + "label": "50", + "method": "update" + }, + { + "args": [ + { + "visible": [ + false, + false, + true, + false, + false, + false, + true, + false + ] + } + ], + "label": "90", + "method": "update" + }, + { + "args": [ + { + "visible": [ + false, + false, + false, + true, + false, + false, + false, + true + ] + } + ], + "label": "130", + "method": "update" + } + ], + "direction": "up", + "font": { + "color": "#000", + "family": "Times New Roman", + "size": 12 + }, + "pad": { + "r": 10, + "t": 10 + }, + "showactive": true, + "x": 0.28, + "xanchor": "left", + "y": -0.22, + "yanchor": "top" + } + ], + "width": 600, + "xaxis": { + "linecolor": "black", + "linewidth": 2, + "range": [ + 0, + 300 + ], + "showgrid": false + }, + "yaxis": { + "linecolor": "black", + "linewidth": 2, + "range": [ + 0, + 1 + ], + "showgrid": false + } + } + } + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "#| label: fig3p2cell\n", + "\n", + "# Prepare Python environment\n", + "import numpy as np\n", + "import scipy.io as sio\n", + "from pathlib import Path\n", + "\n", + "data_dir = Path(\"../../data/03-T2\")\n", + "data_file = \"t2_noise_simulation.mat\"\n", + "\n", + "#Load either archived or generated plot variables\n", + "mat_contents = sio.loadmat(data_dir / data_file)\n", + "\n", + "# Get the signals and parameters from Matlab\n", + "\n", + "# Get matlab signals\n", + "signal_SNR10 = mat_contents['signal_SNR10'][0]\n", + "signal_SNR50 = mat_contents['signal_SNR50'][0]\n", + "signal_SNR90 = mat_contents['signal_SNR90'][0]\n", + "signal_SNR130 = mat_contents['signal_SNR130'][0]\n", + "\n", + "# Get T2 constants from matlab simulation\n", + "T2_SNR10 = mat_contents['T2_SNR10'][0]\n", + "T2_SNR50 = mat_contents['T2_SNR50'][0]\n", + "T2_SNR90 = mat_contents['T2_SNR90'][0]\n", + "T2_SNR130 = mat_contents['T2_SNR130'][0]\n", + "\n", + "# TE \n", + "params = mat_contents['params'][0]\n", + "TE_signals = params['TE'][0][0]\n", + "TE = params['TE'][0][0]\n", + "\n", + "# Noisy data\n", + "SEdata_SNR10 = np.squeeze(mat_contents['SEdata_SNR10'])\n", + "SEdata_SNR50 = np.squeeze(mat_contents['SEdata_SNR50'])\n", + "SEdata_SNR90 = np.squeeze(mat_contents['SEdata_SNR90'])\n", + "SEdata_SNR130 = np.squeeze(mat_contents['SEdata_SNR130'])\n", + "TE_datapoints = np.squeeze(mat_contents['EchoTimes'])\n", + "TE_datapoints = np.squeeze(mat_contents['EchoTimes'])\n", + "\n", + "## Plot\n", + "import matplotlib.pyplot as plt\n", + "import chart_studio.plotly as py\n", + "import plotly.graph_objs as go\n", + "import numpy as np\n", + "from plotly.offline import iplot\n", + "\n", + "config={'showLink': False, 'displayModeBar': False}\n", + "\n", + "# T2 signals with different SNRs\n", + "\n", + "## SNR = 10 \n", + "\n", + "SNR10 = go.Scatter(\n", + " x = TE_signals,\n", + " y = signal_SNR10,\n", + " name = f'T2 Fitting (T2 = {T2_SNR10})',\n", + " text = f'T2 = {T2_SNR10}',\n", + " hoverinfo = 'x+y+text',\n", + " line=dict(color='#1f77b4', dash='solid'),\n", + " visible = True\n", + ")\n", + "\n", + "datapoints_SNR10 = go.Scatter(\n", + " x = TE_datapoints,\n", + " y = SEdata_SNR10,\n", + " name = 'Data points with SNR = 10',\n", + " hoverinfo = 'x+y',\n", + " mode='markers', \n", + " marker=dict(color='red'), \n", + " visible=True\n", + ")\n", + "\n", + "## SNR = 50\n", + "\n", + "SNR50 = go.Scatter(\n", + " x = TE,\n", + " y = signal_SNR50,\n", + " name = f'T2 Fitting (T2 = {T2_SNR50})',\n", + " text = f'T2 = {T2_SNR50}',\n", + " hoverinfo = 'x+y+text',\n", + " line=dict(color='#1f77b4'),\n", + " visible = False\n", + ")\n", + "\n", + "datapoints_SNR50 = go.Scatter(\n", + " x = TE_datapoints,\n", + " y = SEdata_SNR50,\n", + " name = 'Data points with SNR = 50',\n", + " hoverinfo = 'x+y',\n", + " mode='markers', \n", + " marker=dict(color='red'), \n", + " visible=False\n", + ")\n", + "\n", + "## SNR = 90\n", + "\n", + "SNR90 = go.Scatter(\n", + " x = TE_signals,\n", + " y = signal_SNR90,\n", + " name = f'T2 Fitting (T2 = {T2_SNR90})',\n", + " text = f'T2 = {T2_SNR90}',\n", + " hoverinfo = 'x+y+text',\n", + " line=dict(color='#1f77b4'),\n", + " visible = False\n", + ")\n", + "\n", + "datapoints_SNR90 = go.Scatter(\n", + " x = TE_datapoints,\n", + " y = SEdata_SNR90,\n", + " name = 'Data points with SNR = 90',\n", + " hoverinfo = 'x+y',\n", + " mode='markers', \n", + " marker=dict(color='red'), \n", + " visible=False\n", + ")\n", + "\n", + "## SNR = 130\n", + "\n", + "SNR130 = go.Scatter(\n", + " x = TE_signals,\n", + " y = signal_SNR130,\n", + " name = f'T2 Fitting (T2 = {T2_SNR130})',\n", + " text = f'T2 = {T2_SNR130}',\n", + " hoverinfo = 'x+y+text',\n", + " line=dict(color='#1f77b4'),\n", + " visible = False\n", + ")\n", + "\n", + "datapoints_SNR130 = go.Scatter(\n", + " x = TE_datapoints,\n", + " y = SEdata_SNR130,\n", + " name = 'Data points with SNR = 130',\n", + " hoverinfo = 'x+y',\n", + " mode='markers', \n", + " marker=dict(color='red'), \n", + " visible=False\n", + ")\n", + "\n", + "data = [SNR10, SNR50, SNR90, SNR130, datapoints_SNR10, datapoints_SNR50, datapoints_SNR90, datapoints_SNR130]\n", + "\n", + "layout = go.Layout(\n", + " width=600,\n", + " height=470,\n", + " margin=go.layout.Margin(\n", + " l=100,\n", + " r=50,\n", + " b=130,\n", + " t=20,\n", + " ),\n", + " annotations=[\n", + " dict(\n", + " x=0.2,\n", + " y=0.96,\n", + " showarrow=False,\n", + " text='True value : T2 = 109 ms ',\n", + " font=dict(\n", + " family='Times New Roman',\n", + " size=14,\n", + " color = 'black',\n", + " ),\n", + " xref='paper',\n", + " yref='paper'\n", + " ),\n", + " dict(\n", + " x=0.5004254919715793,\n", + " y=-0.175,\n", + " showarrow=False,\n", + " text='Echo Time – TE (ms)',\n", + " font=dict(\n", + " family='Times New Roman',\n", + " size=22\n", + " ),\n", + " xref='paper',\n", + " yref='paper'\n", + " ),\n", + " dict(\n", + " x=-0.15,\n", + " y=0.50,\n", + " showarrow=False,\n", + " text='Transverse Magnetization (Mxy)',\n", + " font=dict(\n", + " family='Times New Roman',\n", + " size=22\n", + " ),\n", + " textangle=-90,\n", + " xref='paper',\n", + " yref='paper'\n", + " ),\n", + " dict(\n", + " x=0.15,\n", + " y=-0.35,\n", + " showarrow=False,\n", + " text='SNR:',\n", + " font=dict(\n", + " family='Times New Roman',\n", + " size=22\n", + " ),\n", + " xref='paper',\n", + " yref='paper'\n", + " ),\n", + " ],\n", + " xaxis=dict(\n", + " range=[0,300],\n", + " showgrid=False,\n", + " linecolor='black',\n", + " linewidth=2\n", + " ),\n", + " yaxis=dict(\n", + " showgrid=False,\n", + " linecolor='black',\n", + " linewidth=2,\n", + " range=[0, 1]\n", + " ),\n", + " legend=dict(\n", + " x=0.55,\n", + " y=0.97,\n", + " traceorder='normal',\n", + " font=dict(\n", + " family='Times New Roman',\n", + " size=12,\n", + " color='#000'\n", + " ),\n", + " bordercolor='#000000',\n", + " borderwidth=2\n", + " ),\n", + " updatemenus=[\n", + " dict(\n", + " buttons=list([\n", + " # Display T2 decay curve and data points with SNR = 10\n", + " dict(\n", + " args=[{'visible': [True, False, False, False, True, False, False, False]}],\n", + " label='10',\n", + " method='update'\n", + " ),\n", + " # Display T2 decay curve and data points with SNR = 50\n", + " dict(\n", + " args=[{'visible': [False, True, False, False, False, True, False, False]}],\n", + " label='50',\n", + " method='update'\n", + " ),\n", + " # Display T2 decay curve and data points with SNR = 90\n", + " dict(\n", + " args=[{'visible': [False, False, True, False, False, False, True, False]}],\n", + " label='90',\n", + " method='update'\n", + " ),\n", + " # Display T2 decay curve and data points with SNR = 130\n", + " dict(\n", + " args=[{'visible': [False, False, False, True, False, False, False, True]}],\n", + " label='130',\n", + " method='update'\n", + " ),\n", + " ]),\n", + " direction='up',\n", + " pad={'r': 10, 't': 10},\n", + " showactive=True,\n", + " x=0.28,\n", + " xanchor='left',\n", + " y=-0.22,\n", + " yanchor='top',\n", + " font=dict(\n", + " family='Times New Roman',\n", + " size=12,\n", + " color='#000'\n", + " )\n", + " ),\n", + " ]\n", + ") \n", + "\n", + "fig = dict(data=data, layout=layout)\n", + "\n", + "iplot(fig, filename = 'ir_fig_2.html', config = config)" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "base", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.12.2" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +}