Ignore:
Timestamp:
Sep 22, 2017, 12:33:16 PM (6 years ago)
Author:
sommeria
Message:

multimask introduced

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/series/civ_input.m

    r1007 r1010  
    15161516hchildren=get(hparent,'children');
    15171517handle_txtbox=findobj(hchildren,'tag','Mask');% look for the mask name box in the same panel
    1518 
     1518handle_NbSlice=findobj(hchildren,'tag','num_NbSlice');% look for the mask name box in the same panel
    15191519testmask=0;
    15201520if value
     
    15261526        ind_A=2;
    15271527    end
    1528     [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
     1528%     [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
    15331533        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
    15341540        set(hObject,'UserData',filemask);%store for future use
    15351541        if ~isempty(filemask)
    15361542            testmask=1;
    1537         end
    1538     end
     1543         end
     1544%     end
    15391545end
    15401546if testmask
     
    15421548    set(handles.Mask,'String',filemask)
    15431549    set(handles.CheckMask,'Value',1)
     1550    if strcmp(NomType,'_1')
     1551        set(handles.num_NbSlice,'Visible','on')
     1552    end
    15441553else
    15451554    set(hObject,'Value',0);
    15461555    set(handle_txtbox,'Visible','off')
     1556    set(handles.num_NbSlice,'Visible','off')
    15471557end
    15481558set(handles.ConfigSource,'String','NEW')
     
    23752385    drawnow
    23762386end
     2387
     2388
     2389
     2390function 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.
     2400function 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.
     2407if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
     2408    set(hObject,'BackgroundColor','white');
     2409end
Note: See TracChangeset for help on using the changeset viewer.