14 #ifndef vtkDICOMParser_h
15 #define vtkDICOMParser_h
17 #include "vtkObject.h"
18 #include "vtkStdString.h"
19 #include "vtkDICOMModule.h"
20 #include "vtkDICOMConfig.h"
21 #include "vtkDICOMCharacterSet.h"
24 #if defined(VTK_ABI_NAMESPACE_BEGIN)
25 VTK_ABI_NAMESPACE_BEGIN
28 class vtkUnsignedShortArray;
30 #if defined(VTK_ABI_NAMESPACE_BEGIN)
37 class vtkDICOMParserInternalFriendship;
57 void PrintSelf(ostream& os, vtkIndent indent) VTK_DICOM_OVERRIDE;
60 vtkSetStringMacro(FileName);
62 vtkGetStringMacro(FileName);
72 vtkSetMacro(Index,
int);
74 int GetIndex() {
return this->Index; }
88 return this->DefaultCharacterSet; }
97 void OverrideCharacterSetOn() {
98 this->SetOverrideCharacterSet(
true); }
99 void OverrideCharacterSetOff() {
100 this->SetOverrideCharacterSet(
false); }
101 bool GetOverrideCharacterSet() {
102 return this->OverrideCharacterSet; }
133 vtkUnsignedShortArray *GetGroups() {
return this->Groups; }
137 bool GetQueryMatched() {
return this->QueryMatched; }
165 int GetBufferSize() {
return this->BufferSize; }
169 virtual void Update();
191 virtual
bool FillBuffer(
192 const
unsigned char* &cp, const
unsigned char* &ep);
198 virtual
bool SeekBuffer(
199 const
unsigned char* &cp, const
unsigned char* &ep, vtkTypeInt64 offset);
207 virtual
bool SkipValue(
208 const
unsigned char* &cp, const
unsigned char* &ep,
unsigned int vl);
211 virtual vtkTypeInt64 GetBytesRemaining(
212 const
unsigned char *cp, const
unsigned char *ep);
215 virtual
void ParseError(
216 const
unsigned char *cp, const
unsigned char *ep, const
char *message);
219 void SetErrorCode(
unsigned long e) { this->ErrorCode = e; }
226 const unsigned char* &cp,
const unsigned char* &ep,
231 const unsigned char* &cp,
const unsigned char* &ep,
236 const unsigned char* cp,
const unsigned char* ep);
239 std::string TransferSyntax;
243 vtkUnsignedShortArray *Groups;
245 vtkTypeInt64 BytesRead;
246 vtkTypeInt64 FileOffset;
247 vtkTypeInt64 FileSize;
248 unsigned char *Buffer;
252 unsigned int PixelDataVL;
256 bool OverrideCharacterSet;
257 unsigned long ErrorCode;
260 friend class vtkDICOMParserInternalFriendship;
263 #ifdef VTK_DICOM_DELETE
Character sets.
Definition: vtkDICOMCharacterSet.h:55
A class that provides basic input/output operations.
Definition: vtkDICOMFile.h:34
An item in a DICOM sequence (type SQ).
Definition: vtkDICOMItem.h:34
A meta data reader for DICOM data.
Definition: vtkDICOMParser.h:48
virtual bool ReadFile(vtkDICOMMetaData *data, int idx)
Read the file into the provided metadata object.
static vtkDICOMParser * New()
Create a new vtkDICOMParser instance.
unsigned int GetPixelDataVL()
Get the VL for the PixelData, will be 0xffffffff if compressed.
Definition: vtkDICOMParser.h:144
void SetQuery(vtkDICOMMetaData *query)
Set a query. Only matching data will be retrieved.
void SetBufferSize(int size)
Set the buffer size, the default is 8192 (8k).
vtkTypeInt64 GetFileSize()
Get the total file length (only valid after Update).
Definition: vtkDICOMParser.h:156
void SetGroups(vtkUnsignedShortArray *groups)
Set specific metadata groups to read (obsolete).
vtkTypeInt64 GetFileOffset()
Get the byte offset to the end of the metadata.
Definition: vtkDICOMParser.h:153
bool ReadMetaHeader(const unsigned char *&cp, const unsigned char *&ep, vtkDICOMMetaData *data, int idx)
Read just the meta header (group 0x0002).
void SetOverrideCharacterSet(bool b)
Override the value stored in SpecificCharacterSet.
unsigned long GetErrorCode()
Get the error code.
Definition: vtkDICOMParser.h:173
bool GetPixelDataFound()
This is true only if PixelData was found in the file.
Definition: vtkDICOMParser.h:141
void SetQueryItem(const vtkDICOMItem &query)
Set a query, using an item instead of vtkDICOMMetaData.
void PrintSelf(ostream &os, vtkIndent indent) VTK_DICOM_OVERRIDE
Print a summary of the contents of this object.
bool ReadMetaData(const unsigned char *&cp, const unsigned char *&ep, vtkDICOMMetaData *data, int idx)
Read the meta data following the meta header.
vtkTypeInt64 GetBytesProcessed(const unsigned char *cp, const unsigned char *ep)
Compute the file offset to the current position.
void SetDefaultCharacterSet(vtkDICOMCharacterSet cs)
Set the character set to use if SpecificCharacterSet is missing.
abstract base class for most VTK objects
Definition: vtkObject.h:54