Goal: Differentiate Infections, sterile inflammation, and healthy tissue using MRI

The following methods were used in this study:

  1. T2 relaxation of the tissue without a contrast agent
  2. Dynamic contrast-enhanced (DCE) MRI using Maltose as a T2-ex contrast agent
  3. Chemical Exchange Saturation Transfer (CEST) MRI without a contrast agent

Author: Julio Cárdenas-Rodríguez, Ph.D.
email: cardenaj@email.arizona.edu

Description of the data

A total of XX mice were used in this study. Each mouse was infected as follows:

  • Right thigh: with approximatley 100 uL of a solution of XX CFU/mL of E. Coli.
  • Left thigh: same dose but using a solution that contain heat-inactivated E. Coli.

Both thighs can be seen in each image, and a total of of five imaging slices were collected around the center of infection. The average signal for the following region of interest (ROIS) were collected for all slices:

  1. Infected Site
  2. Apparently Healthy Tissue on the right thigh
  3. Sterile inflammation on the left thigh
  4. Apparently Healthy Tissue on the left thigh

In [233]:
# Import Python Modules
import numpy as np
#import seaborn as sn
import matplotlib.pyplot as plt
%matplotlib inline
from pylab import *
import pandas as pd
# Import LOCAL functions written by me
from mylocal_functions import *

T2 relaxation


In [2]:
# Make list of all T2.txt files
T2_list = get_ipython().getoutput('ls ../Study_03_CBA/*T2.txt')

# Allocate variables needed for analysis
T2DF=pd.DataFrame()
TR=np.linspace(.012,.012*12,12)

# Fit T2 for all ROIs, slices and mice. construct dataframe
for names in T2_list:
    #Convert txt file to array
    YDataMatrix=txt_2_array(names)
    #Estimate T2
    T2time=fitT2(TR,YDataMatrix)
    #convert to data frame
    df_T2=pd.DataFrame(T2time.T,columns=["Infected","Healthy_Right","Sterile_Inflammation","Healthy_Left"])
    #df_T2=pd.DataFrame(T2time.T,columns=["ROI-1","ROI-2","ROI-3","ROI-4"])
    df_info=name_2_df(names)
    df_final=pd.concat([df_T2,df_info], axis=1)
    T2DF=T2DF.append(df_final,ignore_index=True)

In [3]:
# Plot distribution of estimated T2 for each slice
#T2DF[T2DF.Slice==1].iloc[:,:4].plot.density(); title("Slice 01"); xlim((0.025,.15))
#T2DF[T2DF.Slice==2].iloc[:,:4].plot.density(); title("Slice 02"); xlim((0.025,.15))
#T2DF[T2DF.Slice==3].iloc[:,:4].plot.density(); title("Slice 03"); xlim((0.025,.15))
#T2DF[T2DF.Slice==4].iloc[:,:4].plot.density(); title("Slice 04"); xlim((0.025,.15))
T2DF[T2DF.Slice==5].iloc[:,:4].plot.density(); title("Slice 05"); xlim((0.025,.15))


Out[3]:
(0.025, 0.15)

Fit CEST for each slices and mouse


In [113]:
# list of files
CEST_list=get_ipython().getoutput('ls ../Study_03_CBA/*CEST.txt')
CEST_DF=pd.DataFrame()
Z=np.zeros((4,110))

def normalize_data(DataMatrix):
    rows,cols = DataMatrix.shape
    newData = np.zeros_like(DataMatrix)
    for row in range(rows):
        newData[row,:]=DataMatrix[row,:]/DataMatrix[row,8]      
    return newData

for names in CEST_list:
    #Convert txt file to array
    D=txt_2_array(names); 
    Zn=normalize_data(D.T)
    Z=np.concatenate((Z,Zn))

Z=Z[4::,9::]
    
# define offsets in ppm
a1=np.linspace(-55,-50,9)
ppm=np.linspace(-8,8,101)
full_ppm = np.concatenate((a1, ppm))

In [223]:
# Fit data
from scipy.optimize import curve_fit 
import seaborn as sn
from mylocal_functions import *

def Lorentzian(sat_offset,Amp,Width,Center):
    Width = Width**2; Width=Width/4 
    xdata = (sat_offset-Center)**2
    return (Amp*Width) / (Width +xdata )

def Lorentzian2(sat_offset,a1,w1,c1,a2,w2,c2):
    return Lorentzian(sat_offset,a1,w1,c1) + Lorentzian(sat_offset,a2,w2,c2)


#
Signal=1-Z[12,:]
# fix xdata
xdata=ppm-ppm[Signal.argmax()]
# allocate fitting based on this 
A10, W10, C10 =  0.90, 1, 0
A20, W20, C20 =  .1, 1, -4

A1L, W1L, C1L =  0.5, .1, -.1
A2L, W2L, C2L =  0, .1,   -6

A1U, W1U, C1U =  1.0, 5, +.1
A2U, W2U, C2U =  1.0, 5, -1.0

scale0, scaleL, scaleU = 0, -1, +1

initial_guess = [A10, W10, C10,      A20, W20, C20,    scale0]
lb            = [A1L, W1L, C1L,      A2L, W2L, C2L,    scaleL]
ub            = [A1U, W1U, C1U,      A2U, W2U, C2U,    scaleU]

p, cov = curve_fit(Lscale, xdata, Signal,p0=initial_guess,bounds=(lb, ub))
print(pars_hat)

Yhat=Lscale(xdata,p[0],p[1],p[2],p[3],p[4],p[5],p[6]);
plt.figure(figsize=(10,5))
plt.plot(xdata,Signal,'o',label='Signal'); 
plt.plot(xdata,Yhat,'-',label='Signal');


[ 0.63021089  3.46189776  0.1         0.07612609  3.7466548  -4.25346642
  0.08767454]

In [232]:
from mylocal_functions import *
mylocal_functions.fit_L2_scale?


Object `mylocal_functions.fit_L2_scale` not found.

In [193]:
plt.plot(ppm,Lscale(ppm,A10, W10, C10,      A20, W20, C20,    scale0));

initial_guess = [A10, W10, C10,      A20, W20, C20,    scale0];
lb            = [A1L, W1L, C1L,      A2L, W2L, C2L,    scaleL];
ub            = [A1U, W1U, C1U,      A2U, W2U, C2U,    scaleU];



A=[[initial_guess],[initial_guess]]
array(A).shape


Out[193]:
(2, 1, 7)

In [147]:
ppm[Signal.argmax()]


Out[147]:
4.8000000000000007

In [131]:
L=  Lorentzian(ppm,1,1,1); plt.plot(L)


Out[131]:
[<matplotlib.lines.Line2D at 0x117b0e128>]

In [64]:
plt.plot(ppm,Z.T,'.'); plt.xlim(-10,10)


Out[64]:
(-10, 10)

In [68]:
len(CEST_list)


Out[68]:
16

In [52]:
Z=np.zeros?

In [ ]:
Z=np.zeros

In [44]:


In [45]:
plt.plot(ppm,Z,'--'); plt.xlim(-10,10)


Out[45]:
(-10, 10)

In [ ]:
#Estimate T2
    T2time=fitT2(TR,YDataMatrix)
    #convert to data frame
    df_T2=pd.DataFrame(T2time.T,columns=["Infected","Healthy_Right","Sterile_Inflammation","Healthy_Left"])
    #df_T2=pd.DataFrame(T2time.T,columns=["ROI-1","ROI-2","ROI-3","ROI-4"])
    df_info=name_2_df(names)
    df_final=pd.concat([df_T2,df_info], axis=1)
    T2DF=T2DF.append(df_final,ignore_index=True)

In [18]:
df_info=name_2_df(names)
df_info


Out[18]:
Month Year Mouse Day Slice
0 1 2017 M5 6 5

In [16]:
# Make list of all T2.txt files
CEST_list=get_ipython().getoutput('ls ../Study_03_CBA/*T2.txt')
for names in CEST_list:
    Ydata=txt_2_array(names)
    print(Ydata)
    df_info=name_2_df(names)


[[ 367892.  263009.  270195.  281861.]
 [ 328246.  201351.  216117.  226610.]
 [ 260527.  114746.  131092.  135326.]
 [ 222104.   91496.  106150.  106749.]
 [ 187868.   56680.   68406.   68951.]
 [ 173426.   45618.   53132.   55005.]
 [ 152167.   25581.   39944.   35087.]
 [ 133992.   25784.   31413.   31932.]
 [ 128603.   15702.   22174.   21866.]
 [ 115221.   14972.   20877.   20103.]
 [ 106364.   13531.   17704.   15271.]
 [  99744.   12820.   16177.   16793.]]
