From NAMIC Wiki
Home < NAMIC Wiki:ShapeAnalysis:ShapeAnalysisStatObjects
Statistical Objects framework in ITK
- Abstract base class derived from DataObject: StatisticalObject (similar thinking/design as for SpatialObjects in itk)
- ITK already has a statistic library that is based on the idea of a measurement and sample. Do we need a StatisticalObject?
- Instead of a DataObject, we could also define Adaptors, similar to the Statistics framework based on the 'Sample' class. Unstructured statistical objects could directly use 'Sample' as a base class. Structured statistical objects (i.e. with knowledge of neighborhood, for computation of local variance etc) cannot be included currently with 'Sample' (Correct?). We could use Sample as a base class and put an additional layer on it to make it a Statistical Object.
- Probably the best choice would be to use multiple inheritance using Sample as a base class (offers the GetFrequency and GetMeasurementVector methods) as well as the appropriate DataObject (e.g. MeshSpatialObject). This allows the statististical filters to easily load and save the objects that it needs based on the ImageIO.
- Should we directly derive from Sample or make a special subclass offering general additional functionality, such as SetMeasurementVector and Iterators, alternatively these are offered also by ListSample
- E.g. MeshSample is a subclass of ListSample or a subclass of StatisticalSample which is a Subclass of Sample
Separate Statistical Object Class
- Each 'statistically analyzable' object class derives from the base classes e.g. MeshStatisticalObject could have ListSample and MeshSpatialObject as a base classes
- The Statistical Object class does not add additional information, but rather is a wrapper class that provides abstract access methods
Abstract class design:
- Templated over Measurement T (can be scalar, vector, matrix....anything really)
- GetMeasurementVector(): returns vector (itkArray<T>)
- SetMeasurementVector(itkArray<T> f), Sample does not offer this
- Iterators, Sample does not offer this
- In ITK Dataobjects generally don't know how to load or save themself, so let's design the class as to agree with that standard
- There are several possibilities for loading/saving the object measurements (e.g. a surface or an image) associated with a statistical object:
- The object measurement (surface/image) is loaded by the user and needs to be set via e.g. a SetObjectMeasurement() routine. This is not suggested as the data is usually loaded either in the filter, or in study information class. Otherwise the study information needs to parsed manually by the user in order to load each object measurements.
- We write a separate ImageIO's for all Statistical Objects. This is a large overhead for how little is needed from statistical Object
- Each specific statistical object class is derived from both the abstract statistical object base class (e.g. directly Sample or a subclass of sample), as well as a Dataobject class for which there is already an ImageIO
- Do we need to expand IO support of meshes to openInventor and byu (UNC uses currently OIV and byu), or should we shift to MetaIO? Martin: suggest support of at least also openInventor/Coin3D format, as it is quite widely used in the graphics and surgical assistance environment
First implementations planned at UNC:
- MeshStatisticalObject<MeshType> :: StatisticalObject<MeshType *>
- MeshType is a scalar (usually float or double)
- GetFeatureDimension() returns always 3 (three dimensional mesh)
- Similarly this could be done with an MeshToListAdaptor and a ITK Point<double,3> as MeasurementVector
First implementations planned at Utah:
- DTI image statistical analysis