GDCM: gdcm::Testing Class Reference

GDCM 3.2.11

Public Types | Public Member Functions | Static Public Member Functions | List of all members
gdcm::Testing Class Reference

class for testing More...

`#include <gdcmTesting.h>`

## Public Types
typedef const char *const (* | MD5DataImagesType)[2]
typedef const char *const (* | MediaStorageDataFilesType)[2]
| return the table that map the media storage (as string) of a filename (gdcmData)

## Public Member Functions
| Testing ()=default
| ~Testing ()=default
void | Print (std::ostream &os=std::cout)
| Print.

## Static Public Member Functions
static bool | ComputeFileMD5 (const char *filename, char digest_str[33])
static bool | ComputeMD5 (const char *buffer, size_t buf_len, char digest_str[33])
static const char * | GetDataExtraRoot ()
| Return the GDCM DATA EXTRA ROOT.
static const char * | GetDataRoot ()
| Return the GDCM DATA ROOT.
static const char * | GetFileName (unsigned int file)
static const char *const * | GetFileNames ()
| return the table of fullpath to gdcmData DICOM files:
static int | GetLossyFlagFromFile (const char *filepath)
static const char *const * | GetMD5DataImage (unsigned int file)
static MD5DataImagesType | GetMD5DataImages ()
static const char * | GetMD5FromBrokenFile (const char *filepath)
static const char * | GetMD5FromFile (const char *filepath)
static const char *const * | GetMediaStorageDataFile (unsigned int file)
static MediaStorageDataFilesType | GetMediaStorageDataFiles ()
static const char * | GetMediaStorageFromFile (const char *filepath)
static unsigned int | GetNumberOfFileNames ()
static unsigned int | GetNumberOfMD5DataImages ()
static unsigned int | GetNumberOfMediaStorageDataFiles ()
static const char * | GetPixelSpacingDataRoot ()
| Return the GDCM PIXEL SPACING DATA ROOT (See David Clunie website for dataset).
static std::streamoff | GetSelectedPrivateGroupOffsetFromFile (const char *filepath)
static std::streamoff | GetSelectedTagsOffsetFromFile (const char *filepath)
static const char * | GetSourceDirectory ()
static std::streamoff | GetStreamOffsetFromFile (const char *filepath)
static const char * | GetTempDirectory (const char *subdir=nullptr)
static const wchar_t * | GetTempDirectoryW (const wchar_t *subdir=nullptr)
| NOT THREAD SAFE.
static const char * | GetTempFilename (const char *filename, const char *subdir=nullptr)
| NOT THREAD SAFE.
static const wchar_t * | GetTempFilenameW (const wchar_t *filename, const wchar_t *subdir=nullptr)
| NOT THREAD SAFE.

## Detailed Description

class for testing

this class is used for the nightly regression system for GDCM It makes heavily use of md5 computation

See also
  gdcm::MD5 class for md5 computation

## Member Typedef Documentation

## ◆ MD5DataImagesType

typedef const char* const(* gdcm::Testing::MD5DataImagesType)[2]

return the table that map the md5 (as in md5sum) of the Pixel Data associated to a filename

## ◆ MediaStorageDataFilesType

typedef const char* const(* gdcm::Testing::MediaStorageDataFilesType)[2]

return the table that map the media storage (as string) of a filename (gdcmData)

## Constructor & Destructor Documentation

## ◆ Testing()

gdcm::Testing::Testing | ( |  | ) |
| default

## ◆ ~Testing()

gdcm::Testing::~Testing | ( |  | ) |
| default

## Member Function Documentation

## ◆ ComputeFileMD5()

bool gdcm::Testing::ComputeFileMD5 | ( | const char * | filename,
|  | char | digest_str[33] )
| static

Examples
  MetaImageMD5Activiz.cs.

## ◆ ComputeMD5()

bool gdcm::Testing::ComputeMD5 | ( | const char * | buffer,
|  | size_t | buf_len,
|  | char | digest_str[33] )
| static

MD5 stuff digest_str needs to be at least : strlen = [2*16+1]; string will be \0 padded. (md5 are 32 bytes long) Testing is not meant to be shipped with an installed GDCM release, always prefer the gdcm::MD5 API when doing md5 computation.

## ◆ GetDataExtraRoot()

const char * gdcm::Testing::GetDataExtraRoot | ( |  | ) |
| static

Return the GDCM DATA EXTRA ROOT.

Examples
  DiscriminateVolume.cxx, VolumeSorter.cxx, and reslicesphere.cxx.

## ◆ GetDataRoot()

const char * gdcm::Testing::GetDataRoot | ( |  | ) |
| static

Return the GDCM DATA ROOT.

Examples
  Convert16BitsTo8Bits.cxx, ConvertMultiFrameToSingleFrame.cxx, ConvertRGBToLuminance.cxx, and MagnifyFile.cxx.

