#include <itkScancoHeaderIO.h>
Read Scanco image headers.
Definition at line 34 of file itkScancoHeaderIO.h.
◆ ScancoFileVersions
◆ ScancoHeaderIO()
| itk::ScancoHeaderIO::ScancoHeaderIO |
( |
itkScancoHeaderData * | headerData, |
|
|
std::string | filename = "" ) |
Constructor that initializes the header data pointer. If the pointer is null, the object will fail to be created and will throw an exception.
- Parameters
-
| headerData | Pointer to the location to store the header data |
- Note
- m_RawHeader will be overwritten on read and/or write
- Parameters
-
| filename | optional filename to read the header from or write to. If no filename is provided, it can be specified later using ReadHeader or WriteHeader |
- See also
- ReadHeader(std::string filename) and WriteHeader(std::string filename)
- Exceptions
-
| std::runtime_error | if headerData is null. |
◆ ~ScancoHeaderIO()
| virtual itk::ScancoHeaderIO::~ScancoHeaderIO |
( |
| ) |
|
|
virtualdefault |
◆ ReadHeader() [1/2]
| unsigned long itk::ScancoHeaderIO::ReadHeader |
( |
const std::string | filename = "" | ) |
|
Read the header from a file. If the filename is empty, it will use the m_FileName member variable. If m_FileName is also empty, it will throw an exception.
- Parameters
-
| filename | The name of the file to read the header from. [optional] |
- Note
- If the filename is provided, it will overwrite the m_FileName member variable.
- Exceptions
-
| std::runtime_error | if no filename is provided and m_FileName is empty. |
- Returns
- number of bytes read from the file.
◆ ReadHeader() [2/2]
| virtual unsigned long itk::ScancoHeaderIO::ReadHeader |
( |
std::ifstream & | infile | ) |
|
|
virtual |
Read the header from an infile.
- Parameters
-
| infile | The input file stream to read the header from. |
- Exceptions
-
| std::runtime_error | if the file cannot be opened or read. |
- Note
- Subclasses should implement this method to read the header in the specific format they support.
- Returns
- number of bytes read from the file.
Reimplemented in itk::AIMHeaderIO, and itk::ISQHeaderIO.
◆ SetFilename()
| void itk::ScancoHeaderIO::SetFilename |
( |
const std::string | filename | ) |
|
◆ SetHeaderData()
◆ WriteHeader() [1/2]
| virtual unsigned long itk::ScancoHeaderIO::WriteHeader |
( |
std::ofstream & | outfile, |
|
|
unsigned long | imageSize ) |
|
virtual |
Write the header to an open file stream.
- Parameters
-
| outfile | Pointer to an open std::ofstream where the header will be written. |
| imageSize | size of the image that will be written after the header, in bytes |
- Exceptions
-
| std::runtime_error | if headerData is null. |
- Note
- sublcasses should implement this method to write the header in the specific format they support.
- Returns
- number of bytes written to the file.
Reimplemented in itk::AIMHeaderIO, and itk::ISQHeaderIO.
◆ WriteHeader() [2/2]
| unsigned long itk::ScancoHeaderIO::WriteHeader |
( |
unsigned long | imageSize, |
|
|
std::string | filename = "" ) |
Write the header to a file. If the filename is empty, it will use the m_FileName member variable. If m_FileName is also empty, it will throw an exception.
- Parameters
-
| filename | The name of the file to write the header to [optional] |
| imageSize | size of the image that will be written after the header, in bytes |
- Note
- If the filename is provided, it will overwrite the m_FileName member variable.
- Exceptions
-
| std::runtime_error | if no filename is provided and m_FileName is empty. |
- Returns
- number of bytes written to the file.
◆ m_FileName
| std::string itk::ScancoHeaderIO::m_FileName = "" |
|
protected |
◆ m_HeaderData
The documentation for this class was generated from the following file: