Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions

cmtk::TypedArray Class Reference
[cmtkBase Library]

Generic Variable-Typed Data Array. More...

#include <cmtkTypedArray.h>

Inheritance diagram for cmtk::TypedArray:
Inheritance graph
[legend]

List of all members.

Public Types

typedef TypedArray Self
 This class.
typedef SmartPointer< SelfSmartPtr
 Smart pointer.
typedef SmartConstPointer< SelfSmartConstPtr
 Smart pointer to const.
typedef double(* FunctionTypeDouble )(const double)
 Function pointer type: double to double.
typedef float(* FunctionTypeFloat )(const float)
 Function pointer type: float to float.

Public Member Functions

virtual bool Get (Types::DataItem &, const size_t) const =0
 Get an item from the specified index in the data array.
virtual void GetSequence (Types::DataItem *const values, const size_t index, const size_t length) const =0
 Get a sequence of items from the array.
virtual void Set (const Types::DataItem, const size_t)=0
 Sets the specified array element.
virtual ScalarDataType GetType () const =0
 Return type of stored data.
virtual size_t GetItemSize () const =0
 Return the number of bytes per stored item.
virtual void * GetPaddingPtr () const =0
 Get the adress of the real value used for no data present.
virtual Types::DataItem GetPaddingValue () const =0
 Get the transfer representation of the value used for no data present.
virtual bool PaddingDataAt (const size_t index) const =0
 Test if there is NULL data at a particular location.
virtual Types::DataItemGetData () const =0
 Get complete aray of data values.
virtual void SetData (Types::DataItem *const data)=0
 Set all data from an Types::DataItem array.
virtual Self::SmartPtr Convert (const ScalarDataType dtype) const =0
 Convert to typed array of any given template type.
virtual void * ConvertSubArray (const ScalarDataType dtype, const size_t fromIdx, const size_t len) const =0
 Convert a sub-array to any given primitive data type.
virtual void ConvertSubArray (void *const destination, const ScalarDataType dtype, const size_t fromIdx, const size_t len) const =0
 Convert a sub-array to given primitive data type into existing array.
virtual void * ConvertArray (const ScalarDataType dtype) const
 Convert the array to any given data type.
virtual void ClearArray (const bool usePaddingData=false)=0
 Clear entire array.
virtual void ChangeEndianness ()=0
 Change endianness of data.
virtual void Rescale (const Types::DataItem scale=1, const Types::DataItem offset=0)=0
 Scale values in the array.
virtual void RescaleAndShift (const Types::DataItem scale=1, const Types::DataItem offset=0, const size_t shiftBits=0)=0
 Scale and shift values in the array.
virtual void RescaleToRange (const Types::DataItemRange &toRange)
 Scale values in the array to a given target range.
virtual void GammaCorrection (const Types::DataItem gamma)=0
 Apply gamma correction.
virtual void ApplyFunction (Self::FunctionTypeFloat f)
 Apply real function to data.
virtual void ApplyFunction (Self::FunctionTypeDouble f)
 Apply real function to data.
virtual void ApplyFunctionFloat (Self::FunctionTypeFloat f)=0
 Apply real function to data.
virtual void ApplyFunctionDouble (Self::FunctionTypeDouble f)=0
 Apply real function to data.
virtual void MakeAbsolute ()=0
 Convert all values to absolute values.
virtual void Rescale (const Types::DataItem scale, const Types::DataItem offset, const Types::DataItem truncLo, const Types::DataItem truncHi=CMTK_ITEM_MAX)=0
 Scale values in the array with truncation boundaries.
virtual void Threshold (const Types::DataItemRange &range)=0
 Threshold data.
virtual void ThresholdToPadding (const Types::DataItemRange &range)=0
 Threshold data.
virtual void PruneHistogram (const bool pruneHi, const bool pruneLo, const size_t numberOfBinsTarget, const size_t numberOfBinsInternal=1024)
 Prune histogram to trim noise.
virtual void Binarize (const Types::DataItem threshold=0)=0
 Binarize array values with given threshold.
Self::SmartPtr Clone () const
 Clone an existing TypedArray.
 TypedArray ()
 Default constructor.
virtual ~TypedArray ()
 Destructor.
virtual void FreeData ()=0
 Free data pointer.
void ReleaseDataPointer ()
 Release pointer to data array.
size_t GetDataSize () const
 Return the number of array elements.
size_t GetDataSizeBytes () const
 Return the array size in bytes.
virtual void * GetDataPtr (const size_t offset=0)=0
 Return address of the data array.
virtual const void * GetDataPtr (const size_t offset=0) const =0
 Return address of the data array.
virtual Types::DataItemGetSubArray (Types::DataItem *const, const size_t, const size_t, const Types::DataItem=0) const =0
 Get part of the stored array.
virtual Types::DataItemGetSubArray (const size_t, const size_t, const Types::DataItem=0) const =0
 Allocate memory and get part of the stored array.
bool GetPaddingFlag () const
 Return the flag for padding data.
void ClearPaddingFlag ()
 Clear padding flag. This effectively turns padded pixels into actual data.
virtual void SetPaddingAt (const size_t)=0
 Set the specified array element to no data present.
virtual void SetPaddingValue (const Types::DataItem paddingData)=0
 Select the value to mark non-existent data.
virtual void SetPaddingPtr (const void *paddingData)=0
 Select the value to mark non-existent data.
virtual void ReplacePaddingData (const Types::DataItem value=0)=0
 Replace Padding data (padding) with given value.
virtual bool IsPaddingAt (const size_t index) const =0
 Check for padding data at given location.
virtual bool IsPaddingOrZeroAt (const size_t index) const =0
 Check for padding data or zero at given location.
virtual const Types::DataItemRange GetRange () const =0
 Calculate and return minimum and maximum data value.
virtual double GetEntropy (const bool fractional=CMTK_HISTOGRAM_DISCRETE, const int numberOfBins=128) const =0
 Calculate entropy of distribution of values in this array.
virtual double GetEntropy (Histogram< unsigned int > &histogram) const =0
 Calculate entropy of values in this array using existing histogram.
virtual double GetEntropy (Histogram< double > &histogram, const bool fractional=CMTK_HISTOGRAM_DISCRETE) const =0
 Calculate entropy of values in this array using existing histogram.
virtual double GetEntropy (Histogram< double > &histogram, const double *kernel, const size_t kernelRadius) const =0
 Calculate entropy of values in this array using existing histogram and kernel for Parzen windowing.
virtual size_t GetStatistics (Types::DataItem &mean, Types::DataItem &variance) const =0
 Calculate statistics.
virtual Types::DataItem GetPercentile (const Types::DataItem percentile, const size_t nBins=256) const
 Compute approximate percentile value from histogram.
virtual std::vector
< Types::DataItem
GetPercentileList (const std::vector< Types::DataItem > &percentileList, const size_t nBins=256) const
 Compute list of approximate percentile values from histogram.
virtual Histogram< unsigned
int >::SmartPtr 
GetHistogram (const unsigned int numberOfBins, const bool centeredBins=false) const =0
 Get data histogram.
virtual void BlockSet (const Types::DataItem value, const size_t fromOffset, const size_t toOffset)=0
 Set data block to constant value.
virtual void Fill (const Types::DataItem value)
 Fill entire array with one value.
virtual void BlockCopy (Self &target, const size_t toOffset, const size_t fromOffset, const size_t blockLength) const
 Copy data block to other array.
virtual void BlockSwap (const size_t fromOffset, const size_t toOffset, const size_t blockLength)
 Exchange two data blocks.
virtual void BlockReverse (const size_t fromOffset, const size_t blockLength)
 Revert order of items in a given range.
virtual void ApplyFunctionObject (const TypedArrayFunction &f)=0
 Apply function class to the values of this array.

Static Public Member Functions

static Self::SmartPtr Create (const ScalarDataType dtype, void *const data, const size_t size, const bool freeArray=true, const bool paddingFlag=false, const void *paddingData=NULL)
 Create typed data array from existing array of values.
static Self::SmartPtr Create (const ScalarDataType dtype, const size_t size)
 Create typed data array, allocating new memory for the items array.
static void Free (void *const data)
 Free data allocated by this object.

Protected Member Functions

virtual void Alloc (const size_t datasize)=0
 Allocate array for the given number of elements.
virtual SelfCloneVirtual () const =0
 Virtual clone function: only to be calle by Clone().

Protected Attributes

ScalarDataType m_DataType
 Scalar data type ID.
bool FreeArray
 If not zero, the object should free the allocated array.
size_t DataSize
 The size of the data array, i.e. the number of items allocated.
bool PaddingFlag
 If true, PaddingFlag indicates there are items with no data present.

