Skip to content

Commit

Permalink
viewer movie bug fix when using skip
Browse files Browse the repository at this point in the history
  • Loading branch information
stellastyl committed Jul 13, 2016
1 parent 46bfbcb commit a4439af
Showing 1 changed file with 37 additions and 29 deletions.
66 changes: 37 additions & 29 deletions viz/superSeggerViewerGui.m
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -211,7 +218,7 @@ function initImage(hObject, handles) % Not updated

if ~exist(dirSave, 'dir')
try
mkdir(dirSave);
mkdir(dirSave);
catch
end
else
Expand Down Expand Up @@ -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'))
Expand Down Expand Up @@ -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});

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 = [];
Expand Down Expand Up @@ -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');
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit a4439af

Please sign in to comment.