Changeset 71 for trunk/src/civ_3D.m


Ignore:
Timestamp:
Mar 29, 2010, 6:34:55 PM (11 years ago)
Author:
sommeria
Message:

civ3D updated: introduction of image size
imadoc2struct: reding of image size from the xml file
set_object, view_field and related functions: improvement of projection object editing
mouse: possibility of adjusting the calibrations points with the mouse

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/civ_3D.m

    r42 r71  
    2222function varargout = civ_3D(varargin)
    2323
    24 % Last Modified by GUIDE v2.5 25-Feb-2009 23:14:16
     24% Last Modified by GUIDE v2.5 26-Mar-2010 22:51:31
    2525% Begin initialization code - DO NOT EDIT
    2626gui_Singleton = 1;
     
    234234set(handles.first_i,'String',num2str(num_ref_i));
    235235set(handles.last_i,'String',num2str(num_ref_i));
    236 set(handles.first_j,'String',num2str(num_ref_j));
    237 set(handles.last_j,'String',num2str(num_ref_j));
    238236set(handles.ref_i,'String',num2str(num_ref_i));
    239 set(handles.ref_j,'String',num2str(num_ref_j));
    240237set(handles.browse_root,'UserData',browse);
    241238if ~isempty(varargin)% the interface is opened from uvmat
     
    381378    set(handles.ref_i,'String',num2str(ref_i));
    382379end
    383 if isempty(str2num(str_a))
    384     set(handles.ref_j,'String','1');
    385 else
    386     ref_j=str2num(str_a);
    387     if ~isempty(str2num(str_b))
    388         ref_j=floor((str2num(str_a)+str2num(str_b))/2);
    389         browse.incr_pair(2)=str2num(str_b)-str2num(str_a);
    390     end
    391     set(handles.first_j,'String',num2str(ref_j));
    392     set(handles.last_j,'String',num2str(ref_j));
    393     set(handles.ref_j,'String',num2str(ref_j));
    394 end;
    395380if isequal(ind_opening,1)
    396381    set(handles.CIV1,'Value',1)
     
    470455    last_i=first_i;  %default last_i
    471456end
    472 first_j=str2num(get(handles.first_j,'String'));
    473 if isempty(first_j)| first_j < 1
    474     first_j=1; %default first_j
    475 end
    476 last_j=str2num(get(handles.last_j,'String'));
    477 if isempty(last_j)| last_j < first_j
    478     last_j=first_j; %default last_j
    479 end
     457
    480458incr_i=str2num(get(handles.incr_i,'String'));
    481459if isempty(incr_i) | incr_i < 1;
    482460    set(handles.incr_i,'String','1') %default incr_i
    483 end
    484 incr_j=str2num(get(handles.incr_j,'String'));
    485 if isempty(incr_j) | incr_j < 1;
    486     set(handles.incr_j,'String','1') %default incr_j
    487461end
    488462dt=[];%default
     
    514488%%%%%%%%   read image documentation file  %%%%%%%%%%%%%%%%%%%%%%%%%%%
    515489    mode=''; %default
    516     %read the image documentation file if found
    517 if  isequal(ext,'.xml')
    518     set(handles.ref_i,'Visible','On')%use a reference index
    519     set(handles.ref_j,'Visible','On')
    520     set(handles.dt,'Visible','Off')
    521     set(handles.dt_text,'String','ref. ind.')
    522 elseif isequal(ext,'.avi') | isequal(ext,'.AVI')
    523     set(handles.ref_j,'Visible','Off')
    524     set(handles.dt,'Visible','Off')
    525     set(handles.dt_text,'String','ref. ind.')
    526 else
    527     set(handles.ref_i,'Visible','Off')
    528     set(handles.ref_j,'Visible','Off')
    529     set(handles.dt,'Visible','On')
    530     set(handles.dt_text,'String','dt(ms)=')
    531 end
    532 
    533490if isequal(ext,'.xml')
    534     [XmlData,warntext]=imadoc2struct([filebase '.xml']);
     491    [XmlData,warntext]=imadoc2struct([filebase '.xml'])
    535492        if isfield(XmlData,'Heading')&&isfield(XmlData.Heading','ImageName')
    536493            [PP,FF,fc,str2,str_a,str_b,ext_ima_read,nom_type_read]=name2display(XmlData.Heading.ImageName);
    537494        end
    538         if isfield(XmlData,'Camera')
    539             if isfield(XmlData.Camera,'TimeUnit')
    540                 TimeUnit=XmlData.Camera.TimeUnit;
    541             end
    542             if isfield(XmlData.Camera,'ImageSize')
    543                ImageSize=XmlData.Camera.ImageSize;
    544                if ~isempty(ImageSize)&& ~isempty(ImageSize)
    545                    xindex=findstr(ImageSize,'x');
    546                    if length(xindex)>=2
    547                         npx=str2num(ImageSize(1:xindex(1)-1));
    548                         npy=str2num(ImageSize(xindex(1)+1:xindex(2)-1));
    549                    end
    550                end
    551            end
     495        if isfield(XmlData,'TimeUnit')
     496                TimeUnit=XmlData.TimeUnit;
     497        end
     498        if isfield(XmlData,'Npx')&&isfield(XmlData,'Npy')
     499            set(handles.npx,'String',num2str(XmlData.Npx));
     500            set(handles.npy,'String',num2str(XmlData.Npy));
     501        end
     502        if isfield(XmlData,'Time')&&~isempty(XmlData.Time)
     503            time=XmlData.Time;
     504            set(handles.npz,'String',num2str(size(time,2)));
    552505        end
    553506        pxcmx_search=1;
     
    641594  last_j=1;
    642595end
     596UvData.XmlData=XmlData;
     597
    643598if exist('time','var')
    644     siztime=size(time);
    645     nbfield=siztime(1);
    646     nbfield2=siztime(2);
     599    nbfield=size(time,1);
    647600    set(handles.displ_filebase,'UserData',time); %store the set of times
    648     set(handles.dt_unit,'String',['m' TimeUnit]);
    649601    set(handles.TimeUnit,'String',TimeUnit);
    650602    set(handles.nb_field,'String',num2str(nbfield));
    651     set(handles.nb_field2,'String',num2str(nbfield2));
    652603end
    653604set(handles.CoordUnit,'String',[CoordUnit '/'])
    654 set(handles.pxcmx,'String',num2str(pxcmx));
    655 set(handles.pxcmy,'String',num2str(pxcmy));
    656605if isempty(pxcmx_search)
    657606   set(handles.calcul_search,'UserData',[pxcmx pxcmy]);
     
    659608   set(handles.calcul_search,'UserData',[pxcmx_search pxcmy_search]);
    660609end
    661 set(handles.pxcmx,'UserData',npx);
    662 set(handles.pxcmy,'UserData',npy);
    663610set(handles.first_i,'String',num2str(first_i));
    664611set(handles.last_i,'String',num2str(last_i));%
    665 set(handles.first_j,'String',num2str(first_j));
    666 set(handles.last_j,'String',num2str(last_j));%
    667612browse.ext_ima=ext_ima;
    668613browse.nom_type_ima=nom_type_ima;
     
    830775     set(handles.nb_field,'Visible','On')
    831776     set(handles.ref_i,'Visible','On')
    832      if nbfield2 > 1
    833         set(handles.jtext,'Visible','On')
    834         set(handles.first_j,'Visible','On')
    835         set(handles.last_j,'Visible','On')
    836         set(handles.incr_j,'Visible','On')
    837         set(handles.nb_field2,'Visible','On')
    838         set(handles.ref_j,'Visible','On')
    839      else
    840         set(handles.jtext,'Visible','Off')
    841         set(handles.first_j,'Visible','Off')
    842         set(handles.last_j,'Visible','Off')
    843         set(handles.incr_j,'Visible','Off')
    844         set(handles.nb_field2,'Visible','Off')
    845         set(handles.ref_j,'Visible','Off')
    846     end
    847777elseif isequal(mode,'displacement')%the pairs have the same indices
    848778     displ_num(1,1)=0;
     
    939869end
    940870ref_i=str2num(get(handles.ref_i,'String'));
    941 if isequal(mode,'pair j1-j2')|isequal(mode,'st_pair j1-j2')
    942     ref_j=0;
    943 else
    944     ref_j=str2num(get(handles.ref_j,'String'));
    945 end
    946 if isequal(get(handles.dt_text,'String'),'dt(ms)=')%simple series(Di) with equal interval
    947     ref_i=floor((first_i+last_i)/2);
    948     ref_j=1;
    949 end
    950871time=get(handles.displ_filebase,'UserData');%get the set of times
    951872if isempty(time)
    952873    time=[0 1];
    953874end
    954 dt_unit=str2num(get(handles.dt,'String'));% used when there is no image documentation file
    955875displ_num=get(handles.list_pair_civ1,'UserData');
    956876
     
    1006926    end
    1007927end
    1008 if isequal(mode,'series(Di)') | isequal(mode,'st_series(Di)')
     928if isequal(mode,'series(Di)')
    1009929    if testpair
    1010930              displ_pair{1}=['Di= ' num2str(-floor(browse.incr_pair(1)/2)) '|' num2str(ceil(browse.incr_pair(1)/2))];       
    1011     elseif ~isequal(get(handles.dt_text,'String'),'dt(ms)=')
     931    else
    1012932       for ipair=1:nbpair
    1013933          if select(ipair)         
    1014               dt=time(ref_i+displ_num(4,ipair),ref_j+displ_num(2,ipair))-time(ref_i+displ_num(3,ipair),ref_j+displ_num(1,ipair));%time interval dt
     934              dt=time(ref_i+displ_num(4,ipair),1)-time(ref_i+displ_num(3,ipair),1);%time interval dt
    1015935              displ_pair{ipair}=['Di= ' num2str(-floor(ipair/2)) '|' num2str(ceil(ipair/2)) ' :dt= ' num2str(dt*1000)];
    1016936          else
     
    1018938          end
    1019939       end
    1020     else
    1021        for ipair=1:nbpair
    1022          if select(ipair)
    1023             displ_pair{ipair}=['Di= ' num2str(-floor(ipair/2)) '|' num2str(ceil(ipair/2)) ' :dt= ' num2str(dt_unit*ipair)];
    1024          else
    1025             displ_pair{ipair}='...'; %pair not displayed in the menu
    1026          end
    1027        end
    1028     end
    1029 elseif isequal(mode,'series(Dj)')|isequal(mode,'st_series(Dj)')% series on the j index
    1030     if testpair
    1031          displ_pair{1}=['Dj= ' num2str(-floor(browse.incr_pair(1)/2)) '|' num2str(ceil(browse.incr_pair(1)/2))];
    1032     else
    1033        for ipair=1:nbpair
    1034           if select(ipair)
    1035               dt=time(ref_i+displ_num(4,ipair),ref_j+displ_num(2,ipair))-time(ref_i+displ_num(3,ipair),ref_j+displ_num(1,ipair));%time interval dt
    1036               displ_pair{ipair}=['Dj= ' num2str(-floor(ipair/2)) '|' num2str(ceil(ipair/2)) ' :dt= ' num2str(dt*1000)];
    1037            elseif testpair
    1038               displ_pair{1}=['Dj= ' num2str(-floor(browse.incr_pair(2)/2)) '|' num2str(ceil(browse.incr_pair(2)/2))];
    1039           else
    1040              displ_pair{ipair}='...'; %pair not displayed in the menu
    1041           end
    1042        end
    1043    end
    1044 elseif isequal(mode,'pair j1-j2')|isequal(mode,'st_pair j1-j2')%case of pairs
     940    end
     941elseif isequal(mode,'pair j1-j2')%case of pairs
    1045942    for ipair=1:nbpair
    1046943        if select(ipair)
     
    1073970%--------------------------------------------------------------
    1074971function find_netcpair_civ2(hObject, eventdata, handles)
     972return %do not exist in 3D
    1075973set(gcf,'Pointer','watch')
    1076974%nomenclature types
     
    11241022    ref_j=str2num(get(handles.ref_j,'String'));
    11251023end
    1126 if isequal(get(handles.dt_text,'String'),'dt(ms)=')%simple series(Di) with equal interval
    1127     ref_i=ceil((first_i+last_i)/2);
    1128     ref_j=1;
    1129 end
    1130 %     ref_i=browse.num_ref;%field number initially selected by the browser
    11311024time=get(handles.displ_filebase,'UserData'); %get the set of times
    11321025if isempty(time)
     
    11851078end
    11861079if isequal(mode,'series(Di)')  | isequal(mode,'st_series(Di)')
    1187     if  ~isequal(get(handles.dt_text,'String'),'dt(ms)=')
     1080    if  ~isequal(get(handles.ext_txt,'String'),'dt(ms)=')
    11881081       for ipair=1:nbpair
    11891082          if select(ipair)
     
    12401133last_i=str2num(get(handles.last_i,'String'));
    12411134incr=str2num(get(handles.incr_i,'String'));
    1242 first_j=str2num(get(handles.first_j,'String'));
    1243 last_j=str2num(get(handles.last_j,'String'));
    1244 incr_j=str2num(get(handles.incr_j,'String'));
    12451135list_civ1=get(handles.list_pair_civ1,'String');
    12461136index_civ1=get(handles.list_pair_civ1,'Value');
     
    12491139index_civ2=get(handles.list_pair_civ2,'Value');
    12501140str_civ2=list_civ2{index_civ2};
    1251 if isequal(first_i,[])|isequal(first_j,[]), errordlg('first field number not defined'),...
     1141if isempty(first_i), msgbox_uvmat('ERROR','first field number not defined'),...
    12521142    set(handles.RUN, 'Enable','On'), set(handles.RUN,'BackgroundColor',[1 0 0]),return,end;
    1253 if isequal(last_i,[])| isequal(last_j,[]),errordlg('last field number not defined'),...
     1143if isempty(last_i),msgbox_uvmat('ERROR','last field number not defined'),...
    12541144    set(handles.RUN, 'Enable','On'), set(handles.RUN,'BackgroundColor',[1 0 0]),return,end;
    1255 if isequal(incr,[])| isequal(incr_j,[]),errordlg('increment in field number not defined'),...
     1145if isempty(incr), msgbox_uvmat('ERROR','increment in field number not defined'),...
    12561146    set(handles.RUN, 'Enable','On'), set(handles.RUN,'BackgroundColor',[1 0 0]),return,end;
    1257 if last_i < first_i | last_j < first_j , errordlg('last field number must be larger than the first one'),...
     1147if last_i < first_i , msgbox_uvmat('ERROR','last field number must be larger than the first one'),...
    12581148    set(handles.RUN, 'Enable','On'), set(handles.RUN,'BackgroundColor',[1 0 0]),return,end;
    12591149num1=[first_i:incr:last_i];
    1260 num_j=[first_j:incr_j:last_j];
    1261 if isequal (mode,'series(Di)') |isequal(mode,'st_series(Di)')
     1150if isequal (mode,'series(Di)')
    12621151     %recognize the pair civ1 from the display
    12631152        indsel=find((double(str_civ1)<48)|(double(str_civ1)>57));% character indices of non numerical characters
     
    12731162    num1_civ1=num1-d1;% set of first image numbers
    12741163    num2_civ1=num1+d2;
    1275     num_a_civ1=num_j;
    1276     num_b_civ1=num_j;
     1164    num_a_civ1=1;
     1165    num_b_civ1=1;
    12771166    num1_civ2=num1-floor(index_civ2/2)*ones(size(num1));% set of first image numbers
    12781167    num2_civ2=num1+ceil(index_civ2/2)*ones(size(num1));
    12791168    num1_civ2=num1-d1;% set of first image numbers
    12801169    num2_civ2=num1+d2;
    1281     num_a_civ2=num_j;
    1282     num_b_civ2=num_j;
     1170    num_a_civ2=1;
     1171    num_b_civ2=1;
    12831172    % adjust the first and last field number
    12841173    lastfield=str2num(get(handles.nb_field,'String'));
     
    14391328global civ1_exe civ2_exe patch_exe patch_new_exe fix_exe todo_path sge Civ_exe
    14401329
    1441 pxcmx=get(handles.pxcmx,'String');
    1442 pxcmy=get(handles.pxcmy,'String');
    1443 npx=get(handles.pxcmx,'UserData');
    1444 npy=get(handles.pxcmy,'UserData');
     1330% pxcmx=get(handles.pxcmx,'String');
     1331% pxcmy=get(handles.pxcmy,'String');
     1332% npx=get(handles.pxcmx,'UserData');
     1333% npy=get(handles.pxcmy,'UserData');
    14451334
    14461335%check the list of operations:
     
    14891378path_uvmat=which('uvmat');% check the path detected for source file uvmat
    14901379path_UVMAT=fileparts(path_uvmat); %path to UVMAT
    1491 if isunix
    1492     %fid = fopen(fullfile(path_UVMAT,'PARAM_LINUX.txt'),'r');%open the file with civ_3D binary names
    1493     xmlfile=fullfile(path_UVMAT,'PARAM_LINUX.xml');
    1494     if exist(xmlfile,'file')
    1495         t=xmltree(xmlfile);
    1496         sparam=convert(t);
    1497     end
    1498 else
    1499     %fid = fopen(fullfile(path_UVMAT,'PARAM_WIN.txt'),'r');%open the file with civ_3D binary names
    1500     xmlfile=fullfile(path_UVMAT,'PARAM_WIN.xml');
    1501     if exist(xmlfile,'file')
    1502         t=xmltree(xmlfile);
    1503         sparam=convert(t);
    1504     end
    1505 end
    1506  sge=0;
    1507 if isfield(sparam,'Civ_exe')
    1508     Civ_exe=sparam.Civ_exe
    1509 end
    1510 if isfield(sparam,'Civ1_exe')
    1511     civ1_exe=sparam.Civ1_exe
    1512 end
    1513 if isfield(sparam,'Civ2_exe')
    1514     civ2_exe=sparam.Civ2_exe
    1515 end
    1516 if isfield(sparam,'Patch_exe')
    1517     patch_exe=sparam.Patch_exe
    1518 end
    1519 if isfield(sparam,'PatchNew_exe')
    1520     patch_new_exe=sparam.PatchNew_exe
    1521 end
    1522 if isfield(sparam,'Fix_exe')
    1523     fix_exe=sparam.Fix_exe
    1524 end
    1525 if isfield(sparam,'Todo_path')
    1526     todo_path=sparam.Todo_path
    1527 end
    1528 if isfield(sparam,'SGE')
    1529     sge=str2num(sparam.SGE)
    1530 end
     1380%fid = fopen(fullfile(path_UVMAT,'PARAM_LINUX.txt'),'r');%open the file with civ_3D binary names
     1381xmlfile=fullfile(path_UVMAT,'PARAM.xml');
     1382if exist(xmlfile,'file')
     1383    t=xmltree(xmlfile);
     1384    sparam=convert(t);
     1385end
     1386if isfield(sparam.BatchParam,'Civ3D3CBin')
     1387    Civ3D3CBin=sparam.BatchParam.Civ3D3CBin;
     1388else
     1389    msgbox_uvmat('ERROR','binary for CIV3D3C not defined in PARAM.xml')
     1390    return
     1391end
     1392 
    15311393%choice of batch priority
    15321394ind_answer=2;
    1533 if sge
     1395% if sge
    15341396    [s,w]=unix('qstat -q civ_3D.q|grep job_| wc -l'); %check the waiting list (command unix)
    15351397    if isequal(s,0)
     
    15471409        return
    15481410    end
    1549 end
     1411% end
    15501412%initialize the waitbars
    15511413set(handles.waitbar_1,'Position',[0.946 0.876 0.03 0.001])
     
    16351497%           for j=1:nbslice
    16361498              filename=name_generator(filebase,num1_civ1(ifile),[],'.nc',...
    1637                 nom_type_nc,1,num2_civ1(ifile),[],subdir_civ1);%
     1499                '_i1-i2',1,num2_civ1(ifile),[],subdir_civ1);%
    16381500            detect=exist(filename,'file')
    16391501              if detect% if a netcdf file already exists
     
    16571519%get image names
    16581520for ifile=1:nbfield
    1659     filecell_ima1_civ1{ifile}=name_generator(filebase, num1_civ1(ifile),[],ext_ima,nom_type_ima);%first image
    1660     filecell_ima2_civ1{ifile}=name_generator(filebase, num2_civ1(ifile),[],ext_ima,nom_type_ima); %second image
     1521    filecell_ima1_civ1{ifile}=name_generator(filebase, num1_civ1(ifile),[],'.vol','_i');%first image
     1522    filecell_ima2_civ1{ifile}=name_generator(filebase, num2_civ1(ifile),[],'.vol','_i'); %second image
    16611523     if ~exist(filecell_ima1_civ1{ifile},'file')
    16621524            msgbox_uvmat('ERROR',[filecell_ima1_civ1{ifile} ' not found'])
     
    16841546set(handles.browse_root,'UserData',browse);%update the nomenclature type for uvmat
    16851547
    1686 %COPY IMAGES TO THE FORMAT .vol IF NEEDED
    1687 if isequal(nom_type_ima,'avi')
    1688     nom_type_imanew='_i';
    1689 else
    1690     nom_type_imanew=nom_type_ima;
    1691 end
    1692 
    1693 if ~isequal(ext_ima,'.vol')
    1694     if box_test(1)==1 %if civ1 is performed
    1695        h = waitbar(0,['copy images to the .png format for civ1']);% display a wait bar
    1696        for ifile=1:nbfield
    1697             waitbar(ifile/nbfield);
    1698             Atot=[];
    1699             filename_A=name_generator(filebase,num1_civ1(ifile),1,'.png','_i');%A VOIR
    1700             idetect_cur=exist(filename_A,'file');
    1701             for j=1:nbslice
    1702                     if idetect_cur==0
    1703                         A=read_image(cell2mat(filecell_ima1_civ1(ifile,j)),nom_type_ima2,npx,npy,num1_civ1(ifile));
    1704                         Atot=[Atot;A];
    1705                         %imwrite(A,filename,'BitDepth',16);
    1706                     end
    1707             end
    1708             imwrite(Atot,filename_A,'BitDepth',16);
    1709                     %filecell_ima1_civ1(ifile,j)={filename};
    1710             Atot=[];
    1711             filename_B=name_generator(filebase, num2_civ1(ifile),1,'.png','_i');
    1712             idetect_cur=exist(filename_B,'file');
    1713             for j=1:nbslice
    1714                     if idetect_cur==0
    1715                         A=read_image(cell2mat(filecell_ima2_civ1(ifile,j)),nom_type_ima2,npx,npy,num2_civ1(ifile));
    1716                         Atot=[Atot;A];
    1717 %                         imwrite(A,filename,'BitDepth',16);
    1718                     end
    1719                     %filecell_ima2_civ1(ifile,j)={filename};
    1720             end
    1721             imwrite(Atot,filename_B,'BitDepth',16);
    1722         end
    1723         close(h)
    1724     end   
    1725 end
    1726 
    1727 if ~sge     
    1728     %OPEN THE WAIT LIST FOR BATCH PROCESSES
    1729     name_lock=fullfile(todo_path,'lock'); %lock file
    1730     iwait=0;
    1731     while(exist(name_lock) & iwait<15)
    1732         pause(1); %wait 1 second
    1733         iwait=iwait+1;
    1734     end
    1735     if iwait==15
    1736         errordlg(['I''m tired to wait for the lock file, please delete it then click again on BATCH' name_lock ])
    1737         set(handles.BATCH, 'Enable','On')
    1738         set(handles.BATCH,'BackgroundColor',[1 0 0])
    1739         return
    1740     end
    1741     p0=fopen(name_lock,'w'); %create the file name_lock: prevents other users to interfere
    1742     name_todo=fullfile(todo_path,'TODO.txt');
    1743     p1=fopen(name_todo,'a');
    1744     if (p1<0)
    1745         errordlg(['error in opening ' name_todo])
    1746         set(handles.BATCH, 'Enable','On')
    1747         set(handles.BATCH,'BackgroundColor',[1 0 0])
    1748         return;
    1749     end
    1750 end
    1751 'TESTciv3D'
    1752 nbfield
    17531548for ifile=1:nbfield
    17541549    i_cmd=0;
     
    17701565        [par_civ1.path,resu_file,resu_ext]=fileparts(filecell_nc1{ifile});
    17711566        par_civ1.volume1=filecell_ima1_civ1{ifile};
    1772         par_civ1.volume2=filecell_ima2_civ1{ifile}
    1773         par_civ1.nx=1024;
    1774         par_civ1.ny=1024;
     1567        par_civ1.volume2=filecell_ima2_civ1{ifile};
     1568        par_civ1.nx=str2double(get(handles.npx,'String'));
     1569        par_civ1.ny=str2double(get(handles.npy,'String'));;
    17751570        par_civ1.nz=par_civ1.gridLimits_Zmax - par_civ1.gridLimits_Zmin;
    17761571        'TEST'
     
    17821577    %    save(civAllxml)
    17831578        par_civ1_3d_xml=fullfile(par_civ1.path,[resu_file '.xml']);%[par_civ1.path '/test_to_change.xml'];
    1784          pvalue=num2str((1-ind_answer)*500);
     1579         pvalue=num2str((1-ind_answer)*500)
    17851580        save(civAllxml,par_civ1_3d_xml);
    1786       if(isunix && sge)
    1787          ['echo /CIVX/bin/MPI/lam-7.1.3_g95/bin/mpirun C  /CIVX/bin/civ3d3c -p ' par_civ1_3d_xml '|qsub -p ' pvalue ' -q lam.q -pe lam_loose 16 -e ' par_civ1_3d_xml '.errors -o ' par_civ1_3d_xml '.log' ]
    1788          eval ( ['!echo /CIVX/bin/MPI/lam-7.1.3_g95/bin/mpirun C  /CIVX/bin/civ3d3c -p ' par_civ1_3d_xml '|qsub -p ' pvalue ' -q lam.q -pe lam_loose 16 -e ' par_civ1_3d_xml '.errors -o ' par_civ1_3d_xml '.log' ])
    1789       else
    1790             '3D mode is NOT supported without sge'
    1791       end
    1792          return
     1581   
     1582%       if(isunix && sge)
     1583         ['echo /CIVX/bin/MPI/lam-7.1.3_g95/bin/mpirun C  ' Civ3D3CBin ' -p ' par_civ1_3d_xml '|qsub -p ' pvalue ' -q lam.q -pe lam_loose 16 -e ' par_civ1_3d_xml '.errors -o ' par_civ1_3d_xml '.log' ]
     1584         eval ( ['!echo /CIVX/bin/MPI/lam-7.1.3_g95/bin/mpirun C  ' Civ3D3CBin ' -p ' par_civ1_3d_xml '|qsub -p ' pvalue ' -q lam.q -pe lam_loose 16 -e ' par_civ1_3d_xml '.errors -o ' par_civ1_3d_xml '.log' ])
     1585%       else
     1586%           '3D mode is NOT supported without sge'
     1587%       end
     1588     return
    17931589        % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    17941590        %  fichier xml produit
     
    27232519par.gridSpacing_Z=get(handles.dz_civ1,'String');
    27242520% Zmin=str2num(get(handles.first_j,'String'))-1;
    2725 Zmax=str2num(get(handles.nb_field2,'String'));
     2521Zmax=str2num(get(handles.npz,'String'));
    27262522par.gridLimits_Xmin=0;
    27272523par.gridLimits_Ymin=0;
     
    27292525% A=imread(file_ima);%read the first image to get the size
    27302526%sizim=size(A);
    2731 par.gridLimits_Xmax=1024;%num2str(sizim(2));
    2732 par.gridLimits_Ymax=1024;%num2str(sizim(1));
     2527par.gridLimits_Xmax=str2double(get(handles.npx,'String'));%num2str(sizim(2));
     2528par.gridLimits_Ymax=str2double(get(handles.npy,'String'));%num2str(sizim(1));
    27332529par.gridLimits_Zmax=Zmax;
    27342530par.grid='grille';
     
    33013097
    33023098
    3303 
    3304 function edit75_Callback(hObject, eventdata, handles)
    3305 % hObject    handle to edit75 (see GCBO)
    3306 % eventdata  reserved - to be defined in a future version of MATLAB
    3307 % handles    structure with handles and user data (see GUIDATA)
    3308 
    3309 % Hints: get(hObject,'String') returns contents of edit75 as text
    3310 %        str2double(get(hObject,'String')) returns contents of edit75 as a double
    3311 
    3312 
    3313 % --- Executes during object creation, after setting all properties.
    3314 function edit75_CreateFcn(hObject, eventdata, handles)
    3315 % hObject    handle to edit75 (see GCBO)
    3316 % eventdata  reserved - to be defined in a future version of MATLAB
    3317 % handles    empty - handles not created until after all CreateFcns called
    3318 
    3319 % Hint: edit controls usually have a white background on Windows.
    3320 %       See ISPC and COMPUTER.
    3321 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    3322     set(hObject,'BackgroundColor','white');
    3323 end
    3324 
    3325 
    3326 
    33273099function dz_civ1_Callback(hObject, eventdata, handles)
    33283100% hObject    handle to dz_civ1 (see GCBO)
     
    33343106
    33353107
    3336 % --- Executes during object creation, after setting all properties.
    3337 function dz_civ1_CreateFcn(hObject, eventdata, handles)
    3338 % hObject    handle to dz_civ1 (see GCBO)
     3108function edit77_Callback(hObject, eventdata, handles)
     3109% hObject    handle to edit77 (see GCBO)
    33393110% eventdata  reserved - to be defined in a future version of MATLAB
    3340 % handles    empty - handles not created until after all CreateFcns called
    3341 
    3342 % Hint: edit controls usually have a white background on Windows.
    3343 %       See ISPC and COMPUTER.
    3344 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    3345     set(hObject,'BackgroundColor','white');
    3346 end
    3347 
    3348 
     3111% handles    structure with handles and user data (see GUIDATA)
     3112
     3113% Hints: get(hObject,'String') returns contents of edit77 as text
     3114%        str2double(get(hObject,'String')) returns contents of edit77 as a double
     3115
     3116
     3117
     3118function edit78_Callback(hObject, eventdata, handles)
     3119% hObject    handle to ref_i (see GCBO)
     3120% eventdata  reserved - to be defined in a future version of MATLAB
     3121% handles    structure with handles and user data (see GUIDATA)
     3122
     3123% Hints: get(hObject,'String') returns contents of ref_i as text
     3124%        str2double(get(hObject,'String')) returns contents of ref_i as a double
     3125
     3126
     3127function edit79_Callback(hObject, eventdata, handles)
     3128% hObject    handle to edit79 (see GCBO)
     3129% eventdata  reserved - to be defined in a future version of MATLAB
     3130% handles    structure with handles and user data (see GUIDATA)
     3131
     3132% Hints: get(hObject,'String') returns contents of edit79 as text
     3133%        str2double(get(hObject,'String')) returns contents of edit79 as a double
     3134
     3135
     3136
     3137function npz_Callback(hObject, eventdata, handles)
     3138% hObject    handle to npz (see GCBO)
     3139% eventdata  reserved - to be defined in a future version of MATLAB
     3140% handles    structure with handles and user data (see GUIDATA)
     3141
     3142% Hints: get(hObject,'String') returns contents of npz as text
     3143%        str2double(get(hObject,'String')) returns contents of npz as a double
     3144
     3145
     3146function npy_Callback(hObject, eventdata, handles)
     3147% hObject    handle to npy (see GCBO)
     3148% eventdata  reserved - to be defined in a future version of MATLAB
     3149% handles    structure with handles and user data (see GUIDATA)
     3150
     3151% Hints: get(hObject,'String') returns contents of npy as text
     3152%        str2double(get(hObject,'String')) returns contents of npy as a double
     3153
     3154
     3155
     3156
     3157function npx_Callback(hObject, eventdata, handles)
     3158% hObject    handle to npx (see GCBO)
     3159% eventdata  reserved - to be defined in a future version of MATLAB
     3160% handles    structure with handles and user data (see GUIDATA)
     3161
     3162% Hints: get(hObject,'String') returns contents of npx as text
     3163%        str2double(get(hObject,'String')) returns contents of npx as a double
     3164
     3165
     3166
     3167
Note: See TracChangeset for help on using the changeset viewer.