Private Member Functions

 cmtkGetSetMacro (DataClass, DataClass)
 Parameter defining the primitive data class.

Detailed Description

Generic Variable-Typed Data Array.

This class delivers the common interface of all variable-typed data arrays.

Author:
Torsten Rohlfing

Definition at line 76 of file cmtkTypedArray.h.


Member Typedef Documentation

typedef double(* cmtk::TypedArray::FunctionTypeDouble)(const double)

Function pointer type: double to double.

Definition at line 232 of file cmtkTypedArray.h.

typedef float(* cmtk::TypedArray::FunctionTypeFloat)(const float)

Function pointer type: float to float.

Definition at line 235 of file cmtkTypedArray.h.

This class.

Reimplemented in cmtk::TemplateArray< T >.

Definition at line 83 of file cmtkTypedArray.h.

Smart pointer to const.

Definition at line 89 of file cmtkTypedArray.h.

Smart pointer.

Reimplemented in cmtk::TemplateArray< T >.

Definition at line 86 of file cmtkTypedArray.h.


Constructor & Destructor Documentation

cmtk::TypedArray::TypedArray (  ) [inline]

Default constructor.

Definition at line 312 of file cmtkTypedArray.h.

References cmtk::DATACLASS_GREY.

virtual cmtk::TypedArray::~TypedArray (  ) [inline, virtual]

Destructor.

Just has to be declared virtual.

Definition at line 323 of file cmtkTypedArray.h.


Member Function Documentation

virtual void cmtk::TypedArray::Alloc ( const size_t  datasize ) [protected, pure virtual]

Allocate array for the given number of elements.

Implemented in cmtk::TemplateArray< T >.

virtual void cmtk::TypedArray::ApplyFunction ( Self::FunctionTypeFloat  f ) [inline, virtual]

Apply real function to data.

Definition at line 238 of file cmtkTypedArray.h.

virtual void cmtk::TypedArray::ApplyFunction ( Self::FunctionTypeDouble  f ) [inline, virtual]

Apply real function to data.

Definition at line 244 of file cmtkTypedArray.h.

virtual void cmtk::TypedArray::ApplyFunctionDouble ( Self::FunctionTypeDouble  f ) [pure virtual]

Apply real function to data.

Implemented in cmtk::TemplateArray< T >.

virtual void cmtk::TypedArray::ApplyFunctionFloat ( Self::FunctionTypeFloat  f ) [pure virtual]

Apply real function to data.

Implemented in cmtk::TemplateArray< T >.

virtual void cmtk::TypedArray::ApplyFunctionObject ( const TypedArrayFunction f ) [pure virtual]

Apply function class to the values of this array.

Implemented in cmtk::TemplateArray< T >.

virtual void cmtk::TypedArray::Binarize ( const Types::DataItem  threshold = 0 ) [pure virtual]

Binarize array values with given threshold.

All values greater than threshold (default: zero) are set to one, all values smaller or equal are set to zero.

Implemented in cmtk::TemplateArray< T >.

virtual void cmtk::TypedArray::BlockCopy ( Self target,
const size_t  toOffset,
const size_t  fromOffset,
const size_t  blockLength 
) const [inline, virtual]

Copy data block to other array.

This is really just a convenience wrapper for ConvertSubArray().

Definition at line 476 of file cmtkTypedArray.h.

References GetDataPtr(), and GetType().

Referenced by cmtk::DataGrid::GetCroppedData(), cmtk::DataGrid::GetDataMirrored(), and cmtk::DataGrid::SetOrthoSlice().

virtual void cmtk::TypedArray::BlockSet ( const Types::DataItem  value,
const size_t  fromOffset,
const size_t  toOffset 
) [pure virtual]

Set data block to constant value.

Implemented in cmtk::TemplateArray< T >.

virtual void cmtk::TypedArray::ChangeEndianness (  ) [pure virtual]

Change endianness of data.

Implemented in cmtk::TemplateArray< T >.

virtual void cmtk::TypedArray::ClearArray ( const bool  usePaddingData = false ) [pure virtual]

Clear entire array.

This method is implemented by derived template classes for better efficiency.

Parameters:
usePaddingDataIf this flag is set, then the array will be filled with the PaddingData value, if one exists. Otherwise, the array will be filled with the respective data type's zero value.

Implemented in cmtk::TemplateArray< T >.

void cmtk::TypedArray::ClearPaddingFlag (  ) [inline]

Clear padding flag. This effectively turns padded pixels into actual data.

Definition at line 378 of file cmtkTypedArray.h.

Self::SmartPtr cmtk::TypedArray::Clone (  ) const [inline]

Clone an existing TypedArray.

Memory is allocated and the source array copied item by item. Data is read by the source object's Get method and stored by the destination object's Set method.

Definition at line 306 of file cmtkTypedArray.h.

Referenced by cmtk::DataGridMorphologicalOperators::EliminatePaddingVoting().

virtual Self* cmtk::TypedArray::CloneVirtual (  ) const [protected, pure virtual]

Virtual clone function: only to be calle by Clone().

Implemented in cmtk::TemplateArray< T >.

cmtk::TypedArray::cmtkGetSetMacro ( DataClass  ,
DataClass   
) [private]

Parameter defining the primitive data class.

virtual Self::SmartPtr cmtk::TypedArray::Convert ( const ScalarDataType  dtype ) const [pure virtual]

Convert to typed array of any given template type.

Implemented in cmtk::TemplateArray< T >.

Referenced by cmtk::VoxelMatchingMetric_Type< T, DT >::ImageData::Init().

virtual void* cmtk::TypedArray::ConvertArray ( const ScalarDataType  dtype ) const [inline, virtual]

Convert the array to any given data type.

This function uses ConvertSubArray to convert the complete array.

Returns:
Newly allocated memory of given type. Caller is responsible for freeing this memory with a call to Memory::DeleteArray().
See also:
ConvertSubArray

Definition at line 191 of file cmtkTypedArray.h.

virtual void* cmtk::TypedArray::ConvertSubArray ( const ScalarDataType  dtype,
const size_t  fromIdx,
const size_t  len 
) const [pure virtual]

Convert a sub-array to any given primitive data type.

Returns:
Newly allocated memory of given type. Caller is responsible for freeing this memory with a call to Memory::DeleteArray().

Implemented in cmtk::TemplateArray< T >.

Referenced by cmtk::ScalarImage::ScalarImage().

virtual void cmtk::TypedArray::ConvertSubArray ( void *const   destination,
const ScalarDataType  dtype,
const size_t  fromIdx,
const size_t  len 
) const [pure virtual]

Convert a sub-array to given primitive data type into existing array.

Implemented in cmtk::TemplateArray< T >.

virtual void cmtk::TypedArray::Fill ( const Types::DataItem  value ) [inline, virtual]

Fill entire array with one value.

Definition at line 468 of file cmtkTypedArray.h.

static void cmtk::TypedArray::Free ( void *const   data ) [inline, static]

Free data allocated by this object.

Definition at line 116 of file cmtkTypedArray.h.

virtual void cmtk::TypedArray::FreeData (  ) [pure virtual]

Free data pointer.

Derived classes may have to overload this method to take care of other memory management libraries.

Implemented in cmtk::TemplateArray< T >.

virtual void cmtk::TypedArray::GammaCorrection ( const Types::DataItem  gamma ) [pure virtual]

Apply gamma correction.

Parameters:
gammaThe gamma correction coefficient.

Implemented in cmtk::TemplateArray< T >.

virtual bool cmtk::TypedArray::Get ( Types::DataItem ,
const   size_t 
) const [pure virtual]

Get an item from the specified index in the data array.

If there is no valid data present at the given index, zero is returned and the resulting item is zero, too. This can only happen if PaddingFlag is not zero.

Implemented in cmtk::TemplateArray< T >.

Referenced by cmtk::ImageOperationReplace::Apply(), cmtk::ScalarImage::ApplyBinaryMask(), cmtk::DataGrid::AutoCrop(), cmtk::UniformDistanceMap< TDistanceDataType >::BuildDistanceMap(), cmtk::FilterVolume::ComputeNLWithinWindow(), cmtk::DataGrid::ComputeProjection(), cmtk::GroupwiseRegistrationFunctionalBase::CopyTemplateData(), cmtk::FilterVolume::CoupeFilter(), cmtk::FilterVolume::GaussianFilter(), cmtk::TypedArraySimilarity::GetCorrelationRatio(), cmtk::FilterVolume::GetCoupeBlock(), cmtk::TypedArraySimilarity::GetCrossCorrelation(), cmtk::Image::GetDataAt(), cmtk::DataGridFilter::GetDataMedianFiltered(), cmtk::DataGridFilter::GetDataSobelFiltered(), cmtk::TypedArraySimilarity::GetDifferenceArray(), cmtk::DataGrid::GetDownsampledAndAveraged(), cmtk::HypothesisTests::GetGeneticCovariance(), cmtk::HypothesisTests::GetHeritability(), cmtk::TypedArraySimilarity::GetMinusMeanSquaredDifference(), cmtk::TypedArraySimilarity::GetMutualInformation(), cmtk::TypedArraySimilarity::GetNormalizedMutualInformation(), cmtk::HypothesisTests::GetOneSampleTTest(), cmtk::TypedArraySimilarity::GetOptimalScale(), cmtk::HypothesisTests::GetPairedCorrelation(), cmtk::HypothesisTests::GetPairedTwoTailedTTest(), cmtk::ScalarImage::GetPixelAtCubic(), cmtk::ScalarImageSimilarity::GetRegionalMutualInformation(), cmtk::Volume::GetTrilinear(), cmtk::HypothesisTests::GetUnpairedTwoTailedTTest(), cmtk::HypothesisTests::GetZScores(), cmtk::VoxelMatchingMetric_Type< T, DT >::ImageData::Init(), cmtk::operator-(), cmtk::ScalarImage::operator-=(), cmtk::ReformatVolume::ReformatMasked(), cmtk::FilterVolume::RohlfingFilter(), cmtk::UniformVolumeInterpolatorBase::SetVolume(), cmtk::FilterVolume::StudholmeFilter(), cmtk::DataGrid::TrilinearInterpolation(), cmtk::TypedArrayNoiseEstimatorNaiveGaussian::TypedArrayNoiseEstimatorNaiveGaussian(), cmtk::SplineWarpMultiChannelRegistrationFunctional< TMetricFunctional >::UpdateTransformationFixedControlPoints(), cmtk::PGM::Write16bit(), and cmtk::GroupwiseRegistrationOutput::WriteAverageImage().

virtual Types::DataItem* cmtk::TypedArray::GetData (  ) const [pure virtual]
virtual void* cmtk::TypedArray::GetDataPtr ( const size_t  offset = 0 ) [pure virtual]
virtual const void* cmtk::TypedArray::GetDataPtr ( const size_t  offset = 0 ) const [pure virtual]

Return address of the data array.

Returns:
A pointer to the real data array.

Implemented in cmtk::TemplateArray< T >.

size_t cmtk::TypedArray::GetDataSize (  ) const [inline]
size_t cmtk::TypedArray::GetDataSizeBytes (  ) const [inline]

Return the array size in bytes.

Definition at line 346 of file cmtkTypedArray.h.

virtual double cmtk::TypedArray::GetEntropy ( Histogram< double > &  histogram,
const bool  fractional = CMTK_HISTOGRAM_DISCRETE 
) const [pure virtual]

Calculate entropy of values in this array using existing histogram.

See also:
TypedArray::GetEntropy

Implemented in cmtk::TemplateArray< T >.

virtual double cmtk::TypedArray::GetEntropy ( const bool  fractional = CMTK_HISTOGRAM_DISCRETE,
const int  numberOfBins = 128 
) const [pure virtual]

Calculate entropy of distribution of values in this array.

Implemented in cmtk::TemplateArray< T >.

Referenced by cmtk::VolumeInjectionReconstruction::SetupHistogramKernels().

virtual double cmtk::TypedArray::GetEntropy ( Histogram< unsigned int > &  histogram ) const [pure virtual]

Calculate entropy of values in this array using existing histogram.

By using an already existing histogram, this function ensures that the same numbers and sizes of bins are used for repeated calls of this function, even when the actual data in this array has changed. On the other hand, there is of course a risk that the data may have changed in such a way that the old histogram arrangement does not fit it anymore.

In the process of entropy computation, the histogram is also filled with the data from this array. It is therefore available for subsequent operations after returning from this function.

Implemented in cmtk::TemplateArray< T >.

virtual double cmtk::TypedArray::GetEntropy ( Histogram< double > &  histogram,
const double *  kernel,
const size_t  kernelRadius 
) const [pure virtual]

Calculate entropy of values in this array using existing histogram and kernel for Parzen windowing.

See also:
TypedArray::GetEntropy

Implemented in cmtk::TemplateArray< T >.

virtual Histogram<unsigned int>::SmartPtr cmtk::TypedArray::GetHistogram ( const unsigned int  numberOfBins,
const bool  centeredBins = false 
) const [pure virtual]
virtual size_t cmtk::TypedArray::GetItemSize (  ) const [pure virtual]
bool cmtk::TypedArray::GetPaddingFlag (  ) const [inline]

Return the flag for padding data.

Returns:
If return value is zero, all data stored in the array is valid. A non-zero value indicates, that there are locations with no data present.

Definition at line 375 of file cmtkTypedArray.h.

Referenced by cmtk::Colormap::Apply(), cmtk::DataGridMorphologicalOperators::EliminatePaddingVoting(), cmtk::ImageToImageRGB::Execute(), cmtk::DataGrid::ExtractSliceVirtual(), cmtk::DataGrid::GetOrthoSlice(), cmtk::DataGrid::GetReoriented(), cmtk::VoxelMatchingMetric_Type< T, DT >::ImageData::Init(), cmtk::UniformVolume::Resample(), and cmtk::ScalarImage::ScalarImage().

virtual void* cmtk::TypedArray::GetPaddingPtr (  ) const [pure virtual]

Get the adress of the real value used for no data present.

Implemented in cmtk::TemplateArray< T >.

Referenced by cmtk::Colormap::Apply(), and cmtk::ScalarImage::ScalarImage().

virtual Types::DataItem cmtk::TypedArray::GetPaddingValue (  ) const [pure virtual]
virtual const Types::DataItemRange cmtk::TypedArray::GetRange (  ) const [pure virtual]
virtual void cmtk::TypedArray::GetSequence ( Types::DataItem *const   values,
const size_t  index,
const size_t  length 
) const [pure virtual]

Get a sequence of items from the array.

Parameters:
valuesThis must point to an allocated array of at least as many Types::DataItem objects as given in the "length" parameter.
indexThe index of the item to retrieve. Valid values are in the range [0..Datasize()-1].
lengthNumber of consecutive values to get.

Implemented in cmtk::TemplateArray< T >.

virtual size_t cmtk::TypedArray::GetStatistics ( Types::DataItem mean,
Types::DataItem variance 
) const [pure virtual]

Calculate statistics.

Results will be both zero if there is not data in the array.

Returns:
The number of valid (i.e., non-padding) values that constitute the given results.

Implemented in cmtk::TemplateArray< T >.

Referenced by cmtk::TypedArraySimilarity::GetCorrelationRatio(), cmtk::TypedArraySimilarity::GetCrossCorrelation(), and cmtk::QtWindowLevelControls::slotSetStudy().

virtual Types::DataItem* cmtk::TypedArray::GetSubArray ( Types::DataItem const,
const   size_t,
const   size_t,
const Types::DataItem  = 0 
) const [pure virtual]

Get part of the stored array.

Returns:
A pointer to the buffer given is returned.

Implemented in cmtk::TemplateArray< T >.

virtual Types::DataItem* cmtk::TypedArray::GetSubArray ( const   size_t,
const   size_t,
const Types::DataItem  = 0 
) const [pure virtual]

Allocate memory and get part of the stored array.

Returns:
A pointer to the newly allocated buffer is returned.

Implemented in cmtk::TemplateArray< T >.

virtual ScalarDataType cmtk::TypedArray::GetType (  ) const [pure virtual]
virtual bool cmtk::TypedArray::IsPaddingAt ( const size_t  index ) const [pure virtual]

Check for padding data at given location.

Implemented in cmtk::TemplateArray< T >.

virtual bool cmtk::TypedArray::IsPaddingOrZeroAt ( const size_t  index ) const [pure virtual]

Check for padding data or zero at given location.

Implemented in cmtk::TemplateArray< T >.

Referenced by cmtk::ImageOperationApplyMask::Apply().

virtual void cmtk::TypedArray::MakeAbsolute (  ) [pure virtual]

Convert all values to absolute values.

Implemented in cmtk::TemplateArray< T >.

virtual bool cmtk::TypedArray::PaddingDataAt ( const size_t  index ) const [pure virtual]

Test if there is NULL data at a particular location.

Implemented in cmtk::TemplateArray< T >.

Referenced by cmtk::DataGridMorphologicalOperators::EliminatePaddingVoting(), and cmtk::ImageToImageRGB::MarkPaddingData().

void cmtk::TypedArray::ReleaseDataPointer (  ) [inline]

Release pointer to data array.

The pointer must remain valid until object is destructed itself.

Definition at line 334 of file cmtkTypedArray.h.

virtual void cmtk::TypedArray::ReplacePaddingData ( const Types::DataItem  value = 0 ) [pure virtual]

Replace Padding data (padding) with given value.

Implemented in cmtk::TemplateArray< T >.

Referenced by cmtk::ImageOperationReplace::Apply().

virtual void cmtk::TypedArray::Rescale ( const Types::DataItem  scale,
const Types::DataItem  offset,
const Types::DataItem  truncLo,
const Types::DataItem  truncHi = CMTK_ITEM_MAX 
) [pure virtual]

Scale values in the array with truncation boundaries.

A call to this member function will perform an in-place rescaling of the values in the array with value range truncation. Truncation takes place after the scaling itself, i.e., the truncation boundaries refer to the already scaled values.

Parameters:
scaleThe original data value is multiplied by the parameter first.
offsetThis value is added to the original data value after multiplying it by the scale parameter.
truncLoLower truncation boundary. Scaled items below this threshold will be set to equal its value.
truncHiUpper truncation boundary. Scaled items above this threshold will be set to equal its value.

Implemented in cmtk::TemplateArray< T >.

virtual void cmtk::TypedArray::Rescale ( const Types::DataItem  scale = 1,
const Types::DataItem  offset = 0 
) [pure virtual]

Scale values in the array.

A call to this member function will perform an in-place rescaling of the values in the array.

Parameters:
scaleThe original data value is multiplied by the parameter first.
offsetThis value is added to the original data value after multiplying it by the scale parameter.

Implemented in cmtk::TemplateArray< T >.

virtual void cmtk::TypedArray::RescaleAndShift ( const Types::DataItem  scale = 1,
const Types::DataItem  offset = 0,
const size_t  shiftBits = 0 
) [pure virtual]

Scale and shift values in the array.

Implemented in cmtk::TemplateArray< T >.

virtual void cmtk::TypedArray::Set ( const Types::DataItem  ,
const   size_t 
) [pure virtual]
virtual void cmtk::TypedArray::SetData ( Types::DataItem *const   data ) [pure virtual]

Set all data from an Types::DataItem array.

This function sets all values stored in the present array from a memory region with Types::DataItem values.

Parameters:
dataPointer to an array of Types::DataItem values. Control over the source array is not taken by this object. If it is on the heap, then the calling routine remains responsible for de-allocating the array afterwards.

Implemented in cmtk::TemplateArray< T >.

virtual void cmtk::TypedArray::SetPaddingAt ( const   size_t ) [pure virtual]

Set the specified array element to no data present.

Implemented in cmtk::TemplateArray< T >.

Referenced by cmtk::ScalarImage::InterpolateFrom(), and cmtk::ScalarImage::operator-=().

virtual void cmtk::TypedArray::SetPaddingPtr ( const void *  paddingData ) [pure virtual]

Select the value to mark non-existent data.

Implemented in cmtk::TemplateArray< T >.

virtual void cmtk::TypedArray::SetPaddingValue ( const Types::DataItem  paddingData ) [pure virtual]

Select the value to mark non-existent data.

Implemented in cmtk::TemplateArray< T >.

Referenced by cmtk::DataGrid::GetReoriented().

virtual void cmtk::TypedArray::Threshold ( const Types::DataItemRange range ) [pure virtual]

Threshold data.

All values above upper threshold are set to upper thrershold. All values below lower threshold are set to lower threshold.

Implemented in cmtk::TemplateArray< T >.

virtual void cmtk::TypedArray::ThresholdToPadding ( const Types::DataItemRange range ) [pure virtual]

Threshold data.

All values outside the threshold range are set to the Padding (padding) value.

Implemented in cmtk::TemplateArray< T >.


Member Data Documentation

size_t cmtk::TypedArray::DataSize [protected]

The size of the data array, i.e. the number of items allocated.

Definition at line 509 of file cmtkTypedArray.h.

bool cmtk::TypedArray::FreeArray [protected]

If not zero, the object should free the allocated array.

Definition at line 506 of file cmtkTypedArray.h.

Scalar data type ID.

This field is not yet actually used anywhere. It merely serves a debugging purpose since it allows easy identification of the type of this array from inspecting its data.

Definition at line 503 of file cmtkTypedArray.h.

If true, PaddingFlag indicates there are items with no data present.

Definition at line 513 of file cmtkTypedArray.h.

Referenced by cmtk::TemplateArray< T >::CloneVirtual().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines