GS_Transfer_Slice |
pro
GS_Transfer_Slice,parms,rowdata,path,parmin,datain,info=infoif n_elements(path) eq 0 then begindirpath=
file_dirname((ROUTINE_INFO('GS_Transfer_Slice',/source)).path,/mark)path=dirpath+
'GS_Transfer_Slice.dll'endif arg_present(info) then beginif n_elements(parms) gt 0 then dummy=temporary(parms)if n_elements(info) eq 0 then beginresult=
call_external(path,'GET_PARMS',/F_VALUE,/unload )openr,lun,'parms.txt',/get,error=errorif error eq 1 then returnline=
''WHILE ~ EOF(lun) DO BEGIN READF, lun, lineinfo=
strsplit(line,';',/extract)if n_elements(info) eq 3 then info=[info,'']if n_elements(parms) eq 0 then beginparms={name:
strcompress(info[0],/rem),value:float(info[1]),unit:strcompress(info[2],/rem),hint:info[3]}endif else beginparms=[parms,{name:
strcompress(info[0],/rem),value:float(info[1]),unit:strcompress(info[2],/rem),hint:info[3]}]endENDWHILEfree_lun,lunendif else parms=info.parmsNvox=
1LNpix=
1Ldummy_parmin=
fltarr(n_elements(parms),Nvox,Npix)dummy_parmin[*]=parms.value
dummy_datain=
fltarr(7,parms[18].value,Npix)test_call=
call_external(path,'GET_MW_SLICE',Npix,Nvox,dummy_parmin,dummy_datain,/F_VALUE,/unload )info={parms:parms,$
pixdim:[parms[
18].value,2,3],$spectrum:{x:{axis:
reform(dummy_datain[0,*]),label:'Frequency',unit:'GHz'},$y:{label:[
'LCP','RCP','[RCP+LCP]','[RCP-LCP]','[R-L]/[R+L]'],unit:['sfu','sfu','sfu','sfu','%']}},$channels:[
'Exact Coupling', 'Weak Coupling', 'Strong Coupling']} returnendsz=
size(rowdata,/dim)Npix=sz[
0]Nfreq=sz[
1]Npol=sz[
2]Ncouplings=sz[
3]sz=
size(parms,/dim)Npix=sz[
0]Nvox=sz[
1]Nparms=sz[
2]if n_elements(datain) eq 0 then datain=fltarr(7,Nfreq,Npix)if n_elements(parmin) eq 0 then parmin=fltarr(Nparms,Nvox,Npix)for i=0, npix-1 do beginparmin[*,*,i]=
transpose(parms[i,*,*])endtest_call=
call_external(path,'GET_MW_SLICE',Npix,Nvox,parmin,datain,/F_VALUE,/unload )rowdata[*,*,
0,0]=transpose(datain[5,*,*]);eLrowdata[*,*,
1,0]=transpose(datain[6,*,*]);eRrowdata[*,*,
0,1]=transpose(datain[1,*,*]);wLrowdata[*,*,
1,1]=transpose(datain[2,*,*]);wRrowdata[*,*,
0,2]=transpose(datain[3,*,*]);sLrowdata[*,*,
1,2]=transpose(datain[4,*,*]);sRend