Home > SRC > BTPDE_HARDI.m

BTPDE_HARDI

PURPOSE ^

compute the ADC from Bloch-Torrey equation for ngdir directions and interpolate to 900 directions uniformly distributed on the sphere.

SYNOPSIS ^

function [points,ADC_BT_cmpts_alldir,ADC_BT_allcmpts_alldir]= BTPDE_HARDI(experi_btpde,mymesh,DIFF_cmpts,kappa_bdys,IC_cmpts)

DESCRIPTION ^

 compute the ADC from Bloch-Torrey equation for ngdir directions and interpolate to 900 directions uniformly distributed on the sphere.
 
 Input:
     1. experiment_btpde is a structure with 10 elements:
         ngdir_total 
         gdir        
         sdeltavec   
         bdeltavec   
         seqvec       
         npervec     
         rtol        
         atol        
         qvalues     
         bvalues        
     2. mymesh is a structure with 10 elements:
         Nnode
         Nele
         Nface
         Pts_cmpt_reorder
         Ele_cmpt_reorder
         Pts_ind
         Pts_boundary_reorder
         Fac_boundary_reorder
         Nboundary
         Ncmpt
     3. DIFF_cmpts
     4. kappa_bdys
     5. IC_cmpts
 
 Output:
     1. points (ngdir directions)
     2. ADC_BT_cmpts_alldir
     3. ADC_BT_allcmpts_alldir

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [points,ADC_BT_cmpts_alldir,ADC_BT_allcmpts_alldir] ...
0002     = BTPDE_HARDI(experi_btpde,mymesh,DIFF_cmpts,kappa_bdys,IC_cmpts)
0003 
0004 % compute the ADC from Bloch-Torrey equation for ngdir directions and interpolate to 900 directions uniformly distributed on the sphere.
0005 %
0006 % Input:
0007 %     1. experiment_btpde is a structure with 10 elements:
0008 %         ngdir_total
0009 %         gdir
0010 %         sdeltavec
0011 %         bdeltavec
0012 %         seqvec
0013 %         npervec
0014 %         rtol
0015 %         atol
0016 %         qvalues
0017 %         bvalues
0018 %     2. mymesh is a structure with 10 elements:
0019 %         Nnode
0020 %         Nele
0021 %         Nface
0022 %         Pts_cmpt_reorder
0023 %         Ele_cmpt_reorder
0024 %         Pts_ind
0025 %         Pts_boundary_reorder
0026 %         Fac_boundary_reorder
0027 %         Nboundary
0028 %         Ncmpt
0029 %     3. DIFF_cmpts
0030 %     4. kappa_bdys
0031 %     5. IC_cmpts
0032 %
0033 % Output:
0034 %     1. points (ngdir directions)
0035 %     2. ADC_BT_cmpts_alldir
0036 %     3. ADC_BT_allcmpts_alldir
0037 
0038 Ncmpt = length(DIFF_cmpts);
0039 [points,C,v] = spheresurface_regularpoints(1,experi_btpde.ngdir_total);
0040 ngdir_total = size(points,1);
0041 ii = find(points(:,3) >= 0);
0042 % negii
0043 for j = 1:size(ii,1)
0044     for k = 1:ngdir_total
0045         if (norm(points(j,1:2)-points(k,1:2)) < 1e-10  && points(j,3)+points(k,3) < 1e-10)
0046             negii(ii(j)) = k;
0047         end
0048     end
0049 end
0050 jc = 0;
0051 for ic = 1:size(C,1)
0052     jj = find(C(ic,1) == ii);
0053     kk = find(C(ic,2) == ii);
0054     ll = find(C(ic,3) == ii);
0055     if (~isempty(jj) & ~isempty(kk) & ~isempty(ll))
0056         Ckeep(jc+1,1:3) = C(ic,1:3);
0057         jc = jc+1;
0058     end
0059 end
0060 graddir_index = ii;
0061 ndir = length(graddir_index);
0062 nexperi = length(experi_btpde.sdeltavec);
0063 
0064 ADC_BT_cmpts_alldir = nan*ones(ngdir_total,Ncmpt,nexperi);
0065 ADC_BT_allcmpts_alldir = nan*ones(ngdir_total,nexperi);
0066 for idir = 1:ndir
0067     experi_btpde.gdir = points(graddir_index(idir),:)';
0068     [TOUT,YOUT,MF_cmpts,MF_allcmpts,difftime,BTPDE_elapsed_time] ...
0069         = BTPDE(experi_btpde,mymesh,DIFF_cmpts,kappa_bdys,IC_cmpts);
0070     [ADC_BT_cmpts,ADC_BT_allcmpts,ADC_BT_allcmpts_S0] = FIT_SIGNAL(MF_cmpts,MF_allcmpts,experi_btpde.bvalues);
0071     ADC_BT_cmpts_alldir(graddir_index(idir),:,:) = ADC_BT_cmpts;
0072     ADC_BT_cmpts_alldir(negii(graddir_index(idir)),:,:) = ADC_BT_cmpts;
0073     ADC_BT_allcmpts_alldir(graddir_index(idir),:) = ADC_BT_allcmpts(:,1)';
0074     ADC_BT_allcmpts_alldir(negii(graddir_index(idir)),:) = ADC_BT_allcmpts(:,1)';
0075 end
0076 ADC_BT_cmpts_alldir(find(ADC_BT_cmpts_alldir==0)) = nan;
0077 ADC_BT_allcmpts_alldir(find(ADC_BT_allcmpts_alldir==0)) = nan;

Generated on Mon 28-Jan-2019 12:43:57 by m2html © 2005