From a0c306a3423cf811de06022a8164b6cf014d9dec Mon Sep 17 00:00:00 2001 From: Benjamin Aron Date: Fri, 22 Mar 2024 17:44:17 -0400 Subject: [PATCH] update RK calculation to be the same as matlab --- constant/dirs256.mat | Bin 0 -> 3245 bytes lib/tensor.py | 6 +++++- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 constant/dirs256.mat diff --git a/constant/dirs256.mat b/constant/dirs256.mat new file mode 100644 index 0000000000000000000000000000000000000000..f51c4b589c1c4a2f373e000ec1e49dec1ad460ad GIT binary patch literal 3245 zcma)-dpwi<8^=*S4v|zI%CVlDLgbVjCKRcShV&X1Z0cVab7G?&Tj&Y$u@u4A_G0|3Mkf1nC6BErthpo&G zS(%z@ni!jyY5u>D*uRgs3q&4RYsrdI3@VhFv z%M{&yQsA)feL$wJj9#)9&cjvVWx@FcY9uczfq$ICWt1NwlEjo%`}vzUSbCT9Inrffamhp8NUnQqRHEp@HRoH^B=X zR$tjFZ6OS-9=epyJYH{3Wr>Z*qW|bMEQ|}S3jqYC`w$}E8zs;_Fa*>t`{*L2W%&lCER#$HR zk!Pg+jm^jSd35#;##Z*TG4XxU172Tjy0=ho{|!IaZSb}QnLlp1?_;Oh1ZhYk<$~=s z0=VXW8)DNQ1ad0-&{Y0&+IrEx&Y+G`^1!gSQi}R1)pH1N_;pZZa7goBEYDouV7I!XF7v z2OJET`1ph0{Ce&>F`AaoF7MinyI3*Z#aj{6GHW${>Ym>9!8pIzw2gs1@On$cS;WK? zp(qKy#u^`|dPRG^3j;w{65IWfhWon7&PzA`Y2DqMpZaV(+o@>`r$kEnVpzC7#q4AS z8TS2z6~L%Oq|KI{*Ql0hJz^y@isyAAz2FEt`sW?e%vrLe_eg7 zOKI_nYb>0wcSz&ZEj2S0mCkOKQVU}1mXCHuD-gVUIpSBc^h_H>1NVhC*DyY?okM1;VYN&F1P(@p?m$Z;p7(K~xNBKG-wbe6^ZCSXysM zje7Z9^Y4G9ls8re-q!D&SUU9js?`cCeCT$V{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xy~&<>o#9 z(n!yR^A$fkLO4z8cjwcD&FMpmlGdu)&X&os@m5xUUdpC~_BN=&w(?%RNoLZ}UT*_R z|D#lLFSO6iQ+O#tpg%x!^wbYazv`n&@Vct$5$`72KG6ROVgcVHN!2b2%(J5K1IZg0%@{uq^D z;hxb${$AQR_-VRM5V3t?*B80{i*fA+j?6=G)8_YA;=aM2xXFDNPni_I8^xK;{gT{& z>qZI7*C()8{@^l*GojPNsxyDBi!s)>NBV};b=w`B|Olz+)(>+kp zUC<(fAsClup#vA4tR-TGH#hpQsQT_%XiTw6w@-AO^DL`>Oz}i6K=O<)B;@+_ z1g7>?G)tl()~LQmZFj19>#{)6$#aSG?p!-aY%3(~tv$Uocx=-VGEZw>$T7{ z(V!~}nG>AbLx(1i_X3r#A)2S^y&e-K^&LZwTxttV7oY=}WKd=xUsUz;VkJYwt1LX| zV-0@~a5pfZI#y7C;^;{J0GT{k#R4K5BTY0hMbm6U6W`If3E+((-0C3oVycN^UPcQU z8|)?9sXYev9QD7PIms44o|;V}*2m$~XGA95$^keD(SVF-Q2K2A*PM->6DbVZpbu~9 SC;fYP&Rc)_Zdb6-SMgsJIm#yh literal 0 HcmV?d00001 diff --git a/lib/tensor.py b/lib/tensor.py index 53477f8b..5b15588e 100644 --- a/lib/tensor.py +++ b/lib/tensor.py @@ -213,7 +213,11 @@ def extract_parameters(self, dt, b, mask, extract_dti, extract_dki, fit_w=False) parameters['trace'] = trace if extract_dki: - dirs = np.array(self.fibonacci_sphere(256, True)) + #dirs = np.array(self.fibonacci_sphere(256, True)) + dwd = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) + mat = sio.loadmat(os.path.join(dwd,'constant','dirs256.mat')) + dirs = mat['dirs'] + if fit_w: akc = self.w_kurtosis_coeff(dt, dirs)