Commit 8511351f authored by Paul Antony's avatar Paul Antony

tests for linux and windows10 passed

parent 4733d5f6
...@@ -5,7 +5,6 @@ function [Objects, Preview] = f_CloneClassifier(row, col, ch1Green, ch2Red, ch3B ...@@ -5,7 +5,6 @@ function [Objects, Preview] = f_CloneClassifier(row, col, ch1Green, ch2Red, ch3B
%% Image analysis %% Image analysis
% Red pos % Red pos
%RedLP = imfilter(ch1Green, fspecial('gaussian', 60, 20), 'symmetric');
RedLP = imfilter(ch2Red, fspecial('gaussian', 21, 7), 'symmetric'); RedLP = imfilter(ch2Red, fspecial('gaussian', 21, 7), 'symmetric');
%it(ch2Red) %it(ch2Red)
%it(RedLP) %it(RedLP)
...@@ -13,10 +12,8 @@ function [Objects, Preview] = f_CloneClassifier(row, col, ch1Green, ch2Red, ch3B ...@@ -13,10 +12,8 @@ function [Objects, Preview] = f_CloneClassifier(row, col, ch1Green, ch2Red, ch3B
%it(RedPosMask) %it(RedPosMask)
% Green Pos % Green Pos
%GreenLP = imfilter(ch2Red, fspecial('gaussian', 21, 7), 'symmetric');
GreenLP = imfilter(ch1Green, fspecial('gaussian', 60, 20), 'symmetric'); GreenLP = imfilter(ch1Green, fspecial('gaussian', 60, 20), 'symmetric');
%it(GreenLP) %it(GreenLP)
%GreenPosMask = GreenLP > 150;
GreenPosMask = GreenLP > 200; GreenPosMask = GreenLP > 200;
%it(GreenPosMask) %it(GreenPosMask)
...@@ -43,15 +40,7 @@ function [Objects, Preview] = f_CloneClassifier(row, col, ch1Green, ch2Red, ch3B ...@@ -43,15 +40,7 @@ function [Objects, Preview] = f_CloneClassifier(row, col, ch1Green, ch2Red, ch3B
Objects.ROW = row; Objects.ROW = row;
Objects.COL = col; Objects.COL = col;
% if (Objects.AreaRedPos / Objects.Area > 0.5) & ~(Objects.AreaGreenPos / Objects.Area > 0.5) & (Objects.Area >= 1e5)
% Class = 'Red';
% elseif ~(Objects.AreaRedPos / Objects.Area > 0.5) & (Objects.AreaGreenPos / Objects.Area > 0.5) & (Objects.Area >= 1e5)
% Class = 'Green';
% elseif (Objects.AreaRedPos / Objects.Area > 0.5) & (Objects.AreaGreenPos / Objects.Area > 0.5) & (Objects.Area >= 1e5)
% Class = 'RedGreen';
% else
% Class = 'Neg';
% end
if Objects.AreaBluePos / Objects.Area > 0.5 if Objects.AreaBluePos / Objects.Area > 0.5
Class = 'Blue'; Class = 'Blue';
else else
...@@ -69,11 +58,9 @@ function [Objects, Preview] = f_CloneClassifier(row, col, ch1Green, ch2Red, ch3B ...@@ -69,11 +58,9 @@ function [Objects, Preview] = f_CloneClassifier(row, col, ch1Green, ch2Red, ch3B
Objects.Class = {Class}; Objects.Class = {Class};
%% Previews %% Previews
%RGB = cat(3, imadjust(ch2Red, [0 0.01], [0 1]), imadjust(ch1Green, [0 0.01], [0 1]), zeros(size(ch1Green), 'uint16'));
RGB = cat(3, imadjust(ch2Red, [0 0.01], [0 1]), imadjust(ch1Green, [0 0.01], [0 1]), imadjust(ch3Blue, [0 0.02], [0 1])); RGB = cat(3, imadjust(ch2Red, [0 0.01], [0 1]), imadjust(ch1Green, [0 0.01], [0 1]), imadjust(ch3Blue, [0 0.02], [0 1]));
% imtool(RGB) % imtool(RGB)
Preview = imoverlay2(RGB, imdilate(bwperim(SamplingZone), strel('disk', 10)), [1 1 1]); Preview = imoverlay(RGB, imdilate(bwperim(SamplingZone), strel('disk', 10)), [1 1 1]);
Preview = insertText(Preview, [1 1], Class, 'FontSize', 200, 'BoxColor', 'black', 'TextColor', 'white'); Preview = insertText(Preview, [1 1], Class, 'FontSize', 200, 'BoxColor', 'black', 'TextColor', 'white');
Preview = imresize(Preview, 1/ShrinkFactor); Preview = imresize(Preview, 1/ShrinkFactor);
% imtool(Preview) % imtool(Preview)
......
...@@ -13,9 +13,7 @@ TimepointsTableFilter = cellfun(@(x) ~isempty(x), TimepointsTableClean.Fun_name, ...@@ -13,9 +13,7 @@ TimepointsTableFilter = cellfun(@(x) ~isempty(x), TimepointsTableClean.Fun_name,
TimepointsTableFilter = cell2mat(TimepointsTableFilter); TimepointsTableFilter = cell2mat(TimepointsTableFilter);
TimepointsTableClean2 = TimepointsTable(TimepointsTableFilter, TimepointsTable.Properties.VariableNames); TimepointsTableClean2 = TimepointsTable(TimepointsTableFilter, TimepointsTable.Properties.VariableNames);
TimepointFolders = TimepointsTableClean2.name; TimepointFolders = TimepointsTableClean2.name;
%files = dirrec([hcsDrive, ':\OperaArchiveCol\OB 20141022_MDPD1_3Stains_2Controls', '\', TimepointFolders{timepoint}], '.flex');
files = dirrec([hcsPath, filesep, barcode, filesep, TimepointFolders{timepoint}], '.flex'); files = dirrec([hcsPath, filesep, barcode, filesep, TimepointFolders{timepoint}], '.flex');
%[info, areaNames, plateLayout, areaMap] = flexinfo(files);
[info, areaNames, plateLayout, areaMap] = flexinfoMosaic(files); [info, areaNames, plateLayout, areaMap] = flexinfoMosaic(files);
end end
......
...@@ -13,7 +13,11 @@ function [FileList] = f_LogDependencies(Name, SavePath) ...@@ -13,7 +13,11 @@ function [FileList] = f_LogDependencies(Name, SavePath)
FileCount = size(FileList,1); FileCount = size(FileList,1);
for i = 1:FileCount for i = 1:FileCount
FileThis = regexp(FileList{i}, '\\.*\\(.*)', 'tokens'); FileThis = FileThis{:}{:}; try % Windows
FileThis = regexp(FileList{i}, '\\.*\\(.*)', 'tokens'); FileThis = FileThis{:}{:};
catch % Mac
FileThis = regexp(FileList{i}, '/.*/(.*)', 'tokens'); FileThis = FileThis{:}{:};
end
SavePathThisFile = [SavePath, filesep, FileThis]; SavePathThisFile = [SavePath, filesep, FileThis];
copyfile(FileList{i}, SavePathThisFile); copyfile(FileList{i}, SavePathThisFile);
end end
......
function out = imoverlay2(in, mask, color)
%IMOVERLAY Create a mask-based image overlay.
% OUT = IMOVERLAY(IN, MASK, COLOR) takes an input image, IN, and a binary
% image, MASK, and produces an output image whose pixels in the MASK
% locations have the specified COLOR.
%
% IN should be a grayscale or an RGB image of class uint8, uint16, int16,
% logical, double, or single. If IN is double or single, it should be in
% the range [0, 1]. If it is not in that range, you might want to use
% mat2gray to scale it into that range.
%
% MASK should be a two-dimensional logical matrix.
%
% COLOR should be a 1-by-3 vector of values in the range [0, 1]. [0 0 0]
% is black, and [1 1 1] is white.
%
% OUT is a uint8 RGB image.
%
% Examples
% --------
% Overlay edge detection result in green over the original image.
%
% I = imread('cameraman.tif');
% bw = edge(I, 'canny');
% rgb = imoverlay(I, bw, [0 1 0]);
% imshow(rgb)
%
% Treating the output of peaks as an image, overlay the values greater than
% 7 in red. The output of peaks is not in the usual grayscale image range
% of [0, 1], so use mat2gray to scale it.
%
% I = peaks;
% mask = I > 7;
% rgb = imoverlay(mat2gray(I), mask, [1 0 0]);
% imshow(rgb, 'InitialMagnification', 'fit')
% Steven L. Eddins
% Copyright 2006-2012 The MathWorks, Inc.
% If the user doesn't specify the color, use white.
DEFAULT_COLOR = [1 1 1];
if nargin < 3
color = DEFAULT_COLOR;
end
% Force the 2nd input to be logical.
mask = (mask ~= 0);
% Make the uint8 the working data class. The output is also uint8.
in_uint8 = im2uint8(in);
color_uint8 = im2uint8(color);
% Initialize the red, green, and blue output channels.
if ndims(in_uint8) == 2
% Input is grayscale. Initialize all output channels the same.
out_red = in_uint8;
out_green = in_uint8;
out_blue = in_uint8;
else
% Input is RGB truecolor.
out_red = in_uint8(:,:,1);
out_green = in_uint8(:,:,2);
out_blue = in_uint8(:,:,3);
end
% Replace output channel values in the mask locations with the appropriate
% color value.
out_red(mask) = color_uint8(1);
out_green(mask) = color_uint8(2);
out_blue(mask) = color_uint8(3);
% Form an RGB truecolor image by concatenating the channel matrices along
% the third dimension.
out = cat(3, out_red, out_green, out_blue);
...@@ -7,7 +7,7 @@ clc ...@@ -7,7 +7,7 @@ clc
InPath = ['..', filesep, 'dataIn']; InPath = ['..', filesep, 'dataIn'];
SavePath = ['..', filesep, 'dataOut']; SavePath = ['..', filesep, 'dataOut'];
Barcode = {'HO_20180320_Subcloning_snca4correction_1'}; Barcode = {'HO_20170921_Subcloning_YEL1'};
DisplayChannel = 1; DisplayChannel = 1;
%% Initialize variables and prepare Java environment %% Initialize variables and prepare Java environment
...@@ -28,7 +28,7 @@ for n = 1:size(Barcode, 2) ...@@ -28,7 +28,7 @@ for n = 1:size(Barcode, 2)
SavePathThisBarcode = [SavePath, filesep, Barcode]; SavePathThisBarcode = [SavePath, filesep, Barcode];
AnalysisTimeStamp = datestr(now, 'yyyymmdd_HHMMSS'); AnalysisTimeStamp = datestr(now, 'yyyymmdd_HHMMSS');
SavePath = [SavePathThisBarcode, '\Analysis_', AnalysisTimeStamp]; SavePath = [SavePathThisBarcode, filesep, 'Analysis_', AnalysisTimeStamp];
mkdir(SavePathThisBarcode) mkdir(SavePathThisBarcode)
FileNameShort = mfilename; FileNameShort = mfilename;
newbackup = sprintf('%s_log.m',[SavePathThisBarcode, filesep, FileNameShort]); newbackup = sprintf('%s_log.m',[SavePathThisBarcode, filesep, FileNameShort]);
...@@ -41,7 +41,7 @@ for n = 1:size(Barcode, 2) ...@@ -41,7 +41,7 @@ for n = 1:size(Barcode, 2)
f_LogDependencies(mfilename, SavePathThisBarcode) f_LogDependencies(mfilename, SavePathThisBarcode)
%% Load data %% Load data
[files, info, areaNames, plateLayout, areaMap] = f_Local_Read_Files_Timeseries_Mosaic_BT2('S:\OperaQEHS\OperaArchiveCol', Barcode, 1); [files, info, areaNames, plateLayout, areaMap] = f_Local_Read_Files_Timeseries_Mosaic_BT2(InPath, Barcode, 1);
%% Organize images %% Organize images
% find images for a given mosaic % find images for a given mosaic
......
...@@ -48,10 +48,6 @@ end ...@@ -48,10 +48,6 @@ end
cube = zeros([sizeY(), sizeX(), sizeZ, sizeC], 'uint16'); cube = zeros([sizeY(), sizeX(), sizeZ, sizeC], 'uint16');
% getZCTCoords = @(i) [mod(i, sizeZ), ...
% mod(floor(i / sizeZ), sizeC), ...
% floor(floor(i / sizeZ) / sizeC)];
getCZTCoords = @(i) [mod(floor(i / sizeC), sizeZ), ... getCZTCoords = @(i) [mod(floor(i / sizeC), sizeZ), ...
mod(i, sizeC), ... mod(i, sizeC), ...
floor(floor(i / sizeC) / sizeZ)]; floor(floor(i / sizeC) / sizeZ)];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment