#include <itkHilbertPath.h>
Represent an n-dimensional Hilbert path for a given order.
This class is used to construct a Hilbert spacing-filling curve (or path) for a given order and given dimension. The locality- preserving properties make the Hilbert path an attractive option for mapping multi-dimensional data to a single array.
The path is defined by its dimensionality and order( >= 1 ) with its starting point at [0]^Dimension. The size of the path in each dimension is 2^order where each discrete location is visited by that path. For example, a 2-D Hilbert path of order 8 can map each pixel of a 256x256 image onto a single array. More properties and visualizations can be found in various places on the web.
The implementation is based on [46] and a direct porting of the Aldo Cortesi's python code found at https://github.com/cortesi/scurve
Definition at line 52 of file itkHilbertPath.h.
Public Member Functions | |
virtual::itk::LightObject::Pointer | CreateAnother () const |
InputType | EndOfInput () const override |
OutputType | Evaluate (const PathIndexType &input) const override |
virtual InputType | EvaluateInverse (const IndexType &input) |
OutputType | EvaluateToIndex (const PathIndexType &input) const override |
const char * | GetNameOfClass () const override |
OffsetType | IncrementInput (InputType &input) const override |
virtual HilbertPathSizeType | NumberOfSteps () const |
PathIndexType | TransformMultiDimensionalIndexToPathIndex (const IndexType &index) |
IndexType | TransformPathIndexToMultiDimensionalIndex (const PathIndexType id) |
virtual void | Clear () |
void | Initialize () override |
virtual void | SetHilbertOrder (HilbertOrderType _arg) |
virtual HilbertOrderType | GetHilbertOrder () const |
![]() | |
const char * | GetNameOfClass () const override |
virtual InputType | StartOfInput () const |
![]() | |
virtual void | CopyInformation (const DataObject *) |
virtual void | DataHasBeenGenerated () |
void | DisconnectPipeline () |
bool | GetDataReleased () const |
virtual const bool & | GetReleaseDataFlag () const |
SmartPointer< ProcessObject > | GetSource () const |
DataObjectPointerArraySizeType | GetSourceOutputIndex () const |
const DataObjectIdentifierType & | GetSourceOutputName () const |
virtual ModifiedTimeType | GetUpdateMTime () const |
virtual void | Graft (const DataObject *) |
virtual void | PrepareForNewData () |
virtual void | PropagateRequestedRegion () |
void | ReleaseData () |
virtual void | ReleaseDataFlagOff () |
virtual void | ReleaseDataFlagOn () |
virtual bool | RequestedRegionIsOutsideOfTheBufferedRegion () |
virtual void | ResetPipeline () |
void | SetReleaseDataFlag (bool flag) |
virtual void | SetRequestedRegion (const DataObject *) |
virtual void | SetRequestedRegionToLargestPossibleRegion () |
bool | ShouldIReleaseData () const |
virtual void | Update () |
virtual void | UpdateOutputData () |
virtual void | UpdateOutputInformation () |
void | UpdateSource () const |
virtual bool | VerifyRequestedRegion () |
void | SetPipelineMTime (ModifiedTimeType time) |
virtual const ModifiedTimeType & | GetPipelineMTime () const |
virtual void | SetRealTimeStamp (RealTimeStamp _arg) |
virtual const RealTimeStamp & | GetRealTimeStamp () const |
![]() | |
unsigned long | AddObserver (const EventObject &event, Command *cmd) const |
unsigned long | AddObserver (const EventObject &event, std::function< void(const EventObject &)> function) const |
LightObject::Pointer | CreateAnother () const override |
virtual void | DebugOff () const |
virtual void | DebugOn () const |
Command * | GetCommand (unsigned long tag) |
bool | GetDebug () const |
MetaDataDictionary & | GetMetaDataDictionary () |
const MetaDataDictionary & | GetMetaDataDictionary () const |
virtual ModifiedTimeType | GetMTime () const |
virtual const TimeStamp & | GetTimeStamp () const |
bool | HasObserver (const EventObject &event) const |
void | InvokeEvent (const EventObject &) |
void | InvokeEvent (const EventObject &) const |
virtual void | Modified () const |
void | Register () const override |
void | RemoveAllObservers () |
void | RemoveObserver (unsigned long tag) const |
void | SetDebug (bool debugFlag) const |
void | SetReferenceCount (int) override |
void | UnRegister () const noexcept override |
void | SetMetaDataDictionary (const MetaDataDictionary &rhs) |
void | SetMetaDataDictionary (MetaDataDictionary &&rrhs) |
virtual void | SetObjectName (std::string _arg) |
virtual const std::string & | GetObjectName () const |
![]() | |
Pointer | Clone () const |
virtual void | Delete () |
virtual int | GetReferenceCount () const |
void | Print (std::ostream &os, Indent indent=0) const |
Static Public Member Functions | |
static Pointer | New () |
![]() | |
static bool | GetGlobalReleaseDataFlag () |
static void | GlobalReleaseDataFlagOff () |
static void | GlobalReleaseDataFlagOn () |
static Pointer | New () |
static void | SetGlobalReleaseDataFlag (bool val) |
![]() | |
static bool | GetGlobalWarningDisplay () |
static void | GlobalWarningDisplayOff () |
static void | GlobalWarningDisplayOn () |
static Pointer | New () |
static void | SetGlobalWarningDisplay (bool val) |
![]() | |
static void | BreakOnError () |
static Pointer | New () |
Static Public Attributes | |
static constexpr unsigned int | Dimension = VDimension |
![]() | |
static constexpr unsigned int | PathDimension |
Protected Member Functions | |
HilbertPath () | |
void | PrintSelf (std::ostream &os, Indent indent) const override |
~HilbertPath () override=default | |
![]() | |
virtual IndexType | GetZeroIndex () const |
virtual OffsetType | GetZeroOffset () const |
Path () | |
void | PrintSelf (std::ostream &os, Indent indent) const override |
~Path () override=default | |
![]() | |
DataObject () | |
virtual void | PropagateResetPipeline () |
~DataObject () override | |
![]() | |
Object () | |
bool | PrintObservers (std::ostream &os, Indent indent) const |
virtual void | SetTimeStamp (const TimeStamp &timeStamp) |
~Object () override | |
![]() | |
virtual LightObject::Pointer | InternalClone () const |
LightObject () | |
virtual void | PrintHeader (std::ostream &os, Indent indent) const |
virtual void | PrintTrailer (std::ostream &os, Indent indent) const |
virtual | ~LightObject () |
Private Member Functions | |
void | ConstructHilbertPath () |
PathIndexType | GetBitRange (const PathIndexType, const PathIndexType, const PathIndexType, const PathIndexType) |
PathIndexType | GetDirection (const PathIndexType, const PathIndexType) |
PathIndexType | GetEntry (const PathIndexType) |
PathIndexType | GetGrayCode (const PathIndexType) |
PathIndexType | GetInverseGrayCode (const PathIndexType) |
PathIndexType | GetInverseTransform (const PathIndexType, const PathIndexType, const PathIndexType, const PathIndexType) |
PathIndexType | GetLeftBitRotation (PathIndexType, PathIndexType, const PathIndexType) |
PathIndexType | GetRightBitRotation (PathIndexType, PathIndexType, const PathIndexType) |
PathIndexType | GetTrailingSetBits (const PathIndexType, const PathIndexType) |
PathIndexType | GetTransform (const PathIndexType, const PathIndexType, const PathIndexType, const PathIndexType) |
PathIndexType | SetBit (const PathIndexType, const PathIndexType, const PathIndexType, const PathIndexType) |
Private Attributes | |
HilbertOrderType | m_HilbertOrder { 1 } |
HilbertPathType | m_HilbertPath {} |
Additional Inherited Members | |
![]() | |
std::atomic< int > | m_ReferenceCount {} |
using itk::HilbertPath< TIndexValue, VDimension >::ConstPointer = SmartPointer<const Self> |
Definition at line 61 of file itkHilbertPath.h.
using itk::HilbertPath< TIndexValue, VDimension >::HilbertOrderType = unsigned int |
Definition at line 79 of file itkHilbertPath.h.
using itk::HilbertPath< TIndexValue, VDimension >::HilbertPathSizeType = typename HilbertPathType::size_type |
Definition at line 81 of file itkHilbertPath.h.
using itk::HilbertPath< TIndexValue, VDimension >::HilbertPathType = std::vector<IndexType> |
Definition at line 80 of file itkHilbertPath.h.
using itk::HilbertPath< TIndexValue, VDimension >::IndexType = OutputType |
Definition at line 78 of file itkHilbertPath.h.
using itk::HilbertPath< TIndexValue, VDimension >::PathIndexType = InputType |
The input/output type alias
Definition at line 77 of file itkHilbertPath.h.
using itk::HilbertPath< TIndexValue, VDimension >::Pointer = SmartPointer<Self> |
Definition at line 60 of file itkHilbertPath.h.
using itk::HilbertPath< TIndexValue, VDimension >::Self = HilbertPath<TIndexValue, VDimension> |
Standard class type aliases.
Definition at line 58 of file itkHilbertPath.h.
using itk::HilbertPath< TIndexValue, VDimension >::Superclass = Path<unsigned int, Index<VDimension>, VDimension> |
Definition at line 59 of file itkHilbertPath.h.
|
protected |
|
overrideprotecteddefault |
|
inlinevirtual |
Remove all steps from the path
Definition at line 124 of file itkHilbertPath.h.
|
private |
|
virtual |
Create an object from an instance, potentially deferring to a factory. This method allows you to create an instance of an object that is exactly the same type as the referring object. This is useful in cases where an object has been cast back to a base class.
Reimplemented from itk::LightObject.
|
inlineoverridevirtual |
Where does the path end (what is the last valid input value)?
Reimplemented from itk::Path< unsigned int, Index< 3 >, 3 >.
Definition at line 108 of file itkHilbertPath.h.
|
inlineoverridevirtual |
Evaluate the hilbert path for the index at the specified path-position.
Implements itk::Path< unsigned int, Index< 3 >, 3 >.
Definition at line 88 of file itkHilbertPath.h.
|
inlinevirtual |
Evaluate the hilbert path for the path-position at the specified index.
Definition at line 101 of file itkHilbertPath.h.
|
inlineoverridevirtual |
Like Evaluate(), except always returns an index
Implements itk::Path< unsigned int, Index< 3 >, 3 >.
Definition at line 94 of file itkHilbertPath.h.
|
private |
|
private |
|
private |
|
private |
|
virtual |
Set/get Hilbert order. The multi-dimensional space is of size 2^(HilbertOrder).
|
private |
|
private |
|
private |
|
overridevirtual |
Reimplemented from itk::DataObject.
|
private |
|
private |
|
private |
|
inlineoverridevirtual |
Increment the input variable passed by reference and then return the index stored at the new path-position.
Implements itk::Path< unsigned int, Index< 3 >, 3 >.
Definition at line 117 of file itkHilbertPath.h.
|
inlineoverridevirtual |
Needed for Pipelining
Reimplemented from itk::DataObject.
Definition at line 140 of file itkHilbertPath.h.
|
static |
New() method for dynamic construction
|
inlinevirtual |
How many steps in the path?
Definition at line 133 of file itkHilbertPath.h.
|
overrideprotectedvirtual |
Methods invoked by Print() to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.
Reimplemented from itk::DataObject.
|
private |
|
virtual |
Set/get Hilbert order. The multi-dimensional space is of size 2^(HilbertOrder).
PathIndexType itk::HilbertPath< TIndexValue, VDimension >::TransformMultiDimensionalIndexToPathIndex | ( | const IndexType & | index | ) |
Convert the multidimensional index to the path index
IndexType itk::HilbertPath< TIndexValue, VDimension >::TransformPathIndexToMultiDimensionalIndex | ( | const PathIndexType | id | ) |
Convert the path index to the multidimensional index location
|
staticconstexpr |
Dimension underlying input image.
Definition at line 70 of file itkHilbertPath.h.
|
private |
Definition at line 205 of file itkHilbertPath.h.
|
private |
Definition at line 206 of file itkHilbertPath.h.