Index: trunk/src/civ.m
===================================================================
--- trunk/src/civ.m	(revision 487)
+++ trunk/src/civ.m	(revision 492)
@@ -24,5 +24,5 @@
 %TODO: search range
 
-% Last Modified by GUIDE v2.5 21-Jun-2012 23:37:47
+% Last Modified by GUIDE v2.5 13-Jul-2012 15:11:00
 % Begin initialization code - DO NOT EDIT
 gui_Singleton = 1;
@@ -533,9 +533,17 @@
 end
 if isempty(time) && (strcmp(FileType,'video') || strcmp(FileType,'mmreader'))
-    set(handles.ListPairMode,'Value',1);
-    set(handles.ListPairMode,'String',{'series(Di)'})
+               set(handles.ListPairMode,'Value',1);
     dt=1/get(MovieObject,'FrameRate');%time interval between successive frames
-    MaxIndex_i=get(MovieObject,'NumberOfFrames');
-    time=(dt*(0:MaxIndex_i-1))';%list of image times
+    if strcmp(NomTypeIma,'*')
+        set(handles.ListPairMode,'String',{'series(Di)'})
+        MaxIndex_i=get(MovieObject,'NumberOfFrames');
+        time=(dt*(0:MaxIndex_i-1))';%list of image times
+    else
+        set(handles.ListPairMode,'String',[{'series(Dj)'};{'series(Di)'}])
+        MaxIndex_i=max(i1_series(i1_series>0));
+        MaxIndex_j=get(MovieObject,'NumberOfFrames');    
+        time=ones(MaxIndex_i,1)*(dt*(0:MaxIndex_j-1));%list of image times
+        enable_j(handles,'on')
+    end 
     TimeUnit='s';
     set(handles.ImaDoc,'BackgroundColor',[1 1 1])% set display box back to whiter
@@ -614,5 +622,5 @@
         set(handles.ListPairMode,'Value',1)% advice 'pair j1-j2' except in MaxIndex_j is large
     end
-else
+elseif ~(strcmp(FileType,'video') || strcmp(FileType,'mmreader'))
     set(handles.ListPairMode,'String',{'pair j1-j2';'series(Dj)';'series(Di)'})%multiple choice
     if strcmp(NomTypeNc,'_1-2_1')
@@ -2549,14 +2557,4 @@
     set(handles.ListPairMode,'Value',1) % mode 'civX' selected by default
 end
-% if strcmp(option,'stereo PIV') && get(handles.CheckPatch1,'Value')
-%     set(handles.CheckStereo,'Visible','on')
-% else
-%     set(handles.CheckStereo,'Visible','off')
-% end
-% if strcmp(option,'stereo PIV') && get(handles.CheckPatch2,'Value')
-%     set(handles.CheckStereo,'Visible','on')
-% else
-%     set(handles.CheckStereo,'Visible','off')
-% end
 ListPairMode_Callback(hObject, eventdata, handles)
 
@@ -3855,8 +3853,8 @@
     end
     case 'series(Dj)'  
-        r=regexp(NomTypeIma,'(?<num1>\d+)_(?<num2>\d+)$','names');
-        if ~isempty(r)
+%         r=regexp(NomTypeIma,'(?<num1>\d+)_(?<num2>\d+)$','names');
+%         if ~isempty(r)
             NomTypeNc='_1_1-2';
-        end
+%         end
    case 'series(Di)'
         r=regexp(NomTypeIma,'(?<num1>\d+)_(?<num2>\d+)$','names');
@@ -4375,8 +4373,12 @@
                         case {'PCWIN','PCWIN64'}                     
                             filename=regexprep(filename,'\\','\\\\');% add '\' so that '\' are left as characters
+                                    cmd=['civ_matlab(''' regexprep(filename,'(.+)([/\\])(.+$)','$1$20_XML\\$2$3.xml') ''','''...
+            filename '.nc'');'];
                         case {'GLNX86','GLNXA64','MACI64'}
+                                    cmd=['civ_matlab(''' regexprep(filename,'(.+)([/\\])(.+$)','$1$20_XML$2$3.xml') ''','''...
+            filename '.nc'');'];
                     end
-        cmd=['civ_matlab(''' regexprep(filename,'(.+)([/\\])(.+$)','$1$20_XML$2$3.xml') ''','''...
-            filename '.nc'');'];
+
+        
     case 'civ_matlab.sh'
         switch computer
@@ -4553,2 +4555,32 @@
 % --- Executes on selection change in RunMode.
 function RunMode_Callback(hObject, eventdata, handles)
+
+
+
+function nb_field2_Callback(hObject, eventdata, handles)
+% hObject    handle to nb_field2 (see GCBO)
+% eventdata  reserved - to be defined in a future version of MATLAB
+% handles    structure with handles and user data (see GUIDATA)
+
+% Hints: get(hObject,'String') returns contents of nb_field2 as text
+%        str2double(get(hObject,'String')) returns contents of nb_field2 as a double
+
+
+
+function last_j_Callback(hObject, eventdata, handles)
+% hObject    handle to last_j (see GCBO)
+% eventdata  reserved - to be defined in a future version of MATLAB
+% handles    structure with handles and user data (see GUIDATA)
+
+% Hints: get(hObject,'String') returns contents of last_j as text
+%        str2double(get(hObject,'String')) returns contents of last_j as a double
+
+
+
+function last_i_Callback(hObject, eventdata, handles)
+% hObject    handle to last_i (see GCBO)
+% eventdata  reserved - to be defined in a future version of MATLAB
+% handles    structure with handles and user data (see GUIDATA)
+
+% Hints: get(hObject,'String') returns contents of last_i as text
+%        str2double(get(hObject,'String')) returns contents of last_i as a double
