]> Creatis software - clitk.git/blob - tools/clitkUpdateVRTagDicomGenericFilter.txx
Precision on clitkBlurImage help
[clitk.git] / tools / clitkUpdateVRTagDicomGenericFilter.txx
1 /*=========================================================================
2   Program:   vv                     http://www.creatis.insa-lyon.fr/rio/vv
3
4   Authors belong to:
5   - University of LYON              http://www.universite-lyon.fr/
6   - Léon Bérard cancer center       http://www.centreleonberard.fr
7   - CREATIS CNRS laboratory         http://www.creatis.insa-lyon.fr
8
9   This software is distributed WITHOUT ANY WARRANTY; without even
10   the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11   PURPOSE.  See the copyright notices for more information.
12
13   It is distributed under dual licence
14
15   - BSD        See included LICENSE.txt file
16   - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
17 ===========================================================================**/
18 #ifndef clitkUpdateVRTagDicomGenericFilter_txx
19 #define clitkUpdateVRTagDicomGenericFilter_txx
20
21 /* =================================================
22  * @file   clitkUpdateVRTagDicomGenericFilter.txx
23  * @author
24  * @date
25  *
26  * @brief
27  *
28  ===================================================*/
29
30 #include <sstream>
31 // clitk
32 #include "clitkResampleImageWithOptionsFilter.h"
33 #if GDCM_MAJOR_VERSION >= 2
34 #include "gdcmUIDGenerator.h"
35 #include <gdcmImageHelper.h>
36 #include <gdcmAttribute.h>
37 #include <gdcmReader.h>
38 #include <gdcmWriter.h>
39 #include <gdcmDataElement.h>
40 #include <gdcmTag.h>
41 #include <gdcmDict.h>
42 #include <gdcmDicts.h>
43 #include <gdcmGlobal.h>
44 #else
45 #include "gdcmFile.h"
46 #include "gdcmUtil.h"
47 #endif
48
49 #include "itkImageRegionIterator.h"
50 #include "itkMetaImageIO.h"
51 #include "itkMetaDataDictionary.h"
52
53 namespace clitk
54 {
55
56
57 //-----------------------------------------------------------
58 // Constructor
59 //-----------------------------------------------------------
60 template<class args_info_type>
61 UpdateVRTagDicomGenericFilter<args_info_type>::UpdateVRTagDicomGenericFilter()
62 {
63   m_Verbose=false;
64   m_InputFileName="";
65 }
66
67
68 //-----------------------------------------------------------
69 // Update
70 //-----------------------------------------------------------
71 template<class args_info_type>
72 void UpdateVRTagDicomGenericFilter<args_info_type>::Update()
73 {
74   // Read the Dimension and PixelType
75   int Dimension;
76   std::string PixelType;
77   ReadImageDimensionAndPixelType(m_InputFileName, Dimension, PixelType);
78
79
80   // Call UpdateWithDim
81   if(Dimension==2) UpdateWithDim<2>(PixelType);
82   else if(Dimension==3) UpdateWithDim<3>(PixelType);
83   // else if (Dimension==4)UpdateWithDim<4>(PixelType);
84   else {
85     std::cout<<"Error, Only for 2 or 3  Dimensions!!!"<<std::endl ;
86     return;
87   }
88 }
89
90 //-------------------------------------------------------------------
91 // Update with the number of dimensions
92 //-------------------------------------------------------------------
93 template<class args_info_type>
94 template<unsigned int Dimension>
95 void
96 UpdateVRTagDicomGenericFilter<args_info_type>::UpdateWithDim(std::string PixelType)
97 {
98   if (m_Verbose) std::cout << "Image was detected to be "<<Dimension<<"D and "<< PixelType<<"..."<<std::endl;
99
100   if(PixelType == "short") {
101     if (m_Verbose) std::cout << "Launching filter in "<< Dimension <<"D and signed short..." << std::endl;
102     UpdateWithDimAndPixelType<Dimension, signed short>();
103   }
104   else if(PixelType == "unsigned_short"){
105     if (m_Verbose) std::cout  << "Launching filter in "<< Dimension <<"D and unsigned_short..." << std::endl;
106     UpdateWithDimAndPixelType<Dimension, unsigned short>();
107   }
108
109   else if (PixelType == "unsigned_char") {
110     if (m_Verbose) std::cout  << "Launching filter in "<< Dimension <<"D and unsigned_char..." << std::endl;
111     UpdateWithDimAndPixelType<Dimension, unsigned char>();
112   }
113
114   //     else if (PixelType == "char"){
115   //       if (m_Verbose) std::cout  << "Launching filter in "<< Dimension <<"D and signed_char..." << std::endl;
116   //       UpdateWithDimAndPixelType<Dimension, signed char>();
117   //     }
118   else if (PixelType == "double") {
119     if (m_Verbose) std::cout  << "Launching filter in "<< Dimension <<"D and double..." << std::endl;
120     UpdateWithDimAndPixelType<Dimension, double>();
121   }
122   else {
123     if (m_Verbose) std::cout  << "Launching filter in "<< Dimension <<"D and float..." << std::endl;
124     UpdateWithDimAndPixelType<Dimension, float>();
125   }
126 }
127
128 //-------------------------------------------------------------------
129 // Update with the number of dimensions and the pixeltype read from
130 // the dicom files. The MHD files may be resampled to match the
131 // dicom spacing (and number of slices). Rounding errors in resampling
132 // are handled by removing files when generating the output dicom
133 // series.
134 //-------------------------------------------------------------------
135 template<class args_info_type>
136 template <unsigned int Dimension, class  PixelType>
137 void
138 UpdateVRTagDicomGenericFilter<args_info_type>::UpdateWithDimAndPixelType()
139 {
140   UpdateVRMap<Dimension,PixelType>();
141   InitVRMap<Dimension,PixelType>();
142   char temp[128];
143   f.open(m_ArgsInfo.input_arg,std::fstream::binary);
144   model.open(m_ArgsInfo.model_arg,std::fstream::binary);
145   output.open(m_ArgsInfo.output_arg,std::fstream::binary);
146
147   if(!f.is_open())
148   {
149     std::cout << "File " << m_ArgsInfo.input_arg << " not found." << std::endl;
150     return;
151   }
152   f.seekg (0);
153   model.seekg (0);
154   f.read(temp,128); // first 128 bytes in a DICOM file are unused
155   model.read(temp,128); // first 128 bytes in a DICOM file are unused
156   output.write(temp,128);
157   f.read(temp,4);
158   // verify that the first 4 bytes are DICM
159   if(std::memcmp(temp,"DICM",4))
160   {
161     std::cout << "Not a valid DICOM file!" << std::endl;
162     f.close();
163     return;
164   }
165   model.read(temp,4);
166   output.write(temp,4);
167   counter = 0;
168   size = 0;
169   endSQ = 0;
170
171   while(f.peek() != EOF) // process the entire file
172   {
173     this->ReadDataElement<Dimension,PixelType>(f, model);
174   }
175
176   f.close();
177   model.close();
178   output.close();
179 }
180 //---------------------------------------------------------------------------
181
182
183 //---------------------------------------------------------------------------
184 template<class args_info_type>
185 template <unsigned int Dimension, class  PixelType>
186 void
187 UpdateVRTagDicomGenericFilter<args_info_type>::ReadDataElement(std::ifstream& f, std::ifstream& model)
188 {
189
190   char temp[8] = {0,0,0,0,0,0,0,0};
191   unsigned char SQEndTag[] = {0xFE, 0xFF, 0xDD, 0xE0};
192
193   //Use to convert the output of clitkWriteDicomSeries to the a specific dicom format with the VR tag.
194   //Read the input file f and write it in the output.
195   //Except for the first 7 lines, we copy the model
196   //Except for the 8th line, we remove it.
197   //Except for the lines with an unknow VRTag (??)
198   //While copy, include the 2 letters of the VRTag
199   //For SQ, I had to count the number of byte with size and endSQ
200
201  /* while (f) {
202           uint32_t tempChar;
203     f.read((char*)&tempChar,1);
204     std::cout << tempChar << std::endl;
205   }
206   return;*/
207
208   f.read((char*)&Group,2);
209   if (counter <7) model.read((char*)&Group,2);
210   f.read((char*)&Element,2);
211   if (counter <7) model.read((char*)&Element,2);
212
213   if (counter <7) {
214     output.write((char*)&Group,2);
215     output.write((char*)&Element,2);
216     f.read(temp,2);
217     model.read(temp,2);
218     output.write(temp,2);
219     VR = temp;
220   }
221   else if (counter == 7) {
222     f.read(temp,2);
223     VR = temp;
224   }
225   else {
226     std::string VRtag = "(";
227     VRtag += int_to_hex(Group);
228     std::string tempVR = ",";
229     VRtag += tempVR;
230     VRtag += int_to_hex(Element);
231     tempVR = ")";
232     VRtag += tempVR;
233     VR = VRMapModel[VRtag];
234     if (VR == "??") {
235       f.read(temp,4);
236       return;
237     }
238     output.write((char*)&Group,2);
239     output.write((char*)&Element,2);
240     output.write((char*)&VR[0],1); // Ecrire les 2 lettre separemments en les convertissant en ASCII puis hexa
241     output.write((char*)&VR[1],1);
242   }
243   Length = 0;
244   LengthModel = 0;
245   switch(VRMap[VR])
246   {
247     case VR_OB:         // if VR is OB, OW, OF, SQ, UT, or UN, skip two bytes, then read 4 byte length
248     case VR_OF:
249     case VR_UT:
250     case VR_UN:
251       f.read(temp,2);
252       if (counter <7) model.read(temp,2);
253       output.write(temp,2);
254       f.read((char*)&Length,4);
255       if (counter <7) model.read((char*)&LengthModel,4);
256       if (counter <7) output.write((char*)&LengthModel,4); else output.write((char*)&Length,4);
257       size += Length + 12;
258       break;
259     case VR_SQ:
260       Value = NULL;
261       temp[0] = 0;
262       temp[1] = 0;
263       output.write(temp,2);
264       f.read((char*)&Length,4);
265       output.write((char*)&Length,4);
266       // this is where we'll be creating new Dicom Objects for SQ data
267       // for each Dicom Object in the sequence
268       if(Length==0xFFFFFFFF)
269       {
270         // check the tag before passing to the DicomObj creator
271         f.read(temp,4);
272         while(std::memcmp(temp,SQEndTag,4))
273         {
274           f.seekg(-4,std::ios::cur);
275           ++endSQ;
276           ReadDicomObject<Dimension,PixelType>(f, model);
277           --endSQ;
278           f.read(temp,4);
279         }
280         // skip the next four bytes and continue
281         output.write(temp,4);
282         f.read(temp,4);
283         output.write(temp,4);
284         size += 20;
285       }
286       else
287       {
288         while(size < Length)
289         {
290           ++endSQ;
291           ReadDicomObject<Dimension,PixelType>(f, model);
292           --endSQ;
293         }
294         size += Length + 12;
295       }
296       if (!endSQ)
297         size = 0;
298       return;
299     case VR_OW:
300       f.read(temp,1);
301       output.write(temp,1);
302       temp[0] = 0;
303       temp[1] = 0;
304       output.write(temp,2);
305       f.read((char*)&Length,4);
306       output.write((char*)&Length,4);
307       output.write(temp,2);
308       size += Length + 12;
309     default:
310       f.read((char*)&Length,2);
311       if (counter <7) model.read((char*)&LengthModel,2);
312       if (counter <7) output.write((char*)&LengthModel,2); else if (counter > 7) output.write((char*)&Length,2);
313       size += Length + 8;
314       break;
315   }
316   if (counter >=8) {
317     f.read(temp,2);
318   }
319   if(Length)
320   {
321     Value = new char[Length];
322     ValueModel = new char[LengthModel];
323     if(Value)
324     {
325       f.read(Value,Length);
326       if (counter <7) model.read(ValueModel,LengthModel);
327       if (counter <7) output.write(ValueModel,LengthModel); else if (counter > 7) output.write(Value,Length);
328     }
329     else
330       std::cout << "Error: unable to allocate memory for data element" << std::endl;
331   }
332   else
333     Value = NULL;
334
335   counter++;
336   if (!endSQ)
337     size = 0;
338
339   return;
340 }
341 //---------------------------------------------------------------------------
342
343
344
345 //---------------------------------------------------------------------------
346 template<class args_info_type>
347 template <unsigned int Dimension, class  PixelType>
348 void
349 UpdateVRTagDicomGenericFilter<args_info_type>::ReadDicomObject(std::ifstream& f, std::ifstream& model)
350 {
351   char temp[4];
352   const unsigned char DicomObjTag[4] = {0xFE,0xFF,0x00,0xE0}; //start of item
353   const unsigned char ItemEndTag[4] = {0xFE,0xFF,0x0D,0xE0}; //end of item
354
355
356   // read tags
357   f.read(temp,4);
358   output.write(temp,4);
359   if(std::memcmp(temp,DicomObjTag,4))
360     std::cout << "Nested Dicom Object Tag error\n";
361   // read ObjLength
362   f.read((char*)&Length,4);
363   output.write((char*)&Length,4);
364
365   if(Length == 0xFFFFFFFF)
366   {
367     // create data elements until an FFFE,E00D tag
368     f.read(temp,4);
369     while(std::memcmp(temp, ItemEndTag,4))
370     {
371       f.seekg(-4,std::ios::cur);
372       ++endSQ;
373       ReadDataElement<Dimension,PixelType>(f, model);
374       --endSQ;
375       f.read(temp,4);
376     }
377     output.write(temp,4);
378     f.read(temp,4);
379     output.write(temp,4);
380     size += 16;
381   }
382   else
383   {
384     while(size < Length)
385     {
386       ++endSQ;
387       ReadDataElement<Dimension,PixelType>(f, model);
388       --endSQ;
389     }
390     size += Length + 8;
391     if(size != Length)
392       std::cout << "DicomObj length error\n";
393   }
394 }
395 //---------------------------------------------------------------------------
396
397
398 //---------------------------------------------------------------------------
399 void CopyDictionary (itk::MetaDataDictionary &fromDict, itk::MetaDataDictionary &toDict)
400 {
401   typedef itk::MetaDataDictionary DictionaryType;
402
403   DictionaryType::ConstIterator itr = fromDict.Begin();
404   DictionaryType::ConstIterator end = fromDict.End();
405   typedef itk::MetaDataObject< std::string > MetaDataStringType;
406
407   while( itr != end )
408     {
409     itk::MetaDataObjectBase::Pointer  entry = itr->second;
410
411     MetaDataStringType::Pointer entryvalue =
412       dynamic_cast<MetaDataStringType *>( entry.GetPointer() ) ;
413     if( entryvalue )
414       {
415       std::string tagkey   = itr->first;
416       std::string tagvalue = entryvalue->GetMetaDataObjectValue();
417       itk::EncapsulateMetaData<std::string>(toDict, tagkey, tagvalue);
418       }
419     ++itr;
420     }
421 }
422 //---------------------------------------------------------------------------
423
424
425 //---------------------------------------------------------------------------
426 template <typename T> std::string NumberToString ( T Number )
427 {
428    std::ostringstream ss;
429    ss << Number;
430    return ss.str();
431 }
432 //---------------------------------------------------------------------------
433
434
435 //---------------------------------------------------------------------------
436 std::string string_to_hex( std::string &input )
437 {
438     static const char* const lut = "0123456789ABCDEF";
439     size_t len = input.length();
440
441     std::string output;
442     output.reserve(2 * len);
443     for (size_t i = 0; i < len; ++i)
444     {
445         const unsigned char c = input[i];
446         output.push_back(lut[c >> 4]);
447         output.push_back(lut[c & 15]);
448     }
449     return output;
450 }
451 //---------------------------------------------------------------------------
452
453
454 //---------------------------------------------------------------------------
455 template< typename T > std::string int_to_hex( T i )
456 {
457   std::stringstream stream;
458   stream << std::setfill ('0') << std::setw(sizeof(T)*2) 
459          << std::hex << i;
460   return stream.str();
461 }
462 //---------------------------------------------------------------------------
463
464
465
466 //---------------------------------------------------------------------------
467 template<class args_info_type>
468 template <unsigned int Dimension, class  PixelType>
469 void
470 UpdateVRTagDicomGenericFilter<args_info_type>::InitVRMap()
471 {
472   VRMap["AE"] = VR_AE;
473   VRMap["AS"] = VR_AS;
474   VRMap["AT"] = VR_AT;
475   VRMap["CS"] = VR_CS;
476   VRMap["DA"] = VR_DA;
477   VRMap["DS"] = VR_DS;
478   VRMap["DT"] = VR_DT;
479   VRMap["FL"] = VR_FL;
480   VRMap["FD"] = VR_FD;
481   VRMap["IS"] = VR_IS;
482   VRMap["LO"] = VR_LO;
483   VRMap["LT"] = VR_LT;
484   VRMap["OB"] = VR_OB;
485   VRMap["OF"] = VR_OF;
486   VRMap["OW"] = VR_OW;
487   VRMap["PN"] = VR_PN;
488   VRMap["SH"] = VR_SH;
489   VRMap["SL"] = VR_SL;
490   VRMap["SQ"] = VR_SQ;
491   VRMap["SS"] = VR_SS;
492   VRMap["ST"] = VR_ST;
493   VRMap["TM"] = VR_TM;
494   VRMap["UI"] = VR_UI;
495   VRMap["UL"] = VR_UL;
496   VRMap["UN"] = VR_UN;
497   VRMap["US"] = VR_US;
498   VRMap["UT"] = VR_UT;
499 }
500 //---------------------------------------------------------------------------
501
502
503 //---------------------------------------------------------------------------
504 template<class args_info_type>
505 template <unsigned int Dimension, class  PixelType>
506 void
507 UpdateVRTagDicomGenericFilter<args_info_type>::UpdateVRMap()
508 {
509   VRMapModel["(0002,0000)"] = "UL";
510   VRMapModel["(0002,0001)"] = "OB";
511   VRMapModel["(0002,0002)"] = "UI";
512   VRMapModel["(0002,0003)"] = "UI";
513   VRMapModel["(0002,0010)"] = "UI";
514   VRMapModel["(0002,0012)"] = "UI";
515   VRMapModel["(0002,0013)"] = "SH";
516   VRMapModel["(0008,0005)"] = "CS";
517   VRMapModel["(0008,0008)"] = "CS";
518   VRMapModel["(0008,0016)"] = "UI";
519   VRMapModel["(0008,0018)"] = "UI";
520   VRMapModel["(0008,0020)"] = "DA";
521   VRMapModel["(0008,0021)"] = "DA";
522   VRMapModel["(0008,0022)"] = "DA";
523   VRMapModel["(0008,0023)"] = "DA";
524   VRMapModel["(0008,002a)"] = "DT";
525   VRMapModel["(0008,0030)"] = "TM";
526   VRMapModel["(0008,0031)"] = "TM";
527   VRMapModel["(0008,0032)"] = "TM";
528   VRMapModel["(0008,0033)"] = "TM";
529   VRMapModel["(0008,0050)"] = "SH";
530   VRMapModel["(0008,0060)"] = "CS";
531   VRMapModel["(0008,0070)"] = "LO";
532   VRMapModel["(0008,0090)"] = "PN";
533   VRMapModel["(0008,1010)"] = "SH";
534   VRMapModel["(0008,1030)"] = "LO";
535   VRMapModel["(0008,1032)"] = "SQ";
536   VRMapModel["(0008,0100)"] = "SH";
537   VRMapModel["(0008,0102)"] = "SH";
538   VRMapModel["(0008,0103)"] = "SH";
539   VRMapModel["(0008,0104)"] = "LO";
540   VRMapModel["(0008,103e)"] = "LO";
541   VRMapModel["(0008,1090)"] = "LO";
542   VRMapModel["(0008,1111)"] = "SQ";
543   VRMapModel["(0008,1150)"] = "UI";
544   VRMapModel["(0009,0010)"] = "LO";
545   VRMapModel["(0009,1029)"] = "??";
546   VRMapModel["(0009,1030)"] = "??";
547   VRMapModel["(0009,104d)"] = "??";
548   VRMapModel["(0009,104e)"] = "??";
549   VRMapModel["(0009,104f)"] = "??";
550   VRMapModel["(0009,1050)"] = "??";
551   VRMapModel["(0009,1051)"] = "??";
552   VRMapModel["(0009,1052)"] = "??";
553   VRMapModel["(0009,1053)"] = "??";
554   VRMapModel["(0009,1054)"] = "??";
555   VRMapModel["(0009,1055)"] = "??";
556   VRMapModel["(0009,1056)"] = "??";
557   VRMapModel["(0009,1057)"] = "??";
558   VRMapModel["(0009,1058)"] = "??";
559   VRMapModel["(0009,1059)"] = "??";
560   VRMapModel["(0009,105a)"] = "??";
561   VRMapModel["(0009,105b)"] = "??";
562   VRMapModel["(0009,105c)"] = "??";
563   VRMapModel["(0009,105d)"] = "??";
564   VRMapModel["(0009,105e)"] = "??";
565   VRMapModel["(0009,1069)"] = "??";
566   VRMapModel["(0009,106a)"] = "??";
567   VRMapModel["(0009,106b)"] = "??";
568   VRMapModel["(0009,106c)"] = "??";
569   VRMapModel["(0009,106d)"] = "??";
570   VRMapModel["(0009,106e)"] = "??";
571   VRMapModel["(0009,106f)"] = "??";
572   VRMapModel["(0009,1070)"] = "??";
573   VRMapModel["(0009,1071)"] = "??";
574   VRMapModel["(0009,1087)"] = "??";
575   VRMapModel["(0009,1088)"] = "??";
576   VRMapModel["(0009,1090)"] = "??";
577   VRMapModel["(0009,1091)"] = "??";
578   VRMapModel["(0009,1092)"] = "??";
579   VRMapModel["(0009,1093)"] = "??";
580   VRMapModel["(0009,109a)"] = "??";
581   VRMapModel["(0009,10a3)"] = "??";
582   VRMapModel["(0009,10a4)"] = "??";
583   VRMapModel["(0009,10a9)"] = "??";
584   VRMapModel["(0009,10aa)"] = "??";
585   VRMapModel["(0009,10ab)"] = "??";
586   VRMapModel["(0009,10ac)"] = "??";
587   VRMapModel["(0009,10ad)"] = "??";
588   VRMapModel["(0009,10ae)"] = "??";
589   VRMapModel["(0009,10af)"] = "??";
590   VRMapModel["(0009,10b0)"] = "??";
591   VRMapModel["(0009,10b1)"] = "??";
592   VRMapModel["(0009,10b2)"] = "??";
593   VRMapModel["(0009,10ba)"] = "??";
594   VRMapModel["(0009,10bb)"] = "SQ";
595   VRMapModel["(0009,10bd)"] = "??";
596   VRMapModel["(0009,10c2)"] = "??";
597   VRMapModel["(0009,0010)"] = "LO";
598   VRMapModel["(0009,0010)"] = "LO";
599   VRMapModel["(0009,0010)"] = "LO";
600   VRMapModel["(0009,0010)"] = "LO";
601   VRMapModel["(0009,0010)"] = "LO";
602   VRMapModel["(0009,0010)"] = "LO";
603   VRMapModel["(0009,0010)"] = "LO";
604   VRMapModel["(0009,0010)"] = "LO";
605   VRMapModel["(0009,0010)"] = "LO";
606   VRMapModel["(0009,0010)"] = "LO";
607   VRMapModel["(0009,0010)"] = "LO";
608   VRMapModel["(0009,0010)"] = "LO";
609   VRMapModel["(0009,10c4)"] = "OB";
610   VRMapModel["(0010,0010)"] = "PN";
611   VRMapModel["(0010,0020)"] = "LO";
612   VRMapModel["(0010,0030)"] = "DA";
613   VRMapModel["(0010,0040)"] = "CS";
614   VRMapModel["(0010,1020)"] = "DS";
615   VRMapModel["(0010,1030)"] = "DS";
616   VRMapModel["(0018,0070)"] = "IS";
617   VRMapModel["(0018,0088)"] = "DS";
618   VRMapModel["(0018,0071)"] = "CS";
619   VRMapModel["(0018,1000)"] = "LO";
620   VRMapModel["(0018,1020)"] = "LO";
621   VRMapModel["(0018,1030)"] = "LO";
622   VRMapModel["(0018,1243)"] = "IS";
623   VRMapModel["(0018,5100)"] = "CS";
624   VRMapModel["(0020,000d)"] = "UI";
625   VRMapModel["(0020,000e)"] = "UI";
626   VRMapModel["(0020,0010)"] = "SH";
627   VRMapModel["(0020,0011)"] = "IS";
628   VRMapModel["(0020,0012)"] = "IS";
629   VRMapModel["(0020,0013)"] = "IS";
630   VRMapModel["(0020,4000)"] = "LT";
631   VRMapModel["(0028,0002)"] = "US";
632   VRMapModel["(0028,0004)"] = "CS";
633   VRMapModel["(0028,0008)"] = "IS";
634   VRMapModel["(0028,0009)"] = "AT";
635   VRMapModel["(0028,0010)"] = "US";
636   VRMapModel["(0028,0011)"] = "US";
637   VRMapModel["(0028,0030)"] = "DS";
638   VRMapModel["(0028,0051)"] = "CS";
639   VRMapModel["(0028,0100)"] = "US";
640   VRMapModel["(0028,0101)"] = "US";
641   VRMapModel["(0028,0102)"] = "US";
642   VRMapModel["(0028,0103)"] = "US";
643   VRMapModel["(0040,0244)"] = "DA";
644   VRMapModel["(0040,0245)"] = "TM";
645   VRMapModel["(0040,0253)"] = "SH";
646   VRMapModel["(0040,0254)"] = "LO";
647   VRMapModel["(0040,0260)"] = "SQ";
648   VRMapModel["(0008,0104)"] = "LO";
649   VRMapModel["(0040,0275)"] = "SQ";
650   VRMapModel["(0008,0050)"] = "SH";
651   VRMapModel["(0020,000d)"] = "UI";
652   VRMapModel["(0032,1060)"] = "LO";
653   VRMapModel["(0032,1064)"] = "SQ";
654   VRMapModel["(0008,0100)"] = "SH";
655   VRMapModel["(0008,0102)"] = "SH";
656   VRMapModel["(0008,0103)"] = "SH";
657   VRMapModel["(0008,0104)"] = "LO";
658   VRMapModel["(0040,0008)"] = "SQ";
659   VRMapModel["(0008,0104)"] = "LO";
660   VRMapModel["(0040,0009)"] = "SH";
661   VRMapModel["(0040,1001)"] = "SH";
662   VRMapModel["(0054,0010)"] = "US";
663   VRMapModel["(0054,0011)"] = "US";
664   VRMapModel["(0054,0012)"] = "SQ";
665   VRMapModel["(0054,0013)"] = "SQ";
666   VRMapModel["(0054,0014)"] = "DS";
667   VRMapModel["(0054,0015)"] = "DS";
668   VRMapModel["(0054,0014)"] = "DS";
669   VRMapModel["(0054,0015)"] = "DS";
670   VRMapModel["(0054,0018)"] = "SH";
671   VRMapModel["(0054,0013)"] = "SQ";
672   VRMapModel["(0054,0014)"] = "DS";
673   VRMapModel["(0054,0015)"] = "DS";
674   VRMapModel["(0054,0018)"] = "SH";
675   VRMapModel["(0054,0013)"] = "SQ";
676   VRMapModel["(0054,0014)"] = "DS";
677   VRMapModel["(0054,0015)"] = "DS";
678   VRMapModel["(0054,0018)"] = "SH";
679   VRMapModel["(0054,0016)"] = "SQ";
680   VRMapModel["(0018,0031)"] = "LO";
681   VRMapModel["(0018,1071)"] = "DS";
682   VRMapModel["(0018,1074)"] = "DS";
683   VRMapModel["(0054,0300)"] = "SQ";
684   VRMapModel["(0008,0100)"] = "SH";
685   VRMapModel["(0008,0102)"] = "SH";
686   VRMapModel["(0008,0104)"] = "LO";
687   VRMapModel["(0054,0302)"] = "SQ";
688   VRMapModel["(0008,0100)"] = "SH";
689   VRMapModel["(0008,0102)"] = "SH";
690   VRMapModel["(0008,0104)"] = "LO";
691   VRMapModel["(0054,0306)"] = "SQ";
692   VRMapModel["(0018,1045)"] = "IS";
693   VRMapModel["(0054,0017)"] = "IS";
694   VRMapModel["(0054,0308)"] = "US";
695   VRMapModel["(0018,1045)"] = "IS";
696   VRMapModel["(0054,0017)"] = "IS";
697   VRMapModel["(0054,0308)"] = "US";
698   VRMapModel["(0018,1045)"] = "IS";
699   VRMapModel["(0054,0017)"] = "IS";
700   VRMapModel["(0054,0308)"] = "US";
701   VRMapModel["(0018,1045)"] = "IS";
702   VRMapModel["(0054,0017)"] = "IS";
703   VRMapModel["(0054,0308)"] = "US";
704   VRMapModel["(0054,0020)"] = "US";
705   VRMapModel["(0054,0021)"] = "US";
706   VRMapModel["(0054,0022)"] = "SQ";
707   VRMapModel["(0009,0010)"] = "LO";
708   VRMapModel["(0009,1031)"] = "DS";
709   VRMapModel["(0009,1032)"] = "SH";
710   VRMapModel["(0009,1033)"] = "FD";
711   VRMapModel["(0009,1034)"] = "FD";
712   VRMapModel["(0009,107c)"] = "FD";
713   VRMapModel["(0009,107d)"] = "FD";
714   VRMapModel["(0009,107e)"] = "FD";
715   VRMapModel["(0009,107f)"] = "FD";
716   VRMapModel["(0009,1080)"] = "FD";
717   VRMapModel["(0009,1081)"] = "FD";
718   VRMapModel["(0009,1082)"] = "FD";
719   VRMapModel["(0009,1083)"] = "FD";
720   VRMapModel["(0009,1084)"] = "FD";
721   VRMapModel["(0009,1085)"] = "FD";
722   VRMapModel["(0009,1086)"] = "FD";
723   VRMapModel["(0009,10a5)"] = "FD";
724   VRMapModel["(0009,10a6)"] = "SL";
725   VRMapModel["(0009,10a7)"] = "SL";
726   VRMapModel["(0009,10a8)"] = "FD";
727   VRMapModel["(0018,1142)"] = "DS";
728   VRMapModel["(0018,1147)"] = "CS";
729   VRMapModel["(0018,1149)"] = "IS";
730   VRMapModel["(0018,1180)"] = "SH";
731   VRMapModel["(0018,1181)"] = "CS";
732   VRMapModel["(0018,1182)"] = "IS";
733   VRMapModel["(0020,0032)"] = "DS";
734   VRMapModel["(0020,0037)"] = "DS";
735   VRMapModel["(0028,0031)"] = "DS";
736   VRMapModel["(0054,0200)"] = "DS";
737   VRMapModel["(0009,0010)"] = "LO";
738   VRMapModel["(0009,1031)"] = "DS";
739   VRMapModel["(0009,1032)"] = "SH";
740   VRMapModel["(0009,1033)"] = "FD";
741   VRMapModel["(0009,1034)"] = "FD";
742   VRMapModel["(0009,107c)"] = "FD";
743   VRMapModel["(0009,107d)"] = "FD";
744   VRMapModel["(0009,107e)"] = "FD";
745   VRMapModel["(0009,107f)"] = "FD";
746   VRMapModel["(0009,1080)"] = "FD";
747   VRMapModel["(0009,1081)"] = "FD";
748   VRMapModel["(0009,1082)"] = "FD";
749   VRMapModel["(0009,1083)"] = "FD";
750   VRMapModel["(0009,1084)"] = "FD";
751   VRMapModel["(0009,1085)"] = "FD";
752   VRMapModel["(0009,1086)"] = "FD";
753   VRMapModel["(0009,10a5)"] = "FD";
754   VRMapModel["(0009,10a6)"] = "SL";
755   VRMapModel["(0009,10a7)"] = "SL";
756   VRMapModel["(0009,10a8)"] = "FD";
757   VRMapModel["(0018,1142)"] = "DS";
758   VRMapModel["(0018,1147)"] = "CS";
759   VRMapModel["(0018,1149)"] = "IS";
760   VRMapModel["(0018,1180)"] = "SH";
761   VRMapModel["(0018,1181)"] = "CS";
762   VRMapModel["(0018,1182)"] = "IS";
763   VRMapModel["(0020,0032)"] = "DS";
764   VRMapModel["(0020,0037)"] = "DS";
765   VRMapModel["(0028,0031)"] = "DS";
766   VRMapModel["(0054,0200)"] = "DS";
767   VRMapModel["(0009,0010)"] = "LO";
768   VRMapModel["(0009,1031)"] = "DS";
769   VRMapModel["(0009,1032)"] = "SH";
770   VRMapModel["(0009,1033)"] = "FD";
771   VRMapModel["(0009,1034)"] = "FD";
772   VRMapModel["(0009,107c)"] = "FD";
773   VRMapModel["(0009,107d)"] = "FD";
774   VRMapModel["(0009,107e)"] = "FD";
775   VRMapModel["(0009,107f)"] = "FD";
776   VRMapModel["(0009,1080)"] = "FD";
777   VRMapModel["(0009,1081)"] = "FD";
778   VRMapModel["(0009,1082)"] = "FD";
779   VRMapModel["(0009,1083)"] = "FD";
780   VRMapModel["(0009,1084)"] = "FD";
781   VRMapModel["(0009,1085)"] = "FD";
782   VRMapModel["(0009,1086)"] = "FD";
783   VRMapModel["(0009,10a5)"] = "FD";
784   VRMapModel["(0009,10a6)"] = "SL";
785   VRMapModel["(0009,10a7)"] = "SL";
786   VRMapModel["(0009,10a8)"] = "FD";
787   VRMapModel["(0018,1142)"] = "DS";
788   VRMapModel["(0018,1147)"] = "CS";
789   VRMapModel["(0018,1149)"] = "IS";
790   VRMapModel["(0018,1180)"] = "SH";
791   VRMapModel["(0018,1181)"] = "CS";
792   VRMapModel["(0018,1182)"] = "IS";
793   VRMapModel["(0020,0032)"] = "DS";
794   VRMapModel["(0020,0037)"] = "DS";
795   VRMapModel["(0028,0031)"] = "DS";
796   VRMapModel["(0054,0200)"] = "DS";
797   VRMapModel["(0009,0010)"] = "LO";
798   VRMapModel["(0009,1031)"] = "DS";
799   VRMapModel["(0009,1032)"] = "SH";
800   VRMapModel["(0009,1033)"] = "FD";
801   VRMapModel["(0009,1034)"] = "FD";
802   VRMapModel["(0009,107c)"] = "FD";
803   VRMapModel["(0009,107d)"] = "FD";
804   VRMapModel["(0009,107e)"] = "FD";
805   VRMapModel["(0009,107f)"] = "FD";
806   VRMapModel["(0009,1080)"] = "FD";
807   VRMapModel["(0009,1081)"] = "FD";
808   VRMapModel["(0009,1082)"] = "FD";
809   VRMapModel["(0009,1083)"] = "FD";
810   VRMapModel["(0009,1084)"] = "FD";
811   VRMapModel["(0009,1085)"] = "FD";
812   VRMapModel["(0009,1086)"] = "FD";
813   VRMapModel["(0009,10a5)"] = "FD";
814   VRMapModel["(0009,10a6)"] = "SL";
815   VRMapModel["(0009,10a7)"] = "SL";
816   VRMapModel["(0009,10a8)"] = "FD";
817   VRMapModel["(0018,1142)"] = "DS";
818   VRMapModel["(0018,1147)"] = "CS";
819   VRMapModel["(0018,1149)"] = "IS";
820   VRMapModel["(0018,1180)"] = "SH";
821   VRMapModel["(0018,1181)"] = "CS";
822   VRMapModel["(0018,1182)"] = "IS";
823   VRMapModel["(0020,0032)"] = "DS";
824   VRMapModel["(0020,0037)"] = "DS";
825   VRMapModel["(0028,0031)"] = "DS";
826   VRMapModel["(0054,0200)"] = "DS";
827   VRMapModel["(0054,0050)"] = "US";
828   VRMapModel["(0054,0051)"] = "US";
829   VRMapModel["(0054,0052)"] = "SQ";
830   VRMapModel["(0009,0010)"] = "LO";
831   VRMapModel["(0009,1024)"] = "DS";
832   VRMapModel["(0009,1025)"] = "DS";
833   VRMapModel["(0009,1026)"] = "DS";
834   VRMapModel["(0009,1027)"] = "DT";
835   VRMapModel["(0009,1028)"] = "DT";
836   VRMapModel["(0018,1140)"] = "CS";
837   VRMapModel["(0018,1143)"] = "DS";
838   VRMapModel["(0018,1144)"] = "DS";
839   VRMapModel["(0018,1242)"] = "IS";
840   VRMapModel["(0054,0053)"] = "US";
841   VRMapModel["(0054,0200)"] = "DS";
842   VRMapModel["(0054,0090)"] = "US";
843   VRMapModel["(0054,0202)"] = "CS";
844   VRMapModel["(0054,0400)"] = "SH";
845   VRMapModel["(0054,0410)"] = "SQ";
846   VRMapModel["(0008,0100)"] = "SH";
847   VRMapModel["(0008,0102)"] = "SH";
848   VRMapModel["(0008,0104)"] = "LO";
849   VRMapModel["(0054,0412)"] = "SQ";
850   VRMapModel["(0008,0100)"] = "SH";
851   VRMapModel["(0008,0102)"] = "SH";
852   VRMapModel["(0008,0104)"] = "LO";
853   VRMapModel["(0054,0414)"] = "SQ";
854   VRMapModel["(0008,0100)"] = "SH";
855   VRMapModel["(0008,0102)"] = "SH";
856   VRMapModel["(0008,0104)"] = "LO";
857   VRMapModel["(7fe0,0010)"] = "OW";
858 }
859 //---------------------------------------------------------------------------
860
861 }//end clitk
862
863 #endif //#define clitkUpdateVRTagDicomGenericFilter_txx