makeRegionAxis : calculates the principal axis of the segment mask. INPUT : angle_deg : orientation of segment OUTPUT : e1 : aligned with the major axis e2 : aligned with 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 [e1,e2] = makeRegionAxisFast( angle_deg ) 0002 % makeRegionAxis : calculates the principal axis of the segment mask. 0003 % 0004 % INPUT : 0005 % angle_deg : orientation of segment 0006 % OUTPUT : 0007 % e1 : aligned with the major axis 0008 % e2 : aligned with the minor axis 0009 % 0010 % 0011 % Copyright (C) 2016 Wiggins Lab 0012 % Written by Paul Wiggins. 0013 % University of Washington, 2016 0014 % This file is part of SuperSegger. 0015 % 0016 % SuperSegger is free software: you can redistribute it and/or modify 0017 % it under the terms of the GNU General Public License as published by 0018 % the Free Software Foundation, either version 3 of the License, or 0019 % (at your option) any later version. 0020 % 0021 % SuperSegger is distributed in the hope that it will be useful, 0022 % but WITHOUT ANY WARRANTY; without even the implied warranty of 0023 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0024 % GNU General Public License for more details. 0025 % 0026 % You should have received a copy of the GNU General Public License 0027 % along with SuperSegger. If not, see <http://www.gnu.org/licenses/>. 0028 0029 theta = -(180+angle_deg)*pi/180; 0030 e1 = [ cos(theta), sin(theta)]; 0031 e2 = [-sin(theta), cos(theta)]; 0032 0033 end