Changeset 1068 for trunk/src/series/extract_rdvision.m
- Timestamp:
- Jul 9, 2019, 10:10:18 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/series/extract_rdvision.m
r1066 r1068 489 489 490 490 %% correct NbDtj and NbDti (error from RDvision) 491 if NbDtj==numel(Dtj)% case of bursts492 NbDtj=1;493 uid_motor_nbslice=find(t,'ImaDoc/TranslationMotor/Nbslice');494 if ~isempty(uid_motor_nbslice)&& ~isempty(uid_Dtk)% case of multilevel495 NbSlice=str2num(get(t,get(t,uid_motor_nbslice,'contents'),'value'));496 NbDti=NbSlice-1;497 end498 end491 % if NbDtj==numel(Dtj)% case of bursts 492 % NbDtj=1; 493 % uid_motor_nbslice=find(t,'ImaDoc/TranslationMotor/Nbslice'); 494 % if ~isempty(uid_motor_nbslice)&& ~isempty(uid_Dtk)% case of multilevel 495 % NbSlice=str2num(get(t,get(t,uid_motor_nbslice,'contents'),'value')); 496 % NbDti=NbSlice-1; 497 % end 498 % end 499 499 500 500 if isempty(Dtj)% case of simple series … … 509 509 nbfield2=NbDtj*numel(Dtj)+1; 510 510 NbFrames_xml=nbfield1*nbfield2; 511 if NbFrames_xml<numel(timestamp)512 disp(['ERROR: size from xml ' num2str(NbFrame_xml) ' smaller than timestamp size ' num2str(numel(timestamp))])513 return514 end515 if NbFrames_xml>numel(timestamp)516 nbfield1=floor(numel(timestamp)/nbfield2);517 nbfieldk=floor(nbfield1/nbfieldi);518 nbfield1=nbfieldi*nbfieldk;519 NbDtk=nbfieldk-1;520 t=set(t,uid_content_NbDtk,'value',num2str(NbDtk));% correct NbDtk in the xml file (in practice numel(Dtk)=1;521 timestamp=timestamp(1:nbfield1*nbfield2);522 disp(['image record stopped before end: max index i= ' num2str(nbfield1)]);523 timestamp=reshape(timestamp,nbfield2,nbfield1);524 end525 % check Dtj with respect to timestamp526 timestamp=(reshape(timestamp,nbfield2,[]))';527 diff_Dtj=diff(timestamp(1,:))-Dtj;528 if max(abs(diff_Dtj))>min(Dtj)/1000529 disp(['Dtj from xml file differs from time stamp by ' num2str(max(abs(diff_Dtj))) ', '])%'530 else531 disp('Dtj OK');532 end511 % if NbFrames_xml<numel(timestamp) 512 % disp(['ERROR: size from xml ' num2str(NbFrame_xml) ' smaller than timestamp size ' num2str(numel(timestamp))]) 513 % return 514 % end 515 % if NbFrames_xml>numel(timestamp) 516 % nbfield1=floor(numel(timestamp)/nbfield2); 517 % nbfieldk=floor(nbfield1/nbfieldi); 518 % nbfield1=nbfieldi*nbfieldk; 519 % NbDtk=nbfieldk-1; 520 % t=set(t,uid_content_NbDtk,'value',num2str(NbDtk));% correct NbDtk in the xml file (in practice numel(Dtk)=1; 521 % timestamp=timestamp(1:nbfield1*nbfield2); 522 % disp(['image record stopped before end: max index i= ' num2str(nbfield1)]); 523 % timestamp=reshape(timestamp,nbfield2,nbfield1); 524 % end 525 % % check Dtj with respect to timestamp 526 % timestamp=(reshape(timestamp,nbfield2,[]))'; 527 % diff_Dtj=diff(timestamp(1,:))-Dtj; 528 % if max(abs(diff_Dtj))>min(Dtj)/1000 529 % disp(['Dtj from xml file differs from time stamp by ' num2str(max(abs(diff_Dtj))) ', '])%' 530 % else 531 % disp('Dtj OK'); 532 % end 533 533 end 534 534 535 535 %% adjust Dti 536 if NbDti+1>size(timestamp,1)537 NbDti=size(timestamp,1)-1;538 end539 Dti_stamp=(timestamp(1+NbDti,1)-timestamp(1,1))/NbDti;540 Dti_stamp=(timestamp(1+NbDti,1)-timestamp(2,1))/(NbDti-1);541 t=set(t,uid_content_Dti,'value',num2str(Dti_stamp));%corret Dti542 if abs(Dti_stamp-Dti)>Dti/1000543 disp([msg 'Dti from xml file corrected by ' num2str(Dti_stamp-Dti) ', ']);%'544 else545 disp('Dti OK')546 end536 % if NbDti+1>size(timestamp,1) 537 % NbDti=size(timestamp,1)-1; 538 % end 539 % Dti_stamp=(timestamp(1+NbDti,1)-timestamp(1,1))/NbDti; 540 % Dti_stamp=(timestamp(1+NbDti,1)-timestamp(2,1))/(NbDti-1); 541 % t=set(t,uid_content_Dti,'value',num2str(Dti_stamp));%corret Dti 542 % if abs(Dti_stamp-Dti)>Dti/1000 543 % disp([msg 'Dti from xml file corrected by ' num2str(Dti_stamp-Dti) ', ']);%' 544 % else 545 % disp('Dti OK') 546 % end 547 547 548 548 %% adjust Dtk
Note: See TracChangeset
for help on using the changeset viewer.