SIVIC API  0.9.26
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
svkDataValidator Class Reference

#include <svkDataValidator.h>

Inheritance diagram for svkDataValidator:

Public Types

enum  ValidationErrorStatus {
  VALID_DATA = 0, INVALID_DATA_ORIENTATION = 1, INVALID_DATA_PATIENT_ID = 2, INVALID_DATA_CORRUPTED = 3,
  INVALID_DATA_ACCESSION_NUMBER = 4
}
 

Public Member Functions

 vtkTypeMacro (svkDataValidator, vtkObject)
 
 svkDataValidator ()
 Constructor. More...
 
 ~svkDataValidator ()
 Destructor. More...
 
bool AreDataCompatible (svkImageData *data1, svkImageData *data2)
 Check to see if two datasets are from the same scan. More...
 
bool AreDataOrientationsSame (svkImageData *data1, svkImageData *data2)
 
bool AreDataGeometriesSame (svkImageData *data1, svkImageData *data2)
 
bool AreCellDataArrayStructureSame (svkImageData *data1, svkImageData *data2)
 
bool AreDataExtentsSame (svkImageData *data1, svkImageData *data2)
 
bool AreDataSpacingsSame (svkImageData *data1, svkImageData *data2)
 
bool AreDataOriginsSame (svkImageData *data1, svkImageData *data2)
 
bool IsInvalid (svkDataValidator::ValidationErrorStatus error)
 
bool IsOnlyError (svkDataValidator::ValidationErrorStatus error)
 
bool AreValuesClose (double valueA, double valueB, int percentTolerance)
 

Static Public Member Functions

static svkDataValidatorNew ()
 

Public Attributes

string resultInfo
 Holds the result of the last validation. More...
 

Detailed Description

This class is used to validate datasets and dataset compatibility. Results of comparisons are stored in the resultInfo member variable. If the result yielded no errors the variable will be empty.

NOTE: It might be better to return a string instead of using the member variable, but this would make using the method a little more cumbersome and less intuitive in if statements. It would however allow the method to be static...

Member Enumeration Documentation

Supported DICOM IOD types.

Enumerator
VALID_DATA 
INVALID_DATA_ORIENTATION 
INVALID_DATA_PATIENT_ID 
INVALID_DATA_CORRUPTED 
INVALID_DATA_ACCESSION_NUMBER 

Constructor & Destructor Documentation

Constructor.

References svkDataValidator::resultInfo.

Destructor.

Member Function Documentation

bool AreCellDataArrayStructureSame ( svkImageData data1,
svkImageData data2 
)

Check to see if the data array structures are the same.

References svkDataValidator::resultInfo.

Referenced by svkPlotGridView::GetDataCompatibility().

bool AreDataCompatible ( svkImageData data1,
svkImageData data2 
)

Check to see if two datasets are from the same scan.

Check to see if two datasets are compatible. The resultInfo will be an empty string if they are compatible, otherwise it will contain an error message.

SIDE EFFECT: resultInfo member variable will be changed.

Parameters
data1the first dataset to be compared
data2the second dataset to be compared
Returns
bool (false, not compatible)

References svkDataValidator::AreDataOrientationsSame(), svkImageData::GetDcmHeader(), svkDcmHeader::GetStringValue(), svkDataValidator::INVALID_DATA_ACCESSION_NUMBER, svkDataValidator::INVALID_DATA_CORRUPTED, svkDataValidator::INVALID_DATA_ORIENTATION, svkDataValidator::INVALID_DATA_PATIENT_ID, and svkDataValidator::resultInfo.

Referenced by svkOverlayView::CheckDataOrientations(), svkSpectraReferenceView::GetDataCompatibility(), svkOverlayView::GetDataCompatibility(), and svkPlotGridView::GetDataCompatibility().

bool AreDataExtentsSame ( svkImageData data1,
svkImageData data2 
)

Check to see if two datasets have the same extent

Parameters
data1the first dataset to be compared
data2the second dataset to be compared

References svkDataValidator::resultInfo.

Referenced by svkDataValidator::AreDataGeometriesSame().

bool AreDataGeometriesSame ( svkImageData data1,
svkImageData data2 
)

Check to see if two datasets have the same geometry (extent, spacing, dcos, origin)

Parameters
data1the first dataset to be compared
data2the second dataset to be compared

References svkDataValidator::AreDataExtentsSame(), svkDataValidator::AreDataOrientationsSame(), svkDataValidator::AreDataOriginsSame(), svkDataValidator::AreDataSpacingsSame(), and svkDataValidator::resultInfo.

Referenced by svkPlotGridView::GetDataCompatibility(), and svkImageStatistics::RequestData().

bool AreDataOrientationsSame ( svkImageData data1,
svkImageData data2 
)

Check to see if two datasets have the same orientation

Parameters
data1the first dataset to be compared
data2the second dataset to be compared

References svkDcmHeader::GetDataDcos(), svkImageData::GetDcmHeader(), svkDataValidator::resultInfo, and svkDataValidator::VALID_DATA.

Referenced by svkDataValidator::AreDataCompatible(), and svkDataValidator::AreDataGeometriesSame().

bool AreDataOriginsSame ( svkImageData data1,
svkImageData data2 
)

Check to see if two datasets have the same origin

Parameters
data1the first dataset to be compared
data2the second dataset to be compared

References svkImageData::GetDcmHeader(), svkDcmHeader::GetOrigin(), and svkDataValidator::resultInfo.

Referenced by svkDataValidator::AreDataGeometriesSame().

bool AreDataSpacingsSame ( svkImageData data1,
svkImageData data2 
)

Check to see if two datasets have the same spacing

Parameters
data1the first dataset to be compared
data2the second dataset to be compared

References svkUtils::AreValuesClose(), and svkDataValidator::resultInfo.

Referenced by svkDataValidator::AreDataGeometriesSame().

bool AreValuesClose ( double  valueA,
double  valueB,
int  percentTolerance 
)
bool IsInvalid ( svkDataValidator::ValidationErrorStatus  error)
bool IsOnlyError ( svkDataValidator::ValidationErrorStatus  error)

! Returns true if the given error is the only error present, otherwise returns false. If the given error is not present then false is returned.

References svkDataValidator::IsInvalid().

Referenced by svkOverlayView::GetDataCompatibility().

static svkDataValidator* New ( )
static
vtkTypeMacro ( svkDataValidator  ,
vtkObject   
)

Member Data Documentation

string resultInfo

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