[[ 279800.  224995.  310532.  252678.]
 [ 245980.  163601.  260770.  195819.]
 [ 171551.  106592.  188392.  116671.]
 [ 146527.   89846.  164779.   86285.]
 [ 111523.   56815.  128779.   60903.]
 [ 100048.   44426.  111997.   48461.]
 [  82280.   37343.   93223.   33210.]
 [  73195.   32105.   84228.   23461.]
 [  66633.   15695.   70225.   23409.]
 [  59873.   22108.   67233.   18125.]
 [  54866.   19055.   58278.   10978.]
 [  51036.   13813.   57394.   19180.]]
[[ 307117.  256895.  267627.  280365.]
 [ 256060.  196916.  209964.  217041.]
 [ 196127.  127034.  133615.  142516.]
 [ 166195.   96336.  106263.  115234.]
 [ 135344.   59830.   69844.   74316.]
 [ 117098.   50807.   56687.   62434.]
 [ 101902.   29223.   38872.   46000.]
 [  94093.   25127.   27712.   35913.]
 [  78345.   17589.   26457.   30303.]
 [  75883.   16043.   20574.   27367.]
 [  67990.   12913.   17749.   21242.]
 [  62427.   12218.   13266.   18450.]]
[[ 306021.  320061.  280970.  289121.]
 [ 230865.  247890.  232514.  215885.]
 [ 142402.  145447.  145800.  132217.]
 [ 114563.  107222.  114350.   99042.]
 [  74137.   69023.   77855.   56647.]
 [  57586.   53558.   65222.   47160.]
 [  37499.   30212.   48843.   32345.]
 [  29680.   27278.   41405.   21819.]
 [  21767.   21302.   31006.   14075.]
 [  19289.   17997.   27587.   17561.]
 [  16657.   13464.   20855.   13131.]
 [  13737.   16091.   23002.   10971.]]
[[ 553659.  506996.  455177.  422283.]
 [ 473761.  379697.  360809.  323647.]
 [ 361598.  229911.  230785.  201624.]
 [ 306725.  176861.  181245.  143626.]
 [ 251838.  111291.  132427.   94102.]
 [ 219241.   91259.  100947.   72062.]
 [ 189246.   58697.   75732.   44235.]
 [ 168534.   52351.   69844.   39062.]
 [ 145477.   30948.   51603.   27192.]
 [ 137949.   26571.   44594.   26200.]
 [ 117675.   24578.   40791.   21252.]
 [ 112322.   24390.   33590.   18222.]]
[[ 285447.  299701.  260510.  274176.]
 [ 217469.  234959.  205488.  203759.]
 [ 133854.  136321.  127790.  129827.]
 [ 103562.  103633.  101445.  103809.]
 [  68761.   63616.   63947.   61623.]
 [  53352.   52681.   56694.   45801.]
 [  30373.   26307.   38991.   36251.]
 [  33087.   24495.   29995.   28869.]
 [  20843.   17282.   25428.   15882.]
 [  19834.   19104.   21568.   16187.]
 [  17210.   14650.   20287.   15341.]
 [  14865.   12605.   18304.   12919.]]
[[ 508553.  453162.  452122.  384397.]
 [ 424868.  341628.  362089.  296417.]
 [ 316495.  212666.  250163.  176636.]
 [ 263614.  147558.  203560.  130324.]
 [ 218416.  103332.  149833.   83766.]
 [ 180361.   76652.  123676.   64810.]
 [ 154635.   49882.  101468.   43427.]
 [ 138104.   38179.   86858.   31528.]
 [ 113933.   28569.   76228.   27958.]
 [ 109822.   25558.   66451.   21573.]
 [  91858.   20300.   56760.   17633.]
 [  86841.   18954.   50774.   18082.]]
[[ 303552.  249227.  257414.  251772.]
 [ 255634.  190883.  204368.  205442.]
 [ 201166.  121417.  115797.  123514.]
 [ 169383.   92617.   95635.  104014.]
 [ 137343.   59277.   57191.   67373.]
 [ 115887.   45768.   51613.   55423.]
 [  98594.   30828.   31189.   37762.]
 [  87105.   24511.   29390.   37565.]
 [  73197.   18505.   18888.   25736.]
 [  70193.   15994.   14947.   22236.]
 [  57957.   14805.   14082.   18799.]
 [  53190.   14041.   11339.   19344.]]
[[ 300929.  246660.  276275.  248609.]
 [ 239828.  197459.  217266.  199371.]
 [ 146213.  111802.  149529.  110522.]
 [ 121652.   88773.  119066.   92640.]
 [  78417.   60219.   82812.   59018.]
 [  68040.   45874.   68991.   47442.]
 [  47711.   27839.   56602.   32196.]
 [  44378.   24100.   44309.   27573.]
 [  31206.   22570.   36057.   20603.]
 [  24642.   16063.   35492.   16631.]
 [  23910.   14182.   26420.   15793.]
 [  23294.   15309.   22846.   15028.]]
[[ 512775.  458748.  452122.  384397.]
 [ 427532.  346666.  362089.  296417.]
 [ 317654.  217143.  250163.  176636.]
 [ 263222.  149703.  203560.  130324.]
 [ 217824.  105938.  149833.   83766.]
 [ 179426.   78312.  123676.   64810.]
 [ 153331.   49416.  101468.   43427.]
 [ 136453.   40644.   86858.   31528.]
 [ 111307.   30546.   76228.   27958.]
 [ 108370.   26686.   66451.   21573.]
 [  90147.   19977.   56760.   17633.]
 [  85541.   19522.   50774.   18082.]]
[[ 329654.  355050.  368075.  358024.]
 [ 260012.  289422.  312628.  305076.]
 [ 179540.  209629.  208317.  207855.]
 [ 146712.  174482.  172908.  177837.]
 [ 109106.  134433.  133484.  132798.]
 [  90388.  114568.  114052.  113744.]
 [  70814.   97072.   92945.   92247.]
 [  63308.   87032.   83196.   82550.]
 [  45699.   75807.   73516.   73827.]
 [  44155.   68340.   63160.   65641.]
 [  37904.   61738.   61891.   60740.]
 [  32505.   57057.   55771.   58672.]]
[[ 335860.  333367.  330555.  300547.]
 [ 259251.  270279.  264388.  227970.]
 [ 158392.  160779.  172833.  142720.]
 [ 121575.  129709.  142195.  105912.]
 [  77288.   81690.   99209.   69107.]
 [  59472.   67513.   84855.   52092.]
 [  36061.   41533.   65118.   37155.]
 [  37503.   38939.   51926.   26741.]
 [  25141.   25627.   45911.   21631.]
 [  20072.   23181.   38851.   21117.]
 [  13851.   17244.   32430.   15941.]
 [  16085.   15947.   30330.   14136.]]
[[ 599284.  535352.  464580.  464377.]
 [ 514893.  416738.  349126.  339564.]
 [ 382012.  266132.  224406.  188362.]
 [ 320582.  200151.  167256.  126939.]
 [ 262170.  140133.  111927.   84475.]
 [ 223411.  108716.   91503.   74613.]
 [ 183594.   76646.   63406.   48790.]
 [ 163384.   62711.   52817.   31392.]
 [ 136817.   47175.   38245.   27193.]
 [ 122535.   40983.   33590.   25839.]
 [ 104351.   30760.   27736.   23498.]
 [  98012.   29728.   25077.   20974.]]
[[ 180344.  308470.  289356.  296550.]
 [ 152851.  257550.  222985.  229648.]
 [  92724.  178547.  141349.  146669.]
 [  83045.  143072.  108623.  112763.]
 [  58648.  107344.   67802.   74439.]
 [  48205.   92318.   56641.   58887.]
 [  34658.   66924.   38506.   41387.]
 [  30359.   64888.   30471.   32357.]
 [  23999.   47818.   22910.   23376.]
 [  18705.   42135.   21214.   20522.]
 [  18842.   39023.   15940.   16204.]
 [  16309.   30423.   12123.   12844.]]
[[ 312589.  204281.  328780.  217729.]
 [ 249060.  155080.  264799.  158529.]
 [ 175298.  118665.  178170.  112098.]
 [ 139905.   92807.  142332.   81604.]
 [ 108478.   74230.  106469.   61828.]
 [  89302.   65650.   89283.   54720.]
 [  71774.   50997.   65845.   36195.]
 [  65613.   48692.   56957.   36502.]
 [  49498.   37114.   49704.   27957.]
 [  51637.   43013.   44054.   24837.]
 [  42321.   34379.   34663.   22263.]
 [  39262.   31158.   33746.   20248.]]
[[ 335562.  333763.  334463.  276185.]
 [ 256035.  250648.  273524.  208907.]
 [ 167402.  145257.  187409.  122723.]
 [ 122549.  111994.  160289.   94482.]
 [  84242.   65012.  114491.   56822.]
 [  67600.   51199.  101570.   46415.]
 [  43094.   33235.   75976.   30587.]
 [  43501.   23159.   66637.   23835.]
 [  27354.   18596.   54387.   18197.]
 [  27457.   14971.   53187.   16377.]
 [  21586.   15359.   48669.   12389.]
 [  19232.   13651.   36897.   13249.]]
[[ 285796.  289691.  275552.  285788.]
 [ 238390.  233215.  211603.  224127.]
 [ 162998.  165404.  132791.  140470.]
 [ 136704.  129453.  106639.  112101.]
 [  94302.   91652.   66908.   74919.]
 [  81720.   75128.   52816.   58817.]
 [  58911.   56409.   35539.   39899.]
 [  48091.   44274.   28045.   36696.]
 [  38553.   33050.   19044.   26766.]
 [  31952.   28713.   16628.   20496.]
 [  23318.   21400.   17967.   23020.]
 [  21986.   18580.   13422.   18814.]]
[[ 269510.  227794.  305142.  275063.]
 [ 209678.  165086.  227483.  194863.]
 [ 128580.  103347.  147867.  125487.]
 [ 106276.   78480.  107131.   92610.]
 [  68984.   52352.   71783.   56219.]
 [  56456.   39864.   52986.   44375.]
 [  44581.   25420.   38573.   26196.]
 [  33520.   24156.   31645.   22636.]
 [  29711.   16632.   23346.   15057.]
 [  26842.   18737.   20656.   15105.]
 [  23369.   15716.   17112.   13426.]
 [  20699.   15087.   14718.   11631.]]
[[ 370741.  302190.  255236.  240851.]
 [ 344473.  242692.  198885.  192413.]
 [ 244660.  139652.  121660.  113219.]
 [ 214183.  109413.  100601.   85338.]
 [ 176060.   66742.   64334.   52129.]
 [ 143644.   51201.   58795.   45106.]
 [ 132411.   31942.   36553.   27228.]
 [ 112617.   29505.   36163.   26465.]
 [  97513.   22245.   27955.   18959.]
 [  92608.   15592.   26074.   16804.]
 [  73055.   15186.   24078.   13698.]
 [  73528.   14607.   20142.   14334.]]
[[ 363669.  328647.  327243.  282275.]
 [ 272634.  242190.  267146.  214764.]
 [ 188254.  146952.  174151.  130808.]
 [ 145125.  112602.  140668.   95517.]
 [ 100410.   68915.   99328.   60843.]
 [  90372.   55857.   81147.   48710.]
 [  60833.   32112.   60161.   30870.]
 [  59939.   29170.   53205.   26029.]
 [  46060.   22974.   40417.   19017.]
 [  36538.   18773.   38376.   19278.]
 [  35100.   14143.   29092.   14385.]
 [  28752.   15070.   28313.   13509.]]
[[ 322472.  300402.  280876.  279774.]
 [ 272641.  250105.  222039.  222780.]
 [ 202846.  182593.  148766.  144052.]
 [ 169186.  143581.  117148.  116863.]
 [ 131012.  111605.   80085.   79236.]
 [ 111973.   89248.   65377.   64407.]
 [  91970.   71565.   47444.   44691.]
 [  76757.   57106.   40353.   37153.]
 [  64291.   44414.   26457.   27740.]
 [  55992.   38469.   24527.   22020.]
 [  48320.   29636.   17622.   18538.]
 [  41858.   25256.   20600.   18025.]]
[[ 302266.  223109.  289084.  268465.]
 [ 240966.  169715.  214397.  200795.]
 [ 145228.  101737.  138937.  125953.]
 [ 119567.   81102.  103039.   97193.]
 [  79844.   48635.   65528.   62574.]
 [  62475.   45495.   56370.   49632.]
 [  47895.   26104.   33815.   35011.]
 [  36366.   24735.   33911.   30749.]
 [  32043.   18749.   23144.   22680.]
 [  26275.   17663.   21161.   19953.]
 [  22372.   15587.   16440.   20635.]
 [  18988.   14502.   16449.   15345.]]
[[ 335990.  297282.  296472.  265602.]
 [ 317596.  246577.  222857.  217085.]
 [ 201815.  142411.  149798.  131678.]
 [ 181495.  114625.  115549.  104621.]
 [ 140491.   73356.   71219.   68851.]
 [ 112628.   58630.   66290.   56990.]
 [ 104907.   39176.   40865.   39927.]
 [  80273.   30638.   41672.   34168.]
 [  76068.   24255.   24966.   26910.]
 [  69051.   22152.   23201.   24097.]
 [  50340.   16142.   26043.   20355.]
 [  58699.   15691.   17260.   20394.]]
[[ 371070.  302539.  347024.  285818.]
 [ 307208.  227234.  290361.  214889.]
 [ 228491.  140171.  191470.  133471.]
 [ 184888.  102610.  174839.  103002.]
 [ 143587.   63686.  125140.   63446.]
 [ 133393.   54422.  106123.   48421.]
 [ 105439.   32602.   88299.   34660.]
 [  96510.   30130.   75358.   29038.]
 [  80382.   20735.   63028.   21808.]
 [  68080.   18209.   57274.   19935.]
 [  64123.   13872.   48297.   15430.]
 [  54427.   14598.   43965.   13991.]]
[[ 325582.  326311.  387086.  256632.]
 [ 281927.  278472.  325181.  189492.]
 [ 202997.  207431.  236801.  117830.]
 [ 176170.  175667.  200952.   90664.]
 [ 136456.  134214.  157045.   55825.]
 [ 114440.  112169.  137185.   46900.]
 [  93279.   90624.  110593.   27670.]
 [  79628.   77911.   99131.   22744.]
 [  64197.   60208.   85649.   17981.]
 [  55395.   54906.   78581.   13315.]
 [  45392.   44745.   70084.   13747.]
 [  42404.   37476.   64750.   11380.]]
[[ 335430.  285117.  280506.  290717.]
 [ 283985.  220781.  209330.  212304.]
 [ 186153.  130658.  144944.  135729.]
 [ 160671.  102225.  110398.  101850.]
 [ 119464.   66253.   74183.   63292.]
 [  98539.   51878.   64930.   54583.]
 [  81835.   35573.   42247.   31228.]
 [  70471.   28942.   39043.   27830.]
 [  59054.   21935.   28897.   21471.]
 [  52038.   19539.   28953.   19540.]
 [  46116.   14935.   22449.   14981.]
 [  42703.   16473.   20104.   15066.]]
[[ 355870.  285708.  277265.  264707.]
 [ 320695.  236276.  219379.  209246.]
 [ 229020.  142994.  129931.  124153.]
 [ 194654.  108380.  108006.   98091.]
 [ 160281.   70865.   63960.   61536.]
 [ 126578.   56895.   58917.   50039.]
 [ 118847.   41334.   32284.   34578.]
 [  99212.   32067.   32231.   29504.]
 [  77527.   22514.   29357.   20886.]
 [  81847.   22048.   17798.   18235.]
 [  58619.   16581.   21460.   14829.]
 [  61708.   16118.   16946.   14129.]]
[[ 359956.  314574.  303327.  293855.]
 [ 288083.  235193.  247678.  223234.]
 [ 216076.  156328.  158770.  136627.]
 [ 173476.  113350.  133040.  108025.]
 [ 134398.   78266.   88426.   63897.]
 [ 119179.   63553.   75293.   52645.]
 [  84800.   39208.   57639.   34386.]
 [  82215.   38008.   45503.   26776.]
 [  61063.   22027.   41943.   21616.]
 [  56466.   23920.   35131.   18718.]
 [  47438.   16589.   30417.   16076.]
 [  41821.   16311.   25103.   13900.]]
