ITK  5.2.0
Insight Toolkit
Public Types | List of all members
itk::ImageHelper< NImageDimension, NLoop > Class Template Reference

#include <itkImageHelper.h>

Public Types

using ImageType = ImageBase< NImageDimension >
 
using IndexType = typename ImageType::IndexType
 
using IndexValueType = typename ImageType::IndexValueType
 
using OffsetType = typename ImageType::OffsetType
 
using OffsetValueType = typename ImageType::OffsetValueType
 

Static Public Member Functions

static void ComputeIndex (const IndexType &bufferedRegionIndex, OffsetValueType offset, const OffsetValueType offsetTable[], IndexType &index)
 
static void ComputeIndexInner (const IndexType &bufferedRegionIndex, OffsetValueType &offset, const OffsetValueType offsetTable[], IndexType &index, std::false_type)
 
static void ComputeIndexInner (const IndexType &bufferedRegionIndex, OffsetValueType &offset, const OffsetValueType[], IndexType &index, std::true_type)
 
static void ComputeOffset (const IndexType &bufferedRegionIndex, const IndexType &index, const OffsetValueType offsetTable[], OffsetValueType &offset)
 
static void ComputeOffsetInner (const IndexType &bufferedRegionIndex, const IndexType &index, const OffsetValueType offsetTable[], OffsetValueType &offset, std::false_type)
 
static void ComputeOffsetInner (const IndexType &bufferedRegionIndex, const IndexType &index, const OffsetValueType[], OffsetValueType &offset, std::true_type)
 

Detailed Description

template<unsigned int NImageDimension, unsigned int NLoop>
class itk::ImageHelper< NImageDimension, NLoop >

Fast Index/Offset computation.

These helper methods use recursive templates to unroll the loops of simple calculations. The resulting speed improvement varies from compiler to compiler. Some gcc compilers with debug turned on exhibit slight speed increases, but most compilers see improvement. The ComputeOffset performance improvement is impressive. For example, the Windows VS7.0 compiler shows almost a factor of 2 speed improvement with the recursive templates. Usually recursive templates use partial specialization to terminate loops. Here we use a technique used by Brad King in the itk Concept Checking code.

Note
This work is part of the National Alliance for Medical Image Computing (NAMIC), funded by the National Institutes of Health through the NIH Roadmap for Medical Research, Grant U54 EB005149. Information on the National Centers for Biomedical Computing can be obtained from http://commonfund.nih.gov/bioinformatics.

Definition at line 54 of file itkImageHelper.h.

Member Typedef Documentation

◆ ImageType

template<unsigned int NImageDimension, unsigned int NLoop>
using itk::ImageHelper< NImageDimension, NLoop >::ImageType = ImageBase<NImageDimension>

Definition at line 57 of file itkImageHelper.h.

◆ IndexType

template<unsigned int NImageDimension, unsigned int NLoop>
using itk::ImageHelper< NImageDimension, NLoop >::IndexType = typename ImageType::IndexType

Definition at line 58 of file itkImageHelper.h.

◆ IndexValueType

template<unsigned int NImageDimension, unsigned int NLoop>
using itk::ImageHelper< NImageDimension, NLoop >::IndexValueType = typename ImageType::IndexValueType

Definition at line 61 of file itkImageHelper.h.

◆ OffsetType

template<unsigned int NImageDimension, unsigned int NLoop>
using itk::ImageHelper< NImageDimension, NLoop >::OffsetType = typename ImageType::OffsetType

Definition at line 59 of file itkImageHelper.h.

◆ OffsetValueType

template<unsigned int NImageDimension, unsigned int NLoop>
using itk::ImageHelper< NImageDimension, NLoop >::OffsetValueType = typename ImageType::OffsetValueType

Definition at line 60 of file itkImageHelper.h.

Member Function Documentation

◆ ComputeIndex()

template<unsigned int NImageDimension, unsigned int NLoop>
static void itk::ImageHelper< NImageDimension, NLoop >::ComputeIndex ( const IndexType bufferedRegionIndex,
OffsetValueType  offset,
const OffsetValueType  offsetTable[],
IndexType index 
)
inlinestatic

◆ ComputeIndexInner() [1/2]

template<unsigned int NImageDimension, unsigned int NLoop>
static void itk::ImageHelper< NImageDimension, NLoop >::ComputeIndexInner ( const IndexType bufferedRegionIndex,
OffsetValueType offset,
const OffsetValueType  offsetTable[],
IndexType index,
std::false_type   
)
inlinestatic

ComputeIndex with recursive templates

Definition at line 76 of file itkImageHelper.h.

Referenced by itk::ImageHelper< NImageDimension, NLoop >::ComputeIndex().

◆ ComputeIndexInner() [2/2]

template<unsigned int NImageDimension, unsigned int NLoop>
static void itk::ImageHelper< NImageDimension, NLoop >::ComputeIndexInner ( const IndexType bufferedRegionIndex,
OffsetValueType offset,
const  OffsetValueType[],
IndexType index,
std::true_type   
)
inlinestatic

ComputeIndex with recursive templates

Definition at line 90 of file itkImageHelper.h.

◆ ComputeOffset()

template<unsigned int NImageDimension, unsigned int NLoop>
static void itk::ImageHelper< NImageDimension, NLoop >::ComputeOffset ( const IndexType bufferedRegionIndex,
const IndexType index,
const OffsetValueType  offsetTable[],
OffsetValueType offset 
)
inlinestatic

◆ ComputeOffsetInner() [1/2]

template<unsigned int NImageDimension, unsigned int NLoop>
static void itk::ImageHelper< NImageDimension, NLoop >::ComputeOffsetInner ( const IndexType bufferedRegionIndex,
const IndexType index,
const OffsetValueType  offsetTable[],
OffsetValueType offset,
std::false_type   
)
inlinestatic

ComputeIndex with recursive templates

Definition at line 113 of file itkImageHelper.h.

Referenced by itk::ImageHelper< NImageDimension, NLoop >::ComputeOffset().

◆ ComputeOffsetInner() [2/2]

template<unsigned int NImageDimension, unsigned int NLoop>
static void itk::ImageHelper< NImageDimension, NLoop >::ComputeOffsetInner ( const IndexType bufferedRegionIndex,
const IndexType index,
const  OffsetValueType[],
OffsetValueType offset,
std::true_type   
)
inlinestatic

ComputeIndex with recursive templates

Definition at line 125 of file itkImageHelper.h.


The documentation for this class was generated from the following file: