Shapeworks Studio  2.1
Shape analysis software suite
itkPSMCommandLineClass.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 
19 #ifndef ____itkPSMCommandLineClass__h
20 #define ____itkPSMCommandLineClass__h
21 
22 #include <iostream>
23 #include <string>
24 #include <sstream>
25 #include "itkImage.h"
26 #include "itkPSMProcrustesRegistration.h"
27 #include "itkImageFileReader.h"
28 #include "itkPSMEntropyModelFilter.h"
29 #include "itkPSMProject.h"
30 #include "itkPSMProjectReader.h"
31 #include "itkPSMParticleSystem.h"
32 #include "itkCommand.h"
33 
34 namespace itk
35 {
46 template <unsigned int VDimension>
47 class ITK_EXPORT PSMCommandLineClass : public DataObject
48 {
49  public:
52  typedef DataObject Superclass;
53  typedef SmartPointer<Self> Pointer;
54  typedef SmartPointer<const Self> ConstPointer;
55 
57  itkNewMacro(Self);
58 
60  itkTypeMacro(PSMCommandLineClass, DataObject);
61 
63  typedef typename itk::Image<float, VDimension> ImageType;
64 
68 
71 
74 
77 
78 
81  void ReadProjectFile(const char *fn);
82 
85  void ReadDistanceTransforms(std::string input_path_prefix);
86 
87 
91  void ReadCuttingPlanes();
92 
94  void ReadModelPointFiles();
95 
98  void SetPSMFilterParameters();
99 
101  void WriteOutputs(std::string output_path);
102 
104  void Run(const char *fname, std::string input_path_prefix, std::string output_path);
105 
108  virtual ~PSMCommandLineClass() {};
109 
111  itkGetObjectMacro(PSMFilter, EntropyModelFilterType);
112 
115  itkGetMacro(ReportInterval,unsigned int);
116  itkSetMacro(ReportInterval,unsigned int);
117 
118  protected:
121  void IterateCallback(itk::Object *, const itk::EventObject &);
122 
123  private:
124  PSMCommandLineClass(const Self&); //purposely not implemented
125  void operator=(const Self&); //purposely not implemented
126 
129  std::string m_ProjectFileName;
130 
132  typename EntropyModelFilterType::Pointer m_PSMFilter;
133 
135  typename ProcrustesRegistrationType::Pointer m_ProcrustesRegistration;
136 
138  typename ProjectReaderType::Pointer m_ProjectReader;
139 
141  typename ProjectType::Pointer m_Project;
142 
145  int m_ProcrustesCounter;
146 
148  std::vector<unsigned int> m_ProcrustesInterval;
149 
153  typename itk::MemberCommand<PSMCommandLineClass>::Pointer m_IterateCmd;
154 
157  unsigned int m_ReportInterval;
158 };
159 } // end namespace
160 
161 #ifndef ITK_MANUAL_INSTANTIATION
162 #include "itkPSMCommandLineClass.hxx"
163 #endif
164 
165 #endif
This class is a reader for PSMProjects.
PSMProcrustesRegistration< VDimension > ProcrustesRegistrationType
This class is a data object that holds information about a Particle Shape Modeling project...
Definition: itkPSMProject.h:47
itk::Image< float, VDimension > ImageType
This class interfaces with the PSMProcrustesFunction class to register a list of point sets...
This the most basic of all PSM model optimization filters. This filter assembles all of the necessary...
PSMEntropyModelFilter< typename PSMCommandLineClass::ImageType > EntropyModelFilterType
This class provides a command line tool to run the Particle Shape Modeling. It runs the optimization ...