[[ 390213.  389456.  547320.  284105.]
 [ 345447.  346289.  492458.  207785.]
 [ 253633.  255545.  386850.  131960.]
 [ 222758.  221283.  338118.   94610.]
 [ 173763.  172441.  281058.   63207.]
 [ 148357.  146894.  249650.   50445.]
 [ 123029.  118769.  220654.   32109.]
 [ 104377.  101680.  200130.   28678.]
 [  89474.   83574.  180041.   21463.]
 [  77307.   71939.  168087.   17268.]
 [  64016.   58663.  154307.   14231.]
 [  57757.   51119.  146091.   11512.]]
[[ 468481.  341525.  351276.  356925.]
 [ 420090.  269997.  266347.  265819.]
 [ 307331.  174238.  179611.  175952.]
 [ 276724.  141240.  136439.  126425.]
 [ 223117.   97261.   92095.   85120.]
 [ 194762.   82658.   75317.   69624.]
 [ 167572.   61840.   53884.   45185.]
 [ 147521.   51752.   47666.   40829.]
 [ 134427.   43008.   30120.   25867.]
 [ 115514.   37348.   30473.   25705.]
 [ 103820.   31295.   25025.   20618.]
 [  97878.   29342.   20373.   16422.]]
[[ 454344.  373251.  365198.  314969.]
 [ 432526.  327548.  300022.  255749.]
 [ 315283.  219065.  193247.  155382.]
 [ 284745.  184771.  154642.  125317.]
 [ 225028.  138334.  111811.   83387.]
 [ 194787.  113220.   92717.   69204.]
 [ 168984.   91341.   68479.   47815.]
 [ 146701.   80488.   61982.   39657.]
 [ 125892.   65302.   49528.   28673.]
 [ 111233.   58520.   44585.   26598.]
 [  91688.   49358.   38646.   24794.]
 [  88407.   44301.   37038.   21147.]]
[[ 573509.  573032.  349304.  522165.]
 [ 511242.  510427.  276731.  449681.]
 [ 412546.  409170.  171559.  340213.]
 [ 352871.  354908.  143566.  297598.]
 [ 289588.  293941.   94465.  235026.]
 [ 266609.  267932.   76693.  209008.]
 [ 224090.  226901.   54020.  174271.]
 [ 208023.  211609.   48330.  160663.]
 [ 179133.  184188.   38767.  141480.]
 [ 167846.  172973.   29499.  128458.]
 [ 150477.  154310.   26051.  120308.]
 [ 136893.  143746.   23718.  107479.]]
[[ 457152.  323986.  335464.  340818.]
 [ 394024.  261135.  264091.  270177.]
 [ 313132.  176121.  160520.  170533.]
 [ 260697.  144927.  124774.  138725.]
 [ 223753.   99539.   80657.   88886.]
 [ 184525.   85976.   62632.   72563.]
 [ 160090.   65555.   43676.   50535.]
 [ 141979.   52704.   35188.   42945.]
 [ 116952.   46116.   26803.   28872.]
 [ 112202.   40580.   21147.   28275.]
 [  92307.   35077.   18040.   22880.]
 [  84830.   32529.   15810.   20949.]]
[[ 338411.  358420.  313539.  281266.]
 [ 269401.  263673.  256295.  208731.]
 [ 175887.  163432.  172839.  118620.]
 [ 141053.  123836.  144678.   94830.]
 [  98449.   75453.  103742.   56722.]
 [  80058.   55255.   88146.   43587.]
 [  63921.   44038.   68645.   28045.]
 [  50515.   31663.   62674.   26030.]
 [  43613.   23225.   49623.   19361.]
 [  36986.   21842.   48123.   16308.]
 [  33864.   18401.   41010.   13014.]
 [  29288.   15122.   37994.   13354.]]
[[ 328181.  244900.  313378.  262903.]
 [ 267928.  188683.  258130.  208366.]
 [ 179379.  106669.  182202.  152732.]
 [ 149973.   86893.  144892.  120105.]
 [ 109547.   52624.  106502.   87253.]
 [  88661.   43199.  100019.   80385.]
 [  68626.   25784.   74764.   62063.]
 [  66562.   26498.   62533.   55655.]
 [  55532.   19671.   52849.   45998.]
 [  48391.   18448.   53036.   45231.]
 [  44496.   14324.   40098.   31491.]
 [  37679.   17224.   43333.   38300.]]
[[ 394306.  311061.  313302.  356467.]
 [ 333305.  248640.  239535.  290704.]
 [ 247675.  157780.  149650.  198663.]
 [ 204586.  128802.  115887.  163518.]
 [ 168870.   86161.   68537.  118501.]
 [ 135974.   73205.   59683.  102471.]
 [ 112090.   43388.   40047.   80173.]
 [ 101945.   39766.   29691.   70473.]
 [  81733.   28447.   22138.   58213.]
 [  72176.   22361.   19662.   56112.]
 [  63569.   20506.   15100.   48532.]
 [  54927.   18381.   14741.   47230.]]
[[ 322021.  344013.  315237.  308528.]
 [ 247175.  257531.  233116.  233975.]
 [ 157449.  157860.  148075.  135196.]
 [ 115740.  116519.  108843.  104466.]
 [  77467.   75678.   73500.   58268.]
 [  58434.   53295.   54658.   48582.]
 [  41849.   39395.   37746.   27791.]
 [  32573.   27880.   31040.   25265.]
 [  27268.   23176.   23582.   19230.]
 [  21715.   15629.   17683.   14848.]
 [  19526.   12804.   18017.   11510.]
 [  16248.   14569.   16490.   13835.]]
[[ 558805.  431900.  449407.  434600.]
 [ 472328.  320448.  348791.  329747.]
 [ 364044.  198216.  220249.  197014.]
 [ 317786.  150590.  165055.  148241.]
 [ 245684.   95509.  117152.   91020.]
 [ 226771.   72470.   91889.   67651.]
 [ 177426.   44538.   68459.   47230.]
 [ 170303.   43126.   52463.   36986.]
 [ 138837.   26627.   41301.   22998.]
 [ 124301.   24273.   39142.   22807.]
 [ 115310.   22159.   29346.   18874.]
 [  97064.   22092.   29068.   17154.]]
[[ 340283.  271856.  305958.  258742.]
 [ 261841.  201920.  239132.  201910.]
 [ 165832.  123196.  144687.  115039.]
 [ 120596.   94503.  115188.   91444.]
 [  80595.   55272.   73183.   58173.]
 [  62359.   49039.   56855.   47548.]
 [  43466.   28402.   36556.   30204.]
 [  33408.   27461.   34824.   25409.]
 [  23405.   19249.   22574.   21315.]
 [  22788.   17270.   19588.   17357.]
 [  17382.   15103.   19517.   14227.]
 [  16299.   14505.   15650.   15121.]]
[[ 386179.  321755.  310280.  304058.]
 [ 323267.  264004.  245099.  242820.]
 [ 235415.  170065.  151793.  156251.]
 [ 199887.  143848.  115593.  117208.]
 [ 152496.   97227.   78588.   78489.]
 [ 129402.   76879.   59925.   60875.]
 [ 103582.   55271.   39257.   40716.]
 [  88115.   43326.   36124.   37398.]
 [  73221.   37587.   21704.   20639.]
 [  62927.   24890.   20460.   19261.]
 [  53606.   22406.   15061.   16156.]
 [  46472.   20333.   14288.   12733.]]
[[ 321835.  311964.  309174.  301869.]
 [ 255872.  241410.  237194.  232811.]
 [ 157883.  148411.  147889.  142798.]
 [ 128867.  116125.  110477.  111332.]
 [  84385.   76129.   73574.   74326.]
 [  73001.   59651.   57801.   59865.]
 [  51089.   41963.   40868.   42512.]
 [  44682.   35457.   34500.   35158.]
 [  35970.   24460.   25724.   28246.]
 [  32510.   22297.   24434.   25258.]
 [  26760.   16867.   20073.   18374.]
 [  27580.   17947.   17046.   20484.]]
[[ 533041.  429855.  412136.  383734.]
 [ 460595.  325787.  312522.  288895.]
 [ 346556.  202204.  203035.  168821.]
 [ 303664.  152717.  148188.  131360.]
 [ 242326.   97492.   98629.   84913.]
 [ 213944.   77341.   74955.   60580.]
 [ 174212.   48622.   54629.   40701.]
 [ 159998.   40805.   45555.   35623.]
 [ 135769.   29855.   31555.   25126.]
 [ 120336.   27390.   31493.   23125.]
 [ 106737.   22806.   23970.   18283.]
 [  92008.   21429.   21525.   17872.]]
[[ 331315.  295827.  295641.  270311.]
 [ 262705.  229557.  227930.  209377.]
 [ 166979.  138931.  142743.  121715.]
 [ 129584.  110433.  110354.   98228.]
 [  93870.   67539.   68108.   55233.]
 [  73450.   55478.   58201.   50045.]
 [  55455.   31713.   40094.   32561.]
 [  47470.   31414.   33246.   27862.]
 [  36948.   22294.   26009.   20132.]
 [  32384.   20517.   21998.   19218.]
 [  29111.   15991.   17214.   15164.]
 [  25666.   15334.   19438.   14561.]]
[[ 358548.  351470.  367752.  307749.]
 [ 304583.  299421.  301275.  230483.]
 [ 218595.  214561.  204456.  140824.]
 [ 185918.  180027.  165874.  113719.]
 [ 141324.  133635.  124654.   71527.]
 [ 120325.  114190.  100632.   57870.]
 [  99815.   89768.   80168.   37188.]
 [  81770.   72620.   70649.   32570.]
 [  69869.   63386.   60150.   24028.]
 [  60306.   53421.   51745.   18922.]
 [  49134.   44010.   45197.   18805.]
 [  45777.   42185.   42777.   16792.]]
[[ 431964.  339578.  283354.  304522.]
 [ 364746.  268549.  216070.  225467.]
 [ 250231.  167769.  132381.  138909.]
 [ 213384.  133584.  102995.  106245.]
 [ 159497.   88011.   65959.   67526.]
 [ 134183.   70439.   58613.   52506.]
 [ 115655.   52313.   37213.   37070.]
 [  97707.   41987.   32063.   31038.]
 [  86533.   33419.   24951.   23153.]
 [  78995.   27999.   19460.   20394.]
 [  71111.   19663.   17845.   17443.]
 [  67783.   20087.   17112.   15570.]]
[[ 534402.  444074.  421020.  402519.]
 [ 458352.  351626.  314654.  310649.]
 [ 342834.  235495.  196629.  195114.]
 [ 294866.  188527.  151279.  152007.]
 [ 230624.  133720.  103813.  105028.]
 [ 206994.  108553.   74134.   81089.]
 [ 166851.   81051.   55086.   58715.]
 [ 152530.   69981.   42394.   50427.]
 [ 126725.   54254.   31695.   39369.]
 [ 110839.   45894.   30013.   34984.]
 [  98946.   40296.   27280.   32690.]
 [  88463.   37277.   20277.   27623.]]
[[ 356933.  300109.  291381.  273542.]
 [ 298275.  236925.  217521.  205529.]
 [ 197010.  143478.  141363.  127130.]
 [ 158497.  110348.  115899.  100370.]
 [ 129105.   73295.   70400.   57723.]
 [ 102346.   57761.   58583.   48647.]
 [  82512.   37494.   43982.   31783.]
 [  67980.   30367.   38882.   28405.]
 [  59139.   26066.   25324.   20296.]
 [  50102.   24361.   28647.   17512.]
 [  45729.   17896.   18048.   15177.]
 [  40219.   17365.   18805.   13503.]]
[[ 434411.  417793.  579831.  350178.]
 [ 365674.  355462.  515786.  275944.]
 [ 263713.  264138.  401700.  160142.]
 [ 223582.  222678.  347424.  128378.]
 [ 165431.  166994.  281062.   82107.]
 [ 141538.  145965.  251636.   63732.]
 [ 108644.  109464.  212799.   43247.]
 [  95731.   97614.  196882.   31662.]
 [  72352.   79031.  172962.   25214.]
 [  64446.   69352.  162163.   21692.]
 [  51444.   56097.  147311.   16986.]
 [  45051.   48321.  138057.   17374.]]
[[ 399281.  459599.  390079.  356338.]
 [ 328631.  375520.  307867.  273075.]
 [ 218628.  260014.  194792.  168744.]
 [ 182550.  214119.  153887.  133129.]
 [ 130327.  156466.  103743.   84568.]
 [ 108865.  132743.   85408.   64482.]
 [  83306.  106403.   63546.   47974.]
 [  73442.   94414.   53802.   39824.]
 [  58115.   76018.   44333.   27623.]
 [  51591.   65167.   37908.   23673.]
 [  43370.   60933.   32928.   20825.]
 [  39843.   53637.   31026.   18669.]]
[[ 658681.  499064.  458228.  442019.]
 [ 584520.  395506.  352978.  337946.]
 [ 454319.  236010.  211537.  201668.]
 [ 394269.  181586.  170734.  160411.]
 [ 319506.  120135.  108013.  104062.]
 [ 287807.   95431.   76799.   77519.]
 [ 234803.   61753.   62011.   55301.]
 [ 214949.   47186.   41755.   39619.]
 [ 184074.   37762.   30806.   29271.]
 [ 162887.   27851.   30338.   28220.]
 [ 144696.   22054.   21937.   20209.]
 [ 129045.   22183.   21271.   20746.]]
[[ 460578.  464491.  385926.  379963.]
 [ 402116.  408304.  308215.  316103.]
 [ 292802.  300681.  209842.  216853.]
 [ 247834.  260001.  174417.  184246.]
 [ 197866.  206575.  123088.  135521.]
 [ 168961.  182990.  103244.  114498.]
 [ 145624.  150802.   79107.   91305.]
 [ 124216.  134958.   73219.   81042.]
 [ 106627.  116473.   57260.   68215.]
 [  95764.  105198.   52492.   61069.]
 [  84316.   94261.   45502.   51970.]
 [  76308.   86944.   41177.   46128.]]
[[ 356988.  294710.  317913.  242085.]
 [ 323285.  230289.  232458.  176428.]
 [ 220934.  128607.  171717.  108583.]
 [ 198668.   99805.  132748.   80563.]
 [ 164819.   65072.   84398.   47770.]
 [ 125732.   39858.   91458.   42580.]
 [ 122379.   31270.   50480.   24032.]
 [  99011.   25844.   52316.   22727.]
 [  92518.   16997.   39514.   17856.]
 [  86534.   15422.   34956.   14767.]
 [  72440.   11216.   31635.   14805.]
 [  72741.   13877.   23602.   12995.]]
[[ 596296.  472450.  474615.  421181.]
 [ 528354.  371465.  366749.  318844.]
 [ 396899.  221003.  247205.  201103.]
 [ 354798.  179614.  189454.  152499.]
 [ 270002.  113831.  135891.  102262.]
 [ 248188.   90304.  110849.   78094.]
 [ 206875.   56187.   86945.   53471.]
 [ 177966.   53352.   68749.   41748.]
 [ 163565.   33856.   54469.   30190.]
 [ 140072.   30704.   49446.   27197.]
 [ 129324.   23298.   40544.   21590.]
 [ 115129.   25738.   37696.   21337.]]
[[ 412212.  368430.  351984.  329319.]
 [ 334450.  291151.  275856.  247181.]
 [ 216877.  178369.  182297.  158718.]
 [ 175809.  134203.  139799.  121448.]
 [ 116990.   87938.   95070.   78857.]
 [  94737.   68361.   79442.   62075.]
 [  69057.   47183.   53307.   39515.]
 [  55305.   33084.   46232.   34348.]
 [  41753.   24063.   33800.   24638.]
 [  38059.   20557.   29032.   21793.]
 [  29347.   13650.   23489.   16494.]
 [  26479.   14716.   20054.   15919.]]
[[ 315951.  285395.  311728.  252451.]
 [ 268751.  215137.  232241.  187831.]
 [ 192445.  132540.  149074.  114553.]
 [ 153699.  101772.  123873.   91242.]
 [ 119759.   63474.   79786.   56098.]
 [  98062.   50331.   73819.   47696.]
 [  82174.   35117.   46717.   30231.]
 [  67722.   26286.   46402.   26236.]
 [  54307.   17492.   36082.   19624.]
 [  56457.   18028.   24703.   17113.]
 [  38842.   12843.   29303.   14988.]
 [  43154.   13555.   21718.   13454.]]
