39 #ifndef ITK_DATAMANAGER_H_
40 #define ITK_DATAMANAGER_H_
42 #include <boost/bind.hpp>
43 #include <boost/utility/result_of.hpp>
45 #include <itkObject.h>
46 #include <itkObjectFactory.h>
48 #include "DataManager.h"
49 #include "statismoITKConfig.h"
64 typedef Object Superclass;
65 typedef SmartPointer<Self> Pointer;
66 typedef SmartPointer<const Self> ConstPointer;
73 typedef typename statismo::DataManager<T>::DataItemType DataItemType;
74 typedef typename statismo::DataManager<T>::DataItemListType DataItemListType;
75 typedef statismo::Representer<T> RepresenterType;
78 typename boost::result_of<F()>::type callstatismoImpl(F f)
const {
80 itkExceptionMacro(<<
"Model not properly initialized. Maybe you forgot to call SetRepresenter");
85 itkExceptionMacro(<< s.what());
99 ImplType* GetstatismoImplObj()
const {
104 void SetstatismoImplObj(
ImplType* impl) {
111 void SetRepresenter(
const RepresenterType* representer) {
115 void AddDataset(
typename RepresenterType::DatasetType* ds,
const char* filename) {
119 void Load(
const char* filename) {
123 itkExceptionMacro(<< s.what());
127 void Save(
const char* filename) {
128 callstatismoImpl(boost::bind(&
ImplType::Save, this->m_impl, filename));
131 typename statismo::DataManager<T>::DataItemListType GetData()
const {
ITK Wrapper for the statismo::DataManager class.
Definition: itkDataManager.h:59
Manages Training and Test Data for building Statistical Models and provides functionality for Crossva...
Definition: DataManager.h:114
static DataManager< T > * Load(Representer< T > *representer, const std::string &filename)
Definition: DataManager.hxx:75
static DataManager< T > * Create(const RepresenterType *representer)
Definition: DataManager.h:132
DataItemListType GetData() const
Definition: DataManager.hxx:227
virtual void AddDataset(DatasetConstPointerType dataset, const std::string &URI)
Definition: DataManager.hxx:214
Generic Exception class for the statismo Library.
Definition: Exceptions.h:68
virtual void Save(const std::string &filename) const
Definition: DataManager.hxx:156