Changeset 931 for trunk


Ignore:
Timestamp:
Mar 13, 2016, 6:29:07 PM (5 years ago)
Author:
sommeria
Message:

various

Location:
trunk/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/browse_data.m

    r924 r931  
    4747%------------------------------------------------------------------------
    4848% --- Executes just before browse_data is made visible.
    49 function browse_data_OpeningFcn(hObject, eventdata, handles, DataSeries,EnableMirror)
     49function browse_data_OpeningFcn(hObject, eventdata, handles, DataSeries,EnableMirror,MultiDevices)
    5050%------------------------------------------------------------------------
    5151
     
    7373set(hObject, 'Position', FigPos);
    7474set(hObject, 'Units', OldUnits);
     75if exist('MultiDevices','var') && strcmp(MultiDevices,'on')
     76    set(handles.ListDevices,'Max',2)
     77else
     78    set(handles.ListDevices,'Max',1)
     79end
    7580if exist('EnableMirror','var') && strcmp(EnableMirror,'on')
    7681    set(handles.CreateMirror,'Visible','on')
     
    608613    Campaign=get(handles.SourceDir,'String');
    609614end
     615handles.output=[];
    610616handles.output.Campaign=Campaign;
    611617Experiment=get(handles.ListExperiments,'String');
  • trunk/src/series/extract_multitif.m

    r930 r931  
    142142ImagesPerLevel=100;%100;
    143143count=0;
    144 %count=933;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%CORRECTION EXP08: 67->_11_1
    145 %count=1934%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%CORRECTION EXP07:
     144%count=316;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%CORRECTION EXP08: 4684 images -> start at 316 start 67->_11_1
     145%count=1934%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%CORRECTION EXP07: 3066 images
    146146%% loop on the files
    147147for ifile=1:numel(ListFile)
     
    156156    for iframe=1:NbFrames     
    157157        A=imread(ImageName,iframe);
    158         count=count+1;
     158
    159159        if isequal(ImagesPerLevel,1)% mode series
    160160           
    161             OutputFile=fullfile(OutputDir,['img_' num2str(count) '.png']);
     161            OutputFile=fullfile(OutputDir,['img_' num2str(count+1) '.png']);
    162162        else % mode multilevel or volume (indices i and j)
    163163            i_index=fix(count/ImagesPerLevel)+1;
     
    166166        end
    167167        imwrite(A,OutputFile,'BitDepth',16)
     168        count=count+1;
    168169    end
    169170end
  • trunk/src/series/extract_rdvision.m

    r930 r931  
    44%------------------------------------------------------------------------
    55%
    6 %%%%%%%%%%% GENERAL TO ALL SERIES ACTION FCTS %%%%%%%%%%%%%%%%%%%%%%%%%%%
     6%%%%%%%%%%% GENERAL TO ALL SERIES ACTION FCTS %
     7%%%%%%%%%%%%%%%%%%%%%%%%%%
    78%
    89%OUTPUT
     
    243244   
    244245   
     246   
    245247    %% reading the .sqb file
    246248    m = memmapfile(filename_sqb,'Format', { 'uint32' [1 1] 'offset'; ...
     
    286288        checkpreserve=1;% will not erase the initial files, possibility of error
    287289    end
     290   
     291        %% checking consistency with the xml file
     292    if ~isequal(SeqData.nb_frames,numel(timestamp))
     293        disp_uvmat('ERRROR',['inconsistent number of images ' num2str(SeqData.nb_frames) ' with respect to the xml file: ' num2str(numel(timestamp))] ,checkrun);
     294        return
     295    end   
     296   
    288297    if nbfield2>1
    289298        NomTypeNew='_1_1';
     
    301310    FileDir=SeqData.sequencename;
    302311     FileDir=regexprep(FileDir,'_Master_Dalsa_4M180$','');%suppress '_Master_Dalsa_4M180'
    303     for i1=1:npi-1
    304         for j1=1:npj-1
     312    for i1=1:numel(timestamp)/nbfield2
     313        for j1=1:nbfield2
    305314            OutputFile=fullfile_uvmat(RootPath,FileDir,'img','.png',NomTypeNew,i1,[],j1);% TODO: set NomTypeNew from SeqData.mode
     315            try
    306316            A=imread(OutputFile);% check image reading (stop if error)
     317            catch ME
     318                disp(['checking ' OutputFile])
     319                disp(ME.message)
     320            end
    307321        end
    308322    end
     
    378392    OutputFile=fullfile_uvmat(PathDir,FileDir,'img','.png',NomTypeNew,i1,[],j1);% TODO: set NomTypeNew from SeqData.mode
    379393    fname=fullfile(binrepertoire,sprintf('%s%.5d.bin',SeqData.binfile,SqbData(ii).file_idx));
    380     if exist(OutputFile,'file')
     394    if exist(OutputFile,'file')% do not recreate existing image file
    381395        fid=0;
    382396    else
  • trunk/src/uvmat.m

    r924 r931  
    12731273RootPath=read_file_boxes(hhuvmat);
    12741274
    1275 OutPutDir=uigetfile_uvmat('choosean image folder to calibrate with slice position?',fileparts(RootPath),'uigetdir');
    1276 OutPut=browse_data(OutPutDir);
     1275OutPutDir=uigetfile_uvmat('choose an image folder to document with slice position?',fileparts(RootPath),'uigetdir');
     1276OutPut=browse_data(OutPutDir,'off','on');
    12771277nbcalib=0;
    12781278for ilist=1:numel(OutPut.Experiment)
    1279     SubDirBase=regexprep(OutPut.DataSeries{1},'\..+$','');
    1280     XmlFile=fullfile(OutPut.Campaign,OutPut.Experiment{ilist},[SubDirBase '.xml']);
    1281    
    1282     % read the current xml file
    1283     [s,errormsg]=imadoc2struct(XmlFile,'GeometryCalib');
    1284     if ~isempty(errormsg)
    1285         msgbox_uvmat('ERROR',['error in reading ' XmlFile ': ' errormsg])
    1286         return
    1287     end
    1288     GeometryCalib=s.GeometryCalib;
    1289     GeometryCalib.NbSlice=SliceData.NbSlice;
    1290     GeometryCalib.CheckVolumeScan=SliceData.CheckVolumeScan;
    1291     Z_plane=linspace(SliceData.Z(1),SliceData.Z(2),SliceData.NbSlice);
    1292     GeometryCalib.SliceCoord=Z_plane'*[0 0 1];
    1293     GeometryCalib.SliceAngle=zeros(GeometryCalib.NbSlice,3);
    1294     Angle_1=linspace(SliceData.SliceAngle_1(1),SliceData.SliceAngle_1(2),SliceData.NbSlice);
    1295     Angle_2=linspace(SliceData.SliceAngle_2(1),SliceData.SliceAngle_2(2),SliceData.NbSlice);
    1296     GeometryCalib.SliceAngle(:,1)=Angle_1';%rotation around x axis (to generalise)
    1297     GeometryCalib.SliceAngle(:,2)=Angle_2';%rotation around y axis (to generalise)
    1298     GeometryCalib.SliceAngle(:,3)=0;
    1299     if SliceData.CheckRefraction
    1300         GeometryCalib.InterfaceCoord=[0 0 SliceData.H];
    1301         GeometryCalib.RefractionIndex=SliceData.RefractionIndex;
    1302     elseif isfield(GeometryCalib,'RefractionIndex')
    1303         GeometryCalib=rmfield(GeometryCalib,'RefractionIndex');
    1304         GeometryCalib=rmfield(GeometryCalib,'InterfaceCoord');
    1305     end
    1306    
    1307     % update the current xml file
    1308     errormsg=update_imadoc(GeometryCalib,XmlFile,'GeometryCalib');% introduce the calibration data in the xml file
    1309     if ~strcmp(errormsg,'')
    1310         msgbox_uvmat('ERROR',errormsg);
    1311     else
    1312         display([XmlFile ' updated with slice positions'])
    1313         nbcalib=nbcalib+1;
     1279    for idevice=1:numel(OutPut.DataSeries)
     1280        SubDirBase=regexprep(OutPut.DataSeries{idevice},'\..+$','');
     1281        XmlFile=fullfile(OutPut.Campaign,OutPut.Experiment{ilist},[SubDirBase '.xml']);
     1282       
     1283        % read the current xml file
     1284        if  exist(XmlFile,'file')
     1285            [s,errormsg]=imadoc2struct(XmlFile,'GeometryCalib');
     1286            if ~isempty(errormsg)
     1287                msgbox_uvmat('ERROR',['error in reading ' XmlFile ': ' errormsg])
     1288                return
     1289            end
     1290            GeometryCalib=s.GeometryCalib;
     1291            GeometryCalib.NbSlice=SliceData.NbSlice;
     1292            GeometryCalib.CheckVolumeScan=SliceData.CheckVolumeScan;
     1293            Z_plane=linspace(SliceData.Z(1),SliceData.Z(2),SliceData.NbSlice);
     1294            GeometryCalib.SliceCoord=Z_plane'*[0 0 1];
     1295            GeometryCalib.SliceAngle=zeros(GeometryCalib.NbSlice,3);
     1296            Angle_1=linspace(SliceData.SliceAngle_1(1),SliceData.SliceAngle_1(2),SliceData.NbSlice);
     1297            Angle_2=linspace(SliceData.SliceAngle_2(1),SliceData.SliceAngle_2(2),SliceData.NbSlice);
     1298            GeometryCalib.SliceAngle(:,1)=Angle_1';%rotation around x axis (to generalise)
     1299            GeometryCalib.SliceAngle(:,2)=Angle_2';%rotation around y axis (to generalise)
     1300            GeometryCalib.SliceAngle(:,3)=0;
     1301            if SliceData.CheckRefraction
     1302                GeometryCalib.InterfaceCoord=[0 0 SliceData.H];
     1303                GeometryCalib.RefractionIndex=SliceData.RefractionIndex;
     1304            elseif isfield(GeometryCalib,'RefractionIndex')
     1305                GeometryCalib=rmfield(GeometryCalib,'RefractionIndex');
     1306                GeometryCalib=rmfield(GeometryCalib,'InterfaceCoord');
     1307            end
     1308           
     1309            % update the current xml file
     1310            errormsg=update_imadoc(GeometryCalib,XmlFile,'GeometryCalib');% introduce the calibration data in the xml file
     1311            if ~strcmp(errormsg,'')
     1312                msgbox_uvmat('ERROR',errormsg);
     1313            else
     1314                display([XmlFile ' updated with slice positions'])
     1315                nbcalib=nbcalib+1;
     1316            end
     1317        end
    13141318    end
    13151319end
Note: See TracChangeset for help on using the changeset viewer.