GOFIGURE2  0.9.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
QGoSplitSegmentationAlgo.cxx
Go to the documentation of this file.
1 
2 /*=========================================================================
3  Authors: The GoFigure Dev. Team.
4  at Megason Lab, Systems biology, Harvard Medical school, 2009-11
5 
6  Copyright (c) 2009-11, President and Fellows of Harvard College.
7  All rights reserved.
8 
9  Redistribution and use in source and binary forms, with or without
10  modification, are permitted provided that the following conditions are met:
11 
12  Redistributions of source code must retain the above copyright notice,
13  this list of conditions and the following disclaimer.
14  Redistributions in binary form must reproduce the above copyright notice,
15  this list of conditions and the following disclaimer in the documentation
16  and/or other materials provided with the distribution.
17  Neither the name of the President and Fellows of Harvard College
18  nor the names of its contributors may be used to endorse or promote
19  products derived from this software without specific prior written
20  permission.
21 
22  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
24  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
25  PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
26  BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
27  OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
28  OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
29  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
30  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
31  OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
32  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 
34 =========================================================================*/
36 
37 //-------------------------------------------------------------------------
40  std::vector< vtkPoints* >* iSeeds,
41  QWidget *iParent) : QGoSegmentationAlgo( iParent ), m_Seeds( iSeeds )
42 {}
43 //-------------------------------------------------------------------------
44 
45 //-------------------------------------------------------------------------
47 {
48 
49 }
50 //-------------------------------------------------------------------------
51 
52 //-------------------------------------------------------------------------
54 {
55 
56 }
57 
58 //-------------------------------------------------------------------------
59 
60 //-------------------------------------------------------------------------
61 std::vector<double>
63 GetBounds(const std::vector<double>& iCenter,
64  const double& iRadius,
65  const unsigned int& iOrientation)
66 {
67  assert( iCenter.size() == 3 );
68  assert( iRadius >= 0. );
69  assert( iOrientation < 4 );
70 
71  std::vector<double> boundingBox( 6, 0. );
72  unsigned int k = 0;
73 
74  for(unsigned int i=0; i<3; i++)
75  {
76  if(i == iOrientation)
77  {
78  boundingBox[k++] = iCenter[i];
79  boundingBox[k++] = iCenter[i];
80  }
81  else
82  {
83  boundingBox[k++] = iCenter[i] - iRadius;
84  boundingBox[k++] = iCenter[i] + iRadius;
85  }
86  }
87 
88  return boundingBox;
89 }
90 //-------------------------------------------------------------------------
virtual void SetAlgoWidget(QWidget *iParent=0)
construct the algowidget with the different parameters
abstract class to be the interface between the algorithms for meshes and contours and GoFigure ...
QGoSplitSegmentationAlgo(std::vector< vtkPoints * > *iSeeds, QWidget *iParent=0)
std::vector< double > GetBounds(const std::vector< double > &iCenter, const double &iRadius, const unsigned int &iOrientation=3)