A class to read and write the header part of a dicom file. More...
#include <vil_dicom_header.h>
Public Member Functions | |
| vil_dicom_header_format () | |
| ~vil_dicom_header_format () | |
| bool | isDicomFormat (vil_stream &) |
| True if it is known DICOM format. More... | |
| vil_dicom_header_info | readHeader (vil_stream &fs) |
| Read the dicom header into a header struct. More... | |
| vil_dicom_header_info | lastHeader (void) |
| Method to return the last struct of header info set. More... | |
| bool | headerValid (void) |
| Method to indicate if the header info held is valid or not. More... | |
| vil_dicom_header_endian | systemEndian (void) |
| Return the current system endian. More... | |
| vil_dicom_header_endian | fileEndian (void) |
| Return the endian of the header being read. More... | |
| vil_dicom_header_image_type | imageType (void) |
| Return any encapsulated image type. More... | |
Private Member Functions | |
| vil_dicom_header_type | determineFileType (vil_stream &fs) |
| Method to determine the file type. More... | |
| void | readHeaderElements (vil_stream &fs) |
| Method to read the elements from the header. More... | |
| void | readIdentifyingElements (short element, int dblock_size, vil_stream &fs) |
| Method to read the identifying group's details. More... | |
| void | readPatientElements (short element, int dblock_size, vil_stream &fs) |
| Method to read the patient details. More... | |
| void | readAcquisitionElements (short element, int dblock_size, vil_stream &fs) |
| Method to read the acquisition group's details. More... | |
| void | readRelationshipElements (short element, int dblock_size, vil_stream &fs) |
| Method to read the relationship group's details. More... | |
| void | readImageElements (short element, int dblock_size, vil_stream &fs) |
| Method to read the image group's details. More... | |
| void | readDelimiterElements (short element, int dblock_size, vil_stream &fs) |
| Method to read the delimiter group's details. More... | |
| void | readProcedureElements (short element, int dblock_size, vil_stream &fs) |
| Method to read the procedure group's details. More... | |
| void | readNSPhilipsElements (short element, int dblock_size, vil_stream &fs) |
| Method to read the (non-standard, private) Philips group details. More... | |
| bool | convertValueRepresentation (unsigned int &dblock_size, vil_stream &ifs) |
| Method to convert the Value Representation (VR) (if it exists). More... | |
| bool | pixelDataFound (short group, short element) |
| Method to determine whether or not the actual pixel data has been reached. More... | |
| void | clearInfo (void) |
| vil_dicom_header_endian | calculateEndian (void) |
| Work out whether the current architecture is big or little endian. More... | |
| vil_dicom_header_endian | determineMetaInfo (vil_stream &fs) |
| Initialise all the necessary meta-file stuff. More... | |
| vxl_uint_16 | shortSwap (vxl_uint_16 short_in) |
| Method to byte swap an unsigned short int if necessary. More... | |
| vxl_uint_32 | intSwap (vxl_uint_32 int_in) |
| Method to byte swap an unsigned int if necessary. More... | |
| void | charSwap (char *char_in, int val_size) |
| Method to swap a number inside a char array. More... | |
Private Attributes | |
| vil_dicom_header_info | last_read_ |
| Holds the info from the last header read. More... | |
| bool | info_valid_ |
| TRUE if the header info is valid (i.e. has been read) otherwise FALSE. More... | |
| vil_dicom_header_endian | endian_ |
| A variable to hold the discovered architecture endian. More... | |
| vil_dicom_header_endian | file_endian_ |
| A variable to hold the current header file's endian. More... | |
| vil_dicom_header_image_type | image_type_ |
| A variable to hole the current encapsulate file type (if any). More... | |
A class to read and write the header part of a dicom file.
This class reads and writes the header section of a dicom file, determining the type and storing the information in a dicom structure.
Definition at line 489 of file vil_dicom_header.h.
| vil_dicom_header_format::vil_dicom_header_format | ( | ) |
| vil_dicom_header_format::~vil_dicom_header_format | ( | ) |
|
private |
Work out whether the current architecture is big or little endian.
|
private |
Method to swap a number inside a char array.
| char_in | The char array to swap - on exit contains the result |
| val_size | The size of the var to swap |
|
private |
|
private |
Method to convert the Value Representation (VR) (if it exists).
| data_block | Contains the VR or data block size (always holds the data block size on exit |
| fs | The file stream to read from |
|
private |
Method to determine the file type.
| fs | The file stream for the image to test |
|
private |
Initialise all the necessary meta-file stuff.
| vil_dicom_header_endian vil_dicom_header_format::fileEndian | ( | void | ) |
Return the endian of the header being read.
| bool vil_dicom_header_format::headerValid | ( | void | ) |
Method to indicate if the header info held is valid or not.
| vil_dicom_header_image_type vil_dicom_header_format::imageType | ( | void | ) |
Return any encapsulated image type.
|
private |
Method to byte swap an unsigned int if necessary.
| int_in | The unsigned int to swap |
| bool vil_dicom_header_format::isDicomFormat | ( | vil_stream & | ) |
True if it is known DICOM format.
| vil_dicom_header_info vil_dicom_header_format::lastHeader | ( | void | ) |
Method to return the last struct of header info set.
The class holds a dicom header info struct containing the info from the last dicom file read.
|
private |
Method to determine whether or not the actual pixel data has been reached.
| group | The current group to test |
| element | The element within that group |
|
private |
Method to read the acquisition group's details.
Fills the acquisition details in the last_read_ structure from the file header
| element | The element being read in the acquisition group |
| dblock_size | The size of the data block for this element |
| fs | The file stream to read from |
|
private |
Method to read the delimiter group's details.
Certain field in the delimiter group have no data block, and so should not be skipped. This method takes the appropriate action - to skip or not to skip
| element | The element being read in the delimiter group |
| dblock_size | The size of the data block for this element |
| fs | The file stream to read from |
| vil_dicom_header_info vil_dicom_header_format::readHeader | ( | vil_stream & | fs | ) |
Read the dicom header into a header struct.
Reads the header section of the dicom file and stores the result in a header struct, which it returns. When finished, the file stream should be pointing at the start of the image data
| fs | The file stream to read - on exit points to the start of the image data |
|
private |
Method to read the elements from the header.
This method fills the last_read_ header structure with the necessary fields
| fs | The file stream to read from |
|
private |
Method to read the identifying group's details.
Fills the identifying details in the last_read_ structure from the file header
| element | The element being read in the identifying group |
| dblock_size | The size of the data block for this element |
| fs | The file stream to read from |
|
private |
Method to read the image group's details.
Fills the image details in the last_read_ structure from the file header
| element | The element being read in the image group |
| dblock_size | The size of the data block for this element |
| fs | The file stream to read from |
|
private |
Method to read the (non-standard, private) Philips group details.
| element | The element being read in the image group |
| dblock_size | The size of the data block for this element |
| fs | The file stream to read from |
|
private |
Method to read the patient details.
Fills the patient details in the last_read_ structure from the file header
| element | The element being read in the patient group |
| dblock_size | The size of the data block for this element |
| fs | The file stream to read from |
|
private |
Method to read the procedure group's details.
| element | The element being read in the image group |
| dblock_size | The size of the data block for this element |
| fs | The file stream to read from |
|
private |
Method to read the relationship group's details.
Fills the relationship details in the last_read_ structure from the file header
| element | The element being read in the relationship group |
| dblock_size | The size of the data block for this element |
| fs | The file stream to read from |
|
private |
Method to byte swap an unsigned short int if necessary.
| short_in | The unsigned short to swap |
| vil_dicom_header_endian vil_dicom_header_format::systemEndian | ( | void | ) |
Return the current system endian.
|
private |
A variable to hold the discovered architecture endian.
Definition at line 745 of file vil_dicom_header.h.
|
private |
A variable to hold the current header file's endian.
Definition at line 750 of file vil_dicom_header.h.
|
private |
A variable to hole the current encapsulate file type (if any).
Definition at line 755 of file vil_dicom_header.h.
|
private |
TRUE if the header info is valid (i.e. has been read) otherwise FALSE.
Definition at line 740 of file vil_dicom_header.h.
|
private |
Holds the info from the last header read.
Definition at line 735 of file vil_dicom_header.h.
1.8.15