Home > SRC > HADC_HARDI.m

HADC_HARDI

PURPOSE ^

compute the ADC from HADC model for ngdir directions and interpolate to 900 directions uniformly distributed on the sphere.

SYNOPSIS ^

function [points,ADC_HADC_cmpts_alldir,ADC_HADC_allcmpts_alldir]= HADC_HARDI(experi_hadc,mymesh,DIFF_cmpts,IC_cmpts)

DESCRIPTION ^

 compute the ADC from HADC model for ngdir directions and interpolate to 900 directions uniformly distributed on the sphere.
 
 Input:
     1. experiment_hadc is a structure with 8 elements:
         ngdir_total 
         gdir       
         sdeltavec   
         bdeltavec    
         seqvec       
         npervec     
         rtol        
         atol               
     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. IC_cmpts
 
 Output:
     1. points (ngdir directions)
     2. ADC_HADC_cmpts_alldir
     3. ADC_HADC_allcmpts_alldir

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

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

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