ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkScancoDataManipulation.h File Reference
#include "itkMacro.h"
#include <cstddef>
#include <array>
+ Include dependency graph for itkScancoDataManipulation.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  itkScancoHeaderData
 
struct  itkScancoPixelData
 

Namespaces

namespace  ScancoHeaderField
 

Macros

#define ScancoGetConstMacro(name, type)
 
#define ScancoSetMacro(name, type)
 

Functions

int CheckVersion (const char header[ScancoHeaderField::VersionDiskWidth])
 
void DateToString (const void *target, int year, int month, int day, int hour, int minute, int second, int millis)
 
void DecodeDate (const void *data, int &year, int &month, int &day, int &hour, int &minute, int &second, int &millis)
 
double DecodeDouble (const void *data)
 
float DecodeFloat (const void *data)
 
int DecodeInt (const void *data)
 
int64_t DecodeInt64 (const void *data)
 
void EncodeCurrentDate (void *target)
 
void EncodeDateFromString (void *target, const char dateString[ScancoHeaderField::DateStringBufferSize])
 
void EncodeDouble (double data, void *target)
 
void EncodeFloat (float data, void *target)
 
void EncodeInt (int data, void *target)
 
void EncodeInt64 (int64_t data, void *target)
 
void GetCurrentDateString (void *target)
 
void PadString (char *dest, const char *source, vcl_size_t length)
 
void StripString (char *dest, const char *source, vcl_size_t length)
 

Variables

constexpr std::vcl_size_t ScancoHeaderField::CalibrationDataBufferSize = CalibrationDataDiskWidth + 2
 
constexpr std::vcl_size_t ScancoHeaderField::CalibrationDataDiskWidth = 64
 
constexpr std::vcl_size_t ScancoHeaderField::DateStringBufferSize = 32
 
constexpr std::vcl_size_t ScancoHeaderField::EncodedDateDiskWidth = 8
 
constexpr std::vcl_size_t ScancoHeaderField::PatientNameBufferSize = PatientNameDiskWidth + 2
 
constexpr std::vcl_size_t ScancoHeaderField::PatientNameDiskWidth = 40
 
constexpr std::vcl_size_t ScancoHeaderField::RescaleUnitsBufferSize = RescaleUnitsDiskWidth + 2
 
constexpr std::vcl_size_t ScancoHeaderField::RescaleUnitsDiskWidth = 16
 
constexpr int ScancoHeaderBlockSize = 512
 
constexpr std::vcl_size_t ScancoHeaderField::VersionBufferSize = VersionDiskWidth + 2
 
constexpr std::vcl_size_t ScancoHeaderField::VersionDiskWidth = 16
 

Macro Definition Documentation

◆ ScancoGetConstMacro

#define ScancoGetConstMacro ( name,
type )
Value:
virtual type Get##name() const { return this->m_HeaderData.m_##name; } \
ITK_MACROEND_NOOP_STATEMENT

Definition at line 94 of file itkScancoDataManipulation.h.

◆ ScancoSetMacro

