FIXADHERENT forces an adherent cell to have its largest slice on the bottom of the segmented cell Inputs: segcell = current segmented cell image bot_slice = bottom slice where signal exists top_slice = top slice where signal exists Outputs: rbot_slice = corrected bottom slice rtop_slice = corrected top slice
0001 function [rbot_slice, rtop_slice ] = fixadherent( segcell, bot_slice, top_slice ) 0002 %FIXADHERENT forces an adherent cell to have its largest slice on the bottom of the segmented cell 0003 % 0004 %Inputs: 0005 % segcell = current segmented cell image 0006 % bot_slice = bottom slice where signal exists 0007 % top_slice = top slice where signal exists 0008 % 0009 %Outputs: 0010 % rbot_slice = corrected bottom slice 0011 % rtop_slice = corrected top slice 0012 0013 % Copyright (C) 2006 Murphy Lab 0014 % Carnegie Mellon University 0015 % 0016 % This program is free software; you can redistribute it and/or modify 0017 % it under the terms of the GNU General Public License as published 0018 % by the Free Software Foundation; either version 2 of the License, 0019 % or (at your option) any later version. 0020 % 0021 % This program is distributed in the hope that it will be useful, but 0022 % WITHOUT ANY WARRANTY; without even the implied warranty of 0023 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 0024 % General Public License for more details. 0025 % 0026 % You should have received a copy of the GNU General Public License 0027 % along with this program; if not, write to the Free Software 0028 % Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 0029 % 02110-1301, USA. 0030 % 0031 % For additional information visit http://murphylab.web.cmu.edu or 0032 % send email to murphy@cmu.edu 0033 0034 %Modified by: 0035 % March 21, 2013 D. Sullivan, added license. 0036 % June 6, 2013 D. Sullivan, changed rbot_slice to match our current usage. 0037 0038 top = size(segcell,3); 0039 areas = sum(sum(segcell)); 0040 [junk,truebottom] = max(areas); 0041 0042 %D. Sullivan 6/6/13, fixed rbot_slice problem 0043 % I think this was correct when we pass only slices with fluorescence, but 0044 % currently we pass all slices so the truebottom will have the correct 0045 % indices 0046 % rbot_slice = bot_slice + truebottom - 1; 0047 rbot_slice = truebottom; 0048 0049 rtop_slice = top_slice; 0050 end