Class Name |
Fate |
Deprecated API |
New API
|
Sample |
Refactored
|
- Does not derives from Object anymore, now it derives from DataObject.
- typedef for InstanceIdentifier was replaced from unsigned long to std::vector<MeasurementVectorType>::size_type
- Size() method now returns InstanceIdentifier type, before it returned unsigned int, which was inconsistent with the declaration of InstanceIdentifier as unsigned long. The return type of Size() must be the same use for Id of the elements, since it may reach the same maximum number.
- Removing unnecessary const in identifiers
- GetMeasurementVector( const InstanceItentifier & id ) is now GetMeasurementVector( InstanceItentifier id )
- GetFrequency( const InstanceItentifier & id ) is now GetFrequency( InstanceItentifier id )
- SetMeasurementVectorSize( const MeasurementVectorSizeType s ) is now SetMeasurementVectorSize( MeasurementVectorSizeType s )
|
- const-correctness is now enforced.
- It now derives from DataObject
|
Subsample |
Refactored |
- The concept of Indices and InstanceIdentifiers was fixed. InstanceIdentifiers were previously referring to the original Sample, they are now referring to the current Subsample set of measurement vectors.
- It now derives from its template argument. Before, it was deriving from an explicit itk::Statistics::Sample<> whose template argument MeasurementVector was taken as a trait from the Subsample template argument. The current derivation is more consistent with the notion that the Subsample should behave as the sample from which the instances are taken.
- FrequencyType GetFrequencyByIndex(int index) const : was removed. This method becomes obsolete when the inconsistencies between index and identifier are removed.
- InstanceIdentifier GetInstanceIdentifier(int index) const; was removed. This method becomes obsolete when the inconsistencies between index and identifier are removed.
- Iterators
- Common
- GetInstanceIdentifier() now returns the integer distance to the Begin() element. Before it used to return the index of the instance in the real sample.
- Iterator& operator+(int n) and Iterator& operator-(int n) were removed. The methods were not used, and they were not consistent with other containers. They were also unsafe, given that with Begin() and End() there is no way to verify if an iterator has moved before Begin() or after End() (unless we rely on being aware of the underlying pointer implementation of the Iterators, which would be a violation of the class encapsulation).
- Constructor ConstIterator(typename InstanceIdentifierHolder::const_iterator iter, const Self* classSample) was made protected, since this constructor must only be called by the Sample owner class.
- ConstIterator
- removing Friendship to the Iterator
- non-const Iterator
- removing Friendship to the ConstIterator
|
- The basic principle followed now in the design of the Subsample class is that the subsample should behave as a sample. That is, a user should be able to use a Subsample class in any algorithm that is expecting a Sample.
- AddInstance( InsitanceIdentifier Id )
- Now throws an exception if the Id is larger than the Size of the Sample.
- Now it calls Modified()
- Iterators
- Now the non-const Iterator derives from the ConstIterator
- Methods declared protected and purposely not implemented
- Default constructor: This was a safety risk since it contained uninitialized variables
- The following method are in this category to enforce const correctness. All of them could have offered ways of removing constness without warning
- Iterator(const Self * sample);
- Iterator(typename InstanceIdentifierHolder::const_iterator iter, const Self* classSample);
- Iterator(const ConstIterator & it);
- ConstIterator& operator=(const ConstIterator& it);
|
ListSampleBase |
Deprecated. The class was unecessary, it was providing only a Search() method that should in fact be provided by a process class, not a data container.
|
- If you were deriving a class from the itk::Statistics::ListSampleBase, you should now derive directly from the itk::Statistics::Sample class.
- If you were using the Search() method you can get that functionality now from the (refactored) NeighborhoodSampler filter class. Note that the NeighborhoodSampler now allows users to setup a specific distance metric.
|
|
ListSample |
Refactored |
- It does not derive from the ListSampleBase (since that class was deprecated)
- The iterators API was updated,
- const-correctness is now enforced
- Constructor with instance identifier was moved to the protected section
- ConstIterator does not refer to the non-const Iterator any more.
- Method that allowed to convert ConstIterator into non-const Iterators were removed because they were facilitating the violation of const-correctness
- Various API modifications
- SearchResultVectorType trait was removed. Search is to be implemented as an external algorithm.
- Resize( unsigned int ) now is Resize( InstanceIdentifier ) (keeping 64bits in mind)
- PushBack() before passed the argument by copy, now it passes it as a const reference
- Size() method used to return unsigned int, now it returns InstanceIdentifier (keeping 64bits in mind)
- GetMeasurementVector() instance identifier argument is now passed by copy, since it is just a number
- SetMeasurementVector() now passes InstanceIdentifier by copy, not by const reference
- SetMeasurement() now passes InstanceIdentifier by copy, not by const reference
- GetFrequency() now passes InstanceIdentifier by copy, not by const reference
- GetMeasurementVectorSize() method was removed. The default implementation of the superclass is now functional for this class too.
- The implementation code of most methods was moved to the .txx file.
|
- It derives now from the Sample class directly
- Iterators
- ConstIterator use friendship to the ListSample
- operator-- removed
- non-const Iterator is no longer a friend of the ConstIterator. Instead it derives from the ConstIterator
- The following methods were declared but not implemented, in the protected section with the purpose of preventing const-correctness violations
- Iterator() constructor
- Iterator(const Self * sample) constructor of non-const iterator from const sample
- Iterator( typename InternalDataContainerType::const_iterator iter, InstanceIdentifier iid) constructor of non-const iterator from const sample iterator
- Iterator(const ConstIterator & it) constructor of non-const iterator from ConstIterator
- ConstIterator& operator=(const ConstIterator& it) Assignment of ConstIterator to non-const Iterator.
- The followin methods were moved to the protected section, since only the ListSample class (which is a friend) should call them
- Iterator( typename InternalDataContainerType::iterator iter, InstanceIdentifier iid):ConstIterator( iter, iid )
|
MembershipSample |
Refactoring in Progress Luis |
- It does not derive from itk::Sample anymore, instead it derives from DataObject.
|
|
Histogram |
Refactored Luis to add more here |
|
|
VariableDimensionHistogram |
Pending |
|
|
KdTree |
Pending |
|
|