Home > SuperSegger > batch > processExp.m

processExp

PURPOSE ^

processExp : main function for running the segmentation software.

SYNOPSIS ^

function processExp( dirname )

DESCRIPTION ^

 processExp : main function for running the segmentation software.
 Used to choose the appropriate settings, and converting the images
 filenames before running BatchSuperSeggerOpti.
 Images need to have the NIS-Elements Format, or they can be converted 
 using convertImageNames.

 the naming convention of the image files must be of the following format
 time, xy-positions, fluorescence channel, where c1 is bright field 
 and c2,c3 etc are different fluorescent channels 
 Example of two time points, two xy positions and one fluorescent channel
 filename_t001xy1c1.tif
 filename_t001xy1c2.tif
 filename_t001xy2c1.tif
 filename_t001xy2c2.tif
 filename_t002xy1c1.tif
 filename_t002xy1c2.tif
 filename_t002xy2c1.tif
 filename_t002xy2c2.tif

 INPUT :
       dirname : folder that contains .tif images in NIS elements format. 
 

 Copyright (C) 2016 Wiggins Lab 
 Written by Paul Wiggins, Nathan Kuwada, Stella Stylianidou.
 University of Washington, 2016
 This file is part of SuperSegger.
 
 SuperSegger is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation, either version 3 of the License, or
 (at your option) any later version.
 
 SuperSegger is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with SuperSegger.  If not, see <http://www.gnu.org/licenses/>.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function processExp( dirname )
0002 % processExp : main function for running the segmentation software.
0003 % Used to choose the appropriate settings, and converting the images
0004 % filenames before running BatchSuperSeggerOpti.
0005 % Images need to have the NIS-Elements Format, or they can be converted
0006 % using convertImageNames.
0007 %
0008 % the naming convention of the image files must be of the following format
0009 % time, xy-positions, fluorescence channel, where c1 is bright field
0010 % and c2,c3 etc are different fluorescent channels
0011 % Example of two time points, two xy positions and one fluorescent channel
0012 % filename_t001xy1c1.tif
0013 % filename_t001xy1c2.tif
0014 % filename_t001xy2c1.tif
0015 % filename_t001xy2c2.tif
0016 % filename_t002xy1c1.tif
0017 % filename_t002xy1c2.tif
0018 % filename_t002xy2c1.tif
0019 % filename_t002xy2c2.tif
0020 %
0021 % INPUT :
0022 %       dirname : folder that contains .tif images in NIS elements format.
0023 %
0024 %
0025 % Copyright (C) 2016 Wiggins Lab
0026 % Written by Paul Wiggins, Nathan Kuwada, Stella Stylianidou.
0027 % University of Washington, 2016
0028 % This file is part of SuperSegger.
0029 %
0030 % SuperSegger is free software: you can redistribute it and/or modify
0031 % it under the terms of the GNU General Public License as published by
0032 % the Free Software Foundation, either version 3 of the License, or
0033 % (at your option) any later version.
0034 %
0035 % SuperSegger is distributed in the hope that it will be useful,
0036 % but WITHOUT ANY WARRANTY; without even the implied warranty of
0037 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0038 % GNU General Public License for more details.
0039 %
0040 % You should have received a copy of the GNU General Public License
0041 % along with SuperSegger.  If not, see <http://www.gnu.org/licenses/>.
0042 
0043 %% Converting other microscopes files
0044 % For example if you are using MicroManager and the file format is the
0045 % followin : date-strain_00000000t_BF.tif, date-strain_00000000t_GFP.tif,
0046 % you can run convertImageNames(dirname, 'whatever_name_you_want', '', 't',
0047 % '','', {'BF','GFP'} )
0048 
0049 basename = 'date-strain';
0050 timeFilterBefore ='t';
0051 timeFilterAfter = '_' ;
0052 xyFilterBefore='_x';
0053 xyFilterAfter='_';
0054 channelNames = {'BF','GFP'};
0055 
0056 convertImageNames(dirname, basename, timeFilterBefore, ...
0057     timeFilterAfter, xyFilterBefore,xyFilterAfter, channelNames )
0058 
0059 %% Set the segmentations constants for your bacteria and micrscope resolution
0060 % Using correct resolution ensures correct pixel size and segmentation constants
0061 % if you do not know which constants to use you can run
0062 % tryDifferentConstants(dirname) with a phase image to choose.
0063 % 60X indicates 100nm/pix and 100X indicates 60nm/pix
0064 
0065 % for E. coli we mainly use :
0066 % '60XEc' : loadConstants 60X Ecoli - 100 nm/pix
0067 % '100XEc': loadConstants 100X Ecoli  - 60 nm/pix
0068 
0069 % To see the possible constants type :
0070 %[~, list] = getConstantsList;
0071 % list'
0072 
0073 res = '60XEcLB';
0074 
0075 %% Paralell Processing Mode
0076 % to run code in parallel mode must have the parallel processing toolbox,
0077 % for convenience default is false (non-parallel)
0078 
0079 parallel_flag = false;
0080 
0081 %% Load Constants
0082 CONST = loadConstants(res,parallel_flag) ;
0083 
0084 %% Calculation Options
0085 % after you load the constants you can modify them according to your needs
0086 % for more options, looks at the loadConstants file.
0087 
0088 CONST.trackLoci.numSpots = [5 0]; % Max number of foci to fit in each fluorescence channel (default = [0 0])
0089 CONST.trackLoci.fluorFlag = false ;    % compute integrated fluorescence (default = true)
0090 CONST.trackOpti.NEIGHBOR_FLAG = false; % calculate number of neighbors (default = false)
0091 CONST.imAlign.AlignChannel = 1; % change this if you want the images to be aligned to fluorescence channel
0092 
0093 
0094 %% Skip Frames for Segmentation
0095 % For fast time-lapse or slow growth you can skip phase image frames
0096 % during segmentation to increase processing speed. Fluorescence images
0097 % will not be skipped.
0098 
0099 skip = 1;  % segment every frame
0100 %skip = 5; % segment every fifth phase image
0101 
0102 %% Clean previous segmented data
0103 % If set to true, will begin processing on aligned images; if false, will
0104 % try to restart processing at last successful function (default = false)
0105 
0106 cleanflag = false;
0107 
0108 
0109 %% Start running segmentation
0110 
0111 BatchSuperSeggerOpti( dirname, skip, cleanflag, CONST);
0112 
0113 
0114 end

Generated on Thu 19-Jan-2017 13:55:21 by m2html © 2005