[[ 576948.  457940.  442693.  400382.]
 [ 527822.  367277.  331432.  305285.]
 [ 397200.  222169.  220625.  192098.]
 [ 356127.  177779.  164286.  145809.]
 [ 292207.  117735.  108684.   95337.]
 [ 257708.   92500.   88356.   76137.]
 [ 217372.   63073.   64398.   52824.]
 [ 196666.   55072.   52375.   44179.]
 [ 172206.   36053.   35442.   30677.]
 [ 154875.   34431.   35604.   30137.]
 [ 134814.   23570.   26846.   20489.]
 [ 126317.   22327.   26589.   22692.]]
[[ 418894.  396422.  365499.  332109.]
 [ 347387.  309871.  287438.  251767.]
 [ 239133.  194865.  188747.  163194.]
 [ 204523.  150371.  140210.  122133.]
 [ 150076.   93162.   95221.   76288.]
 [ 128844.   72496.   73015.   62392.]
 [ 102477.   48442.   52520.   40617.]
 [  85463.   39583.   41293.   35024.]
 [  74783.   25479.   25065.   23074.]
 [  63312.   20165.   27646.   19415.]
 [  56338.   20403.   18776.   17559.]
 [  50872.   16522.   17398.   16655.]]
[[ 318521.  270250.  304901.  260498.]
 [ 267057.  205672.  242281.  197474.]
 [ 191157.  128224.  160785.  117824.]
 [ 159458.   95807.  136172.   95253.]
 [ 126165.   65269.   92345.   56204.]
 [ 103372.   51921.   84324.   49154.]
 [  87172.   35056.   57729.   32701.]
 [  74312.   26158.   56767.   30340.]
 [  62443.   21576.   40505.   19968.]
 [  57098.   19599.   35651.   15948.]
 [  47195.   13582.   30453.   16461.]
 [  43949.   14296.   26606.   14542.]]
[[ 553311.  432949.  442803.  380513.]
 [ 494480.  342671.  347191.  289225.]
 [ 385659.  219165.  222376.  178620.]
 [ 345666.  179862.  175246.  137772.]
 [ 275502.  112285.  120463.   89849.]
 [ 251181.  102738.   90852.   70355.]
 [ 210405.   65274.   69166.   44622.]
 [ 186894.   61205.   53145.   36344.]
 [ 162854.   42425.   37759.   26854.]
 [ 146433.   35836.   33928.   24589.]
 [ 126519.   29676.   27727.   21451.]
 [ 115076.   26769.   23314.   18909.]]
[[ 420787.  368028.  355204.  339701.]
 [ 358319.  291194.  284850.  260166.]
 [ 258499.  185060.  184818.  167697.]
 [ 222512.  140548.  150020.  127403.]
 [ 171007.   85422.  101904.   85571.]
 [ 146507.   71622.   81567.   65810.]
 [ 120394.   45198.   61266.   46606.]
 [ 104702.   39583.   49061.   36358.]
 [  87870.   28013.   38105.   23390.]
 [  77245.   23476.   32209.   21431.]
 [  66203.   18381.   25133.   15976.]
 [  58478.   16115.   22499.   17994.]]
[[ 330483.  299544.  292271.  262557.]
 [ 291020.  236242.  220492.  192674.]
 [ 211110.  148365.  150563.  124651.]
 [ 187885.  125996.  115359.   88287.]
 [ 149003.   85653.   78148.   56503.]
 [ 124049.   66840.   71090.   50749.]
 [ 109282.   53506.   43763.   27800.]
 [  90322.   43537.   45407.   27243.]
 [  74782.   32420.   34029.   24689.]
 [  70468.   31867.   25718.   15288.]
 [  59569.   28590.   25512.   14634.]
 [  52863.   18608.   19270.   13643.]]
[[ 622506.  432986.  461751.  413469.]
 [ 575668.  344270.  360191.  309229.]
 [ 452221.  208783.  246930.  206509.]
 [ 410373.  167493.  195620.  154000.]
 [ 344200.  117162.  133165.  100939.]
 [ 304041.   86461.  113658.   83843.]
 [ 265831.   52464.   83222.   58865.]
 [ 236574.   60072.   73268.   47515.]
 [ 209367.   35291.   56277.   35608.]
 [ 187201.   29604.   50283.   29677.]
 [ 167474.   28092.   43219.   23812.]
 [ 154374.   27499.   36952.   21909.]]
[[ 538361.  384378.  349551.  340559.]
 [ 479165.  302974.  282168.  265863.]
 [ 374181.  196517.  183830.  169533.]
 [ 333090.  156683.  144620.  132906.]
 [ 272571.  104092.   99587.   87419.]
 [ 238413.   84065.   83774.   70852.]
 [ 204625.   57384.   57186.   48884.]
 [ 181511.   45307.   46619.   39777.]
 [ 159478.   34845.   36050.   29069.]
 [ 145030.   29481.   30931.   26731.]
 [ 127391.   24192.   26525.   20961.]
 [ 116712.   18709.   21030.   19983.]]
[[ 457684.  368471.  344837.  285262.]
 [ 416235.  303831.  269682.  215409.]
 [ 320796.  213389.  185946.  137343.]
 [ 286015.  176169.  146911.  106678.]
 [ 238745.  134760.  100998.   68762.]
 [ 201972.  108302.   96892.   62771.]
 [ 174893.   89503.   62029.   38707.]
 [ 152296.   72293.   61930.   37792.]
 [ 130861.   58827.   48295.   24779.]
 [ 119913.   51917.   38845.   25491.]
 [ 102557.   45389.   34951.   21782.]
 [  93442.   38476.   31001.   22636.]]
[[ 799476.  481830.  714897.  450209.]
 [ 743744.  371280.  599704.  347569.]
 [ 600191.  238118.  443176.  220106.]
 [ 545141.  184779.  374689.  167262.]
 [ 461295.  130055.  298512.  109246.]
 [ 415306.  102142.  261556.   88449.]
 [ 366073.   60950.  220546.   60256.]
 [ 331477.   57530.  197036.   48203.]
 [ 296575.   36590.  176071.   35026.]
 [ 273619.   34209.  162183.   31805.]
 [ 248236.   27532.  145991.   24950.]
 [ 230040.   26977.  138242.   21480.]]
[[ 802452.  480110.  503074.  439136.]
 [ 751021.  409642.  416034.  352401.]
 [ 599644.  284210.  296319.  244679.]
 [ 545660.  239279.  239866.  195634.]
 [ 460131.  182890.  181363.  144071.]
 [ 420200.  151386.  151369.  117270.]
 [ 368091.  119582.  122426.   94198.]
 [ 341660.  105256.  106962.   79376.]
 [ 306293.   87407.   86965.   62329.]
 [ 286071.   74434.   80146.   58937.]
 [ 263439.   64233.   67094.   47179.]
 [ 247805.   57404.   60911.   41016.]]
[[ 349071.  290538.  271879.  248730.]
 [ 309818.  226868.  212914.  187330.]
 [ 238175.  139787.  140143.  117985.]
 [ 211804.  108058.  114265.   89564.]
 [ 172126.   70934.   77208.   58859.]
 [ 157809.   52994.   62458.   43882.]
 [ 138410.   37474.   44086.   35478.]
 [ 117800.   27643.   40020.   22338.]
 [ 108528.   20035.   31932.   19539.]
 [  95232.   22078.   27771.   14909.]
 [  89414.   17160.   24541.   15376.]
 [  83163.   12735.   19931.   11116.]]
[[ 167093.  336802.  375147.  362677.]
 [ 141050.  274117.  291651.  288389.]
 [  82551.  180240.  192709.  194588.]
 [  69256.  145259.  142511.  145428.]
 [  53428.  104837.  100932.  102059.]
 [  40375.   69763.   79849.   84619.]
 [  34731.   62133.   57896.   57494.]
 [  30896.   39713.   49167.   49672.]
 [  24403.   37957.   30687.   37383.]
 [  21528.   28100.   37339.   34501.]
 [  19599.   19536.   23696.   24025.]
 [  16938.   20315.   22365.   24615.]]
[[ 238620.  264202.  274216.  255032.]
 [ 206043.  204907.  223715.  200563.]
 [ 148174.  124725.  149731.  124172.]
 [ 129015.   91696.  122903.   98611.]
 [ 101029.   62513.   86243.   62801.]
 [  91206.   48981.   73182.   49787.]
 [  71858.   32610.   58676.   37791.]
 [  65123.   24785.   48274.   30308.]
 [  58846.   21238.   38726.   24021.]
 [  50295.   17620.   35797.   18791.]
 [  46016.   15337.   30539.   15357.]
 [  44238.   14838.   27008.   15306.]]
[[ 337474.  302552.  280860.  267250.]
 [ 273369.  222346.  217273.  196843.]
 [ 174452.  134342.  142517.  114324.]
 [ 147140.   92024.  108392.   88084.]
 [ 100472.   60670.   72624.   56500.]
 [  85367.   41983.   59311.   44491.]
 [  64955.   27293.   43830.   27707.]
 [  57549.   22249.   34123.   24122.]
 [  48147.   15829.   26423.   15969.]
 [  42168.   14952.   25091.   16111.]
 [  34650.   11260.   20281.   12005.]
 [  36190.   12898.   20224.   11896.]]
[[ 394442.  364453.  338532.  367062.]
 [ 338345.  301357.  248276.  273852.]
 [ 229854.  195245.  170521.  196664.]
 [ 204412.  163427.  115004.  137404.]
 [ 144190.  113507.   87336.  102081.]
 [ 124875.   87736.   60884.   73322.]
 [  83522.   63786.   52226.   56932.]
 [  72965.   49892.   48491.   47080.]
 [  55831.   42462.   32818.   29598.]
 [  51229.   31036.   31789.   31130.]
 [  43457.   26417.   21366.   20537.]
 [  32242.   27729.   24062.   22342.]]
[[ 311544.  254194.  241327.  262382.]
 [ 270857.  206357.  187856.  192586.]
 [ 211714.  132944.  117389.  120114.]
 [ 181346.  101793.   98132.  103090.]
 [ 152024.   66953.   64352.   59713.]
 [ 135033.   59063.   48819.   52978.]
 [ 109620.   38152.   38140.   35894.]
 [ 103440.   35517.   30508.   25478.]
 [  86720.   24745.   22783.   24098.]
 [  79568.   23094.   21931.   15979.]
 [  71003.   19996.   15291.   16183.]
 [  63981.   15772.   15725.   14631.]]
[[ 319330.  258098.  260280.  251307.]
 [ 256650.  196877.  199918.  187785.]
 [ 172984.  114975.  125778.  112099.]
 [ 145626.   89719.   97188.   84497.]
 [ 103404.   54771.   58904.   53870.]
 [  91793.   45467.   42785.   39421.]
 [  69364.   25853.   31787.   26069.]
 [  62567.   24520.   25872.   21729.]
 [  53827.   16337.   18412.   18009.]
 [  46895.   16356.   14312.   12558.]
 [  40584.   14134.   14341.   13730.]
 [  41965.   14738.   13561.   11198.]]
[[ 367022.  378773.  423636.  386262.]
 [ 306787.  329137.  338121.  319941.]
 [ 210211.  225146.  218519.  209957.]
 [ 181586.  198586.  169079.  161413.]
 [ 117556.  140868.  112292.  116422.]
 [ 102442.  119240.   92047.   87956.]
 [  71713.  100935.   61608.   70175.]
 [  61836.   79423.   54767.   61725.]
 [  48728.   67103.   40692.   41231.]
 [  42301.   59314.   33451.   38856.]
 [  31016.   50656.   27533.   31339.]
 [  29327.   44056.   25114.   28233.]]
[[ 317388.  247653.  259286.  251676.]
 [ 282369.  193302.  213366.  201032.]
 [ 222970.  138063.  138724.  121312.]
 [ 198289.  113801.  107756.   97632.]
 [ 163584.   84144.   80795.   62581.]
 [ 149934.   72844.   62296.   50533.]
 [ 126118.   55352.   49706.   34651.]
 [ 116497.   48965.   42560.   28283.]
 [ 102084.   35579.   34319.   20700.]
 [  94206.   32337.   32547.   18274.]
 [  84608.   30559.   24128.   12781.]
 [  76025.   24924.   26857.   15908.]]
[[ 315983.  271853.  285349.  258620.]
 [ 304642.  214907.  179789.  180035.]
 [ 205298.  129780.  114844.  111568.]
 [ 182353.  103293.   75633.   78847.]
 [ 110024.   61763.   67467.   58686.]
 [ 107110.   52392.   46415.   43274.]
 [  79054.   32281.   36377.   32115.]
 [  70706.   26858.   28386.   27206.]
 [  57688.   18141.   20629.   21215.]
 [  54460.   18030.   19719.   16646.]
 [  44594.   12827.   16198.   15635.]
 [  46977.   14899.   12479.   14687.]]
[[ 483082.  476215.  458038.  376824.]
 [ 411083.  409028.  356776.  290132.]
 [ 303018.  305951.  244247.  190328.]
 [ 257235.  250360.  183969.  140751.]
 [ 197178.  204266.  131434.  100584.]
 [ 170659.  163573.  107389.   80750.]
 [ 132833.  137903.   76401.   52291.]
 [ 116460.  113738.   62411.   45457.]
 [  95251.   98775.   44235.   32452.]
 [  81777.   84897.   42801.   30040.]
 [  69773.   69925.   30523.   24859.]
 [  59385.   64712.   27519.   22593.]]
[[ 363768.  272156.  317607.  274349.]
 [ 330797.  224749.  260883.  211065.]
 [ 249818.  126979.  189079.  135083.]
 [ 229516.  109219.  147617.  104757.]
 [ 182186.   66507.  120967.   68709.]
 [ 165817.   61667.   98518.   54930.]
 [ 139535.   38707.   79354.   31915.]
 [ 124266.   31238.   70341.   29440.]
 [ 107178.   21456.   56886.   19534.]
 [  95571.   18198.   54720.   17535.]
 [  84124.   19199.   43260.   12947.]
 [  77241.   14925.   40703.   12994.]]
[[ 403924.  325107.  308338.  329587.]
 [ 343599.  252255.  239604.  261227.]
 [ 249038.  154254.  147278.  169753.]
 [ 218125.  117863.  116016.  137389.]
 [ 163899.   75056.   78981.   94194.]
 [ 148122.   58157.   58724.   81016.]
 [ 120467.   38547.   43144.   60438.]
 [ 108482.   33081.   34666.   53159.]
 [  94071.   22922.   25344.   40443.]
 [  83941.   19484.   22794.   34486.]
 [  73680.   15800.   18995.   31664.]
 [  63178.   14986.   19109.   28788.]]

