Changeset 1010 for trunk/src/series
- Timestamp:
- Sep 22, 2017, 12:33:16 PM (7 years ago)
- Location:
- trunk/src/series
- Files:
-
- 1 added
- 1 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/series/civ_input.m
r1007 r1010 1516 1516 hchildren=get(hparent,'children'); 1517 1517 handle_txtbox=findobj(hchildren,'tag','Mask');% look for the mask name box in the same panel 1518 1518 handle_NbSlice=findobj(hchildren,'tag','num_NbSlice');% look for the mask name box in the same panel 1519 1519 testmask=0; 1520 1520 if value … … 1526 1526 ind_A=2; 1527 1527 end 1528 [nbslice, flag_mask]=get_mask(InputTable{ind_A,1},handles);% look for a mask with appropriate name1529 if isequal(flag_mask,1)1530 filemask=[num2str(nbslice) 'mask'];1531 testmask=1;1532 else % browse for a mask1528 % [nbslice, flag_mask]=get_mask(InputTable{ind_A,1},handles);% look for a mask with appropriate name 1529 % if isequal(flag_mask,1) 1530 % filemask=[num2str(nbslice) 'mask']; 1531 % testmask=1; 1532 % else % browse for a mask 1533 1533 filemask= uigetfile_uvmat('pick a mask image file:',InputTable{ind_A,1},'image'); 1534 [FilePath,FileName,Ext]=fileparts(filemask); 1535 [RootPath,SubDir,RootFile,i1_series,i2,j1,j2,NomType]=find_file_series(FilePath,[FileName,Ext]); 1536 if strcmp(NomType,'_1') 1537 NbSlice=i1_series(1,2,end); 1538 set(handle_NbSlice,'String',num2str(NbSlice)) 1539 end 1534 1540 set(hObject,'UserData',filemask);%store for future use 1535 1541 if ~isempty(filemask) 1536 1542 testmask=1; 1537 end1538 end1543 end 1544 % end 1539 1545 end 1540 1546 if testmask … … 1542 1548 set(handles.Mask,'String',filemask) 1543 1549 set(handles.CheckMask,'Value',1) 1550 if strcmp(NomType,'_1') 1551 set(handles.num_NbSlice,'Visible','on') 1552 end 1544 1553 else 1545 1554 set(hObject,'Value',0); 1546 1555 set(handle_txtbox,'Visible','off') 1556 set(handles.num_NbSlice,'Visible','off') 1547 1557 end 1548 1558 set(handles.ConfigSource,'String','NEW') … … 2375 2385 drawnow 2376 2386 end 2387 2388 2389 2390 function num_NbSlice_Callback(hObject, eventdata, handles) 2391 % hObject handle to num_NbSlice (see GCBO) 2392 % eventdata reserved - to be defined in a future version of MATLAB 2393 % handles structure with handles and user data (see GUIDATA) 2394 2395 % Hints: get(hObject,'String') returns contents of num_NbSlice as text 2396 % str2double(get(hObject,'String')) returns contents of num_NbSlice as a double 2397 2398 2399 % --- Executes during object creation, after setting all properties. 2400 function num_NbSlice_CreateFcn(hObject, eventdata, handles) 2401 % hObject handle to num_NbSlice (see GCBO) 2402 % eventdata reserved - to be defined in a future version of MATLAB 2403 % handles empty - handles not created until after all CreateFcns called 2404 2405 % Hint: edit controls usually have a white background on Windows. 2406 % See ISPC and COMPUTER. 2407 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 2408 set(hObject,'BackgroundColor','white'); 2409 end -
trunk/src/series/civ_series.m
r1007 r1010 276 276 277 277 %%%%% MAIN LOOP %%%%%% 278 mask name='';% initiate the mask name278 maskoldname='';% initiate the mask name 279 279 FileType_A=''; 280 280 FileType_B=''; … … 440 440 Data.VarAttribute{4}.Role='vector_y'; 441 441 Data.VarAttribute{5}.Role='warnflag'; 442 % case of mask 442 443 if par_civ1.CheckMask&&~isempty(par_civ1.Mask) 443 if strcmp(maskname,par_civ1.Mask)% mask exist, not already read in civ1 444 if isfield(par_civ1,'NbSlice') 445 [RootPath_mask,SubDir_mask,RootFile_mask,i1_mask,i2_mask,j1_mask,j2_mask,Ext_mask]=fileparts_uvmat(Param.ActionInput.Civ1.Mask); 446 i1_mask=mod(i1-1,par_civ1.NbSlice)+1; 447 maskname=fullfile_uvmat(RootPath_mask,SubDir_mask,RootFile_mask,Ext_mask,'_1',i1_mask); 448 else 449 maskname=Param.ActionInput.Civ1.Mask; 450 end 451 if strcmp(maskoldname,maskname)% mask exist, not already read in civ1 444 452 par_civ1.Mask=mask; %use mask already opened 445 453 else 446 454 try 447 par_civ1.Mask=imread( par_civ1.Mask);%update the mask, an store it for future use455 par_civ1.Mask=imread(maskname);%update the mask, an store it for future use 448 456 catch ME 449 457 if ~isempty(ME.message) … … 454 462 end 455 463 mask=par_civ1.Mask; 456 mask name=par_civ1.Mask;464 maskoldname=maskname; 457 465 end 458 466 end … … 704 712 end 705 713 end 706 if par_civ2.CheckMask&&~isempty(par_civ2.Mask) 707 if strcmp(maskname,par_civ2.Mask)% mask exist, not already read in civ1 714 if par_civ2.CheckMask&&~isempty(par_civ2.Mask) 715 if isfield(par_civ2,'NbSlice') 716 [RootPath_mask,SubDir_mask,RootFile_mask,i1_mask,i2_mask,j1_mask,j2_mask,Ext_mask]=fileparts_uvmat(Param.ActionInput.Civ2.Mask); 717 i1_mask=mod(i1-1,par_civ2.NbSlice)+1; 718 maskname=fullfile_uvmat(RootPath_mask,SubDir_mask,RootFile_mask,Ext_mask,'_1',i1_mask); 719 else 720 maskname=Param.ActionInput.Civ2.Mask; 721 end 722 if strcmp(maskoldname,maskname)% mask exist, not already read in civ1 708 723 par_civ2.Mask=mask; %use mask already opened 709 724 else 710 par_civ2.Mask=imread(par_civ2.Mask);%update the mask, and store it for future use 725 try 726 par_civ2.Mask=imread(maskname);%update the mask, an store it for future use 727 catch ME 728 if ~isempty(ME.message) 729 errormsg=['error reading input image: ' ME.message]; 730 disp_uvmat('ERROR',errormsg,checkrun) 731 return 732 end 733 end 711 734 mask=par_civ2.Mask; 712 maskname=par_civ2.Mask; 713 end 714 end 735 maskoldname=maskname; 736 end 737 end 738 715 739 if CheckInputFile % else Dt given by par_civ2 716 740 if strcmp(Param.ActionInput.ListCompareMode,'displacement')
Note: See TracChangeset
for help on using the changeset viewer.