RvtkStatismo and S4 classes
27 Jun 2014As my son Rocco pulled a muscle in his left forearm, he had to stay home today - and so did I. In the short time that I was able to work, I read a bit about S4 classes (that I have not been working with until today) and considered it a good idea to use them in RvtkStatismo to reflect the strict class definitions. Additionally, Rcpp that handles exposing data between R and C++ has a nice interface for those classes.
I created a github branch called S4 (not very inspired) where I redefined pPCA (the class) as S4 class with pPCA (the function), as well as statismoBuildModel being constructors, with the list entries now being called “slots” and addressed via the “@” operator instead of “$”. These slots are still match the definitions and names from my earlier post The advantage is to have a system checking if the entries match the definitions and to have something similar to a constructor in C++. I will now test everything and merge in into master next week, and then continuing with the implementation of more statismo functionality.