diff --git a/viz/superSeggerViewerGui.m b/viz/superSeggerViewerGui.m index d1b12fa..4ada1aa 100644 --- a/viz/superSeggerViewerGui.m +++ b/viz/superSeggerViewerGui.m @@ -185,9 +185,16 @@ function initImage(hObject, handles) % Not updated handles.clist = []; end else + + if numel(direct_contents_err) == 0 && numel(direct_contents_seg) == 0 % no images found abort. cla(handles.axes1) - handles.message.String = ['There are no xy dirs. Choose a different directory.']; + + if numel(dir([dirname, '*.tif'])) > 0 + handles.message.String = ['Directory does not contain segmented data. Please use superSeggerGui to segment your data.']; + else + handles.message.String = ['There are no xy dirs. Choose a different directory.']; + end disable_all_panels(hObject,handles); return; @@ -211,7 +218,7 @@ function initImage(hObject, handles) % Not updated if ~exist(dirSave, 'dir') try - mkdir(dirSave); + mkdir(dirSave); catch end else @@ -445,7 +452,7 @@ function superSeggerViewerGui_OpeningFcn(hObject, eventdata, handles, varargin) function image_directory_Callback(hObject, eventdata, handles) initImage(hObject, handles); - + function image_directory_CreateFcn(hObject, eventdata, handles) if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) @@ -967,23 +974,23 @@ function clickOnImage(hObject, eventdata, handles) disp(['ID : ', num2str(data.regs.ID(ii))]); disp(['Area : ', num2str(data.regs.props(ii).Area)]); if isfield(data,'CellA') - disp(['Pole orientation : ', num2str(data.CellA{ii}.pole.op_ori)]); - disp(['BoundingBox : ', num2str(data.CellA{ii}.BB)]); - disp(['Axis Lengths : ', num2str(data.CellA{ii}.length)]); - disp(['Cell Length : ', num2str(data.CellA{ii}.cellLength(1))]); - disp(['Mean Width : ', num2str(data.CellA{ii}.cellLength(2))]); - disp(['Cell distance : ', num2str(data.CellA{ii}.cell_dist)]); - disp(['Cell Old Pole Age : ', num2str( data.CellA{ii}.pole.op_age)]); - disp(['Cell New Pole Age : ', num2str(data.CellA{ii}.pole.np_age)]); - - if isfield(data.CellA{ii},'fl1') - disp('fluorescence 1 statistics: ') - disp( (data.CellA{ii}.fl1)); - end - if isfield(data.CellA{ii},'fl2') - disp('fluorescence 2 statistics : ') - disp( (data.CellA{ii}.fl1)); - end + disp(['Pole orientation : ', num2str(data.CellA{ii}.pole.op_ori)]); + disp(['BoundingBox : ', num2str(data.CellA{ii}.BB)]); + disp(['Axis Lengths : ', num2str(data.CellA{ii}.length)]); + disp(['Cell Length : ', num2str(data.CellA{ii}.cellLength(1))]); + disp(['Mean Width : ', num2str(data.CellA{ii}.cellLength(2))]); + disp(['Cell distance : ', num2str(data.CellA{ii}.cell_dist)]); + disp(['Cell Old Pole Age : ', num2str( data.CellA{ii}.pole.op_age)]); + disp(['Cell New Pole Age : ', num2str(data.CellA{ii}.pole.np_age)]); + + if isfield(data.CellA{ii},'fl1') + disp('fluorescence 1 statistics: ') + disp( (data.CellA{ii}.fl1)); + end + if isfield(data.CellA{ii},'fl2') + disp('fluorescence 2 statistics : ') + disp( (data.CellA{ii}.fl1)); + end end % disp(data.CellA{ii}); @@ -1178,7 +1185,7 @@ function output_list_Callback(hObject, eventdata, handles) handles = consensus_image(handles) elseif strcmp('Consensus Kymo',value) handles = consensus_kymo(handles); - end + end end set(hObject, 'UserData', get(hObject, 'Value')); % for double click selection @@ -1356,14 +1363,14 @@ function intMakeCellMovie(handles) skip = (endFr-startFr)/(numFrm-1); end - if isnan(numFrm) && ~isnan(skip) + if isnan(numFrm) && ~isnan(skip) skip = skip; - end - - if isnan(skip) && isnan(numFrm) + end + + if isnan(skip) && isnan(numFrm) skip = 1; % default value end - + else startFr = []; endFr = []; @@ -1426,14 +1433,15 @@ function makeFieldMovie(handles) if ~isempty(startFr) mov.cdata = []; mov.colormap = []; - + counter = 1; for ii = round(startFr:skip: endFr) delete(get(handles.axes1, 'Children')) [data_r, data_c, data_f] = intLoadDataViewer( handles.dirname_seg, ... handles.contents, ii, handles.num_im, handles.clist, handles.FLAGS); showSeggerImage( data_c, data_r, data_f, handles.FLAGS, handles.clist, handles.CONST, handles.axes1); drawnow; - mov(ii) = getframe; + mov(counter) = getframe; + counter = counter + 1; handles.message.String = ['Frame number: ', num2str(ii)]; end choice = questdlg('Save movie?', 'Save movie?', 'Yes', 'No', 'No'); @@ -1504,7 +1512,7 @@ function save_clist_Callback(hObject, eventdata, handles) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) try - clist = handles.clist; + clist = handles.clist; if ~isempty(clist) save( [handles.dirname0,handles.contents_xy(handles.dirnum).name,filesep,'clist.mat'],'-STRUCT','clist'); end