Skip to content

Commit

Permalink
Fixed bug in showSeggerImage generated when merging with master. Mult…
Browse files Browse the repository at this point in the history
…i channel support fix added for Consensus image generation
  • Loading branch information
Paul Wiggins committed Jun 22, 2018
1 parent 8782968 commit 3611641
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 33 deletions.
4 changes: 3 additions & 1 deletion viz/makeConsensusImage.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function [ imMosaic, imColor, imBW, imInv, imMosaic10 ] = makeConsensusImage ...
function [ imMosaic, imColor, imBW, imInv, imMosaic10, towerMask ] = makeConsensusImage ...
(dataImArray, CONST, skip, mag, disp_flag, fnum, clist)
% makeConsensusImage : Computes consensus fluorescence localization from cells in a cell files
%
Expand Down Expand Up @@ -89,6 +89,8 @@
dataImArray.ssTot, dataImArray.cellArrayNum, CONST, disp_flag );
imBWunmasked = dataImArray.towerNorm;
imBWmask = dataImArray.towerMask;

towerMask = dataImArray.towerMask;
end
end

Expand Down
12 changes: 0 additions & 12 deletions viz/showSeggerImage.m
Original file line number Diff line number Diff line change
Expand Up @@ -245,18 +245,6 @@ function doFrameMerge( x_, y_ )



% if you are in fluorescence mode (f_flag) draw the fluor channels
if FLAGS.composite
nc = numel(find(~cellfun('isempty',strfind(fieldnames(data),'fluor'))));
for i = 1 : nc
im = updateFluorImage(data, im, i, FLAGS, CONST, clist);
end

elseif FLAGS.f_flag > 0
im = updateFluorImage(data, im, FLAGS.f_flag, FLAGS, CONST);
end


if FLAGS.colored_regions
im = label2rgb (data.regs.regs_label, 'lines', 'k');
elseif FLAGS.Outline_flag % it just outlines the cells
Expand Down
71 changes: 51 additions & 20 deletions viz/superSeggerViewerGui.m
Original file line number Diff line number Diff line change
Expand Up @@ -1534,35 +1534,66 @@ function output_list_Callback(hObject, eventdata, handles)
if ~areCellsLoaded(handles)
errordlg('No cell files found');
else
if ~exist('dataImArray','var') || isempty(dataImArray)
fnum = handles.FLAGS.f_flag;
if fnum == 0
fnum = 1;
if true % ~exist('dataImArray','var') || isempty(dataImArray)

nc = intGetChannelNum(handles.data_c);

if handles.FLAGS.composite
ranger = find( handles.FLAGS.include(2:nc+1) );
else
ranger = handles.FLAGS.f_flag;
end
[dataImArray] = makeConsensusArray( handles.dirname_cell, handles.CONST...
, 5,[], fnum, handles.clist);
save ([handles.dirSave,'dataImArray'],'dataImArray');

imm = {};

for ff = ranger
tmpskip = 1;

tmp = makeConsensusArray( handles.dirname_cell, handles.CONST...
, tmpskip,[], ff, handles.clist);



[imMosaic, imColor, imBW, imInv, imMosaic10, towerMask ] ...
= makeConsensusImage(tmp,handles.CONST,tmpskip,4,0);

if handles.FLAGS.composite || ~handles.CONST.view.falseColorFlag
comm = { imBW, handles.CONST.view.fluorColor{ff}, handles.FLAGS.level(ff+1) };
else
comm = { imBW, jet(256) };
end

imm = comp( {imm}, comm );
end

if ~isempty( imm )
imm = comp( {imm, 'mask', towerMask} );
end

else
handles.message.String = 'dataImArray already calculated';
end
[imMosaic, imColor, imBW, imInv, imMosaic10 ] = makeConsensusImage(dataImArray,handles.CONST,5,4,0);
if handles.save_output.Value
save ([handles.dirSave, 'show_consensus'], 'imMosaic', 'imColor', 'imBW', 'imInv', 'imMosaic10');

% if handles.save_output.Value
% save ([handles.dirSave, 'show_consensus'], 'imMosaic', 'imColor', 'imBW', 'imInv', 'imMosaic10');
% end

if ~isempty( imm )
figure(2);
clf;
imshow(imm);
end
figure(2);
clf;
imshow(imColor);

end


function makeCellKymo(handles)
if ~areCellsLoaded(handles)
errordlg('No cell files found');
else
c = str2double(handles.cell_no.String);
if numel(c) > 1
c = c(1);
function makeCellKymo(handles)
if ~areCellsLoaded(handles)
errordlg('No cell files found');
else
c = str2double(handles.cell_no.String);
if numel(c) > 1
c = c(1);
end
if isempty(c) || isnan(c) || c < 1 || c > max(handles.data_c.regs.ID)
handles.message.String = ['Invalid cell number'];
Expand Down

0 comments on commit 3611641

Please sign in to comment.