43 #ifndef SVK_DCMTK_ADAPTER_H
44 #define SVK_DCMTK_ADAPTER_H
45 #define HEADER_MAX_READ_LENGTH 256
48 #include <vtkObjectFactory.h>
49 #include <vtkObject.h>
52 #include <dcmtk/dcmdata/dctk.h>
53 #include <dcmtk/dcmdata/dctag.h>
90 virtual void SetValue(
const char* name,
int value);
91 virtual void SetValue(
const char* name,
float value);
92 virtual void SetValue(
const char* name,
double value);
93 virtual void SetValue(
const char* name,
string value,
bool setMetaInfo =
false);
94 virtual void SetValue(
const char* name,
unsigned char* values,
int numValues);
95 virtual void SetValue(
const char* name,
unsigned short* values,
int numValues);
96 virtual void SetValue(
const char* name,
signed short* values,
int numValues);
97 virtual void SetValue(
const char* name,
float* values,
int numValues);
101 virtual void GetByteValue(
const char* name,
char* values,
long unsigned int numValues);
102 virtual void GetShortValue(
const char* name,
short* values,
long unsigned int numValues);
103 virtual unsigned short GetShortValue(
const char* name,
long unsigned int position );
104 virtual unsigned short GetPixelValue(
long unsigned int position);
107 virtual void GetFloatValue(
const char* name,
float* values,
long unsigned int numValues);
113 const char* parentSeqName,
114 int parentSeqItemPosition,
115 const char* elementName
120 const char* elementName,
122 const char* parentSeqName = NULL,
123 int parentSeqItemPosition = 0
128 const char* elementName,
131 const char* parentSeqName = NULL,
132 int parentSeqItemPosition = 0
137 const char* elementName,
138 unsigned short* values,
140 const char* parentSeqName = NULL,
141 int parentSeqItemPosition = 0
146 const char* elementName,
147 unsigned int* values,
149 const char* parentSeqName = NULL,
150 int parentSeqItemPosition = 0
155 const char* elementName,
157 unsigned long int numValues,
158 const char* parentSeqName = NULL,
159 int parentSeqItemPosition = 0
164 const char* elementName,
166 const char* parentSeqName = NULL,
167 int parentSeqItemPosition = 0
172 const char* elementName,
174 const char* parentSeqName = NULL,
175 int parentSeqItemPosition = 0
180 const char* elementName,
182 const char* parentSeqName = NULL,
183 int parentSeqItemPosition = 0
188 const char* elementName,
190 const char* parentSeqName = NULL,
191 int parentSeqItemPosition = 0
197 const char* elementName,
198 const char* parentSeqName,
199 int parentSeqItemPosition);
212 const char* elementName,
213 const char* parentSeqName = NULL,
214 int parentSeqItemPosition = 0,
220 const char* elementName,
221 const char* parentSeqName = NULL,
222 int parentSeqItemPosition = 0,
228 const char* elementName,
229 const char* parentSeqName = NULL,
230 int parentSeqItemPosition = 0,
236 const char* elementName,
239 const char* parentSeqName = NULL,
240 int parentSeqItemPosition = 0
245 const char* elementName,
246 const char* parentSeqName = NULL,
247 int parentSeqItemPosition = 0
252 const char* elementName,
253 const char* parentSeqName = NULL,
254 int parentSeqItemPosition = 0
259 const char* elementName,
261 const char* parentSeqName = NULL,
262 int parentSeqItemPosition = 0
269 const char* parentSeqName,
270 int parentSeqItemPosition
276 virtual int ReadDcmFile(
string fileName,
unsigned int maxLength );
283 virtual bool ElementExists(
const char* elementName,
const char* parentSeqName);
294 const DcmDictEntry* FindEntry(
const char* name );
295 DcmTag GetDcmTag(
const char* name);
296 DcmTagKey GetDcmTagKey(
const char* name);
297 DcmItem* GetDcmItem(DcmItem* dataset,
const char* seqName,
int itemPosition);
298 DcmSequenceOfItems* GetDcmSequence(
const char* seqName);
299 void SetPrivateDictionaryElements();
300 void SetGEPrivateDictionaryElements();
301 E_TransferSyntax originalXferSyntax;
307 OFBool replaceOldElements;
308 DcmDataDictionary* privateDic;
310 map<string, const DcmDictEntry*> foundEntries;
311 DcmElement* pixelDataElement;
314 static bool privateElementsAdded;
324 #endif //SVK_DCMTK_ADAPTER_H
virtual void GetByteValue(const char *name, char *values, long unsigned int numValues)
Definition: svkDcmtkAdapter.cc:852
virtual unsigned short GetPixelValue(long unsigned int position)
Definition: svkDcmtkAdapter.cc:925
virtual void ModifyValueRecursive(const char *name, string value)
Definition: svkDcmtkAdapter.cc:775
Definition: svkDcmtkAdapter.h:65
virtual int GetNumberOfElements(const char *elementName)
Definition: svkDcmtkAdapter.cc:1865
virtual int ReadDcmFileHeaderOnly(string fileName)
Definition: svkDcmtkAdapter.cc:2072
virtual void ClearSequence(const char *seqName)
Definition: svkDcmtkAdapter.cc:1381
vtkTypeMacro(svkDcmtkAdapter, svkDcmHeader)
virtual long int GetLongIntSequenceItemElement(const char *seqName, int seqItemPosition, const char *elementName, const char *parentSeqName=NULL, int parentSeqItemPosition=0, int pos=0)
Definition: svkDcmtkAdapter.cc:1521
virtual void HandleTagNotFoundException(const svkTagNotFound &e)
Definition: svkDcmtkAdapter.cc:2174
virtual void ClearElement(const char *elementName)
Definition: svkDcmtkAdapter.cc:1402
Definition: svkDcmtkException.h:71
virtual void CopyDcmHeader(svkDcmHeader *headerCopy)
Definition: svkDcmtkAdapter.cc:2095
virtual string GetStringValue(const char *name)
Definition: svkDcmtkAdapter.cc:967
virtual void SetValue(const char *name, int value)
Definition: svkDcmtkAdapter.cc:632
virtual void InsertEmptyElement(const char *name)
Definition: svkDcmtkAdapter.cc:587
virtual void WriteDcmFileCompressed(string fileName)
Definition: svkDcmtkAdapter.cc:1999
virtual int GetIntSequenceItemElement(const char *seqName, int seqItemPosition, const char *elementName, const char *parentSeqName=NULL, int parentSeqItemPosition=0, int pos=0)
Definition: svkDcmtkAdapter.cc:1492
virtual string GetStringSequenceItemElement(const char *seqName, int seqItemPosition, const char *elementName, const char *parentSeqName=NULL, int parentSeqItemPosition=0)
Definition: svkDcmtkAdapter.cc:1648
virtual void CopySequence(svkDcmHeader *target, const char *seqName)
Definition: svkDcmtkAdapter.cc:1349
static svkDcmtkAdapter * New()
virtual bool ElementExists(const char *elementName, const char *parentSeqName)
Definition: svkDcmtkAdapter.cc:2114
virtual int GetIntValue(const char *name)
Definition: svkDcmtkAdapter.cc:800
virtual int ReadDcmFile(string fileName, unsigned int maxLength)
Definition: svkDcmtkAdapter.cc:2023
svkDcmtkAdapter()
Definition: svkDcmtkAdapter.cc:63
virtual void RemoveElement(const char *elementName)
Definition: svkDcmtkAdapter.cc:1415
virtual void PrintDcmHeader()
Definition: svkDcmtkAdapter.cc:565
virtual void CreateIOD(DcmIodType iodType)
Definition: svkDcmtkAdapter.cc:497
virtual void ReplaceOldElements(bool replaceElements)
Definition: svkDcmtkAdapter.cc:2160
virtual void AddSequenceItemElement(const char *parentSeqName, int parentSeqItemPosition, const char *elementName)
Definition: svkDcmtkAdapter.cc:1009
virtual double GetDoubleValue(const char *name)
Definition: svkDcmtkAdapter.cc:954
virtual void InsertUniqueUID(const char *name)
Definition: svkDcmtkAdapter.cc:601
~svkDcmtkAdapter()
Definition: svkDcmtkAdapter.cc:96
virtual float GetFloatValue(const char *name)
Definition: svkDcmtkAdapter.cc:813
virtual int GetSequenceItemElementLength(const char *seqName, int seqItemPosition, const char *elementName, const char *parentSeqName, int parentSeqItemPosition)
Definition: svkDcmtkAdapter.cc:1886
virtual int GetOriginalXFerSyntax()
Definition: svkDcmtkAdapter.cc:2082
Definition: svkDcmtkIod.h:64
virtual void SetSOPClassUID(DcmIodType iodType)
Definition: svkDcmtkAdapter.cc:507
string GenerateUniqueUID()
Definition: svkDcmtkAdapter.cc:616
virtual string GetDcmNameFromTag(string groupElementString)
Definition: svkDcmtkAdapter.cc:1728
virtual float GetFloatSequenceItemElement(const char *seqName, int seqItemPosition, const char *elementName, const char *parentSeqName=NULL, int parentSeqItemPosition=0, int pos=0)
Definition: svkDcmtkAdapter.cc:1555
virtual void GetShortValue(const char *name, short *values, long unsigned int numValues)
Definition: svkDcmtkAdapter.cc:881
virtual void WriteDcmFile(string fileName)
Definition: svkDcmtkAdapter.cc:1981
virtual int GetNumberOfItemsInSequence(const char *seqName)
Definition: svkDcmtkAdapter.cc:1923
virtual double GetDoubleSequenceItemElement(const char *seqName, int seqItemPosition, const char *elementName, const char *parentSeqName=NULL, int parentSeqItemPosition=0)
Definition: svkDcmtkAdapter.cc:1621