SIVIC API
0.9.26
|
#include <svkDataValidator.h>
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 svkDataValidator * | New () |
Public Attributes | |
string | resultInfo |
Holds the result of the last validation. More... | |
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...
svkDataValidator | ( | ) |
Constructor.
References svkDataValidator::resultInfo.
~svkDataValidator | ( | ) |
Destructor.
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.
data1 | the first dataset to be compared |
data2 | the second dataset to be compared |
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
data1 | the first dataset to be compared |
data2 | the 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)
data1 | the first dataset to be compared |
data2 | the 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
data1 | the first dataset to be compared |
data2 | the 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
data1 | the first dataset to be compared |
data2 | the 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
data1 | the first dataset to be compared |
data2 | the 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 | ) |
Returns true if the data sets are incompatible wrt the specified error check (svkDataValidator::ValidationErrorStatus).
Referenced by svkOverlayView::CheckDataOrientations(), svkSpectraReferenceView::GetDataCompatibility(), svkOverlayView::GetDataCompatibility(), svkPlotGridView::GetDataCompatibility(), and svkDataValidator::IsOnlyError().
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 |
vtkTypeMacro | ( | svkDataValidator | , |
vtkObject | |||
) |
string resultInfo |
Holds the result of the last validation.
Referenced by svkDataValidator::AreCellDataArrayStructureSame(), svkDataValidator::AreDataCompatible(), svkDataValidator::AreDataExtentsSame(), svkDataValidator::AreDataGeometriesSame(), svkDataValidator::AreDataOrientationsSame(), svkDataValidator::AreDataOriginsSame(), svkDataValidator::AreDataSpacingsSame(), svkSpectraReferenceView::GetDataCompatibility(), svkOverlayView::GetDataCompatibility(), svkPlotGridView::GetDataCompatibility(), svkImageStatistics::RequestData(), and svkDataValidator::svkDataValidator().