#define ScancoSetMacro ( name,
type )
Value:
virtual void Set##name(type _arg) \
{ \
itkDebugMacro("setting " #name " to " << _arg); \
ITK_GCC_PRAGMA_PUSH \
ITK_GCC_SUPPRESS_Wfloat_equal \
if (this->m_HeaderData.m_##name != _arg) \
{ \
this->m_HeaderData.m_##name = std::move(_arg); \
this->Modified(); \
} \
} \
ITK_MACROEND_NOOP_STATEMENT
#define ITK_GCC_PRAGMA_POP

Definition at line 98 of file itkScancoDataManipulation.h.

Function Documentation

◆ CheckVersion()

int CheckVersion ( const char header[ScancoHeaderField::VersionDiskWidth])

Check the file header to see what type of file it is.

Parameters
headerA pointer to the first 16 bytes of the file header.
Returns
0 if unrecognized, 1 if ISQ/RAD, 2 if AIM 020, 3 if AIM 030.

References ScancoHeaderField::VersionDiskWidth.

◆ DateToString()

void DateToString ( const void * target,
int year,
int month,
int day,
int hour,
int minute,
int second,
int millis )

Formats a date into a string of the form DD-MMM-YYYY HH:MM:SS:mmm

Parameters
targetPointer to a buffer of at least 32 bytes to store the formatted date string.
yearThe year.
monthThe month (1-12).
dayThe day (1-31).
hourThe hour (0-23).
minuteThe minute (0-59).
secondThe second (0-59).
millisThe milliseconds (0-999).

◆ DecodeDate()

void DecodeDate ( const void * data,
int & year,
int & month,
int & day,
int & hour,
int & minute,
int & second,
int & millis )

Convert a VMS timestamp to a calendar date.

Parameters
dataPointer to a buffer of at least 8 bytes containing the VMS timestamp.
yearThe extracted Gregorian year.
monthThe extracted Gregorian month (1-12).
dayThe extracted Gregorian day (1-31).
hourThe extracted hour (0-23).
minuteThe extracted minute (0-59).
secondThe extracted second (0-59).
millisThe extracted milliseconds (0-999).

◆ DecodeDouble()

double DecodeDouble ( const void * data)

Convert char data to float (double precision).

Parameters
dataPointer to a buffer of at least 8 bytes.
Returns
The decoded double value.

◆ DecodeFloat()

float DecodeFloat ( const void * data)

Convert char data to float (single precision).

Parameters
dataPointer to a buffer of at least 4 bytes.
Returns
The decoded float value.

◆ DecodeInt()

int DecodeInt ( const void * data)

Convert char data to 32-bit int (little-endian).

Parameters
dataPointer to a buffer of at least 4 bytes.
Returns
The decoded integer value.

◆ DecodeInt64()

int64_t DecodeInt64 ( const void * data)

Convert char data to 64-bit int (little-endian)

Parameters
dataPointer to a buffer of at least 4 bytes.
Returns
The decoded integer value.

◆ EncodeCurrentDate()

void EncodeCurrentDate ( void * target)

Convert the current calendar date to a VMS timestamp and store in target

Parameters
targetPointer to a buffer of at least 8 bytes to store the VMS timestamp.

◆ EncodeDateFromString()

void EncodeDateFromString ( void * target,
const char dateString[ScancoHeaderField::DateStringBufferSize] )

Convert a calendar date to VMS timestamp

Parameters
targetPointer to a buffer of at least 8 bytes to store the timestamp.
dateStringA string in the format "YYYY-MM-DD HH:MM:SS.mmm"

References ScancoHeaderField::DateStringBufferSize.

◆ EncodeDouble()

void EncodeDouble ( double data,
void * target )

◆ EncodeFloat()

void EncodeFloat ( float data,
void * target )

Convert float data to char data.

Parameters
dataThe float to convert.
targetPointer to a buffer of at least 4 bytes to store the result.

◆ EncodeInt()

void EncodeInt ( int data,
void * target )

Convert 32-bit int (little-endian) to char data.

Parameters
dataThe integer to convert.
targetPointer to a buffer of at least 4 bytes to store the result.

◆ EncodeInt64()

void EncodeInt64 ( int64_t data,
void * target )

Convert 64-bit int (little-endian) to char data.

Parameters
dataThe integer to convert.
targetPointer to a buffer of at least 8 bytes to store the result.

◆ GetCurrentDateString()

void GetCurrentDateString ( void * target)

Get the current date and time as a string in the format "YYYY-MM-DD HH:MM:SS.mmm".

Parameters
targetPointer to a buffer of at least 32 bytes to store the current date string.

◆ PadString()

void PadString ( char * dest,
const char * source,
vcl_size_t length )

Pad a string with spaces to a specified length.

Attention
dest must have a size of at least l+1.
Parameters
destThe destination string to be padded.
sourceThe source string to copy from.
lengthThe total length of the destination string after padding.

◆ StripString()

void StripString ( char * dest,
const char * source,
vcl_size_t length )

Strip a string by removing trailing whitespace.

Attention
dest must have a size of at least l+1.
Parameters
destThe destination string to be stripped.
sourceThe source string to copy from.
lengthThe total length of the destination string.

Variable Documentation

◆ ScancoHeaderBlockSize

int ScancoHeaderBlockSize = 512
constexpr

Definition at line 113 of file itkScancoDataManipulation.h.