Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages |
#include <itkAdvancedImageMomentsCalculator.h>
Compute moments of an n-dimensional image.
This class provides methods for computing the moments and related properties of a single-echo image. Computing the (non-central) moments of a large image can easily take a million times longer than computing the various other values derived from them, so we compute the moments only on explicit request, and save their values (in an AdvancedImageMomentsCalculator object) for later retrieval by the user.
The non-central moments computed by this class are not really intended for general use and are therefore in index coordinates; that is, we pretend that the index that selects a particular pixel also equals its physical coordinates. The center of gravity, central moments, principal moments and principal axes are all more generally useful and are computed in the physical coordinates defined by the Origin and Spacing parameters of the image.
The methods that return values return the values themselves rather than references because the cost is small compared to the cost of computing the moments and doing so simplifies memory management for the caller.
Definition at line 66 of file itkAdvancedImageMomentsCalculator.h.
Data Structures | |
struct | ComputePerThreadStruct |
struct | MultiThreaderParameterType |
Public Types | |
typedef AffineTransformType::Pointer | AffineTransformPointer |
typedef AffineTransform< double, itkGetStaticConstMacro(ImageDimension) > | AffineTransformType |
typedef itk::BinaryThresholdImageFilter< TImage, TImage > | BinaryThresholdImageFilterType |
typedef SmartPointer< const Self > | ConstPointer |
typedef ImageType::ConstPointer | ImageConstPointer |
typedef ImageGridSamplerType::Pointer | ImageGridSamplerPointer |
typedef itk::ImageGridSampler< ImageType > | ImageGridSamplerType |
typedef ImageType::Pointer | ImagePointer |
typedef ImageSampleContainerType::Pointer | ImageSampleContainerPointer |
typedef ImageGridSamplerType::ImageSampleContainerType | ImageSampleContainerType |
typedef TImage | ImageType |
typedef TImage::PixelType | InputPixelType |
typedef Matrix< ScalarType, itkGetStaticConstMacro(ImageDimension), itkGetStaticConstMacro(ImageDimension) > | MatrixType |
typedef SmartPointer< Self > | Pointer |
typedef double | ScalarType |
typedef AdvancedImageMomentsCalculator< TImage > | Self |
typedef SpatialObjectType::ConstPointer | SpatialObjectConstPointer |
typedef SpatialObjectType::Pointer | SpatialObjectPointer |
typedef SpatialObject< itkGetStaticConstMacro(ImageDimension) > | SpatialObjectType |
typedef Object | Superclass |
typedef Vector< ScalarType, itkGetStaticConstMacro(ImageDimension) > | VectorType |
Static Public Member Functions | |
static Pointer | New () |
Protected Types | |
typedef itk::PlatformMultiThreader | ThreaderType |
typedef ThreaderType::WorkUnitInfo | ThreadInfoType |
typedef ImageType::RegionType | ThreadRegionType |
Protected Member Functions | |
AdvancedImageMomentsCalculator () | |
virtual void | InitializeThreadingParameters (void) |
itkAlignedTypedef (ITK_CACHE_LINE_ALIGNMENT, PaddedComputePerThreadStruct, AlignedComputePerThreadStruct) | |
itkPadStruct (ITK_CACHE_LINE_ALIGNMENT, ComputePerThreadStruct, PaddedComputePerThreadStruct) | |
void | LaunchComputeThreaderCallback (void) const |
void | PrintSelf (std::ostream &os, Indent indent) const override |
virtual void | ThreadedCompute (ThreadIdType threadID) |
~AdvancedImageMomentsCalculator () override | |
Static Protected Member Functions | |
static ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION | ComputeThreaderCallback (void *arg) |
Protected Attributes | |
bool | m_CenterOfGravityUsesLowerThreshold |
AlignedComputePerThreadStruct * | m_ComputePerThreadVariables |
ThreadIdType | m_ComputePerThreadVariablesSize |
InputPixelType | m_LowerThresholdForCenterGravity |
SizeValueType | m_NumberOfPixelsCounted |
SizeValueType | m_NumberOfSamplesForCenteredTransformInitialization |
ImageSampleContainerPointer | m_SampleContainer |
ThreaderType::Pointer | m_Threader |
MultiThreaderParameterType | m_ThreaderParameters |
bool | m_UseMultiThread |
Private Member Functions | |
AdvancedImageMomentsCalculator (const Self &) | |
void | DoPostProcessing () |
void | operator= (const Self &) |
typedef AffineTransformType::Pointer itk::AdvancedImageMomentsCalculator< TImage >::AffineTransformPointer |
Definition at line 112 of file itkAdvancedImageMomentsCalculator.h.
typedef AffineTransform< double, itkGetStaticConstMacro(ImageDimension) > itk::AdvancedImageMomentsCalculator< TImage >::AffineTransformType |
Affine transform for mapping to and from principal axis
Definition at line 111 of file itkAdvancedImageMomentsCalculator.h.
typedef itk::BinaryThresholdImageFilter< TImage, TImage > itk::AdvancedImageMomentsCalculator< TImage >::BinaryThresholdImageFilterType |
Definition at line 230 of file itkAdvancedImageMomentsCalculator.h.
typedef SmartPointer< const Self > itk::AdvancedImageMomentsCalculator< TImage >::ConstPointer |
Definition at line 73 of file itkAdvancedImageMomentsCalculator.h.
typedef ImageType::ConstPointer itk::AdvancedImageMomentsCalculator< TImage >::ImageConstPointer |
Definition at line 108 of file itkAdvancedImageMomentsCalculator.h.
typedef ImageGridSamplerType::Pointer itk::AdvancedImageMomentsCalculator< TImage >::ImageGridSamplerPointer |
Definition at line 223 of file itkAdvancedImageMomentsCalculator.h.
typedef itk::ImageGridSampler< ImageType > itk::AdvancedImageMomentsCalculator< TImage >::ImageGridSamplerType |
Definition at line 221 of file itkAdvancedImageMomentsCalculator.h.
typedef ImageType::Pointer itk::AdvancedImageMomentsCalculator< TImage >::ImagePointer |
Standard image type pointer within this class.
Definition at line 107 of file itkAdvancedImageMomentsCalculator.h.
typedef ImageSampleContainerType::Pointer itk::AdvancedImageMomentsCalculator< TImage >::ImageSampleContainerPointer |
Definition at line 226 of file itkAdvancedImageMomentsCalculator.h.
typedef ImageGridSamplerType::ImageSampleContainerType itk::AdvancedImageMomentsCalculator< TImage >::ImageSampleContainerType |
Definition at line 225 of file itkAdvancedImageMomentsCalculator.h.
typedef TImage itk::AdvancedImageMomentsCalculator< TImage >::ImageType |
Standard image type within this class.
Definition at line 104 of file itkAdvancedImageMomentsCalculator.h.
typedef TImage::PixelType itk::AdvancedImageMomentsCalculator< TImage >::InputPixelType |
Definition at line 231 of file itkAdvancedImageMomentsCalculator.h.
typedef Matrix< ScalarType, itkGetStaticConstMacro(ImageDimension), itkGetStaticConstMacro(ImageDimension) > itk::AdvancedImageMomentsCalculator< TImage >::MatrixType |
Standard matrix type within this class.
Definition at line 101 of file itkAdvancedImageMomentsCalculator.h.
typedef SmartPointer< Self > itk::AdvancedImageMomentsCalculator< TImage >::Pointer |
Definition at line 72 of file itkAdvancedImageMomentsCalculator.h.
typedef double itk::AdvancedImageMomentsCalculator< TImage >::ScalarType |
Standard scalar type within this class.
Definition at line 86 of file itkAdvancedImageMomentsCalculator.h.
typedef AdvancedImageMomentsCalculator< TImage > itk::AdvancedImageMomentsCalculator< TImage >::Self |
Standard class typedefs.
Definition at line 70 of file itkAdvancedImageMomentsCalculator.h.
typedef SpatialObjectType::ConstPointer itk::AdvancedImageMomentsCalculator< TImage >::SpatialObjectConstPointer |
Definition at line 96 of file itkAdvancedImageMomentsCalculator.h.
typedef SpatialObjectType::Pointer itk::AdvancedImageMomentsCalculator< TImage >::SpatialObjectPointer |
Spatial Object member types used within this class.
Definition at line 95 of file itkAdvancedImageMomentsCalculator.h.
typedef SpatialObject< itkGetStaticConstMacro(ImageDimension) > itk::AdvancedImageMomentsCalculator< TImage >::SpatialObjectType |
Spatial Object type within this class.
Definition at line 92 of file itkAdvancedImageMomentsCalculator.h.
typedef Object itk::AdvancedImageMomentsCalculator< TImage >::Superclass |
Definition at line 71 of file itkAdvancedImageMomentsCalculator.h.
|
protected |
Typedefs for multi-threading.
Definition at line 244 of file itkAdvancedImageMomentsCalculator.h.
|
protected |
Definition at line 245 of file itkAdvancedImageMomentsCalculator.h.
|
protected |
The type of region used for multithreading
Definition at line 287 of file itkAdvancedImageMomentsCalculator.h.
typedef Vector< ScalarType, itkGetStaticConstMacro(ImageDimension) > itk::AdvancedImageMomentsCalculator< TImage >::VectorType |
Standard vector type within this class.
Definition at line 89 of file itkAdvancedImageMomentsCalculator.h.
|
protected |
|
overrideprotected |
|
private |
|
virtual |
|
virtual |
void itk::AdvancedImageMomentsCalculator< TImage >::Compute | ( | ) |
Compute moments of a new or modified image. This method computes the moments of the image given as a parameter and stores them in the object. The values of these moments and related parameters can then be retrieved by using other methods of this object. The multi-threading implementation.
void itk::AdvancedImageMomentsCalculator< TImage >::ComputeSingleThreaded | ( | ) |
The main functions that performs the single thread computation.
|
staticprotected |
Compute threader callback function.
|
private |
Internal helper function. Does post processing at the end of ComputeSingleThreaded() and AfterThreadedCompute()
VectorType itk::AdvancedImageMomentsCalculator< TImage >::GetCenterOfGravity | ( | ) | const |
Return center of gravity, in physical coordinates. This method returns the center of gravity of the image whose moments were last computed by this object. The center of gravity is computed in physical coordinates.
MatrixType itk::AdvancedImageMomentsCalculator< TImage >::GetCentralMoments | ( | ) | const |
Return second central moments, in physical coordinates. This method returns the central second moments of the image whose moments were last computed by this object. The central moments are computed in physical coordinates.
|
virtual |
Run-time type information (and related methods).
VectorType itk::AdvancedImageMomentsCalculator< TImage >::GetFirstMoments | ( | ) | const |
Return first moments about origin, in index coordinates. This method returns the first moments around the origin of the image whose moments were last computed by this object. For simplicity, these moments are computed in index coordinates rather than physical coordinates.
AffineTransformPointer itk::AdvancedImageMomentsCalculator< TImage >::GetPhysicalAxesToPrincipalAxesTransform | ( | ) | const |
Get the affine transform from physical axes to principal axes This method returns an affine transform which transforms from the physical coordinate system to the principal axes coordinate system.
MatrixType itk::AdvancedImageMomentsCalculator< TImage >::GetPrincipalAxes | ( | ) | const |
Return principal axes, in physical coordinates. This method returns the principal axes of the image whose moments were last computed by this object. The moments are returned as an orthogonal matrix, each row of which corresponds to one principal moment; for example, the principal axis corresponding to the smallest principal moment is the vector m[0], where m is the value returned by this method. The matrix of principal axes is guaranteed to be a proper rotation; that is, to have determinant +1 and to preserve parity. (Unless you have foolishly made one or more of the spacing values negative; in that case, you get to figure out the consequences.) The moments are computed in physical coordinates.
AffineTransformPointer itk::AdvancedImageMomentsCalculator< TImage >::GetPrincipalAxesToPhysicalAxesTransform | ( | ) | const |
Get the affine transform from principal axes to physical axes This method returns an affine transform which transforms from the principal axes coordinate system to physical coordinates.
VectorType itk::AdvancedImageMomentsCalculator< TImage >::GetPrincipalMoments | ( | ) | const |
Return principal moments, in physical coordinates. This method returns the principal moments of the image whose moments were last computed by this object. The moments are returned as a vector, with the principal moments ordered from smallest to largest. The moments are computed in physical coordinates.
MatrixType itk::AdvancedImageMomentsCalculator< TImage >::GetSecondMoments | ( | ) | const |
Return second moments about origin, in index coordinates. This method returns the second moments around the origin of the image whose moments were last computed by this object. For simplicity, these moments are computed in index coordinates rather than physical coordinates.
ScalarType itk::AdvancedImageMomentsCalculator< TImage >::GetTotalMass | ( | ) | const |
Return the total mass (or zeroth moment) of an image. This method returns the sum of pixel intensities (also known as the zeroth moment or the total mass) of the image whose moments were last computed by this object.
|
protectedvirtual |
Initialize some multi-threading related parameters.
|
protected |
|
protected |
itk::AdvancedImageMomentsCalculator< TImage >::itkStaticConstMacro | ( | ImageDimension | , |
unsigned int | , | ||
TImage::ImageDimension | |||
) |
Extract the dimension of the image.
|
protected |
Launch MultiThread Compute.
|
static |
Method for creation through the object factory.
|
private |
|
overrideprotected |
|
virtual |
|
virtual |
|
inlinevirtual |
Set the input image.
Definition at line 115 of file itkAdvancedImageMomentsCalculator.h.
|
virtual |
|
virtual |
Set some parameters.
|
inline |
Set the number of threads.
Definition at line 212 of file itkAdvancedImageMomentsCalculator.h.
|
inlinevirtual |
Set the spatial object mask.
Definition at line 126 of file itkAdvancedImageMomentsCalculator.h.
|
inlineprotectedvirtual |
The threaded implementation of Compute().
|
protected |
Definition at line 291 of file itkAdvancedImageMomentsCalculator.h.
|
private |
Definition at line 306 of file itkAdvancedImageMomentsCalculator.h.
|
private |
Definition at line 307 of file itkAdvancedImageMomentsCalculator.h.
|
mutableprotected |
Definition at line 281 of file itkAdvancedImageMomentsCalculator.h.
|
mutableprotected |
Definition at line 282 of file itkAdvancedImageMomentsCalculator.h.
|
private |
Definition at line 311 of file itkAdvancedImageMomentsCalculator.h.
|
protected |
Definition at line 290 of file itkAdvancedImageMomentsCalculator.h.
|
private |
Definition at line 303 of file itkAdvancedImageMomentsCalculator.h.
|
private |
Definition at line 304 of file itkAdvancedImageMomentsCalculator.h.
|
private |
Definition at line 305 of file itkAdvancedImageMomentsCalculator.h.
|
protected |
Definition at line 284 of file itkAdvancedImageMomentsCalculator.h.
|
protected |
Definition at line 289 of file itkAdvancedImageMomentsCalculator.h.
|
private |
Definition at line 309 of file itkAdvancedImageMomentsCalculator.h.
|
private |
Definition at line 308 of file itkAdvancedImageMomentsCalculator.h.
|
protected |
Definition at line 292 of file itkAdvancedImageMomentsCalculator.h.
|
private |
Definition at line 312 of file itkAdvancedImageMomentsCalculator.h.
|
protected |
Definition at line 246 of file itkAdvancedImageMomentsCalculator.h.
|
mutableprotected |
Definition at line 265 of file itkAdvancedImageMomentsCalculator.h.
|
protected |
Definition at line 283 of file itkAdvancedImageMomentsCalculator.h.
|
private |
Definition at line 302 of file itkAdvancedImageMomentsCalculator.h.
Generated on 1667476801 for elastix by 1.9.4 |