![]() ImageType :: Pointer image = SomeFilter -> GetOutput() ĬonstIteratorType constIterator ( image, image -> GetRequestedRegion() ) Using IteratorType = itk :: ImageRegionIterator Using ConstIteratorType = itk :: ImageRegionConstIterator Here is a simple example that defines and constructs a simple image iterator for an itk::Image. Const versions of iterators may read, but may not write pixel Instantiated on a non-const image pointer. ![]() There is a const and a non-const version of most ITK image iterators. Iteration region is any subregion of the image within the current BufferedRegion. The iteration region must be wholly contained within the image. The image region, called the iteration region, is a rectilinear area in which iteration isĬonstrained. There is no restriction on the dimensionality of the image or on the pixel type of theĪn iterator constructor requires at least two arguments, a smart pointer to the image to iterate across, and an Iterators may deviate from this standard or provide additional methods.Īll image iterators have at least one template parameter that is the image type over which they This section describes the standard ITK image iterator programming interface. Code is more compact and often generalizes automatically to higherĭimensions, algorithms run much faster, and iterators simplify tasks such as multithreading and Using the ITK iterators instead of accessing data directly through the itk::Image Specifically designed to work with image containers, their interface and implementation is optimized for In ITK we use iterators to write generic image processing code for images instantiated with differentĬombinations of pixel type, pixel container type, and dimensionality. Many iterator implementations have an interface similar to a C Sequentially reference elements of an array. It can be moved forward (incremented) and backward (decremented) through memory to IteratorsĪppear in for and while loop constructs, visiting each data point in turn. The iterator is so named because it is used for iterative, sequential access of container values. Interface so that algorithm code can reference data in a generic way and maintain functional independence An iterator is an abstraction of a memory pointer.Įvery container type must define its own iterator type, but all iterators are written to provide a common To access data in containers,Īlgorithms use a third class of objects called iterators. Container objects store data and algorithms operate on data. Generic programming models define functionally independent components called containers andĪlgorithms. ![]() Iterator types and provide examples of how they are used. Programming interface common to most ITK image iterators. The next section is a brief introduction that defines iterators in the context of ITK. Specialized to simplify common image processing tasks. ITK has a wide variety of image iterators, some of which are highly An iterator is a generalization of the familiar C programming language pointer Iterators This chapter introduces the image iterator, an important generic programming constructįor image processing in ITK. ![]()
0 Comments
Leave a Reply. |