Changeset 792 for trunk


Ignore:
Timestamp:
Jul 2, 2014, 10:04:43 PM (7 years ago)
Author:
sommeria
Message:
 
File:
1 edited

Legend:

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

    r788 r792  
    5252    ParamOut.ProjObject='off';...%can use projection object(option 'off'/'on',
    5353    ParamOut.Mask='off';...%can use mask option   (option 'off'/'on', 'off' by default)
    54     ParamOut.OutputDirExt='.ima';%set the output dir extension
     54    ParamOut.OutputSubDir=Param.InputTable{1,3};
     55    ParamOut.OutputDirExt='';%set the output dir extension
    5556    if size(Param.InputTable,1)>1
    5657        msgbox_uvmat('WARNING', 'this function acts only on the first input file line')
     
    9596FileInfo{1}=get_file_info(filecell{1,1});
    9697if ~strcmp(FileInfo{1}.FileType,'rdvision')
    97     msgbox_uvmat('ERROR','the input is not from rdvision: a .seq file must be opened')
     98    msgbox_uvmat('ERROR','the input is not from rdvision: a .seq or .sqb file must be opened')
    9899    return
    99100end
     
    106107
    107108SubDirBase=regexprep(SubDir{1},'\..*','');%take the root part of SubDir, before the first dot '.'
    108 filexml=[fullfile(RootPath{1},SubDirBase) '.xml'];%new convention: xml at the level of the image folder
     109filexml=[fullfile(RootPath{1},RootFile{1}) '.xml'];%new convention: xml at the level of the image folder
    109110if ~exist(filexml,'file')
    110     filexml=[fullfile(RootPath{1},SubDir{1},RootFile{1}) '.xml']; % old convention: xml inside the image folder
    111     if ~exist(filexml,'file')
    112         filexml=[fullfile(RootPath{1},SubDir{1},RootFile{1}) '.civ']; % very old convention: .civ file
    113         if ~exist(filexml,'file')
    114             filexml='';
    115         end
    116     end
    117 end
    118 XmlData=[];
    119 if ~isempty(filexml)
    120     [XmlData,error]=imadoc2struct_special(filexml);
    121 end
     111    msgbox_uvmat('ERROR',[filexml ' missing'])
     112    return
     113end
     114[XmlData,error]=imadoc2struct_special(filexml);
    122115if isfield(XmlData,'Time')
    123116    itime=itime+1;
     
    209202        end
    210203            SubDirBase=regexprep(SubDir{1},'\..*','');%take the root part of SubDir, before the first dot '.'
    211     filexml_new=[fullfile(RootPath{1},SubDirBase) '.xml'];
    212         save(t,filexml_new)
     204   % filexml_new=[fullfile(RootPath{1},SubDirBase) '.xml'];
     205        save(t,filexml)
    213206end
    214207
     
    220213end
    221214filename=fullfile_uvmat(RootPath{1},SubDir{1},RootFile{1},FileExt{1},'*',1);
    222 OutputDir=[SubDir{1} Param.OutputDirExt];
     215OutputDir=[Param.OutputSubDir Param.OutputDirExt];
    223216for ifile=1:nbfield
    224217            update_waitbar(WaitbarHandle,ifile/nbfield)
     
    241234    end
    242235    i1=floor((ifile-1+first_label)/nbfield2)+1;
    243     OutputFile=fullfile_uvmat(RootPath{1},OutputDir,RootFile{1},'.png',NomTypeNew,i1,[],j1);
     236    OutputFile=fullfile_uvmat(RootPath{1},OutputDir,'img','.png',NomTypeNew,i1,[],j1);
    244237    try
    245238        imwrite(A,OutputFile,'BitDepth',BitDepth) % case of 16 bit images
Note: See TracChangeset for help on using the changeset viewer.