- メインページ
- モジュール
- ネームスペース
- データ構造
- ファイル

- ファイル一覧
- グローバル

dicom_tag.h
説明を見る。
1 //
2 // Copyright (c) 2003-2011, MIST Project, Nagoya University
3 // All rights reserved.
4 //
5 // Redistribution and use in source and binary forms, with or without modification,
6 // are permitted provided that the following conditions are met:
7 //
8 // 1. Redistributions of source code must retain the above copyright notice,
9 // this list of conditions and the following disclaimer.
10 //
11 // 2. Redistributions in binary form must reproduce the above copyright notice,
12 // this list of conditions and the following disclaimer in the documentation
13 // and/or other materials provided with the distribution.
14 //
15 // 3. Neither the name of the Nagoya University nor the names of its contributors
16 // may be used to endorse or promote products derived from this software
17 // without specific prior written permission.
18 //
19 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
20 // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
21 // FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
22 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
25 // IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
26 // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 //
28
33 #ifndef __INCLUDE_MIST_DICOM_TAG__
34 #define __INCLUDE_MIST_DICOM_TAG__
35
36
37 #ifndef __INCLUDE_MIST_CONF_H__
38 #include "../config/mist_conf.h"
39 #endif
40
41 #include <iostream>
42 #include <string>
43 #include <set>
44
45
46 // mist名前空間の始まり
47 _MIST_BEGIN
48
49
52
55
56
58 namespace dicom
59 {
60 typedef size_t size_type;
61 typedef ptrdiff_t difference_type;
62
63 #ifdef __INCLUDE_DICOM_TAG_ALL__
64
65 // 対応しているタグを全てインクルードする
66 #define __INCLUDE_DICOM_TAG_0000__
67 #define __INCLUDE_DICOM_TAG_0002__
68 #define __INCLUDE_DICOM_TAG_0004__
69 #define __INCLUDE_DICOM_TAG_0008__
70 #define __INCLUDE_DICOM_TAG_0010__
71 #define __INCLUDE_DICOM_TAG_0012__
72 #define __INCLUDE_DICOM_TAG_0018__
73 #define __INCLUDE_DICOM_TAG_0020__
74 #define __INCLUDE_DICOM_TAG_0022__
75 #define __INCLUDE_DICOM_TAG_0028__
76 #define __INCLUDE_DICOM_TAG_0032__
77 #define __INCLUDE_DICOM_TAG_0038__
78 #define __INCLUDE_DICOM_TAG_003A__
79 #define __INCLUDE_DICOM_TAG_0040__
80 #define __INCLUDE_DICOM_TAG_0042__
81 #define __INCLUDE_DICOM_TAG_0044__
82 #define __INCLUDE_DICOM_TAG_0046__
83 #define __INCLUDE_DICOM_TAG_0050__
84 #define __INCLUDE_DICOM_TAG_0054__
85 #define __INCLUDE_DICOM_TAG_0060__
86 #define __INCLUDE_DICOM_TAG_0062__
87 #define __INCLUDE_DICOM_TAG_0064__
88 #define __INCLUDE_DICOM_TAG_0066__
89 #define __INCLUDE_DICOM_TAG_0070__
90 #define __INCLUDE_DICOM_TAG_0072__
91 #define __INCLUDE_DICOM_TAG_0074__
92 #define __INCLUDE_DICOM_TAG_0088__
93 #define __INCLUDE_DICOM_TAG_0100__
94 #define __INCLUDE_DICOM_TAG_0400__
95 #define __INCLUDE_DICOM_TAG_2000__
96 #define __INCLUDE_DICOM_TAG_2010__
97 #define __INCLUDE_DICOM_TAG_2020__
98 #define __INCLUDE_DICOM_TAG_2030__
99 #define __INCLUDE_DICOM_TAG_2040__
100 #define __INCLUDE_DICOM_TAG_2050__
101 #define __INCLUDE_DICOM_TAG_2100__
102 #define __INCLUDE_DICOM_TAG_2110__
103 #define __INCLUDE_DICOM_TAG_2120__
104 #define __INCLUDE_DICOM_TAG_2130__
105 #define __INCLUDE_DICOM_TAG_2200__
106 #define __INCLUDE_DICOM_TAG_3002__
107 #define __INCLUDE_DICOM_TAG_3004__
108 #define __INCLUDE_DICOM_TAG_3006__
109 #define __INCLUDE_DICOM_TAG_3008__
110 #define __INCLUDE_DICOM_TAG_300A__
111 #define __INCLUDE_DICOM_TAG_300C__
112 #define __INCLUDE_DICOM_TAG_300E__
113 #define __INCLUDE_DICOM_TAG_4000__
114 #define __INCLUDE_DICOM_TAG_4008__
115 #define __INCLUDE_DICOM_TAG_4FFE__
116 #define __INCLUDE_DICOM_TAG_5000__
117 #define __INCLUDE_DICOM_TAG_5200__
118 #define __INCLUDE_DICOM_TAG_5400__
119 #define __INCLUDE_DICOM_TAG_5600__
120 #define __INCLUDE_DICOM_TAG_6000__
121 #define __INCLUDE_DICOM_TAG_FFFF__
122
123 #else
124
125 // 個別にインクルードするタグを指定する
126 // DICOMのタグの内，有効にするタグの種類のみ定義する
127 // 利用するものが多くなるにつれ，コンパイル時間が増加するので注意
128
129 // DICOM画像のみを表示するのであれば，以下の3つのマクロのみを有効にすれば良い
130 #define __INCLUDE_DICOM_TAG_0002__
131 #define __INCLUDE_DICOM_TAG_0028__
132 #define __INCLUDE_DICOM_TAG_FFFF__
133
134 #endif
135
136
138 enum dicom_vr
139 {
140 UNKNOWN,
141 AE,
142 AS,
143 AT,
144 CS,
145 DA,
146 DS,
147 DT,
148 FL,
149 FD,
150 IS,
151 LO,
152 LT,
153 OB,
154 OF,
155 OW,
156 PN,
157 SH,
158 SL,
159 SQ,
160 SS,
161 ST,
162 TM,
163 UI,
164 UL,
165 UN,
166 US,
167 UT,
168 };
169
170
172 inline unsigned int construct_dicom_tag( unsigned short group, unsigned short element )
173 {
174 return( ( ( (unsigned int)group << 16 ) & 0xffff0000 ) + ( (unsigned int)element & 0x0000ffff ) );
175 }
176
177
179 inline unsigned short get_dicom_group( unsigned int group_element )
180 {
181 return( static_cast< unsigned short >( 0x0000ffff & ( group_element >> 16 ) ) );
182 }
183
185 inline unsigned short get_dicom_element( unsigned int group_element )
186 {
187 return( static_cast< unsigned short >( 0x0000ffff & group_element ) );
188 }
189
190
192 inline dicom_vr get_dicom_vr( const std::string &vr )
193 {
194 dicom_vr ret = UNKNOWN;
195
196 if( vr == "AE" )
197 {
198 ret = AE;
199 }
200 else if( vr == "AS" )
201 {
202 ret = AS;
203 }
204 else if( vr == "AT" )
205 {
206 ret = AT;
207 }
208 else if( vr == "CS" )
209 {
210 ret = CS;
211 }
212 else if( vr == "DA" )
213 {
214 ret = DA;
215 }
216 else if( vr == "DS" )
217 {
218 ret = DS;
219 }
220 else if( vr == "DT" )
221 {
222 ret = DT;
223 }
224 else if( vr == "FL" )
225 {
226 ret = FL;
227 }
228 else if( vr == "FD" )
229 {
230 ret = FD;
231 }
232 else if( vr == "IS" )
233 {
234 ret = IS;
235 }
236 else if( vr == "LO" )
237 {
238 ret = LO;
239 }
240 else if( vr == "LT" )
241 {
242 ret = LT;
243 }
244 else if( vr == "OB" )
245 {
246 ret = OB;
247 }
248 else if( vr == "OF" )
249 {
250 ret = OF;
251 }
252 else if( vr == "OW" )
253 {
254 ret = OW;
255 }
256 else if( vr == "PN" )
257 {
258 ret = PN;
259 }
260 else if( vr == "SH" )
261 {
262 ret = SH;
263 }
264 else if( vr == "SL" )
265 {
266 ret = SL;
267 }
268 else if( vr == "SQ" )
269 {
270 ret = SQ;
271 }
272 else if( vr == "SS" )
273 {
274 ret = SS;
275 }
276 else if( vr == "ST" )
277 {
278 ret = ST;
279 }
280 else if( vr == "TM" )
281 {
282 ret = TM;
283 }
284 else if( vr == "UI" )
285 {
286 ret = UI;
287 }
288 else if( vr == "UL" )
289 {
290 ret = UL;
291 }
292 else if( vr == "UN" )
293 {
294 ret = UN;
295 }
296 else if( vr == "US" )
297 {
298 ret = US;
299 }
300 else if( vr == "UT" )
301 {
302 ret = UT;
303 }
304
305 return( ret );
306 }
307
308
310 inline std::string get_dicom_vr( const dicom_vr &vr )
311 {
312 std::string ret = "UNKNOWN";
313 switch( vr )
314 {
315 case AE:
316 ret = "AE";
317 break;
318
319 case AS:
320 ret = "AS";
321 break;
322
323 case AT:
324 ret = "AT";
325 break;
326
327 case CS:
328 ret = "CS";
329 break;
330
331 case DA:
332 ret = "DA";
333 break;
334
335 case DS:
336 ret = "DS";
337 break;
338
339 case DT:
340 ret = "DT";
341 break;
342
343 case FL:
344 ret = "FL";
345 break;
346
347 case FD:
348 ret = "FD";
349 break;
350
351 case IS:
352 ret = "IS";
353 break;
354
355 case LO:
356 ret = "LO";
357 break;
358
359 case LT:
360 ret = "LT";
361 break;
362
363 case OB:
364 ret = "OB";
365 break;
366
367 case OW:
368 ret = "OW";
369 break;
370
371 case PN:
372 ret = "PN";
373 break;
374
375 case SH:
376 ret = "SH";
377 break;
378
379 case SL:
380 ret = "SL";
381 break;
382
383 case SQ:
384 ret = "SQ";
385 break;
386
387 case SS:
388 ret = "SS";
389 break;
390
391 case ST:
392 ret = "ST";
393 break;
394
395 case TM:
396 ret = "TM";
397 break;
398
399 case UI:
400 ret = "UI";
401 break;
402
403 case UL:
404 ret = "UL";
405 break;
406
407 case UN:
408 ret = "UN";
409 break;
410
411 case US:
412 ret = "US";
413 break;
414
415 case UT:
416 ret = "UT";
417 break;
418
419 default:
420 break;
421 }
422 return( ret );
423 }
424
425
427 class dicom_tag
428 {
429 public:
430 unsigned int tag;
431 dicom_vr vr;
432 int vm;
433 std::string comment;
434 bool enable;
435
436 public:
438 dicom_tag( unsigned int t = 0xffffffff, dicom_vr vvr = UNKNOWN, int vvm = 1, const std::string &text = "", bool b = true ) : tag( t ), vr( vvr ), vm( vvm ), comment( text ), enable( b ) { }
439
441 dicom_tag( unsigned int t, const std::string &vvr, int vvm, const std::string &text, bool b ) : tag( t ), vr( get_dicom_vr( vvr ) ), vm( vvm ), comment( text ), enable( b ) { }
442
444 dicom_tag( const dicom_tag &t ) : tag( t.tag ), vr( t.vr ), vm( t.vm ), comment( t.comment ), enable( t.enable ) { }
445
446
448 const dicom_tag &operator =( const dicom_tag &t )
449 {
450 if( &t != this )
451 {
452 tag = t.tag;
453 vr = t.vr;
454 vm = t.vm;
455 comment = t.comment;
456 enable = t.enable;
457 }
458 return( *this );
459 }
460
462 bool operator <( const dicom_tag &t ) const
463 {
464 return( tag < t.tag );
465 }
466
468 unsigned short get_group( ) const { return( get_dicom_group( tag ) ); }
469
471 unsigned short get_element( ) const { return( get_dicom_element( tag ) ); }
472 };
473
474
476 class dicom_uid
477 {
478 public:
479 std::string uid;
480 std::string name;
481 std::string type;
482
483 public:
485 dicom_uid( const std::string &id = "", const std::string &n = "", const std::string &t = "" ) : uid( id ), name( n ), type( t ){ }
486
487
489 dicom_uid( const dicom_uid &id ) : uid( id.uid ), name( id.name ), type( id.type ){ }
490
491
493 const dicom_uid &operator =( const dicom_uid &id )
494 {
495 if( &id != this )
496 {
497 uid = id.uid;
498 name = id.name;
499 type = id.type;
500 }
501 return( *this );
502 }
503
504
506 bool operator <( const dicom_uid &id ) const
507 {
508 return( uid < id.uid );
509 }
510 };
511
512
513
515 class dicom_tag_table : public std::multiset< dicom_tag >
516 {
517 protected:
518 typedef std::multiset< dicom_tag > baseclass;
519 typedef struct
520 {
521 unsigned char dmy;
522 unsigned short group;
523 unsigned short element;
524 dicom_vr vr;
525 signed short vm;
526 const char * comment;
527 } dicom_tag_element;
528
529
531 void insert_tag( unsigned short group, unsigned short element, const std::string &vr, int vm, const std::string &comment, bool b = true )
532 {
533 baseclass::insert( dicom_tag( construct_dicom_tag( group, element ), vr, vm, comment, b ) );
534 }
535
536
538 void insert_tag( unsigned short group, unsigned short element, dicom_vr vr, int vm, const std::string &comment, bool b = true )
539 {
540 baseclass::insert( dicom_tag( construct_dicom_tag( group, element ), vr, vm, comment, b ) );
541 }
542
543
545 void insert_tag( const dicom_tag_element *dicom_tags )
546 {
547 const dicom_tag_element *tag = dicom_tags;
548 while( !( tag->group == 0x0000 && tag->element == 0x0000 && tag->vr == UNKNOWN ) )
549 {
550 insert_tag( tag->group, tag->element, tag->vr, tag->vm, tag->comment );
551 tag++;
552 }
553 }
554
555 public:
557 bool contain_tag( unsigned short group, unsigned short element ) const
558 {
559 baseclass::const_iterator ite = baseclass::find( dicom_tag( construct_dicom_tag( group, element ), UNKNOWN, 1, "" ) );
560 return( ite != baseclass::end( ) );
561 }
562
564 dicom_tag get_tag( unsigned short group, unsigned short element, const std::string &vr ) const
565 {
566 return( get_tag( group, element, get_dicom_vr( vr ) ) );
567 }
568
570 dicom_tag get_tag( unsigned short group, unsigned short element, dicom_vr vr ) const
571 {
572 dicom_tag tag( construct_dicom_tag( group, element ), UNKNOWN, 1, "" );
573 baseclass::const_iterator ite = baseclass::find( tag );
574 if( ite == baseclass::end( ) )
575 {
576 return( dicom_tag( 0xffffffff, UNKNOWN, 1, "no tag exists." ) );
577 }
578
579 baseclass::const_iterator upper_ite = baseclass::upper_bound( tag );
580 baseclass::const_iterator iite = ite;
581 do
582 {
583 if( iite->vr == vr ) return( *iite );
584 iite++;
585 } while( iite != upper_ite );
586 return( *ite );
587 }
588
590 dicom_tag get_tag( unsigned short group, unsigned short element ) const
591 {
592 dicom_tag tag( construct_dicom_tag( group, element ), UNKNOWN, 1, "" );
593 baseclass::const_iterator ite = baseclass::find( tag );
594 if( ite == baseclass::end( ) )
595 {
596 return( dicom_tag( 0xffffffff, UNKNOWN, 1, "no tag exists." ) );
597 }
598 return( *ite );
599 }
600
601
664 dicom_tag_table( )
665 {
666 #ifdef __INCLUDE_DICOM_TAG_0000__
667 {
668 dicom_tag_element dicom_tag_elements[] = {
669 #include "dicom_tag/dicom_tag0000.csv"
670 };
671 insert_tag( dicom_tag_elements );
672 }
673 #endif
674 #ifdef __INCLUDE_DICOM_TAG_0002__
675 {
676 dicom_tag_element dicom_tag_elements[] = {
677 #include "dicom_tag/dicom_tag0002.csv"
678 };
679 insert_tag( dicom_tag_elements );
680 }
681 #endif
682 #ifdef __INCLUDE_DICOM_TAG_0004__
683 {
684 dicom_tag_element dicom_tag_elements[] = {
685 #include "dicom_tag/dicom_tag0004.csv"
686 };
687 insert_tag( dicom_tag_elements );
688 }
689 #endif
690 #ifdef __INCLUDE_DICOM_TAG_0008__
691 {
692 dicom_tag_element dicom_tag_elements[] = {
693 #include "dicom_tag/dicom_tag0008.csv"
694 };
695 insert_tag( dicom_tag_elements );
696 }
697 #endif
698 #ifdef __INCLUDE_DICOM_TAG_0010__
699 {
700 dicom_tag_element dicom_tag_elements[] = {
701 #include "dicom_tag/dicom_tag0010.csv"
702 };
703 insert_tag( dicom_tag_elements );
704 }
705 #endif
706 #ifdef __INCLUDE_DICOM_TAG_0012__
707 {
708 dicom_tag_element dicom_tag_elements[] = {
709 #include "dicom_tag/dicom_tag0012.csv"
710 };
711 insert_tag( dicom_tag_elements );
712 }
713 #endif
714 #ifdef __INCLUDE_DICOM_TAG_0018__
715 {
716 dicom_tag_element dicom_tag_elements[] = {
717 #include "dicom_tag/dicom_tag0018.csv"
718 };
719 insert_tag( dicom_tag_elements );
720 }
721 #endif
722 #ifdef __INCLUDE_DICOM_TAG_0020__
723 {
724 dicom_tag_element dicom_tag_elements[] = {
725 #include "dicom_tag/dicom_tag0020.csv"
726 };
727 insert_tag( dicom_tag_elements );
728 }
729 #endif
730 #ifdef __INCLUDE_DICOM_TAG_0022__
731 {
732 dicom_tag_element dicom_tag_elements[] = {
733 #include "dicom_tag/dicom_tag0022.csv"
734 };
735 insert_tag( dicom_tag_elements );
736 }
737 #endif
738 #ifdef __INCLUDE_DICOM_TAG_0028__
739 {
740 dicom_tag_element dicom_tag_elements[] = {
741 #include "dicom_tag/dicom_tag0028.csv"
742 };
743 insert_tag( dicom_tag_elements );
744 }
745 #endif
746 #ifdef __INCLUDE_DICOM_TAG_0032__
747 {
748 dicom_tag_element dicom_tag_elements[] = {
749 #include "dicom_tag/dicom_tag0032.csv"
750 };
751 insert_tag( dicom_tag_elements );
752 }
753 #endif
754 #ifdef __INCLUDE_DICOM_TAG_0038__
755 {
756 dicom_tag_element dicom_tag_elements[] = {
757 #include "dicom_tag/dicom_tag0038.csv"
758 };
759 insert_tag( dicom_tag_elements );
760 }
761 #endif
762 #ifdef __INCLUDE_DICOM_TAG_003A__
763 {
764 dicom_tag_element dicom_tag_elements[] = {
765 #include "dicom_tag/dicom_tag003A.csv"
766 };
767 insert_tag( dicom_tag_elements );
768 }
769 #endif
770 #ifdef __INCLUDE_DICOM_TAG_0040__
771 {
772 dicom_tag_element dicom_tag_elements[] = {
773 #include "dicom_tag/dicom_tag0040.csv"
774 };
775 insert_tag( dicom_tag_elements );
776 }
777 #endif
778 #ifdef __INCLUDE_DICOM_TAG_0042__
779 {
780 dicom_tag_element dicom_tag_elements[] = {
781 #include "dicom_tag/dicom_tag0042.csv"
782 };
783 insert_tag( dicom_tag_elements );
784 }
785 #endif
786 #ifdef __INCLUDE_DICOM_TAG_0044__
787 {
788 dicom_tag_element dicom_tag_elements[] = {
789 #include "dicom_tag/dicom_tag0044.csv"
790 };
791 insert_tag( dicom_tag_elements );
792 }
793 #endif
794 #ifdef __INCLUDE_DICOM_TAG_0046__
795 {
796 dicom_tag_element dicom_tag_elements[] = {
797 #include "dicom_tag/dicom_tag0046.csv"
798 };
799 insert_tag( dicom_tag_elements );
800 }
801 #endif
802 #ifdef __INCLUDE_DICOM_TAG_0050__
803 {
804 dicom_tag_element dicom_tag_elements[] = {
805 #include "dicom_tag/dicom_tag0050.csv"
806 };
807 insert_tag( dicom_tag_elements );
808 }
809 #endif
810 #ifdef __INCLUDE_DICOM_TAG_0054__
811 {
812 dicom_tag_element dicom_tag_elements[] = {
813 #include "dicom_tag/dicom_tag0054.csv"
814 };
815 insert_tag( dicom_tag_elements );
816 }
817 #endif
818 #ifdef __INCLUDE_DICOM_TAG_0060__
819 {
820 dicom_tag_element dicom_tag_elements[] = {
821 #include "dicom_tag/dicom_tag0060.csv"
822 };
823 insert_tag( dicom_tag_elements );
824 }
825 #endif
826 #ifdef __INCLUDE_DICOM_TAG_0062__
827 {
828 dicom_tag_element dicom_tag_elements[] = {
829 #include "dicom_tag/dicom_tag0062.csv"
830 };
831 insert_tag( dicom_tag_elements );
832 }
833 #endif
834 #ifdef __INCLUDE_DICOM_TAG_0064__
835 {
836 dicom_tag_element dicom_tag_elements[] = {
837 #include "dicom_tag/dicom_tag0064.csv"
838 };
839 insert_tag( dicom_tag_elements );
840 }
841 #endif
842 #ifdef __INCLUDE_DICOM_TAG_0066__
843 {
844 dicom_tag_element dicom_tag_elements[] = {
845 #include "dicom_tag/dicom_tag0066.csv"
846 };
847 insert_tag( dicom_tag_elements );
848 }
849 #endif
850 #ifdef __INCLUDE_DICOM_TAG_0070__
851 {
852 dicom_tag_element dicom_tag_elements[] = {
853 #include "dicom_tag/dicom_tag0070.csv"
854 };
855 insert_tag( dicom_tag_elements );
856 }
857 #endif
858 #ifdef __INCLUDE_DICOM_TAG_0072__
859 {
860 dicom_tag_element dicom_tag_elements[] = {
861 #include "dicom_tag/dicom_tag0072.csv"
862 };
863 insert_tag( dicom_tag_elements );
864 }
865 #endif
866 #ifdef __INCLUDE_DICOM_TAG_0074__
867 {
868 dicom_tag_element dicom_tag_elements[] = {
869 #include "dicom_tag/dicom_tag0074.csv"
870 };
871 insert_tag( dicom_tag_elements );
872 }
873 #endif
874 #ifdef __INCLUDE_DICOM_TAG_0088__
875 {
876 dicom_tag_element dicom_tag_elements[] = {
877 #include "dicom_tag/dicom_tag0088.csv"
878 };
879 insert_tag( dicom_tag_elements );
880 }
881 #endif
882 #ifdef __INCLUDE_DICOM_TAG_0100__
883 {
884 dicom_tag_element dicom_tag_elements[] = {
885 #include "dicom_tag/dicom_tag0100.csv"
886 };
887 insert_tag( dicom_tag_elements );
888 }
889 #endif
890 #ifdef __INCLUDE_DICOM_TAG_0400__
891 {
892 dicom_tag_element dicom_tag_elements[] = {
893 #include "dicom_tag/dicom_tag0400.csv"
894 };
895 insert_tag( dicom_tag_elements );
896 }
897 #endif
898 #ifdef __INCLUDE_DICOM_TAG_2000__
899 {
900 dicom_tag_element dicom_tag_elements[] = {
901 #include "dicom_tag/dicom_tag2000.csv"
902 };
903 insert_tag( dicom_tag_elements );
904 }
905 #endif
906 #ifdef __INCLUDE_DICOM_TAG_2010__
907 {
908 dicom_tag_element dicom_tag_elements[] = {
909 #include "dicom_tag/dicom_tag2010.csv"
910 };
911 insert_tag( dicom_tag_elements );
912 }
913 #endif
914 #ifdef __INCLUDE_DICOM_TAG_2020__
915 {
916 dicom_tag_element dicom_tag_elements[] = {
917 #include "dicom_tag/dicom_tag2020.csv"
918 };
919 insert_tag( dicom_tag_elements );
920 }
921 #endif
922 #ifdef __INCLUDE_DICOM_TAG_2030__
923 {
924 dicom_tag_element dicom_tag_elements[] = {
925 #include "dicom_tag/dicom_tag2030.csv"
926 };
927 insert_tag( dicom_tag_elements );
928 }
929 #endif
930 #ifdef __INCLUDE_DICOM_TAG_2040__
931 {
932 dicom_tag_element dicom_tag_elements[] = {
933 #include "dicom_tag/dicom_tag2040.csv"
934 };
935 insert_tag( dicom_tag_elements );
936 }
937 #endif
938 #ifdef __INCLUDE_DICOM_TAG_2050__
939 {
940 dicom_tag_element dicom_tag_elements[] = {
941 #include "dicom_tag/dicom_tag2050.csv"
942 };
943 insert_tag( dicom_tag_elements );
944 }
945 #endif
946 #ifdef __INCLUDE_DICOM_TAG_2100__
947 {
948 dicom_tag_element dicom_tag_elements[] = {
949 #include "dicom_tag/dicom_tag2100.csv"
950 };
951 insert_tag( dicom_tag_elements );
952 }
953 #endif
954 #ifdef __INCLUDE_DICOM_TAG_2110__
955 {
956 dicom_tag_element dicom_tag_elements[] = {
957 #include "dicom_tag/dicom_tag2110.csv"
958 };
959 insert_tag( dicom_tag_elements );
960 }
961 #endif
962 #ifdef __INCLUDE_DICOM_TAG_2120__
963 {
964 dicom_tag_element dicom_tag_elements[] = {
965 #include "dicom_tag/dicom_tag2120.csv"
966 };
967 insert_tag( dicom_tag_elements );
968 }
969 #endif
970 #ifdef __INCLUDE_DICOM_TAG_2130__
971 {
972 dicom_tag_element dicom_tag_elements[] = {
973 #include "dicom_tag/dicom_tag2130.csv"
974 };
975 insert_tag( dicom_tag_elements );
976 }
977 #endif
978 #ifdef __INCLUDE_DICOM_TAG_2200__
979 {
980 dicom_tag_element dicom_tag_elements[] = {
981 #include "dicom_tag/dicom_tag2200.csv"
982 };
983 insert_tag( dicom_tag_elements );
984 }
985 #endif
986 #ifdef __INCLUDE_DICOM_TAG_3002__
987 {
988 dicom_tag_element dicom_tag_elements[] = {
989 #include "dicom_tag/dicom_tag3002.csv"
990 };
991 insert_tag( dicom_tag_elements );
992 }
993 #endif
994 #ifdef __INCLUDE_DICOM_TAG_3004__
995 {
996 dicom_tag_element dicom_tag_elements[] = {
997 #include "dicom_tag/dicom_tag3004.csv"
998 };
999 insert_tag( dicom_tag_elements );
1000 }
1001 #endif
1002 #ifdef __INCLUDE_DICOM_TAG_3006__
1003 {
1004 dicom_tag_element dicom_tag_elements[] = {
1005 #include "dicom_tag/dicom_tag3006.csv"
1006 };
1007 insert_tag( dicom_tag_elements );
1008 }
1009 #endif
1010 #ifdef __INCLUDE_DICOM_TAG_3008__
1011 {
1012 dicom_tag_element dicom_tag_elements[] = {
1013 #include "dicom_tag/dicom_tag3008.csv"
1014 };
1015 insert_tag( dicom_tag_elements );
1016 }
1017 #endif
1018 #ifdef __INCLUDE_DICOM_TAG_300A__
1019 {
1020 dicom_tag_element dicom_tag_elements[] = {
1021 #include "dicom_tag/dicom_tag300A.csv"
1022 };
1023 insert_tag( dicom_tag_elements );
1024 }
1025 #endif
1026 #ifdef __INCLUDE_DICOM_TAG_300C__
1027 {
1028 dicom_tag_element dicom_tag_elements[] = {
1029 #include "dicom_tag/dicom_tag300C.csv"
1030 };
1031 insert_tag( dicom_tag_elements );
1032 }
1033 #endif
1034 #ifdef __INCLUDE_DICOM_TAG_300E__
1035 {
1036 dicom_tag_element dicom_tag_elements[] = {
1037 #include "dicom_tag/dicom_tag300E.csv"
1038 };
1039 insert_tag( dicom_tag_elements );
1040 }
1041 #endif
1042 #ifdef __INCLUDE_DICOM_TAG_4000__
1043 {
1044 dicom_tag_element dicom_tag_elements[] = {
1045 #include "dicom_tag/dicom_tag4000.csv"
1046 };
1047 insert_tag( dicom_tag_elements );
1048 }
1049 #endif
1050 #ifdef __INCLUDE_DICOM_TAG_4008__
1051 {
1052 dicom_tag_element dicom_tag_elements[] = {
1053 #include "dicom_tag/dicom_tag4008.csv"
1054 };
1055 insert_tag( dicom_tag_elements );
1056 }
1057 #endif
1058 #ifdef __INCLUDE_DICOM_TAG_4FFE__
1059 {
1060 dicom_tag_element dicom_tag_elements[] = {
1061 #include "dicom_tag/dicom_tag4FFE.csv"
1062 };
1063 insert_tag( dicom_tag_elements );
1064 }
1065 #endif
1066 #ifdef __INCLUDE_DICOM_TAG_5000__
1067 {
1068 dicom_tag_element dicom_tag_elements[] = {
1069 #include "dicom_tag/dicom_tag5000.csv"
1070 };
1071 insert_tag( dicom_tag_elements );
1072 }
1073 #endif
1074 #ifdef __INCLUDE_DICOM_TAG_5200__
1075 {
1076 dicom_tag_element dicom_tag_elements[] = {
1077 #include "dicom_tag/dicom_tag5200.csv"
1078 };
1079 insert_tag( dicom_tag_elements );
1080 }
1081 #endif
1082 #ifdef __INCLUDE_DICOM_TAG_5400__
1083 {
1084 dicom_tag_element dicom_tag_elements[] = {
1085 #include "dicom_tag/dicom_tag5400.csv"
1086 };
1087 insert_tag( dicom_tag_elements );
1088 }
1089 #endif
1090 #ifdef __INCLUDE_DICOM_TAG_5600__
1091 {
1092 dicom_tag_element dicom_tag_elements[] = {
1093 #include "dicom_tag/dicom_tag5600.csv"
1094 };
1095 insert_tag( dicom_tag_elements );
1096 }
1097 #endif
1098 #ifdef __INCLUDE_DICOM_TAG_6000__
1099 {
1100 dicom_tag_element dicom_tag_elements[] = {
1101 #include "dicom_tag/dicom_tag6000.csv"
1102 };
1103 insert_tag( dicom_tag_elements );
1104 }
1105 #endif
1106 #ifdef __INCLUDE_DICOM_TAG_FFFF__
1107 {
1108 dicom_tag_element dicom_tag_elements[] = {
1109 #include "dicom_tag/dicom_tagFFFF.csv"
1110 };
1111 insert_tag( dicom_tag_elements );
1112 }
1113 #endif
1114 }
1115 };
1116
1117
1119 class dicom_uid_table : public std::set< dicom_uid >
1120 {
1121 protected:
1122 typedef std::set< dicom_uid > baseclass;
1123 typedef struct
1124 {
1125 unsigned char dmy;
1126 const char * uid;
1127 const char * name;
1128 const char * type;
1129 } dicom_uid_element;
1130
1131
1133 void insert_uid( const std::string &id = "", const std::string &n = "", const std::string &t = "" )
1134 {
1135 baseclass::insert( dicom_uid( id, n, t ) );
1136 }
1137
1138
1140 void insert_uid( const dicom_uid_element *dicom_uids )
1141 {
1142 const dicom_uid_element *uid = dicom_uids;
1143 while( !( uid->uid == NULL && uid->name == NULL && uid->type == NULL ) )
1144 {
1145 insert_uid( uid->uid, uid->name, uid->type );
1146 uid++;
1147 }
1148 }
1149
1150 public:
1152 bool contain_uid( const std::string &uid ) const
1153 {
1154 baseclass::const_iterator ite = baseclass::find( dicom_uid( uid ) );
1155 return( ite != baseclass::end( ) );
1156 }
1157
1158
1160 dicom_uid get_uid( const std::string &uid )
1161 {
1162 dicom_uid id( uid );
1163 baseclass::iterator ite = baseclass::find( id );
1164 if( ite == baseclass::end( ) )
1165 {
1166 return( dicom_uid( uid, uid, "no uid exists." ) );
1167 }
1168 return( *ite );
1169 }
1170
1171
1173 dicom_uid_table( )
1174 {
1175 dicom_uid_element dicom_uid_elements[] = {
1176 #include "dicom_tag/dicom_uid.csv"
1177 };
1178 insert_uid( dicom_uid_elements );
1179 }
1180 };
1181 }
1182
1183
1185 // DICOM画像入出力グループの終わり
1186
1188 // 画像入出力グループの終わり
1189
1190
1191 // mist名前空間の終わり
1192 _MIST_END
1193
1194
1195 #endif // __INCLUDE_MIST_DICOM_TAG__
1196