


makeRegionSize : computes the projections lengths on the principal axis.
INPUT :
mask : masked region of interest
e1 : orientation of major axis
e2 : oreintation of minor axis
OUTPUT:
L1 : projection length of region on the major axis
L2 : projection length of region on the minor axis
Copyright (C) 2016 Wiggins Lab
Written by Paul Wiggins.
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/>.

0001 function [L1,L2] = makeRegionSize( mask,e1,e2 ) 0002 % makeRegionSize : computes the projections lengths on the principal axis. 0003 % 0004 % INPUT : 0005 % mask : masked region of interest 0006 % e1 : orientation of major axis 0007 % e2 : oreintation of minor axis 0008 % OUTPUT: 0009 % L1 : projection length of region on the major axis 0010 % L2 : projection length of region on the minor axis 0011 % 0012 % 0013 % Copyright (C) 2016 Wiggins Lab 0014 % Written by Paul Wiggins. 0015 % University of Washington, 2016 0016 % This file is part of SuperSegger. 0017 % 0018 % SuperSegger is free software: you can redistribute it and/or modify 0019 % it under the terms of the GNU General Public License as published by 0020 % the Free Software Foundation, either version 3 of the License, or 0021 % (at your option) any later version. 0022 % 0023 % SuperSegger is distributed in the hope that it will be useful, 0024 % but WITHOUT ANY WARRANTY; without even the implied warranty of 0025 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0026 % GNU General Public License for more details. 0027 % 0028 % You should have received a copy of the GNU General Public License 0029 % along with SuperSegger. If not, see <http://www.gnu.org/licenses/>. 0030 0031 mask = ~~mask; 0032 0033 im_size = size(mask); 0034 im_size_x = im_size(2); 0035 im_size_y = im_size(1); 0036 0037 xxx = 1:im_size_x; 0038 yyy = 1:im_size_y; 0039 0040 [X,Y] = meshgrid( xxx, yyy ); 0041 0042 Xp = (-(X(mask))*e1(2)+(Y(mask))*e1(1)); 0043 Yp = (-(X(mask))*e2(2)+(Y(mask))*e2(1)); 0044 0045 XPmax = max(Xp); 0046 YPmax = max(Yp); 0047 XPmin = min(Xp); 0048 YPmin = min(Yp); 0049 0050 L2 = XPmax-XPmin; 0051 L1 = YPmax-YPmin; 0052 0053 end