## ◆ GetFileName()

const char * gdcm::Testing::GetFileName | ( | unsigned int | file | ) |
| static

Examples
  MetaImageMD5Activiz.cs.

## ◆ GetFileNames()

const char *const * gdcm::Testing::GetFileNames | ( |  | ) |
| static

return the table of fullpath to gdcmData DICOM files:

Examples
  TestReader.cxx.

## ◆ GetLossyFlagFromFile()

int gdcm::Testing::GetLossyFlagFromFile | ( | const char * | filepath | ) |
| static

Return the lossy flag of the given filename -1 -> Error 0 -> Lossless 1 -> Lossy

## ◆ GetMD5DataImage()

const char *const * gdcm::Testing::GetMD5DataImage | ( | unsigned int | file | ) |
| static

## ◆ GetMD5DataImages()

MD5DataImagesType gdcm::Testing::GetMD5DataImages | ( |  | ) |
| static

## ◆ GetMD5FromBrokenFile()

const char * gdcm::Testing::GetMD5FromBrokenFile | ( | const char * | filepath | ) |
| static

Return what should have been the md5 of file 'filepath' This is based on current GDCM implementation to decipher a broken DICOM file.

## ◆ GetMD5FromFile()

const char * gdcm::Testing::GetMD5FromFile | ( | const char * | filepath | ) |
| static

## ◆ GetMediaStorageDataFile()

const char *const * gdcm::Testing::GetMediaStorageDataFile | ( | unsigned int | file | ) |
| static

## ◆ GetMediaStorageDataFiles()

MediaStorageDataFilesType gdcm::Testing::GetMediaStorageDataFiles | ( |  | ) |
| static

## ◆ GetMediaStorageFromFile()

const char * gdcm::Testing::GetMediaStorageFromFile | ( | const char * | filepath | ) |
| static

Examples
  MetaImageMD5Activiz.cs, and TestReader.cxx.

## ◆ GetNumberOfFileNames()

unsigned int gdcm::Testing::GetNumberOfFileNames | ( |  | ) |
| static

Examples
  MetaImageMD5Activiz.cs.

## ◆ GetNumberOfMD5DataImages()

unsigned int gdcm::Testing::GetNumberOfMD5DataImages | ( |  | ) |
| static

## ◆ GetNumberOfMediaStorageDataFiles()

unsigned int gdcm::Testing::GetNumberOfMediaStorageDataFiles | ( |  | ) |
| static

## ◆ GetPixelSpacingDataRoot()

const char * gdcm::Testing::GetPixelSpacingDataRoot | ( |  | ) |
| static

Return the GDCM PIXEL SPACING DATA ROOT (See David Clunie website for dataset).

## ◆ GetSelectedPrivateGroupOffsetFromFile()

std::streamoff gdcm::Testing::GetSelectedPrivateGroupOffsetFromFile | ( | const char * | filepath | ) |
| static

Return the offset just after private attribute (0009,0010,"GEMS_IDEN_01") if found. Otherwise the offset of the next attribute -1 if not found

## ◆ GetSelectedTagsOffsetFromFile()

std::streamoff gdcm::Testing::GetSelectedTagsOffsetFromFile | ( | const char * | filepath | ) |
| static

Return the offset just after Pixel Data Length (7fe0,0000) if found. Otherwise the offset of the very first pixel cell in Pixel Data -1 if not found

## ◆ GetSourceDirectory()

const char * gdcm::Testing::GetSourceDirectory | ( |  | ) |
| static

## ◆ GetStreamOffsetFromFile()

std::streamoff gdcm::Testing::GetStreamOffsetFromFile | ( | const char * | filepath | ) |
| static

Return the offset of the very first pixel cell in the PixelData -1 if not found

## ◆ GetTempDirectory()

const char * gdcm::Testing::GetTempDirectory | ( | const char * | subdir = nullptr | ) |
| static

NOT THREAD SAFE Returns the temp directory as used in testing needing to output data:

Examples
  MetaImageMD5Activiz.cs.

## ◆ GetTempDirectoryW()

const wchar_t * gdcm::Testing::GetTempDirectoryW | ( | const wchar_t * | subdir = nullptr | ) |
| static

NOT THREAD SAFE.

## ◆ GetTempFilename()

const char * gdcm::Testing::GetTempFilename | ( | const char * | filename,
|  | const char * | subdir = nullptr )
| static

NOT THREAD SAFE.

Examples
  MetaImageMD5Activiz.cs.

## ◆ GetTempFilenameW()

const wchar_t * gdcm::Testing::GetTempFilenameW | ( | const wchar_t * | filename,
|  | const wchar_t * | subdir = nullptr )
| static

NOT THREAD SAFE.

## ◆ Print()

void gdcm::Testing::Print | ( | std::ostream & | os = std::cout | ) |

Print.

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

- gdcmTesting.h