Generic Variable-Typed Data Array. More...
#include <cmtkTypedArray.h>
Public Types | |
typedef TypedArray | Self |
This class. | |
typedef SmartPointer< Self > | SmartPtr |
Smart pointer. | |
typedef SmartConstPointer< Self > | SmartConstPtr |
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::DataItem * | GetData () 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::DataItem * | GetSubArray (Types::DataItem *const, const size_t, const size_t, const Types::DataItem=0) const =0 |
Get part of the stored array. | |
virtual Types::DataItem * | GetSubArray (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 Self * | CloneVirtual () 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. |
Generic Variable-Typed Data Array.
This class delivers the common interface of all variable-typed data arrays.
Definition at line 76 of file cmtkTypedArray.h.
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.
typedef TypedArray cmtk::TypedArray::Self |
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.
typedef SmartPointer<Self> cmtk::TypedArray::SmartPtr |
Smart pointer.
Reimplemented in cmtk::TemplateArray< T >.
Definition at line 86 of file cmtkTypedArray.h.
cmtk::TypedArray::TypedArray | ( | ) | [inline] |
Default constructor.
Definition at line 312 of file cmtkTypedArray.h.
References cmtk::DATACLASS_GREY.
virtual cmtk::TypedArray::~TypedArray | ( | ) | [inline, virtual] |
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.
usePaddingData | If 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 >.
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.
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.
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.
gamma | The 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] |
Get complete aray of data values.
The calling routine is responsible for de-allocating the returned array by calling 'free' after use.
Implemented in cmtk::TemplateArray< T >.
Referenced by cmtk::ImageOperationApplyMask::Apply(), cmtk::GroupwiseRegistrationFunctionalBase::CopyTemplateData(), cmtk::DataGridMorphologicalOperators::EliminatePaddingVoting(), cmtk::DataGridFilter::GetDataMedianFiltered(), cmtk::DataGridFilter::GetDataSobelFiltered(), cmtk::Study::ReadVolume(), cmtk::Study::UpdateFromVolume(), cmtk::SplineWarpMultiChannelRegistrationFunctional< TMetricFunctional >::UpdateTransformationFixedControlPoints(), cmtk::VolumeInjectionReconstruction::VolumeInjectionReconstruction(), cmtk::VolumeFromFile::WriteAnalyzeHdr(), cmtk::GroupwiseRegistrationOutput::WriteAverageImage(), and cmtk::VolumeFromFile::WriteNifti().
virtual void* cmtk::TypedArray::GetDataPtr | ( | const size_t | offset = 0 ) |
[pure virtual] |
Return address of the data array.
Implemented in cmtk::TemplateArray< T >.
Referenced by cmtk::Colormap::Apply(), BlockCopy(), cmtk::DataGrid::ExtractSliceVirtual(), cmtk::DataGrid::GetOrthoSlice(), cmtk::DataGrid::GetReoriented(), cmtk::ScalarImageIO::WriteAnalyze(), cmtk::VolumeFromFile::WriteAnalyzeHdr(), cmtk::VolumeFromFile::WriteMetaImage(), and cmtk::VolumeFromFile::WriteNifti().
virtual const void* cmtk::TypedArray::GetDataPtr | ( | const size_t | offset = 0 ) |
const [pure virtual] |
Return address of the data array.
Implemented in cmtk::TemplateArray< T >.
size_t cmtk::TypedArray::GetDataSize | ( | ) | const [inline] |
Return the number of array elements.
Definition at line 342 of file cmtkTypedArray.h.
Referenced by cmtk::VoxelMatchingMetric_Type< T, DT >::ImageData::AllocDataArray(), cmtk::Colormap::Apply(), cmtk::ImageOperationReplace::Apply(), cmtk::TypedArraySimilarity::CheckArrayDimensions(), cmtk::GroupwiseRegistrationFunctionalBase::CopyTemplateData(), cmtk::FilterVolume::CoupeFilter(), cmtk::TypedArraySimilarityMemory::CreateHistogram(), cmtk::FilterVolume::GaussianFilter(), cmtk::TypedArraySimilarity::GetCorrelationRatio(), cmtk::TypedArraySimilarity::GetCrossCorrelation(), cmtk::DataGridFilter::GetDataMedianFiltered(), cmtk::DataGrid::GetDataMirrored(), cmtk::DataGridFilter::GetDataSobelFiltered(), cmtk::TypedArraySimilarity::GetDifferenceArray(), cmtk::TypedArraySimilarity::GetMinusMeanSquaredDifference(), cmtk::TypedArraySimilarity::GetMutualInformation(), cmtk::TypedArraySimilarity::GetNormalizedMutualInformation(), cmtk::TypedArraySimilarity::GetOptimalScale(), cmtk::FilterVolume::RohlfingFilter(), cmtk::UniformVolumeInterpolatorBase::SetVolume(), cmtk::FilterVolume::StudholmeFilter(), cmtk::TypedArrayNoiseEstimatorNaiveGaussian::TypedArrayNoiseEstimatorNaiveGaussian(), cmtk::ImageSymmetryPlaneCommandLineBase::WriteAligned(), cmtk::ScalarImageIO::WriteAnalyze(), cmtk::VolumeFromFile::WriteAnalyzeHdr(), cmtk::VolumeFromFile::WriteMetaImage(), and cmtk::VolumeFromFile::WriteNifti().
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.
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.
Implemented in cmtk::TemplateArray< T >.
virtual Histogram<unsigned int>::SmartPtr cmtk::TypedArray::GetHistogram | ( | const unsigned int | numberOfBins, |
const bool | centeredBins = false |
||
) | const [pure virtual] |
Get data histogram.
numberOfBins | Number of histogram bins |
centeredBins | Flag for bins centered around the samples |
Implemented in cmtk::TemplateArray< T >.
Referenced by cmtk::TypedArrayFunctionHistogramEqualization::TypedArrayFunctionHistogramEqualization(), cmtk::TypedArrayFunctionHistogramMatching::TypedArrayFunctionHistogramMatching(), cmtk::TypedArrayNoiseEstimatorBrummer::TypedArrayNoiseEstimatorBrummer(), cmtk::TypedArrayNoiseEstimatorMaximumLikelihood::TypedArrayNoiseEstimatorMaximumLikelihood(), and cmtk::TypedArrayNoiseEstimatorNaiveGaussian::TypedArrayNoiseEstimatorNaiveGaussian().
virtual size_t cmtk::TypedArray::GetItemSize | ( | ) | const [pure virtual] |
Return the number of bytes per stored item.
Implemented in cmtk::TemplateArray< T >.
Referenced by cmtk::DataGrid::ExtractSliceVirtual(), cmtk::DataGrid::GetOrthoSlice(), cmtk::DataGrid::GetReoriented(), cmtk::ScalarImageIO::WriteAnalyze(), cmtk::VolumeFromFile::WriteAnalyzeHdr(), cmtk::VolumeFromFile::WriteMetaImage(), and cmtk::VolumeFromFile::WriteNifti().
bool cmtk::TypedArray::GetPaddingFlag | ( | ) | const [inline] |
Return the flag for padding data.
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] |
Get the transfer representation of the value used for no data present.
Implemented in cmtk::TemplateArray< T >.
Referenced by cmtk::DataGridMorphologicalOperators::EliminatePaddingVoting(), cmtk::DataGrid::ExtractSliceVirtual(), cmtk::DataGrid::GetOrthoSlice(), cmtk::DataGrid::GetReoriented(), cmtk::VoxelMatchingMetric_Type< T, DT >::ImageData::Init(), and cmtk::UniformVolume::Resample().
virtual const Types::DataItemRange cmtk::TypedArray::GetRange | ( | ) | const [pure virtual] |
Calculate and return minimum and maximum data value.
Implemented in cmtk::TemplateArray< T >.
Referenced by cmtk::TypedArraySimilarity::GetCorrelationRatio(), cmtk::TypedArraySimilarity::GetMutualInformation(), cmtk::TypedArraySimilarity::GetNormalizedMutualInformation(), cmtk::TypedArraySimilarity::GetPeakSignalToNoiseRatio(), cmtk::TypedArraySimilarityMemory::GetRangeX(), cmtk::TypedArraySimilarityMemory::GetRangeY(), cmtk::VolumeIO::Read(), cmtk::Study::ReadVolume(), cmtk::FilterVolume::RohlfingFilter(), cmtk::VolumeInjectionReconstruction::SetupHistogramKernels(), cmtk::FilterVolume::StudholmeFilter(), cmtk::TypedArrayFunctionHistogramEqualization::TypedArrayFunctionHistogramEqualization(), cmtk::Study::UpdateFromVolume(), cmtk::ImageSymmetryPlaneCommandLineBase::WriteAligned(), cmtk::ScalarImageIO::WriteAnalyze(), cmtk::VolumeFromFile::WriteAnalyzeHdr(), and cmtk::VolumeFromFile::WriteNifti().
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.
values | This must point to an allocated array of at least as many Types::DataItem objects as given in the "length" parameter. |
index | The index of the item to retrieve. Valid values are in the range [0..Datasize()-1]. |
length | Number 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.
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.
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.
Implemented in cmtk::TemplateArray< T >.
virtual ScalarDataType cmtk::TypedArray::GetType | ( | ) | const [pure virtual] |
Return type of stored data.
Implemented in cmtk::TemplateArray< T >.
Referenced by cmtk::Colormap::Apply(), BlockCopy(), cmtk::DataGrid::ComputeProjection(), cmtk::FilterVolume::CoupeFilter(), cmtk::DataGrid::ExtractSliceVirtual(), cmtk::FilterVolume::GaussianFilter(), cmtk::TypedArraySimilarity::GetCorrelationRatio(), cmtk::DataGrid::GetCroppedData(), cmtk::DataGridFilter::GetDataMedianFiltered(), cmtk::DataGrid::GetDataMirrored(), cmtk::DataGridFilter::GetDataSobelFiltered(), cmtk::TypedArraySimilarity::GetDifferenceArray(), cmtk::DataGrid::GetDownsampledAndAveraged(), cmtk::DataGrid::GetOrthoSlice(), cmtk::DataGrid::GetReoriented(), cmtk::operator-(), cmtk::VolumeIO::Read(), cmtk::UniformVolume::Resample(), cmtk::FilterVolume::RohlfingFilter(), cmtk::ScalarImage::ScalarImage(), cmtk::DataGrid::SetOrthoSlice(), cmtk::FilterVolume::StudholmeFilter(), cmtk::ImageSymmetryPlaneCommandLineBase::WriteAligned(), cmtk::ScalarImageIO::WriteAnalyze(), cmtk::VolumeFromFile::WriteAnalyzeHdr(), cmtk::VolumeFromFile::WriteMetaImage(), and cmtk::VolumeFromFile::WriteNifti().
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.
scale | The original data value is multiplied by the parameter first. |
offset | This value is added to the original data value after multiplying it by the scale parameter. |
truncLo | Lower truncation boundary. Scaled items below this threshold will be set to equal its value. |
truncHi | Upper 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.
scale | The original data value is multiplied by the parameter first. |
offset | This 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] |
Sets the specified array element.
Implemented in cmtk::TemplateArray< T >.
Referenced by cmtk::ImageOperationReplace::Apply(), cmtk::ScalarImage::InterpolateFrom(), and cmtk::ScalarImage::operator-=().
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.
data | Pointer 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 >.
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.
ScalarDataType cmtk::TypedArray::m_DataType [protected] |
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.
bool cmtk::TypedArray::PaddingFlag [protected] |
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().