Shapeworks Studio  2.1
Shape analysis software suite
itkPSMProject.h
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef __itkPSMProject_h
19 #define __itkPSMProject_h
20 
21 #include "itkMacro.h"
22 #include "itkPSMDOMNode.h"
23 #include "itkDataObject.h"
24 #include "itkObjectFactory.h"
25 #include "itkEventObject.h"
26 #include "itkExceptionObject.h"
27 #include <vnl/vnl_vector_fixed.h>
28 
29 namespace itk
30 {
31 
47  class ITK_EXPORT PSMProject : public Object
48 {
49  public:
51  typedef PSMProject Self;
52  typedef Object Superclass;
53  typedef SmartPointer<Self> Pointer;
54  typedef SmartPointer<const Self> ConstPointer;
55 
57  itkNewMacro(Self);
58 
60  itkTypeMacro(PSMProject, Object);
61 
63  static const std::string data_tag;
64  static const std::string distance_transform_tag;
65  static const std::string distance_transforms_tag;
66  static const std::string domain_tag;
67  static const std::string correspondences_tag;
68  static const std::string cutting_plane_tag;
69  static const std::string model_tag;
70  static const std::string name_tag;
71  static const std::string optimization_tag;
72  static const std::string number_of_scales_tag;
73  static const std::string preprocessing_tag;
74  static const std::string procrustes_tag;
75  static const std::string psm_project_tag;
76  static const std::string scale_tag;
77  static const std::string scale_number_tag;
78  static const std::string variables_tag;
79 
80 
84  void SetDOMNode(PSMDOMNode *p);
85 
90  PSMDOMNode::Pointer &GetDOMNode()
91  { return m_DOMNode; }
92 
93 
96  bool HasDomains() const;
97 
99  const DOMNode *GetDomainNode(const std::string &name) const;
100 
103  bool HasDomainDistanceTransform(const std::string &name) const;
104 
107  const std::vector<std::string > &
108  GetDomainDistanceTransform(const std::string &name) const;
109 
111  bool HasDomainCuttingPlanes(const std::string &name) const;
112 
116  std::vector<vnl_vector_fixed<double,3> >
117  GetDomainCuttingPlanes(const std::string &name) const;
118 
123  std::vector<std::string> GetDomainNames() const;
124 
131  const std::vector<std::string> &GetModel(const std::string &name);
132 
134  bool HasModel(const std::string &name) const;
135 
139  const std::vector<std::string> &GetDistanceTransforms() const;
140 
146  const DOMNode *GetOptimization() const
147  {
148  return m_DOMNode->GetChild(optimization_tag);
149  }
150 
152  unsigned int GetNumberOfOptimizationScales() const;
153 
157  bool HasOptimizationAttribute(const std::string& name, unsigned int i = 0) const;
158 
167  double GetOptimizationAttribute(const std::string &name, unsigned int i = 0) const;
168 
170  bool HasProcrustes() const;
171 
174  bool HasVariables(const std::string &name) const;
175 
182  std::vector<double> GetVariables(const std::string &name) const;
183 
187  const std::vector<std::string > &GetVariablesText(const std::string &name) const;
188 
194  void Stream(std::ostream &os);
195 
196  protected:
197  PSMProject() {};
198  void PrintSelf(std::ostream& os, Indent indent) const;
199  virtual ~PSMProject() {};
200 
203  void StreamChildren(PSMDOMNode *,std::ostream &os, Indent indent);
204 
206  const PSMDOMNode *GetDataNode() const;
207 
208  private:
209  PSMProject(const Self &); // purposely not implemented
210  void operator=(const Self &); // purposely not implemented
211 
213  PSMDOMNode::Pointer m_DOMNode;
214 };
215 
216 } // end namespace itk
217 
218 #endif
static const std::string data_tag
Definition: itkPSMProject.h:63
PSMProject Self
Definition: itkPSMProject.h:51
This class is a data object that holds information about a Particle Shape Modeling project...
Definition: itkPSMProject.h:47
Class to represent a node in the PSM Document Object Model (DOM) tree structure.
Definition: itkPSMDOMNode.h:46
const DOMNode * GetOptimization() const
PSMDOMNode::Pointer & GetDOMNode()
Definition: itkPSMProject.h:90