In [7]:
def scale(y,index):
    return y/y[index
    
for names in CEST_list:
               print(names)


  File "<ipython-input-7-a0c39e03cafe>", line 7
    for names in CEST_list:
      ^
SyntaxError: invalid syntax

In [11]:



../Study_03_CBA/Goldenberg_M1_S1_2017_1_2_T2.txt
../Study_03_CBA/Goldenberg_M1_S1_2017_1_5_T2.txt
../Study_03_CBA/Goldenberg_M1_S2_2017_1_2_T2.txt
../Study_03_CBA/Goldenberg_M1_S2_2017_1_5_T2.txt
../Study_03_CBA/Goldenberg_M1_S2_2017_1_6_T2.txt
../Study_03_CBA/Goldenberg_M1_S3_2017_1_5_T2.txt
../Study_03_CBA/Goldenberg_M1_S3_2017_1_6_T2.txt
../Study_03_CBA/Goldenberg_M1_S4_2017_1_2_T2.txt
../Study_03_CBA/Goldenberg_M1_S4_2017_1_5_T2.txt
../Study_03_CBA/Goldenberg_M1_S4_2017_1_6_T2.txt
../Study_03_CBA/Goldenberg_M1_S5_2017_1_2_T2.txt
../Study_03_CBA/Goldenberg_M1_S5_2017_1_5_T2.txt
../Study_03_CBA/Goldenberg_M1_S5_2017_1_6_T2.txt
../Study_03_CBA/Goldenberg_M2_S1_2017_1_2_T2.txt
../Study_03_CBA/Goldenberg_M2_S1_2017_1_4_T2.txt
../Study_03_CBA/Goldenberg_M2_S1_2017_1_6_T2.txt
../Study_03_CBA/Goldenberg_M2_S2_2017_1_2_T2.txt
../Study_03_CBA/Goldenberg_M2_S2_2017_1_4_T2.txt
../Study_03_CBA/Goldenberg_M2_S2_2017_1_5_T2.txt
../Study_03_CBA/Goldenberg_M2_S2_2017_1_6_T2.txt
../Study_03_CBA/Goldenberg_M2_S3_2017_1_2_T2.txt
../Study_03_CBA/Goldenberg_M2_S3_2017_1_4_T2.txt
../Study_03_CBA/Goldenberg_M2_S3_2017_1_5_T2.txt
../Study_03_CBA/Goldenberg_M2_S3_2017_1_6_T2.txt
../Study_03_CBA/Goldenberg_M2_S4_2017_1_2_T2.txt
../Study_03_CBA/Goldenberg_M2_S4_2017_1_4_T2.txt
../Study_03_CBA/Goldenberg_M2_S4_2017_1_5_T2.txt
../Study_03_CBA/Goldenberg_M2_S4_2017_1_6_T2.txt
../Study_03_CBA/Goldenberg_M2_S5_2017_1_2_T2.txt
../Study_03_CBA/Goldenberg_M2_S5_2017_1_4_T2.txt
../Study_03_CBA/Goldenberg_M2_S5_2017_1_5_T2.txt
../Study_03_CBA/Goldenberg_M2_S5_2017_1_6_T2.txt
../Study_03_CBA/Goldenberg_M3_S1_2017_1_2_T2.txt
../Study_03_CBA/Goldenberg_M3_S1_2017_1_4_T2.txt
../Study_03_CBA/Goldenberg_M3_S1_2017_1_6_T2.txt
../Study_03_CBA/Goldenberg_M3_S2_2017_1_2_T2.txt
../Study_03_CBA/Goldenberg_M3_S2_2017_1_4_T2.txt
../Study_03_CBA/Goldenberg_M3_S2_2017_1_5_T2.txt
../Study_03_CBA/Goldenberg_M3_S2_2017_1_6_T2.txt
../Study_03_CBA/Goldenberg_M3_S3_2017_1_2_T2.txt
../Study_03_CBA/Goldenberg_M3_S3_2017_1_4_T2.txt
../Study_03_CBA/Goldenberg_M3_S3_2017_1_5_T2.txt
../Study_03_CBA/Goldenberg_M3_S3_2017_1_6_T2.txt
../Study_03_CBA/Goldenberg_M3_S4_2017_1_2_T2.txt
../Study_03_CBA/Goldenberg_M3_S4_2017_1_4_T2.txt
../Study_03_CBA/Goldenberg_M3_S4_2017_1_5_T2.txt
../Study_03_CBA/Goldenberg_M3_S4_2017_1_6_T2.txt
../Study_03_CBA/Goldenberg_M3_S5_2017_1_2_T2.txt
../Study_03_CBA/Goldenberg_M3_S5_2017_1_4_T2.txt
../Study_03_CBA/Goldenberg_M3_S5_2017_1_5_T2.txt
../Study_03_CBA/Goldenberg_M3_S5_2017_1_6_T2.txt
../Study_03_CBA/Goldenberg_M4_S1_2017_1_4_T2.txt
../Study_03_CBA/Goldenberg_M4_S1_2017_1_5_T2.txt
../Study_03_CBA/Goldenberg_M4_S1_2017_1_6_T2.txt
../Study_03_CBA/Goldenberg_M4_S2_2017_1_4_T2.txt
../Study_03_CBA/Goldenberg_M4_S2_2017_1_5_T2.txt
../Study_03_CBA/Goldenberg_M4_S2_2017_1_6_T2.txt
../Study_03_CBA/Goldenberg_M4_S3_2017_1_4_T2.txt
../Study_03_CBA/Goldenberg_M4_S3_2017_1_5_T2.txt
../Study_03_CBA/Goldenberg_M4_S3_2017_1_6_T2.txt
../Study_03_CBA/Goldenberg_M4_S4_2017_1_4_T2.txt
../Study_03_CBA/Goldenberg_M4_S4_2017_1_5_T2.txt
../Study_03_CBA/Goldenberg_M4_S4_2017_1_6_T2.txt
../Study_03_CBA/Goldenberg_M4_S5_2017_1_4_T2.txt
../Study_03_CBA/Goldenberg_M4_S5_2017_1_5_T2.txt
../Study_03_CBA/Goldenberg_M4_S5_2017_1_6_T2.txt
../Study_03_CBA/Goldenberg_M5_S1_2017_1_5_T2.txt
../Study_03_CBA/Goldenberg_M5_S2_2017_1_2_T2.txt
../Study_03_CBA/Goldenberg_M5_S2_2017_1_5_T2.txt
../Study_03_CBA/Goldenberg_M5_S2_2017_1_6_T2.txt
../Study_03_CBA/Goldenberg_M5_S3_2017_1_2_T2.txt
../Study_03_CBA/Goldenberg_M5_S3_2017_1_5_T2.txt
../Study_03_CBA/Goldenberg_M5_S3_2017_1_6_T2.txt
../Study_03_CBA/Goldenberg_M5_S4_2017_1_2_T2.txt
../Study_03_CBA/Goldenberg_M5_S4_2017_1_5_T2.txt
../Study_03_CBA/Goldenberg_M5_S4_2017_1_6_T2.txt
../Study_03_CBA/Goldenberg_M5_S5_2017_1_2_T2.txt
../Study_03_CBA/Goldenberg_M5_S5_2017_1_5_T2.txt
../Study_03_CBA/Goldenberg_M5_S5_2017_1_6_T2.txt

In [5]:
Ydata=txt_2_array(names)
    rows, cols = Ydata.shape
    for i in range(cols):
        ydata=Ydata[:,i]; ydata=ydata/ydata[9]; ydata=ydata[9:]
        integral=np.sum(yd)


---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-5-db8e2d7c4b8e> in <module>()
      1 # Allocate variables needed for analysis
----> 2 YDataMatrix=txt_2_array(CEST_list)

/Users/Julio/GitHub/Machine-Learning-4-MRI/Infection_vs_Inflammation/Code/mylocal_functions.py in txt_2_array(file_name)
      5 
      6 def txt_2_array(file_name):
----> 7     f1 = open(file_name,'r')
      8 
      9     # Read all lines

TypeError: invalid file: ['../Study_03_CBA/Goldenberg_M1_S3_2017_1_2_CEST.txt', '../Study_03_CBA/Goldenberg_M1_S3_2017_1_5_CEST.txt', '../Study_03_CBA/Goldenberg_M1_S3_2017_1_6_CEST.txt', '../Study_03_CBA/Goldenberg_M2_S3_2017_1_2_CEST.txt', '../Study_03_CBA/Goldenberg_M2_S3_2017_1_4_CEST.txt', '../Study_03_CBA/Goldenberg_M2_S3_2017_1_6_CEST.txt', '../Study_03_CBA/Goldenberg_M2_S4_2017_1_5_CEST.txt', '../Study_03_CBA/Goldenberg_M3_S3_2017_1_2_CEST.txt', '../Study_03_CBA/Goldenberg_M3_S3_2017_1_4_CEST.txt', '../Study_03_CBA/Goldenberg_M3_S3_2017_1_5_CEST.txt', '../Study_03_CBA/Goldenberg_M3_S4_2017_1_6_CEST.txt', '../Study_03_CBA/Goldenberg_M4_S3_2017_1_4_CEST.txt', '../Study_03_CBA/Goldenberg_M4_S3_2017_1_5_CEST.txt', '../Study_03_CBA/Goldenberg_M4_S3_2017_1_6_CEST.txt', '../Study_03_CBA/Goldenberg_M5_S4_2017_1_5_CEST.txt', '../Study_03_CBA/Goldenberg_M5_S4_2017_1_6_CEST.txt']

In [ ]:
# Fit T2 for all ROIs, slices and mice. construct dataframe
for names in T2_list:
    #Convert txt file to array
    YDataMatrix=txt_2_array(names)
    #Estimate T2
    T2time=fitT2(TR,YDataMatrix)
    #convert to data frame
    df_T2=pd.DataFrame(T2time.T,columns=["Infected","Healthy_Right","Sterile_Inflammation","Healthy_Left"])
    #df_T2=pd.DataFrame(T2time.T,columns=["ROI-1","ROI-2","ROI-3","ROI-4"])
    df_info=name_2_df(names)
    df_final=pd.concat([df_T2,df_info], axis=1)
    T2DF=T2DF.append(df_final,ignore_index=True)

CEST MRI


In [ ]: