diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 25937f8..a42c03a 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -48,7 +48,7 @@ jobs: - name: Build HTML Assets run: myst build --execute --html - name: Upload artifact - uses: actions/upload-pages-artifact@v1 + uses: actions/upload-pages-artifact@v4 with: path: './_build/html' - name: Deploy to GitHub Pages diff --git a/3 T2 Mapping/1 Monoexponential T2 Mapping/02-Signal modelling.md b/3 T2 Mapping/1 Monoexponential T2 Mapping/02-Signal modelling.md index 8f922a2..6621ae7 100644 --- a/3 T2 Mapping/1 Monoexponential T2 Mapping/02-Signal modelling.md +++ b/3 T2 Mapping/1 Monoexponential T2 Mapping/02-Signal modelling.md @@ -24,10 +24,12 @@ where Mz(0-) is the longitudinal magnetization immediately preceding the 90 degr Figure 3 shows transverse relaxation curves for T2 and T2* values for white matter and gray matter, using the relaxation times from Siemonsen et al. (2008). + :::{figure} #fig3p2cell :label: t2Plot2 -Figure 3. Transverse relaxation decay curves for T2 and T2* values in white matter and gray matter. The T2 and T2* constants were taken from Siemonsen et al. (2008). +Transverse relaxation decay curves for T2 and T2* values in white matter and gray matter. The T2 and T2* constants were taken from Siemonsen et al. (2008). ::: + In NMR physics, it has been shown that T2 relaxation times must be equal to or shorter than 2T1 (Levitt, 2008); however, it has been demonstrated that T2 can exceed T1 in very rare cases (Traficante, 1991). In living organisms however, T2 is always shorter than T1. diff --git a/figures/3 T2 mapping/fig3p2.ipynb b/figures/3 T2 mapping/fig3p2.ipynb new file mode 100644 index 0000000..0bf14eb --- /dev/null +++ b/figures/3 T2 mapping/fig3p2.ipynb @@ -0,0 +1,2035 @@ +{ + "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 = 109.77 ms (White Matter)", + "text": "T2 = 109.77 ms (White Matter)", + "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, + 0.9727716305617135, + 0.9462846452256947, + 0.9205188573117115, + 0.8954546297899187, + 0.8710728603147747, + 0.847354966666459, + 0.8242828725886977, + 0.8018389940122005, + 0.7800062256532122, + 0.758767927976963, + 0.738107914516083, + 0.7180104395343159, + 0.698460186026129, + 0.6794422540430751, + 0.6609421493380081, + 0.6429457723184977, + 0.6254394073010251, + 0.6084097120577698, + 0.5918437076480193, + 0.5757287685264537, + 0.5600526129207657, + 0.5448032934712813, + 0.52996918812545, + 0.5155389912802615, + 0.5015017051658409, + 0.48784663146365476, + 0.4745633631529387, + 0.46164177657913474, + 0.449072023738291, + 0.4368445247715459, + 0.42494996066397345, + 0.4133792661422295, + 0.402123622765581, + 0.39117445220505764, + 0.3805234097055989, + 0.3701623777262184, + 0.3600834597533342, + 0.35027897428255406, + 0.3407414489643246, + 0.33146361490898696, + 0.32243840114689504, + 0.313658929239377, + 0.3051185080364298, + 0.2968106285771551, + 0.2887289591290462, + 0.2808673403623486, + 0.2732197806558136, + 0.2657804515302695, + 0.25854368320652865, + 0.25150396028424604, + 0.24465591753843444, + 0.23799433583043497, + 0.2315141381302242, + 0.22521038564702794, + 0.21907827406529168, + 0.21311312988313974, + 0.20731040685053204, + 0.20166568250440425, + 0.19617465479815013, + 0.19083313882287778, + 0.18563706361794058, + 0.1805824690683126, + 0.17566550288644261, + 0.17088241767628817, + 0.16622956807729058, + 0.16170340798611532, + 0.15730048785403938, + 0.1530174520579269, + 0.14885103634278835, + 0.14479806533397507, + 0.14085545011711245, + 0.13702018588392756, + 0.13328934964217728, + 0.1296600979879311, + 0.12612966493851127, + 0.12269535982443819, + 0.11935456523877488, + 0.11610473504230745, + 0.11294339242304113, + 0.1098681280085332, + 0.10687659802962389, + 0.103966522534166, + 0.10113568364939182, + 0.09838192389159252, + 0.09570314452182285, + 0.09309730394637689, + 0.09056241616081648, + 0.08809654923636592, + 0.08569782384751995, + 0.08336441183974244, + 0.0810945348361645, + 0.07888646288221937, + 0.07673851312718266, + 0.07464904854161089, + 0.07261647666970333, + 0.07063924841563393, + 0.06871585686293015, + 0.06684483612599784, + 0.06502476023291748 + ] + }, + { + "hoverinfo": "x+y+text", + "line": { + "color": "#ff7f0e", + "dash": "solid" + }, + "name": "T2 = 96.07 ms (Gray Matter)", + "text": "T2 = 96.07 ms (Gray Matter)", + "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, + 0.9689496233673424, + 0.9388633726237147, + 0.9097113112971411, + 0.8814644324543761, + 0.854094629838376, + 0.8275746699019642, + 0.8018781647098608, + 0.7769795456821155, + 0.7528540381528146, + 0.7294776367187524, + 0.7068270813535342, + 0.6848798342633449, + 0.6636140574613559, + 0.6430085910384548, + 0.6230429321086762, + 0.6036972144083865, + 0.5849521885289198, + 0.5667892027629995, + 0.5491901845458846, + 0.5321376224727762, + 0.5156145488745896, + 0.49960452293475566, + 0.4840916143302523, + 0.4690603873805867, + 0.45449588568895927, + 0.4403836172603238, + 0.4267095400815386, + 0.41346004814925874, + 0.4006219579316675, + 0.38818249525057646, + 0.3761292825708413, + 0.3644503266844454, + 0.35313400677699824, + 0.342169062864773, + 0.3315445845907783, + 0.3212500003687166, + 0.31127506686402656, + 0.30160985880154284, + 0.29224475908963227, + 0.2831704492509789, + 0.2743779001504971, + 0.2658583630111465, + 0.25760336070870854, + 0.24960467933686478, + 0.2418543600341814, + 0.2343446910648697, + 0.22706820014544168, + 0.22001764700962606, + 0.21318601620414604, + 0.20656651010819155, + 0.20015254216963851, + 0.19393773035128736, + 0.1879158907805971, + 0.18208103159659822, + 0.176427346987861, + 0.17094921141558733, + 0.16564117401607753, + 0.16049795317700274, + 0.15551443128208617, + 0.15068564961896383, + 0.14600680344515832, + 0.14147323720725574, + 0.13708043990852914, + 0.13282404062039896, + 0.12869980413326412, + 0.12470362674237703, + 0.12083153216456785, + 0.11707966758175696, + 0.11344429980731703, + 0.10992181157147173, + 0.10650869792203349, + 0.10320156273690041, + 0.09999711534484079, + 0.0968921672512042, + 0.09388362896529984, + 0.09096850692628661, + 0.08814390052451486, + 0.08540699921535719, + 0.08275507972265524, + 0.0801855033290012, + 0.0776957132501565, + 0.07528323209099616, + 0.07294565938044698, + 0.07068066918296656, + 0.06848600778418715, + 0.066359491448421, + 0.06429900424579592, + 0.0623024959468591, + 0.06036797998255451, + 0.05849353146754344, + 0.05667728528490202, + 0.05491743423028922, + 0.05321222721373955, + 0.05155996751729037, + 0.04995901110671092, + 0.048407764995652414, + 0.046904685660592256, + 0.04544827750499442, + 0.044037091371158826 + ] + }, + { + "hoverinfo": "x+y+text", + "line": { + "color": "#1f77b4", + "dash": "dot" + }, + "name": "T2* = 67.63 ms (White Matter)", + "text": "T2* = 67.63 ms (White Matter)", + "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": [ + 1, + 0.9561819276909578, + 0.914283878842796, + 0.8742217217286707, + 0.8359150111118285, + 0.7992868267107165, + 0.7642636187422415, + 0.7307750602330236, + 0.6987539058020883, + 0.6681358566314267, + 0.6388594313532869, + 0.610865842594935, + 0.5840988789329862, + 0.5585047920202701, + 0.5340321886585793, + 0.5106319276005816, + 0.48825702087367373, + 0.46686253942763356, + 0.4464055229166104, + 0.42684489343429455, + 0.4081413730290452, + 0.39025740483334675, + 0.37315707764921996, + 0.35680605383815556, + 0.34117150037077126, + 0.32622202289774044, + 0.3119276027096052, + 0.2982595364588895, + 0.28519037852347245, + 0.2726938858954879, + 0.26074496548508563, + 0.24931962373324143, + 0.23839491843243507, + 0.22794891265845438, + 0.21796063072081867, + 0.2084100160433694, + 0.19927789089045236, + 0.19054591785782113, + 0.1821965630509343, + 0.17421306087670949, + 0.16657938037803424, + 0.15928019304343408, + 0.15230084202725871, + 0.14562731271858023, + 0.13924620459970596, + 0.13314470433779635, + 0.12731056005555677, + 0.12173205672933769, + 0.11639799266524316, + 0.11129765700601019, + 0.10642080822349387, + 0.10175765355357012, + 0.0972988293321613, + 0.0930353821928995, + 0.08895875108867163, + 0.08506075010094614, + 0.0813335520023615, + 0.07776967253957079, + 0.07436195540478135, + 0.07110355786581285, + 0.06798793702581851, + 0.06500883668507856, + 0.06216027477848509, + 0.05943653136349148, + 0.056832137134407365, + 0.054341862439974506, + 0.05196070678217167, + 0.049683888775161535, + 0.047506836544217085, + 0.045425178545348735, + 0.04343473478719748, + 0.041531508437568, + 0.039711677797747036, + 0.037971588628491974, + 0.036307746812279516, + 0.03471681133708065, + 0.03319558758757307, + 0.03174102093031964, + 0.03035019058003208, + 0.029020303734603015, + 0.027748689967129817, + 0.026532795863668933, + 0.025370179895953623, + 0.024258507518779334, + 0.02319554648221201, + 0.0221791623492067, + 0.021207314209635158, + 0.020278050582116798, + 0.019389505495423176, + 0.018539894741588164, + 0.01772751229319921, + 0.01695072687767639, + 0.016207978701659527, + 0.015497776318926798, + 0.01481869363555469, + 0.014169367046306426, + 0.013548492696498, + 0.012954823863844323, + 0.01238716845502749, + 0.01184438661196081 + ] + }, + { + "hoverinfo": "x+y+text", + "line": { + "color": "#ff7f0e", + "dash": "dot" + }, + "name": "T2* = 48.48 ms (Gray Matter)", + "text": "T2* = 48.48 ms (Gray Matter)", + "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": [ + 1, + 0.9394071909129929, + 0.8824858703390402, + 0.8290135724756054, + 0.7787813113480533, + 0.7315927640290116, + 0.6872635033487658, + 0.6456202770978864, + 0.6065003309049934, + 0.5697507721432606, + 0.5352279723796091, + 0.5027970060311855, + 0.47233112303521907, + 0.4437112534712944, + 0.4168255421999516, + 0.3915689116988417, + 0.36784265138786665, + 0.3455540318382631, + 0.3246159423578417, + 0.304946550535954, + 0.2864689824175876, + 0.26911102205660953, + 0.252804829273924, + 0.23748667451745564, + 0.22309668978771127, + 0.20957863465546128, + 0.19687967645706728, + 0.18495018380839245, + 0.17374353263028364, + 0.1632159239275147, + 0.15332621260901533, + 0.14403574668036337, + 0.13530821618005556, + 0.12710951126915399, + 0.11940758891967936, + 0.11217234768072941, + 0.10537551003286959, + 0.09899051187100188, + 0.09299239868377715, + 0.0873577280237882, + 0.08206447788736812, + 0.07709196064591387, + 0.07242074219235298, + 0.06803256598675235, + 0.06391028170421785, + 0.06003777820621734, + 0.056399920573359914, + 0.05298249095353595, + 0.049772132994234275, + 0.04675629964186151, + 0.04392320410404732, + 0.041261773783281136, + 0.03876160700183949, + 0.036412932348871434, + 0.03420657049075816, + 0.032133898295490404, + 0.030186815130850437, + 0.02835771120468204, + 0.02663943782351226, + 0.025025279453286985, + 0.02350892747302497, + 0.02208445551881166, + 0.020746296321769806, + 0.01948921994948233, + 0.018308313365828652, + 0.017198961229347904, + 0.016156827855083183, + 0.015177840269408495, + 0.014258172291611132, + 0.01339422958001588, + 0.012582635584206438, + 0.011820218348441231, + 0.011103998114687399, + 0.010431175676821655, + 0.009799121440482964, + 0.009205365145819386, + 0.00864758621296256, + 0.00812360467249708, + 0.00763137264547815, + 0.007168966339698881, + 0.00673457853092633, + 0.006326511499720452, + 0.005943170396231132, + 0.005583057007040751, + 0.005244763899691255, + 0.004926968922010834, + 0.004628430034741813, + 0.004347980457274135, + 0.004084524107512483, + 0.003837031318054703, + 0.0036045348119389457, + 0.0033861259222316598, + 0.003180951040681307, + 0.002988208281558189, + 0.002807144347641519, + 0.002637051586105207, + 0.002477265222795744, + 0.0023271607640930002, + 0.0021861515561995386, + 0.0020536864923194776 + ] + } + ], + "layout": { + "annotations": [ + { + "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" + } + ], + "height": 375, + "legend": { + "bordercolor": "#000000", + "borderwidth": 2, + "font": { + "color": "#000", + "family": "Times New Roman", + "size": 12 + }, + "traceorder": "normal", + "x": 0.53, + "y": 0.97 + }, + "margin": { + "b": 60, + "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, + true, + false, + false + ] + } + ], + "label": "T2", + "method": "update" + }, + { + "args": [ + { + "visible": [ + false, + false, + true, + true + ] + } + ], + "label": "T2*", + "method": "update" + }, + { + "args": [ + { + "visible": [ + true, + true, + true, + true + ] + } + ], + "label": "T2 and T2*", + "method": "update" + } + ], + "direction": "down", + "font": { + "color": "#000", + "family": "Times New Roman", + "size": 12 + }, + "pad": { + "r": 10, + "t": 10 + }, + "showactive": true, + "x": 0.3, + "xanchor": "left", + "y": 1, + "yanchor": "top" + } + ], + "width": 600, + "xaxis": { + "linecolor": "black", + "linewidth": 2, + "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", + "\n", + "import scipy.io as sio\n", + "from pathlib import Path\n", + "\n", + "data_dir = Path(\"../../data/03-T2\")\n", + "data_file = \"t2_and_t2star_curvs.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", + "# T2\n", + "T2_signal_WM = mat_contents['signal_WM_T2'][0]\n", + "T2_signal_GM = mat_contents['signal_GM_T2'][0]\n", + "\n", + "# T2*\n", + "T2star_signal_WM = mat_contents['signal_WM_T2star'][0]\n", + "T2star_signal_GM = mat_contents['signal_GM_T2star'][0]\n", + "\n", + "# TE \n", + "params = mat_contents['params']\n", + "TE = mat_contents['params']['TE'][0][0][0]\n", + "\n", + "## Plot\n", + "\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\n", + "\n", + "wm_T2 = go.Scatter(\n", + " x = TE,\n", + " y = T2_signal_WM,\n", + " name = 'T2 = 109.77 ms (White Matter)',\n", + " text = 'T2 = 109.77 ms (White Matter)',\n", + " hoverinfo = 'x+y+text',\n", + " line=dict(color='#1f77b4', dash='solid'),\n", + " visible = True\n", + ")\n", + "\n", + "gm_T2 = go.Scatter(\n", + " x = TE,\n", + " y = T2_signal_GM,\n", + " name = 'T2 = 96.07 ms (Gray Matter)',\n", + " text = 'T2 = 96.07 ms (Gray Matter)',\n", + " hoverinfo = 'x+y+text',\n", + " line=dict(color='#ff7f0e', dash='solid'),\n", + " visible = True\n", + ")\n", + "\n", + "# T2* signals\n", + "\n", + "wm_T2star = go.Scatter(\n", + " x = TE,\n", + " y = T2star_signal_WM,\n", + " name = 'T2* = 67.63 ms (White Matter)',\n", + " text = 'T2* = 67.63 ms (White Matter)',\n", + " hoverinfo = 'x+y+text',\n", + " line=dict(color='#1f77b4', dash='dot'),\n", + " visible = False\n", + ")\n", + "\n", + "gm_T2star = go.Scatter(\n", + " x = TE,\n", + " y = T2star_signal_GM,\n", + " name = 'T2* = 48.48 ms (Gray Matter)',\n", + " text = 'T2* = 48.48 ms (Gray Matter)',\n", + " hoverinfo = 'x+y+text',\n", + " line=dict(color='#ff7f0e', dash='dot'),\n", + " visible = False\n", + ")\n", + "\n", + "data = [wm_T2, gm_T2, wm_T2star, gm_T2star]\n", + "\n", + "layout = go.Layout(\n", + " width=600,\n", + " height=375,\n", + " margin=go.layout.Margin(\n", + " l=100,\n", + " r=50,\n", + " b=60,\n", + " t=20,\n", + " ),\n", + " annotations=[\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", + " ],\n", + " xaxis=dict(\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.53,\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\n", + " dict(\n", + " args=[{'visible': [True, True, False, False]}],\n", + " label='T2',\n", + " method='update'\n", + " ),\n", + " # Display T2*\n", + " dict(\n", + " args=[{'visible': [False, False, True, True]}],\n", + " label='T2*',\n", + " method='update'\n", + " ),\n", + " # Display both T2 and T2*\n", + " dict(\n", + " args=[{'visible': [True, True, True, True]}],\n", + " label='T2 and T2*',\n", + " method='update'\n", + " ),\n", + " ]),\n", + " direction='down',\n", + " pad={'r': 10, 't': 10},\n", + " showactive=True,\n", + " x=0.30,\n", + " xanchor='left',\n", + " y=1.0,\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 +}