Home > SuperSegger > Internal > getPoleSign.m

getPoleSign

PURPOSE ^

getPoleSign : returns the sign of the pole for a cell data structure

SYNOPSIS ^

function [ poleSign ] = getPoleSign( data )

DESCRIPTION ^

 getPoleSign : returns the sign of the pole for a cell data structure
 or a data.CellA strcture.
 
 INPUT :
       data : region/cell (err/seg) file  with CellA structure.
 OUTPUT :
       poleSign : 1 if aligned along e1, -1 if in opposite direction.

 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/>.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [ poleSign ] = getPoleSign( data )
0002 % getPoleSign : returns the sign of the pole for a cell data structure
0003 % or a data.CellA strcture.
0004 %
0005 % INPUT :
0006 %       data : region/cell (err/seg) file  with CellA structure.
0007 % OUTPUT :
0008 %       poleSign : 1 if aligned along e1, -1 if in opposite direction.
0009 %
0010 % Copyright (C) 2016 Wiggins Lab
0011 % Written by Paul Wiggins.
0012 % University of Washington, 2016
0013 % This file is part of SuperSegger.
0014 %
0015 % SuperSegger is free software: you can redistribute it and/or modify
0016 % it under the terms of the GNU General Public License as published by
0017 % the Free Software Foundation, either version 3 of the License, or
0018 % (at your option) any later version.
0019 %
0020 % SuperSegger is distributed in the hope that it will be useful,
0021 % but WITHOUT ANY WARRANTY; without even the implied warranty of
0022 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0023 % GNU General Public License for more details.
0024 %
0025 % You should have received a copy of the GNU General Public License
0026 % along with SuperSegger.  If not, see <http://www.gnu.org/licenses/>.
0027 
0028 
0029 poleSign = 1;
0030 
0031 if  isfield(data,'CellA') && isfield(data.CellA{1},'pole') ...
0032         && isfield(data.CellA{1}.pole,'op_ori')
0033     poleSign = data.CellA{1}.pole.op_ori;
0034 elseif  isfield(data,'pole') && isfield(data.pole,'op_ori')
0035     poleSign = data.pole.op_ori;
0036 end
0037 
0038 end
0039

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