Codebase list gdcm / 5a35a45
New upstream version 3.1.0 Andreas Tille 2 years ago
49 changed file(s) with 855 addition(s) and 1287 deletion(s). Raw diff Collapse all Expand all
0 # back-up
1 *~
2 *.bak
3
4 # files when there are conflicts
5 *.orig
6
7 # qtcreator files
8 CMakeLists.txt.user*
9
10 # kdevelop files
11 *.kdev*
0 [submodule "Testing/Data"]
1 path = Testing/Data
2 url = git://git.code.sf.net/p/gdcm/gdcmdata
0 # https://docs.travis-ci.com/user/environment-variables/#Default-Environment-Variables
1 # https://github.com/travis-ci/travis-ci/issues/3505
20 language: cpp
31 # Use the faster container-based infrastructure.
42 #sudo: false
5 dist: xenial
3 # https://github.com/travis-ci/travis-ci/issues/9033
4 sudo: true
65 env:
76 global:
87 # The next declaration is the encrypted COVERITY_SCAN_TOKEN, created
98 # via the "travis encrypt" command using the project repo's public key
10 - secure: ClIqhtIIfQPhil8GH9bnJg70rvJfuYs7Z2Aq2SrdwQsIFNvvfFD5pVxQiaYbZI3nxNclggQ50BmGB96e6jLxbbd/xlIOjcU19W2nzyP6LGkXFHDHm8FwhqqDNpfYvirAOfqgjqf7khRe3ajF33jhrLrhb5QOO5640N93pdChu1sAvI0LZv8JFIUcN7A7To3+WYc7H4CK3U8B2V8nzqcBSHDZNBGAdeVdmldwrlBtQeWBg5wJAEzzUHn0x+kltqvuoPYi2ShpaUkEfHeUWYhOT1uoyXNRAqHXiM1jhiw3JCkqaf7sUKLzyx0ozjTnYntNMggtBzavKjuYg6RhdlNdNbdsi2nxrycCOyCZcF+d4limq+yDMqoP7g/DnPag7XFgjkG/ThULPu+pEK/6nV1NqGNWFu1CqgAwPW7hGbIUADPsMEb+Bz2L2KUof2wU1cdvGK4fzsM9Qpdipbagghn4b5eGtvyBzYzoCS02AKrYfimhcm8bVmlfaMVgd6PnJ19Y1+ADCWwStwaQL2S6udh66JVGNszY/kYSmZKn51RQQDkubmGpywzeNdn7gM9u8QR9s2Lsq0GaSdptcLOPmVNSg6mQJThbMRHM/H2UrSyo7/GLr28sNNbYNweGPevsnrRJPUdG2ENWVw5rg1sD1cLm8rLlD4H2f/b97X9NCl4bLxY=
9 - secure: "ClIqhtIIfQPhil8GH9bnJg70rvJfuYs7Z2Aq2SrdwQsIFNvvfFD5pVxQiaYbZI3nxNclggQ50BmGB96e6jLxbbd/xlIOjcU19W2nzyP6LGkXFHDHm8FwhqqDNpfYvirAOfqgjqf7khRe3ajF33jhrLrhb5QOO5640N93pdChu1sAvI0LZv8JFIUcN7A7To3+WYc7H4CK3U8B2V8nzqcBSHDZNBGAdeVdmldwrlBtQeWBg5wJAEzzUHn0x+kltqvuoPYi2ShpaUkEfHeUWYhOT1uoyXNRAqHXiM1jhiw3JCkqaf7sUKLzyx0ozjTnYntNMggtBzavKjuYg6RhdlNdNbdsi2nxrycCOyCZcF+d4limq+yDMqoP7g/DnPag7XFgjkG/ThULPu+pEK/6nV1NqGNWFu1CqgAwPW7hGbIUADPsMEb+Bz2L2KUof2wU1cdvGK4fzsM9Qpdipbagghn4b5eGtvyBzYzoCS02AKrYfimhcm8bVmlfaMVgd6PnJ19Y1+ADCWwStwaQL2S6udh66JVGNszY/kYSmZKn51RQQDkubmGpywzeNdn7gM9u8QR9s2Lsq0GaSdptcLOPmVNSg6mQJThbMRHM/H2UrSyo7/GLr28sNNbYNweGPevsnrRJPUdG2ENWVw5rg1sD1cLm8rLlD4H2f/b97X9NCl4bLxY="
1110
1211 # -m32 is not supported
1312 # no poppler, openjpeg, uuid, json
1413 # no swig
15
16 # using debian-sid I get:
17 # /usr/bin/ld: BFD (GNU Binutils for Ubuntu) 2.22 internal error, aborting at
18 # ../../bfd/reloc.c line 443 in bfd_get_reloc_size
1914 matrix:
2015 fast_finish: true
2116 include:
2217 - compiler: gcc
2318 os: linux
2419 env:
25 - CFLAGS="-g -O2"
26 - CXXFLAGS="-g -O2"
27 - CMAKE_EXTRA="-DGDCM_WRAP_PYTHON:BOOL=OFF -DGDCM_BUILD_DOCBOOK_MANPAGES:BOOL=OFF"
28 - B_NAME=default
29 - CPACK_NAME=Linux
30 - compiler: gcc
31 os: linux
32 # No docbook-xsl-ns
33 addons: {apt: {packages: [default-jdk, mono-devel, swig, libcharls-dev, libvtk5-dev, libexpat-dev, libz-dev, uuid-dev, python-all-dev, libpoppler-private-dev, xsltproc, docbook-xsl, dcmtk]}}
34 env:
3520 - CFLAGS="-Wall -Wextra -m64"
3621 - CXXFLAGS="-Wall -Wextra -m64"
37 # Cant use manpage with old docbook
38 - CMAKE_EXTRA="-DGDCM_USE_SYSTEM_OPENSSL:BOOL=ON -DGDCM_WRAP_PYTHON:BOOL=ON -DGDCM_WRAP_CSHARP:BOOL=ON -DGDCM_WRAP_JAVA:BOOL=ON -DGDCM_WRAP_PHP:BOOL=OFF -DGDCM_USE_SYSTEM_EXPAT:BOOL=ON -DGDCM_USE_SYSTEM_JSON:BOOL=OFF -DGDCM_USE_SYSTEM_LIBXML2:BOOL=ON -DGDCM_USE_SYSTEM_OPENJPEG:BOOL=OFF -DGDCM_USE_SYSTEM_POPPLER:BOOL=ON -DGDCM_USE_SYSTEM_UUID:BOOL=ON -DGDCM_USE_SYSTEM_ZLIB:BOOL=ON -DGDCM_WEAK_SWIG_CHECK:BOOL=ON -DGDCM_LEGACY_SILENT:BOOL=ON -DGDCM_BUILD_DOCBOOK_MANPAGES:BOOL=OFF"
22 - CMAKE_EXTRA="-DCMAKE_INTERPROCEDURAL_OPTIMIZATION:BOOL=ON -DGDCM_USE_SYSTEM_OPENSSL:BOOL=ON -DGDCM_WRAP_PYTHON:BOOL=OFF -DGDCM_WRAP_CSHARP:BOOL=OFF -DGDCM_WRAP_JAVA:BOOL=OFF -DGDCM_WRAP_PHP:BOOL=OFF -DGDCM_USE_SYSTEM_EXPAT:BOOL=ON -DGDCM_USE_SYSTEM_JSON:BOOL=OFF -DGDCM_USE_SYSTEM_LIBXML2:BOOL=ON -DGDCM_USE_SYSTEM_OPENJPEG:BOOL=OFF -DGDCM_USE_SYSTEM_POPPLER:BOOL=OFF -DGDCM_USE_SYSTEM_UUID:BOOL=OFF -DGDCM_USE_SYSTEM_ZLIB:BOOL=ON -DGDCM_BUILD_DOCBOOK_MANPAGES:BOOL=OFF"
3923 - B_NAME=system
40 - CPACK_NAME=Linux
4124 - compiler: clang
4225 os: linux
4326 env:
44 - CFLAGS="-g -O0 -Wall -Wextra -m64 -fsanitize=address,undefined,shift"
45 - CXXFLAGS="-g -O0 -Wall -Wextra -m64 -fsanitize=address,undefined,shift"
27 - ASAN_OPTIONS=verbosity=1:log_threads=1
28 - CFLAGS="-Wall -Wextra -m64 -fsanitize=address,undefined"
29 - CXXFLAGS="-g -Wall -Wextra -m64 -fsanitize=address,undefined"
4630 - CMAKE_EXTRA="-DGDCM_BUILD_DOCBOOK_MANPAGES:BOOL=OFF"
4731 - B_NAME=fsanitize
48 - CPACK_NAME=Linux
4932 - compiler: clang
5033 os: osx
5134 env:
5235 - CFLAGS="-Wall -Wextra" # -m64 -fsanitize=address,undefined
5336 - CXXFLAGS="-Wall -Wextra" # -m64 -fsanitize=address,undefined
54 # http://stackoverflow.com/questions/15678153/homebrew-python-on-mac-os-x-10-8-fatal-python-error-pythreadstate-get-no-cu
55 #- CMAKE_EXTRA="-DGDCM_WRAP_PYTHON:BOOL=ON -DGDCM_BUILD_DOCBOOK_MANPAGES:BOOL=OFF -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python2.7"
56 - CMAKE_EXTRA="-DGDCM_WRAP_PYTHON:BOOL=ON -DGDCM_WRAP_CSHARP:BOOL=OFF -DGDCM_WRAP_JAVA:BOOL=OFF -DGDCM_USE_SYSTEM_UUID:BOOL=ON -DGDCM_USE_SYSTEM_ZLIB:BOOL=ON -DGDCM_BUILD_DOCBOOK_MANPAGES:BOOL=OFF"
57 - B_NAME=default
58 - CPACK_NAME=Darwin
37 - CMAKE_EXTRA="-DCMAKE_INTERPROCEDURAL_OPTIMIZATION:BOOL=ON -DGDCM_BUILD_DOCBOOK_MANPAGES:BOOL=OFF"
38 - B_NAME=fsanitize
5939
6040 before_install:
6141 #- env
6242 - cmake --version
63 - if [ "$B_NAME" == "system" ]; then swig -version; fi
64 # do not run the full test suite for now on fsanitize and osx (takes too long)
65 - if [ "$B_NAME" == "fsanitize" ]; then mv Testing/Data Testing/Data.old; fi
66 # https://docs.travis-ci.com/user/osx-ci-environment/#Environment-variables
67 - if [ "$TRAVIS_OS_NAME" == "osx" ]; then mv Testing/Data Testing/Data.old; fi
68 - if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew update ; fi
69 - if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew install swig docbook-xsl ; fi
70 - if [ "$TRAVIS_OS_NAME" == "osx" ]; then swig -version; fi
71 # https://github.com/travis-ci/travis-ci/issues/2312
72 #- if [ "$TRAVIS_OS_NAME" == "osx" ]; then virtualenv env -p python3 ; fi
73 #- if [ "$TRAVIS_OS_NAME" == "osx" ]; then source env/bin/activate ; fi
74 # kakadu setup for linux/system:
75 - if [ "$B_NAME" == "system" ]; then wget http://kakadusoftware.com/wp-content/uploads/2014/06/KDU77_Demo_Apps_for_Linux-x86-64_150710.zip; fi
76 - if [ "$B_NAME" == "system" ]; then unzip KDU77_Demo_Apps_for_Linux-x86-64_150710.zip; fi
77 - if [ "$B_NAME" == "system" ]; then export PATH=$PATH:$PWD/KDU77_Demo_Apps_for_Linux-x86-64_150710; fi
43 #- swig -version
44 # do not run the full test suite for now
45 - mv Testing/Data Testing/Data.old
7846 install: true
79 before_script:
80 - cmake -Wno-dev -G "Unix Makefiles" -DCMAKE_BUILD_TYPE:STRING=None -DGDCM_BUILD_TESTING:BOOL=ON -DGDCM_BUILD_APPLICATIONS:BOOL=ON -DGDCM_BUILD_SHARED_LIBS:BOOL=ON -DBUILDNAME:STRING=${TRAVIS_OS_NAME}-${TRAVIS_BRANCH}-${B_NAME} ${CMAKE_EXTRA} .
47 before_script: true
48 script:
49 - cmake -Wno-dev -G "Unix Makefiles" -DCMAKE_BUILD_TYPE:STRING=None -DGDCM_BUILD_TESTING:BOOL=ON -DGDCM_BUILD_APPLICATIONS:BOOL=ON -DGDCM_BUILD_SHARED_LIBS:BOOL=ON -DGDCM_ALLOW_INSOURCE_BUILD:BOOL=ON -DBUILDNAME:STRING=${TRAVIS_OS_NAME}-${TRAVIS_BRANCH}-${B_NAME} ${CMAKE_EXTRA} .
8150 - ctest -D ExperimentalStart
82 script:
8351 - ctest -D ExperimentalBuild -j2
8452 - ctest -D ExperimentalTest -j2 || true
85 after_success:
8653 - ctest -D ExperimentalSubmit || true
87 # prefer after_success since before_deploy is not called (conditions unmet)
88 - cpack -G TGZ
89 - cpack -G TBZ2
54
55 after_success: true
9056 after_failure: true
91
92 before_deploy:
93 - VTAG=$(echo $TRAVIS_TAG | cut -f2 -dv)
94 deploy:
95 edge: true
96 provider: releases
97 api_key:
98 secure: R5+dbibdcgPHq6cAPC8uepifDuS3yjZu2dBB2oSeQtBZTAeN1VIfJMrF8TeQDqj2GC28RHxXm4BHwdJ2FUpBXjOS2eUE6Mto1Rbbvfi63MREnFPIAWkNyLtR2Jxq/Gzb8X05PbCWGwCNvX9eeo+qcWTpczuQvJ+/bds7MyRsk45+sUc+j7rglAbxewgijsXebCkObwaXmhqTYJwrvf2lyEnA2Jo1gL2WmK6iPjHvTOVS9JfBMqVRmlk7j8efnqag8fMCzNp1Ess5wBy5Jf58qvVs7RuuBi16s7vOOBtb9xVjcDB1KaAxc/dDQGQhRkrveBtH18ZpFrArOj6DBPbupS3+xuU4ywdYbCuGnvdpRFafBc+iNU4M81crkFUDmSPEQChBnL4wwpaYaQ1LlgdlF0r9/Rlu2/iqKe4t7rdZnkQqQ/3SNNf+x4AKnGmaSGasV/VUXstTGVrtl7hsDMzSdrVCXODao0SRv5tPSI3BgAZi7NzCJ/xv5LgA1EQVkGdTQN0ZpKZCQYfifL5K6oYDI+WlAFU0OcH+9dy4KNqF+QnzMh9iPwP0zR6BN9yE0w6ydnyNt0CkIUaxgaTtr+pHPXsmmtgXzQScESC8B9JHGocOXjT6MtyUmoP/ewlPz2G6x114PnAL7LlZ07jPqAASJwW/ZiXtBcVxv50hPhC7L80=
99 file:
100 - GDCM-$VTAG-$CPACK_NAME-x86_64.tar.gz
101 - GDCM-$VTAG-$CPACK_NAME-x86_64.tar.bz2
102 skip_cleanup: true
103 on:
104 repo: malaterre/GDCM
105 condition: $B_NAME = default
106 all_branches: true
107 tags: true
108
109 # final
11057 after_script: true
11158
11259 addons:
11360 coverity_scan:
11461 project:
115 name: malaterre/GDCM
62 name: "malaterre/GDCM"
11663 description: "Grassroots DICOM"
11764 notification_email: mathieu.malaterre@gmail.com
118 build_command_prepend: cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo
119 -DGDCM_BUILD_SHARED_LIBS:BOOL=ON ..
65 build_command_prepend: cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo -DGDCM_BUILD_SHARED_LIBS:BOOL=ON -DGDCM_ALLOW_INSOURCE_BUILD:BOOL=ON -DGDCM_BUILD_DOCBOOK_MANPAGES:BOOL=OFF ..
12066 build_command: cmake --build .
12167 branch_pattern: coverity_scan
812812 namespace gdcm
813813 {
814814
815 static inline void ReplaceIf(DataSet &rootds, const DataSet &ds, const Tag & t1, const Tag & t2 )
816 {
817 if( !ds.FindDataElement( t1 ) ) return ;
815 static const DataElement &GetNestedDataElement( const DataSet &ds, const Tag & t1, const Tag & t2 )
816 {
817 assert( ds.FindDataElement( t1 ) );
818818 SmartPointer<SequenceOfItems> sqi1 = ds.GetDataElement( t1 ).GetValueAsSQ();
819 if( !sqi1 || sqi1->IsEmpty() ) return ;
819 assert( sqi1 );
820820 const Item &item1 = sqi1->GetItem(1);
821821 const DataSet & ds1 = item1.GetNestedDataSet();
822 if( !ds1.FindDataElement( t2 ) ) return ;
823 rootds.Replace(ds1.GetDataElement( t2 ));
822 assert( ds1.FindDataElement( t2 ) );
823 return ds1.GetDataElement( t2 );
824824 }
825825
826826 static bool RemapSharedIntoOld( gdcm::DataSet & ds,
836836 const DataSet & sfgs_ds = item1.GetNestedDataSet();
837837 #if 1
838838 // Repetition Time
839 ReplaceIf(ds, sfgs_ds, Tag(0x0018,0x9112), Tag(0x0018,0x0080) );
839 ds.Replace( GetNestedDataElement(sfgs_ds, Tag(0x0018,0x9112), Tag(0x0018,0x0080) ) );
840840 // Echo Train Length
841 ReplaceIf(ds, sfgs_ds, Tag(0x0018,0x9112), Tag(0x0018,0x0091) );
841 ds.Replace( GetNestedDataElement(sfgs_ds, Tag(0x0018,0x9112), Tag(0x0018,0x0091) ) );
842842 // Flip Angle
843 ReplaceIf(ds, sfgs_ds, Tag(0x0018,0x9112), Tag(0x0018,0x1314) );
843 ds.Replace( GetNestedDataElement(sfgs_ds, Tag(0x0018,0x9112), Tag(0x0018,0x1314) ) );
844844 // Number of Averages
845 ReplaceIf(ds, sfgs_ds, Tag(0x0018,0x9119), Tag(0x0018,0x0083) );
845 ds.Replace( GetNestedDataElement(sfgs_ds, Tag(0x0018,0x9119), Tag(0x0018,0x0083) ) );
846846
847847 // Percent Sampling
848 ReplaceIf(ds, sfgs_ds, Tag(0x0018,0x9125), Tag(0x0018,0x0093) );
848 ds.Replace( GetNestedDataElement(sfgs_ds, Tag(0x0018,0x9125), Tag(0x0018,0x0093) ) );
849849 // Percent Phase Field of View
850 ReplaceIf(ds, sfgs_ds, Tag(0x0018,0x9125), Tag(0x0018,0x0094) );
850 ds.Replace( GetNestedDataElement(sfgs_ds, Tag(0x0018,0x9125), Tag(0x0018,0x0094) ) );
851851 // Receive Coil Name
852 ReplaceIf(ds, sfgs_ds, Tag(0x0018,0x9042), Tag(0x0018,0x1250) );
852 ds.Replace( GetNestedDataElement(sfgs_ds, Tag(0x0018,0x9042), Tag(0x0018,0x1250) ) );
853853 // Transmit Coil Name
854 ReplaceIf(ds, sfgs_ds, Tag(0x0018,0x9049), Tag(0x0018,0x1251) );
854 ds.Replace( GetNestedDataElement(sfgs_ds, Tag(0x0018,0x9049), Tag(0x0018,0x1251) ) );
855855 // InPlanePhaseEncodingDirection
856 ReplaceIf(ds, sfgs_ds, Tag(0x0018,0x9125), Tag(0x0018,0x1312) );
856 ds.Replace( GetNestedDataElement(sfgs_ds, Tag(0x0018,0x9125), Tag(0x0018,0x1312) ) );
857857 // TransmitterFrequency
858 ReplaceIf(ds, sfgs_ds, Tag(0x0018,0x9006), Tag(0x0018,0x9098) );
858 ds.Replace( GetNestedDataElement(sfgs_ds, Tag(0x0018,0x9006), Tag(0x0018,0x9098) ) );
859859 // InversionRecovery
860 ReplaceIf(ds, sfgs_ds, Tag(0x0018,0x9115), Tag(0x0018,0x9009) );
860 ds.Replace( GetNestedDataElement(sfgs_ds, Tag(0x0018,0x9115), Tag(0x0018,0x9009) ) );
861861 // FlowCompensation
862 ReplaceIf(ds, sfgs_ds, Tag(0x0018,0x9115), Tag(0x0018,0x9010) );
862 ds.Replace( GetNestedDataElement(sfgs_ds, Tag(0x0018,0x9115), Tag(0x0018,0x9010) ) );
863863 // ReceiveCoilType
864 ReplaceIf(ds, sfgs_ds, Tag(0x0018,0x9042), Tag(0x0018,0x9043) );
864 ds.Replace( GetNestedDataElement(sfgs_ds, Tag(0x0018,0x9042), Tag(0x0018,0x9043) ) );
865865 // QuadratureReceiveCoil
866 ReplaceIf(ds, sfgs_ds, Tag(0x0018,0x9042), Tag(0x0018,0x9044) );
866 ds.Replace( GetNestedDataElement(sfgs_ds, Tag(0x0018,0x9042), Tag(0x0018,0x9044) ) );
867867 // SlabThickness
868 ReplaceIf(ds, sfgs_ds, Tag(0x0018,0x9107), Tag(0x0018,0x9104) );
868 ds.Replace( GetNestedDataElement(sfgs_ds, Tag(0x0018,0x9107), Tag(0x0018,0x9104) ) );
869869 // MultiCoilDefinitionSequence
870 ReplaceIf(ds, sfgs_ds, Tag(0x0018,0x9042), Tag(0x0018,0x9045) );
870 ds.Replace( GetNestedDataElement(sfgs_ds, Tag(0x0018,0x9042), Tag(0x0018,0x9045) ) );
871871 // SlabOrientation
872 ReplaceIf(ds, sfgs_ds, Tag(0x0018,0x9107), Tag(0x0018,0x9105) );
872 ds.Replace( GetNestedDataElement(sfgs_ds, Tag(0x0018,0x9107), Tag(0x0018,0x9105) ) );
873873 // MidSlabPosition
874 ReplaceIf(ds, sfgs_ds, Tag(0x0018,0x9107), Tag(0x0018,0x9106) );
874 ds.Replace( GetNestedDataElement(sfgs_ds, Tag(0x0018,0x9107), Tag(0x0018,0x9106) ) );
875875 // OperatingModeSequence
876 ReplaceIf(ds, sfgs_ds, Tag(0x0018,0x9112), Tag(0x0018,0x9176) );
876 ds.Replace( GetNestedDataElement(sfgs_ds, Tag(0x0018,0x9112), Tag(0x0018,0x9176) ) );
877877 // MRAcquisitionPhaseEncodingStepsOutOf
878 ReplaceIf(ds, sfgs_ds, Tag(0x0018,0x9125), Tag(0x0018,0x9232) );
878 ds.Replace( GetNestedDataElement(sfgs_ds, Tag(0x0018,0x9125), Tag(0x0018,0x9232) ) );
879879 // SpecificAbsorptionRateSequence
880 ReplaceIf(ds, sfgs_ds, Tag(0x0018,0x9112), Tag(0x0018,0x9239) );
880 ds.Replace( GetNestedDataElement(sfgs_ds, Tag(0x0018,0x9112), Tag(0x0018,0x9239) ) );
881881 // AnatomicRegionSequence
882 ReplaceIf(ds, sfgs_ds, Tag(0x0020,0x9071), Tag(0x0008,0x2218) );
882 ds.Replace( GetNestedDataElement(sfgs_ds, Tag(0x0020,0x9071), Tag(0x0008,0x2218) ) );
883883 // Purpose of Reference Code Sequence
884884 // FIXME what if there is multiple purpose of rcs ?
885 ReplaceIf(ds, sfgs_ds, Tag(0x0008,0x1140), Tag(0x0040,0xa170) );
885 ds.Replace( GetNestedDataElement(sfgs_ds, Tag(0x0008,0x1140), Tag(0x0040,0xa170) ) );
886886 #else
887887 for(
888888 DataSet::ConstIterator it = sfgs_ds.Begin();
897897
898898 #if 1
899899 // Effective Echo Time
900 ReplaceIf(ds, pffgs_ds, Tag(0x0018,0x9114), Tag(0x0018,0x9082) );
900 ds.Replace( GetNestedDataElement(pffgs_ds, Tag(0x0018,0x9114), Tag(0x0018,0x9082) ) );
901901 // -> should also be Echo Time
902902 // Nominal Cardiac Trigger Delay Time
903 ReplaceIf(ds, pffgs_ds, Tag(0x0018,0x9118), Tag(0x0020,0x9153) );
903 ds.Replace( GetNestedDataElement(pffgs_ds, Tag(0x0018,0x9118), Tag(0x0020,0x9153) ) );
904904 // Metabolite Map Description
905 ReplaceIf(ds, pffgs_ds, Tag(0x0018,0x9152), Tag(0x0018,0x9080) );
905 ds.Replace( GetNestedDataElement(pffgs_ds, Tag(0x0018,0x9152), Tag(0x0018,0x9080) ) );
906906 // IPP
907 ReplaceIf(ds, pffgs_ds, Tag(0x0020,0x9113), Tag(0x0020,0x0032) );
907 ds.Replace( GetNestedDataElement(pffgs_ds, Tag(0x0020,0x9113), Tag(0x0020,0x0032) ) );
908908 // IOP
909 ReplaceIf(ds, pffgs_ds, Tag(0x0020,0x9116), Tag(0x0020,0x0037) );
909 ds.Replace( GetNestedDataElement(pffgs_ds, Tag(0x0020,0x9116), Tag(0x0020,0x0037) ) );
910910 // Slice Thickness
911 ReplaceIf(ds, pffgs_ds, Tag(0x0028,0x9110), Tag(0x0018,0x0050) );
911 ds.Replace( GetNestedDataElement(pffgs_ds, Tag(0x0028,0x9110), Tag(0x0018,0x0050) ) );
912912 // Pixel Spacing
913 ReplaceIf(ds, pffgs_ds, Tag(0x0028,0x9110), Tag(0x0028,0x0030) );
913 ds.Replace( GetNestedDataElement(pffgs_ds, Tag(0x0028,0x9110), Tag(0x0028,0x0030) ) );
914914
915915 // window level
916 ReplaceIf(ds, pffgs_ds, Tag(0x0028,0x9132), Tag(0x0028,0x1050) );
917 ReplaceIf(ds, pffgs_ds, Tag(0x0028,0x9132), Tag(0x0028,0x1051) );
916 ds.Replace( GetNestedDataElement(pffgs_ds, Tag(0x0028,0x9132), Tag(0x0028,0x1050) ) );
917 ds.Replace( GetNestedDataElement(pffgs_ds, Tag(0x0028,0x9132), Tag(0x0028,0x1051) ) );
918918
919919 // rescale slope/intercept
920 ReplaceIf(ds, pffgs_ds, Tag(0x0028,0x9145), Tag(0x0028,0x1052) );
921 ReplaceIf(ds, pffgs_ds, Tag(0x0028,0x9145), Tag(0x0028,0x1053) );
922 ReplaceIf(ds, pffgs_ds, Tag(0x0028,0x9145), Tag(0x0028,0x1054) );
920 ds.Replace( GetNestedDataElement(pffgs_ds, Tag(0x0028,0x9145), Tag(0x0028,0x1052) ) );
921 ds.Replace( GetNestedDataElement(pffgs_ds, Tag(0x0028,0x9145), Tag(0x0028,0x1053) ) );
922 ds.Replace( GetNestedDataElement(pffgs_ds, Tag(0x0028,0x9145), Tag(0x0028,0x1054) ) );
923923
924924 // FrameReferenceDateTime
925 ReplaceIf(ds, pffgs_ds, Tag(0x0020,0x9111), Tag(0x0018,0x9151) );
925 ds.Replace( GetNestedDataElement(pffgs_ds, Tag(0x0020,0x9111), Tag(0x0018,0x9151) ) );
926926 // FrameAcquisitionDuration
927 ReplaceIf(ds, pffgs_ds, Tag(0x0020,0x9111), Tag(0x0018,0x9220) );
927 ds.Replace( GetNestedDataElement(pffgs_ds, Tag(0x0020,0x9111), Tag(0x0018,0x9220) ) );
928928 // TemporalPositionIndex
929 ReplaceIf(ds, pffgs_ds, Tag(0x0020,0x9111), Tag(0x0020,0x9128) );
929 ds.Replace( GetNestedDataElement(pffgs_ds, Tag(0x0020,0x9111), Tag(0x0020,0x9128) ) );
930930 // InStackPositionNumber
931 ReplaceIf(ds, pffgs_ds, Tag(0x0020,0x9111), Tag(0x0020,0x9057) );
931 ds.Replace( GetNestedDataElement(pffgs_ds, Tag(0x0020,0x9111), Tag(0x0020,0x9057) ) );
932932 // FrameType
933 ReplaceIf(ds, pffgs_ds, Tag(0x0018,0x9226), Tag(0x0008,0x9007) );
933 ds.Replace( GetNestedDataElement(pffgs_ds, Tag(0x0018,0x9226), Tag(0x0008,0x9007) ) );
934934 // DimensionIndexValues
935 ReplaceIf(ds, pffgs_ds, Tag(0x0020,0x9111), Tag(0x0020,0x9157) );
935 ds.Replace( GetNestedDataElement(pffgs_ds, Tag(0x0020,0x9111), Tag(0x0020,0x9157) ) );
936936 // FrameAcquisitionDateTime
937 ReplaceIf(ds, pffgs_ds, Tag(0x0020,0x9111), Tag(0x0018,0x9074) );
937 ds.Replace( GetNestedDataElement(pffgs_ds, Tag(0x0020,0x9111), Tag(0x0018,0x9074) ) );
938938 // Nominal Cardiac Trigger Delay Time -> Trigger Time
939939 //const DataElement &NominalCardiacTriggerDelayTime =
940940 // GetNestedDataElement(pffgs_ds, Tag(0x0018,0x9226), Tag(0x0008,0x9007) );
14151415 const gdcm::DataElement &pixeldata = image.GetDataElement();
14161416 //const gdcm::ByteValue *bv = pixeldata.GetByteValue();
14171417 gdcm::SmartPointer<gdcm::ByteValue> bv = const_cast<gdcm::ByteValue*>(pixeldata.GetByteValue());
1418 if( !bv )
1419 {
1420 std::cerr << "decompress first" << std::endl;
1421 return 1;
1422 }
14231418 unsigned long slice_len = image.GetBufferLength() / dims[2];
14241419 assert( slice_len * dims[2] == image.GetBufferLength() );
14251420 //assert( image.GetBufferLength() == bv->GetLength() );
14701465
14711466 char date[22];
14721467 const size_t datelen = 8;
1473 gdcm::System::GetCurrentDateTime(date);
1468 //int res = gdcm::System::GetCurrentDateTime(date);
14741469 gdcm::Attribute<0x8,0x12> instcreationdate;
14751470 instcreationdate.SetValue( gdcm::DTComp( date, datelen ) );
14761471 ds.Replace( instcreationdate.GetAsDataElement() );
15181513 // gdcm::DataElement &pd = slice.GetDataElement();
15191514 const char *sliceptr = bv->GetPointer() + i * slice_len;
15201515 gdcm::DataElement newpixeldata( gdcm::Tag(0x7fe0,0x0010) );
1521 newpixeldata.SetVR( pixeldata.GetVR() );
15221516 newpixeldata.SetByteValue( sliceptr, (uint32_t)slice_len); // slow !
15231517 ds.Replace( newpixeldata );
15241518
0 cmake_minimum_required(VERSION 3.9.2 FATAL_ERROR)
1
2 set(GDCM_MAX_VALIDATED_CMAKE_VERSION "3.13.1")
0 cmake_minimum_required(VERSION 3.9.2 FATAL_ERROR) # travis-ci wants 3.9.2
1
2 set(GDCM_MAX_VALIDATED_CMAKE_VERSION "3.13.4")
33 if("${CMAKE_VERSION}" VERSION_LESS_EQUAL "${GDCM_MAX_VALIDATED_CMAKE_VERSION}")
44 # As of 2018-12-04 GDCM has been validated to build with cmake version 3.13.1 new policies.
55 # Set and use the newest cmake policies that are validated to work
1616 #----------------------------------------------------------------------------
1717
1818 project(GDCM
19 VERSION 3.0.8
19 VERSION 3.1.0
2020 LANGUAGES CXX C
2121 )
2222 ## NOTE: the "DESCRIPTION" feature of project() was introduced in cmake 3.10.0
1818 #include "gdcmUIDGenerator.h"
1919
2020 #include <iostream>
21 #include <sstream>
2122 #include <string>
2223
2324 #include <map>
3031 * The output file will be stored in `outvid.dcm` as
3132 * MultiframeGrayscaleByteSecondaryCaptureImageStorage
3233 */
33 int main(int argc, char *argv[])
34
35 using namespace gdcm;
36 static bool processgroup(Item & item3, std::string const & outfilename)
3437 {
35 if( argc < 2 ) return 1;
36 using namespace gdcm;
37 const char *filename = argv[1];
38 gdcm::Reader reader;
39 reader.SetFileName( filename );
40 reader.Read();
41
42 gdcm::File &file = reader.GetFile();
43 gdcm::DataSet &ds = file.GetDataSet();
44 const PrivateTag tseq(0x7fe1,0x1,"GEMS_Ultrasound_MovieGroup_001");
45
46 if( !ds.FindDataElement( tseq ) ) return 1;
47 const DataElement& seq = ds.GetDataElement( tseq );
48
49 SmartPointer<SequenceOfItems> sqi = seq.GetValueAsSQ();
50 assert( sqi->GetNumberOfItems() == 1 );
51 Item &item = sqi->GetItem(1);
52 DataSet &subds = item.GetNestedDataSet();
53
54 const PrivateTag tseq1(0x7fe1,0x10,"GEMS_Ultrasound_MovieGroup_001");
55
56 if( !subds.FindDataElement( tseq1 ) ) return 1;
57 const DataElement& seq1 = subds.GetDataElement( tseq1 );
58
59 SmartPointer<SequenceOfItems> sqi2 = seq1.GetValueAsSQ();
60 //int n = sqi2->GetNumberOfItems();
61 int index = 1;
62 Item &item2 = sqi2->GetItem(index);
63 DataSet &subds2 = item2.GetNestedDataSet();
64
65 const PrivateTag tseq2(0x7fe1,0x20,"GEMS_Ultrasound_MovieGroup_001");
66
67 if( !subds2.FindDataElement( tseq2 ) ) return 1;
68 const DataElement& seq2 = subds2.GetDataElement( tseq2 );
69
70 // std::cout << seq2 << std::endl;
71
72 SmartPointer<SequenceOfItems> sqi3 = seq2.GetValueAsSQ();
73 size_t ni3 = sqi3->GetNumberOfItems(); (void)ni3;
74 assert( sqi3->GetNumberOfItems() >= 1 );
75 Item &item3 = sqi3->GetItem(1);
38 // Item &item3 = sqi3->GetItem(1);
7639 DataSet &subds3 = item3.GetNestedDataSet();
7740
7841 const PrivateTag tseq6(0x7fe1,0x26,"GEMS_Ultrasound_MovieGroup_001");
9255 {
9356 Element<VR::SL, VM::VM4> el;
9457 el.SetFromDataElement( subds6.GetDataElement( tseq7 ) );
95 std::cout << "El= " << el.GetValue() << std::endl;
9658 dimx = el.GetValue(0);
9759 dimy = el.GetValue(1);
60 std::cout << "Dims= " << dimx << " " << dimy << std::endl;
9861 }
9962 }
10063
12285 const DataElement& de8 = subds4.GetDataElement( tseq8 );
12386 Element<VR::UL,VM::VM1> ldimz;
12487 ldimz.SetFromDataElement( de8 );
88 std::cout << "ldimz: " << ldimz.GetValue() << std::endl;
12589 dimz += ldimz.GetValue();
12690 if( !subds4.FindDataElement( tseq4 ) ) return true;
12791 const DataElement& seq4 = subds4.GetDataElement( tseq4 );
13397
13498 const ByteValue *bv4 = seq4.GetByteValue();
13599 (void)bv4;
100 Element<VR::FD, VM::VM1_n> el0;
101 el0.SetFromDataElement( seq4 );
102 std::cout << "TimeStamp (" << el0.GetLength() << "): ";
103 // Seems like the 3D volumes is split into chunks of max 100 frames...
104 assert( ldimz.GetValue() == el0.GetLength() );
105 for( unsigned long i = 0; i < el0.GetLength(); ++i ) {
106 if(i) std::cout << ",";
107 std::cout << el0.GetValue(i);
108 }
109 std::cout << std::endl;
136110 #if 0
137111 {
138112 std::ofstream out( "/tmp/mo4", std::ios::binary );
190164 de.SetByteValue( ms.GetString(), (uint32_t)strlen(ms.GetString()));
191165 dataset.Replace( de ); // replace !
192166
193 w.SetFileName( "outvid.dcm" );
167 w.SetFileName( outfilename.c_str() );
194168 if( !w.Write() )
195169 {
196 return 1;
197 }
170 return false;
171 }
172 return true;
173 }
174
175 int main(int argc, char *argv[])
176 {
177 if( argc < 2 ) return 1;
178 const char *filename = argv[1];
179 gdcm::Reader reader;
180 reader.SetFileName( filename );
181 reader.Read();
182
183 gdcm::File &file = reader.GetFile();
184 gdcm::DataSet &ds = file.GetDataSet();
185 const PrivateTag tseq(0x7fe1,0x1,"GEMS_Ultrasound_MovieGroup_001");
186
187 if( !ds.FindDataElement( tseq ) ) return 1;
188 const DataElement& seq = ds.GetDataElement( tseq );
189
190 SmartPointer<SequenceOfItems> sqi = seq.GetValueAsSQ();
191 assert( sqi->GetNumberOfItems() == 1 );
192 Item &item = sqi->GetItem(1);
193 DataSet &subds = item.GetNestedDataSet();
194
195 const PrivateTag tseq1(0x7fe1,0x10,"GEMS_Ultrasound_MovieGroup_001");
196
197 if( !subds.FindDataElement( tseq1 ) ) return 1;
198 const DataElement& seq1 = subds.GetDataElement( tseq1 );
199
200 SmartPointer<SequenceOfItems> sqi2 = seq1.GetValueAsSQ();
201 assert( sqi2->GetNumberOfItems() == 1 );
202 //int n = sqi2->GetNumberOfItems();
203 int index = 1;
204 Item &item2 = sqi2->GetItem(index);
205 DataSet &subds2 = item2.GetNestedDataSet();
206
207 const PrivateTag tseq2(0x7fe1,0x20,"GEMS_Ultrasound_MovieGroup_001");
208
209 if( !subds2.FindDataElement( tseq2 ) ) return 1;
210 const DataElement& seq2 = subds2.GetDataElement( tseq2 );
211
212 // std::cout << seq2 << std::endl;
213
214 SmartPointer<SequenceOfItems> sqi3 = seq2.GetValueAsSQ();
215 size_t ni3 = sqi3->GetNumberOfItems(); (void)ni3;
216 assert( sqi3->GetNumberOfItems() >= 1 );
217 std::cout << "#Groups = " << sqi3->GetNumberOfItems() << std::endl;
218 for( SequenceOfItems::SizeType i = 1; i <= sqi3->GetNumberOfItems(); ++i) {
219 Item &item3 = sqi3->GetItem(i);
220 std::ostringstream os;
221 os << "outvid";
222 os << i;
223 os << ".dcm";
224 processgroup(item3, os.str());
225 }
198226
199227 return 0;
200228 }
4242 return 0;
4343 }
4444
45 #ifdef _MSC_VER
46 static inline std::string ToUtf8(std::wstring const &str) {
47 std::string ret;
48 int len = WideCharToMultiByte(CP_UTF8, 0, str.c_str(), (int)str.length(),
49 nullptr, 0, NULL, NULL);
50 if (len > 0) {
51 ret.resize(len);
52 WideCharToMultiByte(CP_UTF8, 0, str.c_str(), (int)str.length(), &ret[0],
53 len, NULL, NULL);
54 }
55 return ret;
56 }
57 #endif
58
5945 unsigned int Directory::Explore(FilenameType const &name, bool recursive)
6046 {
6147 unsigned int nFiles = 0;
48 std::string fileName;
49 std::string dirName = name;
50 //assert( System::FileIsDirectory( dirName ) );
51 Directories.push_back( dirName );
6252 #ifdef _MSC_VER
63 std::wstring fileName;
64 std::wstring dirName = System::ConvertToUNC(name.c_str());
65 Directories.push_back(ToUtf8(dirName));
66 WIN32_FIND_DATAW fileData;
67 if ('\\' != dirName[dirName.size()-1]) dirName.push_back('\\');
68 assert( '\\' == dirName[dirName.size()-1] );
69 const std::wstring firstfile = dirName+L"*";
70 HANDLE hFile = FindFirstFileW(firstfile.c_str(), &fileData);
53 WIN32_FIND_DATA fileData;
54 if ('/' != dirName[dirName.size()-1]) dirName.push_back('/');
55 assert( '/' == dirName[dirName.size()-1] );
56 const FilenameType firstfile = dirName+"*";
57 HANDLE hFile = FindFirstFile(firstfile.c_str(), &fileData);
7158
7259 for(BOOL b = (hFile != INVALID_HANDLE_VALUE); b;
73 b = FindNextFileW(hFile, &fileData))
60 b = FindNextFile(hFile, &fileData))
7461 {
7562 fileName = fileData.cFileName;
7663 if ( fileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY )
7764 {
7865 // Need to check for . and .. to avoid infinite loop
79 if ( fileName != L"." && fileName != L".."
66 if ( fileName != "." && fileName != ".."
8067 && fileName[0] != '.' // discard any hidden dir
8168 && recursive )
8269 {
83 nFiles += Explore(ToUtf8(dirName + fileName), recursive);
70 nFiles += Explore(dirName+fileName,recursive);
8471 }
8572 }
8673 else
8774 {
8875 if (fileName[0] != '.') // discard "unix like" hidden files such as .git in submodules
8976 {
90 Filenames.push_back(ToUtf8(dirName+fileName));
77 Filenames.push_back(dirName+fileName);
9178 nFiles++;
9279 }
9380 }
10188 }
10289
10390 #else
104 std::string fileName;
105 std::string dirName = name;
106 // assert( System::FileIsDirectory( dirName ) );
107 Directories.push_back(dirName);
10891 // Real POSIX implementation: scandir is a BSD extension only, and doesn't
10992 // work on debian for example
11093
6464 typedef classname Self; \
6565 typedef super Superclass; \
6666 classname() {} \
67 virtual ~classname() override = default; \
67 virtual ~classname() {} \
6868 virtual const char * GetEventName() const { return #classname; } \
6969 virtual bool CheckEvent(const ::gdcm::Event* e) const \
7070 { return dynamic_cast<const Self*>(e) ? true : false; } \
134134 */
135135 }
136136
137 static inline int Mkdir2(const char *utf8)
138 {
139 #ifdef _MSC_VER
140 const std::wstring unc = System::ConvertToUNC(utf8);
141 return _wmkdir(unc.c_str());
142 #else
143 return Mkdir(utf8);
144 #endif
145 }
146
147137 bool System::MakeDirectory(const char *path)
148138 {
149139 if( !path || !*path )
165155 while(ok && (pos = dir.find('/', pos)) != std::string::npos)
166156 {
167157 topdir = dir.substr(0, pos+1);
168 ok = ok && (System::FileIsDirectory(topdir.c_str()) || 0 == Mkdir2(topdir.c_str()));
158 ok = ok && (System::FileIsDirectory(topdir.c_str()) || 0 == Mkdir(topdir.c_str()));
169159 pos++;
170160 }
171161 if( !ok ) return false;
177167 {
178168 topdir = dir;
179169 }
180 if(Mkdir2(topdir.c_str()) != 0)
170 if(Mkdir(topdir.c_str()) != 0)
181171 {
182172 // There is a bug in the Borland Run time library which makes MKDIR
183173 // return EACCES when it should return EEXISTS
198188 // return true if the file exists
199189 bool System::FileExists(const char* filename)
200190 {
191 #ifdef _MSC_VER
192 # define access _access
193 #endif
201194 #ifndef R_OK
202195 # define R_OK 04
203196 #endif
204 #ifdef _MSC_VER
205 const std::wstring unc = System::ConvertToUNC(filename);
206 if (_waccess(unc.c_str(), R_OK) != 0)
207 #else
208197 if ( access(filename, R_OK) != 0 )
209 #endif
210198 {
211199 return false;
212200 }
219207
220208 bool System::FileIsDirectory(const char* name)
221209 {
222 #ifdef _MSC_VER
223 struct _stat64i32 fs;
224 const std::wstring wname = System::ConvertToUNC(name);
225 if (_wstat(wname.c_str(), &fs) == 0)
226 #else
227210 struct stat fs;
228211 if(stat(name, &fs) == 0)
229 #endif
230212 {
231213 #if _WIN32
232214 return ((fs.st_mode & _S_IFDIR) != 0);
382364 #ifndef PATH_MAX
383365 #define PATH_MAX 4096
384366 #endif
385
386 #ifdef _MSC_VER
387 namespace {
388 static inline std::wstring ToUtf16(std::string const &str) {
389 std::wstring ret;
390 int len = MultiByteToWideChar(CP_UTF8, 0, str.c_str(), (int)str.length(),
391 nullptr, 0);
392 if (len > 0) {
393 ret.resize(len);
394 MultiByteToWideChar(CP_UTF8, 0, str.c_str(), (int)str.length(), &ret[0],
395 len);
396 }
397 return ret;
398 }
399 // http://arsenmk.blogspot.com/2015/12/handling-long-paths-on-windows.html
400 static inline bool ComputeFullPath(std::wstring const &in,
401 std::wstring &out) {
402 // consider an input fileName of type PCWSTR (const wchar_t*)
403 const wchar_t *fileName = in.c_str();
404 DWORD requiredBufferLength =
405 GetFullPathNameW(fileName, 0, nullptr, nullptr);
406
407 if (0 == requiredBufferLength) // means failure
408 {
409 return false;
410 }
411
412 out.resize(requiredBufferLength);
413 wchar_t *buffer = &out[0];
414
415 DWORD result =
416 GetFullPathNameW(fileName, requiredBufferLength, buffer, nullptr);
417
418 if (0 == result) {
419 return false;
420 }
421
422 // buffer now contains the full path name of fileName, use it.
423 return true;
424 }
425
426 static inline std::wstring HandleMaxPath(std::wstring const &in) {
427 if (in.size() >= MAX_PATH) {
428 std::wstring out;
429 bool ret = ComputeFullPath(in, out);
430 if (!ret) return in;
431 if (out.size() < 4) return in;
432 if (out[0] == '\\' && out[1] == '\\' && out[2] == '?') {
433 // nothing to do
434 } else if (out[0] == '\\' && out[1] == '\\' && out[2] != '?') {
435 // server path
436 const std::wstring prefix = LR"(\\?\UNC\)";
437 out = prefix + (out.c_str() + 2);
438 } else {
439 // regular C:\ style path:
440 assert(out[1] == ':');
441 const std::wstring prefix = LR"(\\?\)";
442 out = prefix + out.c_str();
443 }
444 return out;
445 }
446 return in;
447 }
448 } // namespace
449 #endif
450
451 std::wstring System::ConvertToUNC(const char *utf8path)
452 {
453 #ifdef _MSC_VER
454 const std::wstring uft16path = ToUtf16(utf8path);
455 const std::wstring uncpath = HandleMaxPath(uft16path);
456 return uncpath;
457 #else
458 (void)utf8path;
459 return std::wstring();
460 #endif
461 }
462367
463368 // return size of file; also returns zero if no file exists
464369 size_t System::FileSize(const char* filename)
3737 static bool RemoveFile(const char* source);
3838 /// remove a directory named source
3939 static bool DeleteDirectory(const char *source);
40
41 /// When needed convert a PATH into a UNC equivalent. This allow
42 /// transparent support for path longer that MAX_PATH.
43 /// Only on _MSC_VER compiler, return empty string otherwise.
44 static std::wstring ConvertToUNC(const char *utf8path);
4540
4641 /// Return the last error
4742 static const char *GetLastSystemError();
82358235 {0x0051,0x0011,"SIEMENS MR HEADER",VR::LO,VM::VM1,"PAT Mode (Ima PAT Mode)",false },
82368236 {0x0051,0x0012,"SIEMENS MR HEADER",VR::SH,VM::VM1,"?Table Position?",false },
82378237 {0x0051,0x0013,"SIEMENS MR HEADER",VR::SH,VM::VM1,"Positive PCS Directions",false },
8238 {0x0051,0x0014,"SIEMENS MR HEADER",VR::SH,VM::VM1,"?v150_through?",false },
82398238 {0x0051,0x0015,"SIEMENS MR HEADER",VR::SH,VM::VM1,"?Data Filter?",false },
82408239 {0x0051,0x0016,"SIEMENS MR HEADER",VR::LO,VM::VM1,"?Image Type?",false },
82418240 {0x0051,0x0017,"SIEMENS MR HEADER",VR::SH,VM::VM1,"?Slice Thickness?",false },
8484 endif()
8585
8686 add_library(gdcmDSED ${DSED_SRCS} ${DSED3_SRCS})
87 #target_compile_features(gdcmDSED PUBLIC cxx_strong_enums)
87 target_compile_features(gdcmDSED PUBLIC cxx_strong_enums)
8888 target_link_libraries(gdcmDSED LINK_PUBLIC gdcmCommon)
8989 # zlib stuff are actually included (template) so we need to link them here.
9090 target_link_libraries(gdcmDSED LINK_PRIVATE ${GDCM_ZLIB_LIBRARIES})
6969 bv->SetLength(ValueLengthField);
7070 if( !bv->Read<TSwap>(is) )
7171 {
72 gdcmAssertAlwaysMacro(0 && "Should not happen");
72 assert(0 && "Should not happen");
7373 return is;
7474 }
7575 ValueField = bv;
537537 return os;
538538 }
539539 // Write Value Length
540 // The following code should always work since we are in the case of IVRLE - CP246
541 // however broken file such as PET-GE-dicomwrite-PixelDataSQUNv2.dcm breaks this assumption right here:
542 // see bug #502
543540 const SequenceOfItems *sqi = dynamic_cast<const SequenceOfItems*>( ValueField.GetPointer() ); //GetSequenceOfItems();
544541 if( sqi && !ValueLengthField.IsUndefined() )
545542 {
826826 return false;
827827 }
828828
829 void Reader::SetFileName(const char *utf8path)
829 #ifdef _MSC_VER
830 namespace {
831 static inline std::wstring ToUtf16(std::string const & str) {
832 std::wstring ret;
833 int len = MultiByteToWideChar(CP_UTF8, 0, str.c_str(), (int)str.length(), nullptr, 0);
834 if (len > 0) {
835 ret.resize(len);
836 MultiByteToWideChar(CP_UTF8, 0, str.c_str(), (int)str.length(), &ret[0], len);
837 }
838 return ret;
839 }
840 // http://arsenmk.blogspot.com/2015/12/handling-long-paths-on-windows.html
841 static inline bool ComputeFullPath(std::wstring const &in, std::wstring &out) {
842 // consider an input fileName of type PCWSTR (const wchar_t*)
843 const wchar_t *fileName = in.c_str();
844 DWORD requiredBufferLength = GetFullPathNameW(fileName, 0, nullptr, nullptr);
845
846 if (0 == requiredBufferLength) // means failure
847 {
848 return false;
849 }
850
851 out.resize(requiredBufferLength);
852 wchar_t *buffer = &out[0];
853
854 DWORD result =
855 GetFullPathNameW(fileName, requiredBufferLength, buffer, nullptr);
856
857 if (0 == result) {
858 return false;
859 }
860
861 // buffer now contains the full path name of fileName, use it.
862 return true;
863 }
864
865 static inline std::wstring HandleMaxPath(std::wstring const &in) {
866 if (in.size() >= MAX_PATH) {
867 std::wstring out;
868 bool ret = ComputeFullPath(in, out);
869 if (!ret) return in;
870 if (out.size() < 4) return in;
871 if (out[0] == '\\' && out[1] == '\\' && out[2] == '?') {
872 // nothing to do
873 } else if (out[0] == '\\' && out[1] == '\\' && out[2] != '?') {
874 // server path
875 const std::wstring prefix = LR"(\\?\UNC\)";
876 out = prefix + (out.c_str() + 2);
877 } else {
878 // regular C:\ style path:
879 assert(out[1] == ':');
880 const std::wstring prefix = LR"(\\?\)";
881 out = prefix + out.c_str();
882 }
883 return out;
884 }
885 return in;
886 }
887 } // namespace
888 #endif
889
890 void Reader::SetFileName(const char *uft8path)
830891 {
831892 if(Ifstream) delete Ifstream;
832893 Ifstream = new std::ifstream();
833 if (utf8path && *utf8path) {
894 if (uft8path && *uft8path) {
834895 #ifdef _MSC_VER
835 const std::wstring uncpath = System::ConvertToUNC(utf8path);
896 const std::wstring uft16path = ToUtf16(uft8path);
897 const std::wstring uncpath = HandleMaxPath(uft16path);
836898 Ifstream->open(uncpath.c_str(), std::ios::binary);
837899 #else
838 Ifstream->open( utf8path, std::ios::binary);
900 Ifstream->open( uft8path, std::ios::binary);
839901 #endif
840902 }
841903 if( Ifstream->is_open() )
161161 return !os.fail();
162162 }
163163
164 void Writer::SetFileName(const char *utf8path)
164 void Writer::SetFileName(const char *filename)
165165 {
166166 //std::cerr << "Stream: " << filename << std::endl;
167167 //std::cerr << "Ofstream: " << Ofstream << std::endl;
174174 delete Ofstream;
175175 }
176176 Ofstream = new std::ofstream();
177 if (utf8path && *utf8path)
178 {
179 #ifdef _MSC_VER
180 const std::wstring uncpath = System::ConvertToUNC(utf8path);
181 Ofstream->open(uncpath.c_str(), std::ios::out | std::ios::binary);
182 #else
183 Ofstream->open(utf8path, std::ios::out | std::ios::binary);
184 #endif
185 assert(Ofstream->is_open());
186 assert(!Ofstream->fail());
187 }
177 Ofstream->open(filename, std::ios::out | std::ios::binary );
178 assert( Ofstream->is_open() );
179 assert( !Ofstream->fail() );
188180 //std::cerr << Stream.is_open() << std::endl;
189181 Stream = Ofstream;
190182 }
0 ISO_IR 100 : 28591 : Latin Alphabet No. 1 Unextended
1 ISO_IR 101 : 28592 : Latin Alphabet No. 2 Unextended
2 ISO_IR 109 : 28593 : Latin Alphabet No. 3 Unextended
3 ISO_IR 110 : 28594 : Latin Alphabet No. 4 Unextended
4 ISO_IR 144 : 28595 : Cyrillic Unextended
5 ISO_IR 127 : 28596 : Arabic Unextended
6 ISO_IR 126 : 28597 : Greek Unextended
7 ISO_IR 138 : 28598 : Hebrew Unextended
8 ISO_IR 148 : 28599 : Latin Alphabet No. 5 (Turkish) Unextended
9 ISO_IR 13 : 932 : JIS X 0201 (Shift JIS) Unextended
10 ISO_IR 166 : 874 : TIS 620-2533 (Thai) Unextended
11 ISO_IR 192 : 65001 : Unicode in UTF-8
12 ISO 2022 IR 6 : 28591 : Default
13 ISO 2022 IR 100 : 28591 : Latin Alphabet No. 1 Extended
14 ISO 2022 IR 101 : 28592 : Latin Alphabet No. 2 Extended
15 ISO 2022 IR 109 : 28593 : Latin Alphabet No. 3 Extended
16 ISO 2022 IR 110 : 28594 : Latin Alphabet No. 4 Extended
17 ISO 2022 IR 144 : 28595 : Cyrillic Extended
18 ISO 2022 IR 127 : 28596 : Arabic Extended
19 ISO 2022 IR 126 : 28597 : Greek Extended
20 ISO 2022 IR 138 : 28598 : Hebrew Extended
21 ISO 2022 IR 148 : 28599 : Latin Alphabet No. 5 (Turkish) Extended
22 ISO 2022 IR 13 : 50222 : JIS X 0201 (Shift JIS) Extended
23 ISO 2022 IR 166 : 874 : TIS 620-2533 (Thai) Extended
24 ISO 2022 IR 87 : 50222 : JIS X 0208 (Kanji) Extended
25 ISO 2022 IR 159 : 50222 : JIS X 0212 (Kanji) Extended
26 ISO 2022 IR 149 : 20949 : KS X 1001 (Hangul and Hanja) Extended
27 GB18030 : 54936 : Chinese (Simplified) Extended
103103 const VR &devr = de.GetVR();
104104 if( devr != VR::INVALID && devr != VR::UN )
105105 {
106 gdcmWarningMacro("Please report. Missing dict entry for: [" << owner << "]" << " de is: " << de );
106 gdcmWarningMacro("Please report. Missing dict entry for: " << de );
107107 return devr;
108108 }
109109 // CP-246
106106 {
107107 if( !de.IsEmpty() )
108108 {
109 gdcmWarningMacro("DICOM file written out may not be readable" );
109 gdcmErrorMacro("DICOM file written out may not be readable" );
110110 cvr = VR::UN;
111111 }
112112 }
17701770 if( !raw_len.first || !raw_len.second ) return false;
17711771 // check pixel format *after* DecodeByStreamsCommon !
17721772 const PixelFormat & pf2 = this->GetPixelFormat();
1773 if( pf.GetSamplesPerPixel() != pf2.GetSamplesPerPixel()
1774 || pf.GetBitsAllocated() != pf2.GetBitsAllocated()
1775 )
1776 {
1777 gdcmErrorMacro( "Invalid PixelFormat found (mismatch DICOM vs J2K)" );
1778 return false;
1779 }
1780
1773 if( pf != pf2 ) return false;
17811774
17821775 char *raw = raw_len.first;
17831776 const unsigned int rowsize = xmax - xmin + 1;
259259 if( Internal->BitsAllocated == 16 )
260260 {
261261 //assert( Internal->BitPosition >= 12 );
262 if( !ds.FindDataElement( Tag(0x7fe0,0x0010) ) )
262 if( ds.FindDataElement( Tag(0x7fe0,0x0010) ) )
263263 {
264264 gdcmWarningMacro("Could not find Pixel Data. Cannot extract Overlay." );
265265 return false;
6666 } ScalarType;
6767
6868 // default cstor:
69 PixelFormat () : PixelFormat(1, 8, 8, 7, 0) {}
70
7169 explicit PixelFormat (
72 unsigned short samplesperpixel,
70 unsigned short samplesperpixel = 1,
7371 unsigned short bitsallocated = 8,
7472 unsigned short bitsstored = 8,
7573 unsigned short highbit = 7,
3939 std::string StringFilter::ToString(const Tag& t) const
4040 {
4141 return ToStringPair(t).second;
42 }
43
44 std::string StringFilter::ToString(const PrivateTag& privTag) const
45 {
46 const DataSet &ds = GetFile().GetDataSet();
47 const DataElement &de = ds.GetDataElement(privTag);
48 return ToStringPair(de).second;
4942 }
5043
5144 std::string StringFilter::ToString(const DataElement& de) const
4545 /// Directly from a Tag:
4646 std::string ToString(const Tag& t) const;
4747
48 std::string ToString(const PrivateTag& t) const;
49
5048 /// Convert to string the ByteValue contained in a DataElement
5149 /// the returned elements are:
5250 /// pair.first : the name as found in the dictionary of DataElement
+413
-0
TODO less more
0 PrepGroupName.cxx does not handle Pixel Data group name since it has a space in the name...
1
2 -----------------------------------------------------------------------
3 gdcmDictPrinter allowed me to find bug in dclunie tool:
4 gems.tpl:(0043,001b) VERS="GEM" VR="SS" VM="1" Owner="GEMS_PARM_01"
5 -----------------------------------------------------------------------
6 dcmtk is confused:
7 (0028,0034) IS [ 185\185] # 8, 1 Pixel Aspect Ratio
8
9 -----------------------------------------------------------------------
10 Offer mapping from UID to Manufacturer: eg. 1.3.12.2.1107 -> SIEMENS
11
12 -----------------------------------------------------------------------
13 > We use a Philips ENVISOR machine to do Cardiac TOE Echo. We are about
14 > to produce a CD of some of the Echo loops. Can anyone suggest a good
15 > DICOM to AVI converted for Echo loops.
16
17 we have implemented a tool called "dcm2avi" that can be used for this
18 purpose. Please send an email to dicom/at/offis/dot/de in case you are
19 interested in an evaluation version of this program.
20 -----------------------------------------------------------------------
21
22 from sup58_ft2.doc
23 >CTDIvol (0018,9445) 2C Computed Tomography Dose Index (CTDIvol), im mGy according to IEC 60601-2-44, Ed.2.1 (Clause 29.1.103.4), The Volume CTDIvol. It describes the average dose for this frame for the selected CT conditions of operation.
24 -----------------------------------------------------------------------
25 Calling dcmodify [1][2] with option --erase-tag should do what you want.
26 -----------------------------------------------------------------------
27 You should be able to say: this file is a ACR NEMA read it ! So the wizard
28 should be bypass and the discovery step can be skipped.
29 -----------------------------------------------------------------------
30 Need to handle image rotation/flip
31 (0070,0041) CS [Y] # 2, 1 ImageHorizontalFlip
32 (0070,0042) US 270 # 2, 1 ImageRotation
33 -----------------------------------------------------------------------
34 Parsing SQ can actually double the time to read a file
35 /images/test_DCEMRI/04-004-4/MR-20070129/Perfusion/Perfusion_205_
36 -----------------------------------------------------------------------
37 The NEMA Enhanced CT and MR multi-frame test sets contain a couple of
38 images that have Supplemental Palette Color LUTs. See:
39
40 "ftp://medical.nema.org/medical/dicom/Multiframe/"
41
42 and in particular:
43
44 CT0012
45 CT0013
46 CT0014
47
48 GFUNCST2
49 MRVPWCB2
50 -----------------------------------------------------------------------
51 Wrong Private element in dcmtk:
52 (0009,1227) TM [210959.000000] # 14, 1 LastMoveTime
53 I found:
54 diction.pfl:Table Zero Time,0009,SIEMENS CM VA0 CMS,27,TM,1
55 -----------------------------------------------------------------------
56 Make File Meta Information configurable from CMake
57 -----------------------------------------------------------------------
58 Add progress to gdcmscanner
59 -----------------------------------------------------------------------
60 FIX the reading of 3F3F SQ in: Bug_Philips_ItemTag_3F3F
61 -----------------------------------------------------------------------
62 gdcm does not read the associated data in RT Object file - RTImage and RTDose. For RTImage pixel spacing is in 3002,0011 and position of upper left corner is in 3002,0012.
63 -----------------------------------------------------------------------
64 Extract Mosaic as 3D volume:
65 afni.nimh.nih.gov/pub/dist/doc/misc/DICOM/data/From_TomRoss/20021009-1-Toms_fMri/4-ep2d_bold_moco_ax3x3-192/image-00002-000042.IMA
66 -----------------------------------------------------------------------
67 Correctly display:
68 PHANTOM.MR.CARDIO_COEUR_S_QUENCE_DE_REP_RAGE.9.257.2008.03.20.14.53.25.578125.43151705.IMA
69 -----------------------------------------------------------------------
70 TODO: need a gdcm::ExtractOverlayFromPixelDataFilter
71 to rewrite a gdcm::Image
72 -----------------------------------------------------------------------
73 Provide operator() == for String<LO> (should discard length, space char...)
74 -----------------------------------------------------------------------
75 Should handle old Date format (with - separator)
76 -----------------------------------------------------------------------
77 vtkMedicalImageProp user defined value should be written back to disk
78 -> TODO: SQ will be difficult to handle
79 -----------------------------------------------------------------------
80 Filter should use OpenMP ?
81 -----------------------------------------------------------------------
82 GDCMFakeJPEG should be detected (at least a warning
83 -----------------------------------------------------------------------
84 Hum, looks like vs 2007+1 can be used to redistribute binaries:
85 http://www.microsoft.com/express/support/faq/
86
87 # Can I use Express Editions for commercial use?
88
89 Yes, there are no licensing restrictions for applications built using Visual Studio Express Editions.
90
91
92 Some random links:
93
94 http://blogs.msdn.com/nikolad/archive/2006/04/11/Download-location-for-VCRedist.aspx
95 http://blogs.msdn.com/vcblog/archive/2007/10/12/how-to-redistribute-the-visual-c-libraries-with-your-application.aspx
96
97 -----------------------------------------------------------------------
98 TODO:
99 /home/mmalaterre/Creatis/gdcmDataExtra/gdcmSampleData/images_of_interest/ITK-GDCM-1.2.2.saysExplicitVR-butIsImplicitVR.dcm
100 -----------------------------------------------------------------------
101 ZSpacing for RTDoseStorage is not handled properly:
102 bin/gdcmvtkGDCMTests TestvtkGDCMImageWriter BogugsItemAndSequenceLengthCorrected.dcm
103 -----------------------------------------------------------------------
104 There are still some subtle issues with Enhanced modality:
105 * what if frames are not order according to IPP ?
106 * what is the intercept/slope are not constant throughout the frames ?
107 -----------------------------------------------------------------------
108 Add support for namelink packaging
109 -----------------------------------------------------------------------
110 Need a MediaStorage::IsRetired / UIDs::IsRetired
111 -----------------------------------------------------------------------
112 What if:
113 (0018,0084) DS [ 63.89.73.30] # 10,1 Imaging Frequency
114 -----------------------------------------------------------------------
115 play with imageplanewdg / Orthoplanewidget
116 http://www.itk.org/pipermail/insight-users/2006-January/016463.html
117 -----------------------------------------------------------------------
118 window level in Enhanced objects is not handled
119 -----------------------------------------------------------------------
120 wow cpack is finally documented:
121 http://www.itk.org/Wiki/CMake:Component_Install_With_CPack
122 -----------------------------------------------------------------------
123 TODO:
124 gdcmData/GDCMPrinterDisplayUNasSQ.dcm
125 -----------------------------------------------------------------------
126 http://mlblog.osdir.com/programming.swig/2003-02/msg00053.html
127 -----------------------------------------------------------------------
128 doxygen is pretty advanced for this project:
129 http://sourceforge.net/projects/od1n/
130 -----------------------------------------------------------------------
131 STL-based (non-validating) XML Parser
132 http://www.codeguru.com/cpp/i-n/internet/xml/article.php/c3451/
133 -----------------------------------------------------------------------
134 There is subttle bug in the Part3 support:
135
136 <entry group="0010" element="1002" name="Other Patient IDs Sequence" type="3">
137 <description>A sequence of identification numbers or codes used to identify the patient, which may or may not be human readable, and may or may not have been obtained from an implanted or attached device such as an RFID or barcode.
138 If present, shall contain one or more items.</description>
139 </entry>
140 <entry group="0010" element="0020" name="&gt;Patient ID" type="1">
141 <description>An identification number or code used to identify the patient.</description>
142 </entry>
143 <entry group="0010" element="0021" name="&gt;Issuer of Patient ID" type="1">
144 <description>Identifier of the Assigning Authority that issued the Patient ID.</description>
145 </entry>
146 <entry group="0010" element="0022" name="&gt;Type of Patient ID" type="1">
147 <description>The type of identifier in this item. Defined Terms:
148 TEXT
149 RFID
150 BARCODE
151 Note: The identifier is coded as a string regardless of the type, not as a binary value.</description>
152
153 What this means is that 10,22 is Type 1 only within sequence 10,1002
154 -----------------------------------------------------------------------
155 Yet another brain dead philips DICOM image:
156
157 gdcmDataExtra/gdcmBreakers/Unexpected-Sequence-Terminator/images/Philips-Intera_Unexpected_Sequence_Terminator_1.dcm
158
159 (2005,e005) DS (CS) [75.0] # 4,1 Synergy Reconstruction Type
160 ...
161 (2005,e030) FL 79.9997\0 # 8,1 (2) ?
162
163 -----------------------------------------------------------------------
164 Thread with Philips BigEndian/LittleEndian inversion
165 http://www.creatis.insa-lyon.fr/pipermail/dcmlib/2004-November/000898.html
166 -----------------------------------------------------------------------
167 Looks like ELSCINT1 is doing a group xx for element:
168 {0x6003,0x0010,"ELSCINT1",VR::CS,VM::VM1,"Text Overlay Flag",false },
169 need to repeat for:
170 {0x6005,0x0010,"ELSCINT1",VR::CS,VM::VM1,"Text Overlay Flag",false },
171 and so and so forth...
172 -----------------------------------------------------------------------
173 SIEMENS MrProt / IDEA / Numaris stuff:
174 apt-get source minc-tools
175 conversion/dcm2mnc/dicom_to_minc.c
176 ./conversion/dcm2mnc/siemens_to_dicom.c
177 ./conversion/dcm2mnc/siemens_header_defs.h
178 http://www.nmr.mgh.harvard.edu/~greve/dicom-unpack
179 http://atonal.ucdavis.edu/matlab/fmri/spm5/spm_dicom_convert.m
180
181 -----------------------------------------------------------------------
182 cmake export() might be helpful to cleanup cmakelists.txt
183 -----------------------------------------------------------------------
184 BasicOffsetTable is never computed...
185 -----------------------------------------------------------------------
186 Need a gdcm::DataSetToPythonDict class
187 -----------------------------------------------------------------------
188 Need a gdcm::ApplyRuleFilter class
189
190 where Addrule:
191
192 void AddRule( void(*func)(DataElement &de) )
193
194 where
195
196 void func(DataElement &de)
197 {
198 if( de.IsPrivate() )
199 {
200 ds.Remove( de );
201 }
202 }
203 -----------------------------------------------------------------------
204 Fix the UseGDCM. So that user can do:
205
206 FIND_PACKAGE(GDCM REQUIRED)
207 INCLUDE( ${GDCM_USE_FILE} )
208
209 ADD_EXECUTABLE(bla bla.cxx)
210 TARGET_LIBK_LIBRARIES(bla vtkgdcm)
211 -----------------------------------------------------------------------
212 http://www.4bitterguys.com/phpBB2/viewtopic.php?t=7426
213 http://www.data-compression.info/ABC/index.htm
214 http://www.geocities.com/truth_out_there/additionalinfo.html
215 -----------------------------------------------------------------------
216 FIX data dict, missing bunch of old acr nema stuff
217 -----------------------------------------------------------------------
218 Create a toplevel main gdcmswig.i to avoid code duplication for C# and python
219 -----------------------------------------------------------------------
220 This is a SC, with Pixel Spacing and Rescale Slope/Intercept
221 gdcmData/WeirdOverlayThingy.dcm
222 Using gdcm2vtk will loose everything...
223 -----------------------------------------------------------------------
224 C# has some sort of compilation in XML to construct the documentation... to investigate
225 -----------------------------------------------------------------------
226 RegionOfInterestImageFilter is the streaming interface for ITKIO
227 -----------------------------------------------------------------------
228 http://www.stack.nl/~dimitri/doxygen/external.html
229 with tag file from:
230 http://www.vtk.org/doc/release/5.2/
231 or:
232 http://www.vtk.org/doc/nightly/
233 -----------------------------------------------------------------------
234 TODO: explicit TS for:
235 LUTDATA_implicit_OW.dcm
236 -----------------------------------------------------------------------
237 Fix gdcm::Sorter::SetSortFunction for wrapped language
238 -----------------------------------------------------------------------
239 Add more siemens stuff from:
240 dicom_to_minc.c
241 apt-get source minc
242 -----------------------------------------------------------------------
243 file meta header does not check for valid of imp class uid
244 Need to be UIDGenerator::IsValid
245 -----------------------------------------------------------------------
246 Bug gdcmconv should properly autorecompute explicit length for:
247 BogusItemLengthImplicitPrivateAtt.dcm
248 -----------------------------------------------------------------------
249 gdcmconv --squeeze to squeeze extra space (trailing)
250 -----------------------------------------------------------------------
251 gdcmimg /usr/share/VTKData/Data/beach.jpg out.dcm
252 gdcmraw out.dcm out.jpg
253 -> out.jpg still contains the JFIF marker (color space...)
254 -----------------------------------------------------------------------
255 BUG: SERIOUS gdcm does not allow creation of such file
256 dcmcjpeg +fs 100 GE_DLX-8-MONO2-Multiframe.dcm /tmp/jpeg3.dcm
257
258 tricky for jpeg 2000
259 -----------------------------------------------------------------------
260 Following same bug: need to fix gdcmconv --split 65536 for multiframe
261 also need to check BasicOffset is properly discarded
262 -----------------------------------------------------------------------
263 Can I handle SetImageFormat (invalid) properly ?
264 eg. vtkImageData is single comp but ImageFormat=RGB ...
265 -----------------------------------------------------------------------
266 FIXME:
267 gdcmconv --deflated gdcmDataExtra/gdcmNonImageData/c15-5.dcm out.dcm
268 could not read: gdcmDataExtra/gdcmNonImageData/c15-5.dcm
269 -----------------------------------------------------------------------
270 Technically nothing prevent someone from using JPegcompress on PDF object
271 So gdcm::ImageChangeTransferSyntax should let non-image pass
272 -----------------------------------------------------------------------
273 Add support for invalid SC generated from ITK/gdcm 1.2.4
274 -----------------------------------------------------------------------
275 When converting an Enhanced CT, IOP is moved from root dataset to
276 Sharedgroups but original attribute is kept (should be removed)
277 same goes for WindowLevel, Rescale ...
278 -----------------------------------------------------------------------
279 old SC and numberOfFrames > 1:
280 ITK_GDCM124_MultiframeSecondaryCaptureInvalid.dcm
281 -----------------------------------------------------------------------
282 TODO: try to handle:
283 gdcmData/gdcm-CR-DCMTK-16-NonSamplePerPix.dcm
284 -----------------------------------------------------------------------
285 OPJ_LIMIT_DECODING to parse header only
286 -----------------------------------------------------------------------
287 check volume_to_jp3d/ jp3d_to_volume to handle JPEG2000 Part 2
288 -----------------------------------------------------------------------
289 Write a gdcm2jp2 that would be cool ?
290 Need to handle PALETTE_COLOR in JP2 palettetized (PCLR)
291 There is only one problem with slope/rescale -> float
292 -----------------------------------------------------------------------
293 Private tags extracted from private DCS is cool, but one would also
294 need Defined terms, that would be *very* cool !
295 -----------------------------------------------------------------------
296 Amicas JP2 to DICOM:
297 http://www.mikekristofferson.com/misc/mri/amicas-patients/
298 -----------------------------------------------------------------------
299 Prepare a DICOM file with VR:UN element with Value Length odd ... what is the padding then ?
300 -----------------------------------------------------------------------
301 Add example of JPC (redundancy 3D volume / J2K)
302 -----------------------------------------------------------------------
303 Create a PDF Storage class with a trailing Pixel Data element to test broken DICOM implementation
304 -----------------------------------------------------------------------
305 Prepare a Basic Pixel Spacing Calibration example but with SC SOP so that
306 we have Nominal Scanned Pixel Spacing case...
307 -----------------------------------------------------------------------
308 I think there is a bug in ByteValue::SetByte. What if byte buffer is 0xfffffffe long ?
309 internally I ++ the length, which would make it an undefined length.
310 -----------------------------------------------------------------------
311 Get rid of polarssl now that OpenSSL completely replaces it
312 ... I might even have to get rid of OpenSSL
313 http://gdcm.sourceforge.net/wiki/index.php/Tools/openssl#Giving_up_on_OpenSSL
314 -----------------------------------------------------------------------
315 gdcmdump map-uid-names
316 -----------------------------------------------------------------------
317 +/*
318 + * Windows _snprintf and _vsnprintf are not compatible to linux versions.
319 + * Result value is not size of buffer needed, but -1 if no fit is possible.
320 + *
321 + * This fuction tries to 'fix' this by at least suggesting enlarging the
322 + * size by 20.
323 + */
324 -> polarssl
325 -----------------------------------------------------------------------
326 Update charls for bug fix (16bits RGB still not working)
327 -----------------------------------------------------------------------
328 vtkGDCMImageReader::GetDirectionCosines(uint i)
329 -----------------------------------------------------------------------
330 http://blog.mozilla.com/nnethercote/2009/02/27/eliminating-undefined-values-with-valgrind-the-easy-way/
331 > And just think, if C++ warned about fields uninitialised by constructors,
332 I think adding -Weffc++ to the CXXFLAGS should help about that.
333 -----------------------------------------------------------------------
334 gdcmimg should strip the JFIF / JP2 markers
335 -----------------------------------------------------------------------
336 TODO: to get rid of openssl on Win32 one could use the CryptoAPI:
337 [Example C Program: Signing a Message and Verifying a Message Signature]
338 http://msdn.microsoft.com/en-us/library/aa382372.aspx
339 http://www.ureader.com/msg/16591281.aspx
340 -----------------------------------------------------------------------
341 Fix gdcm::spacing before release CP-586
342 -----------------------------------------------------------------------
343 This is part of CPack's API. There is no API in the make system to use
344 this feature.
345
346 You have to run "make preinstall" to prepare the installation and then
347 run "cmake -DCOMPONENT=Runtime -P cmake_install.cmake" to do the
348 component-specific installation.
349 -----------------------------------------------------------------------
350 vtkGDCMImageReader:: SetReferencedStudyUID()
351 to allow creation of DERIVED / SECONDARY
352 -----------------------------------------------------------------------
353 Make sure Overlay can reference original instance
354 question:
355 image is a reslice of original image, how do I map to original UID ?
356 -----------------------------------------------------------------------
357 * There is a current limitation of not handling Referenced SOP Class UID /
358 * Referenced SOP Instance UID simply because the gdcm::Scanner does not allow us
359 * See PS 3.11 / Table D.3-2 STD-GEN Additional DICOMDIR Keys
360 -----------------------------------------------------------------------
361 RTSTRUCT support
362 http://www.nabble.com/How-to-load-sequence-items-td20622657.html
363
364 Re: How to load sequence items
365 -----------------------------------------------------------------------
366 # CPP check
367 find_program(CPPCHECK_EXECUTABLE NAMES cppcheck
368 DOC "cppcheck - static check tool")
369 add_custom_target (cppcheck ${CPPCHECK_EXECUTABLE} -a -f -q
370 ${GDCM_SOURCE_DIR}"
371 COMMENT "Checking C++ code")
372
373 -----------------------------------------------------------------------
374 Reduce excess linkage:
375 http://wiki.mandriva.com/en/Development/Tasks/Packaging/Problems/Underlinking
376 http://wiki.mandriva.com/en/Overlinking
377 -----------------------------------------------------------------------
378 Generate doc for python automatically
379 -----------------------------------------------------------------------
380 Display Shutter: It should not invert to white when radiologist invert
381 lookup table
382 -----------------------------------------------------------------------
383 Private Tags IMPAC
384 http://www.varian.com/media/oncology/services_and_support/pdf/dicom/System_Server_8.2_8.5_8.6.pdf
385 http://www.varian.com/media/oncology/services_and_support/pdf/dicom/System_Server_DCS.pdf
386 -----------------------------------------------------------------------
387 http://www.w3.org/People/Bos/JPEG-XMP/
388 rdjpgxmp : extract XMP metadata from a JPEG file
389 -----------------------------------------------------------------------
390 PDFParser:
391 http://www.codeproject.com/kb/cpp/ExtractPDFText.aspx
392 http://www.codeproject.com/KB/recipes/mgpdfreader.aspx
393 passepartout-0.6› src› ps› pdfparser.ccC
394 http://www.cocoabuilder.com/archive/cocoa/114723-pdf-meta-data.html#115418
395 http://blog.didierstevens.com/programs/pdf-tools/
396 http://sourceforge.net/projects/pdfsqueezer/develop
397 -----------------------------------------------------------------------
398 FIX Iterator in gdcm::Dict
399 -----------------------------------------------------------------------
400 Structured REport for Presentation
401 -----------------------------------------------------------------------
402 WADO instead of DICOM protocol
403 -----------------------------------------------------------------------
404 http://assimp.sourceforge.net/main_license.html
405 -----------------------------------------------------------------------
406 Missing dict for: SIEMENS MED SP DXMG WH AWS 1
407 http://www.medical.siemens.com/siemens/en_GLOBAL/rg_marcom_FBAs/files/brochures/DICOM/sp_mammo/WH_AWS_VB30_dcs_ekl.pdf
408 -----------------------------------------------------------------------
409 Other quantization algorithm:
410 http://alpng.sourceforge.net/octree.html
411 -----------------------------------------------------------------------
412 http://www.hitachimed.com/idc/groups/hitachimedical/documents/supportingdocumentpdf/poc_013216.pdf
1515 #include <iostream>
1616
1717 #include <string.h> // strlen
18 #include <stdio.h> // EOF
1819
1920 int TestString2(int , char *[])
2021 {
2425 gdcm::String<> s2 = "coucou!";
2526 std::cout << s2 << " -> " << s2.size() << std::endl;
2627
27 gdcm::String<'\0',64,0> s3 = "coucou";
28 gdcm::String<EOF,64,0> s3 = "coucou";
2829 std::cout << s3.c_str() << " -> " << s3.size() << std::endl;
2930
30 gdcm::String<'\0',64,0> s4 = "coucou!";
31 gdcm::String<EOF,64,0> s4 = "coucou!";
3132 std::cout << s4.c_str() << " -> " << s4.size() << std::endl;
3233
3334 const char *s = "coucou!";
34 gdcm::String<'\0',64,0> s5( s, strlen(s) );
35 gdcm::String<EOF,64,0> s5( s, strlen(s) );
3536 std::cout << s5.c_str() << " -> " << s5.size() << std::endl;
3637
3738 std::string ss = "coucou!";
38 gdcm::String<'\0',64,0> s6( ss );
39 gdcm::String<EOF,64,0> s6( ss );
3940 std::cout << s6.c_str() << " -> " << s6.size() << std::endl;
4041
41 gdcm::String<'\0',64,0> s7( ss, 1, 5 );
42 gdcm::String<EOF,64,0> s7( ss, 1, 5 );
4243 std::cout << s7.c_str() << " -> " << s7.size() << std::endl;
4344
44 gdcm::String<'\0',64,0> s8( ss, 1, 6 );
45 gdcm::String<EOF,64,0> s8( ss, 1, 6 );
4546 std::cout << s8.c_str() << " -> " << s8.size() << std::endl;
4647
4748 return 0;
4949 PET-cardio-Multiframe-Papyrus.dcm
5050 # No way to read this image:
5151 ELSCINT1_LOSSLESS_RICE.dcm
52 # SignedShortLossless has never really been supported anyway:
53 SignedShortLosslessBug.dcm
54 # Would need to process ALL Pixel Data element when decompressing:
55 PET-GE-dicomwrite-PixelDataSQUNv3.dcm
5652 # Toshiba US Private Data Storage 1.2.392.200036.9116.7.8.1.1.1
5753 TOSHIBA_MDW_HEADER.dcm
5854 # TODO, nasty:
259259 { "Bug_Siemens_PrivateIconNoItem.dcm" , "1.2.840.10008.5.1.4.1.1.2" },
260260 { "HardcopyColor_YBR_RCT_J2K_PC1.dcm" , "1.2.840.10008.5.1.1.30" },
261261 { "PET-GE-dicomwrite-PixelDataSQUNv2.dcm" , "1.2.840.10008.5.1.4.1.1.128" },
262 { "PET-GE-dicomwrite-PixelDataSQUNv3.dcm" , "1.2.840.10008.5.1.4.1.1.128" },
263262
264263 /* Stopping condition */
265264 { nullptr ,nullptr }
5959 TestStringFilter1
6060 TestStringFilter2
6161 TestStringFilter3
62 TestStringFilter4
6362 TestUIDGenerator
6463 TestUUIDGenerator
6564 #TestUIDGenerator3
4646 System::MakeDirectory( tmpdir.c_str() );
4747 //return 1;
4848 }
49 if(verbose) std::cout << "Processing: " << filename << std::endl;
5049 std::string outfilename = Testing::GetTempFilename( filename, subdir );
5150
5251 // Create directory first:
105105 {
106106 assert( vr == VR::DS || vr == VR::SS || vr == VR::SH );
107107 assert( vr2 == VR::IS || vr2 == VR::US || vr2 == VR::CS );
108 return vr;
109 }
110 // PHILIPS_Gyroscan-12-Jpeg_Extended_Process_2_4.dcm
111 if( de.GetTag() == Tag(0x0008,0x0040) )
112 {
113 assert( vr == VR::SS );
114 assert( vr2 == VR::US );
115108 return vr;
116109 }
117110 if( vr == VR::SQ || vr2 == VR::SQ )
235228 return 1;
236229 }
237230
231 const gdcm::Global &g = gdcm::GlobalInstance;
232 const gdcm::Dicts &dicts = g.GetDicts();
238233 const gdcm::File & file = r.GetFile();
239234 gdcm::Printer2 print;
240235 print.SetFile( file );
1515 #include "gdcmImageWriter.h"
1616 #include "gdcmTesting.h"
1717 #include "gdcmFilename.h"
18 #include "gdcmByteSwap.h"
1918 #include "gdcmSystem.h"
2019
2120 int TestImageChangePlanarConfigurationFunc(const char *filename, bool verbose = false)
9090
9191 if( verbose )
9292 {
93 if(ref) std::cout << "ref=" << ref << std::endl;
93 std::cout << "ref=" << ref << std::endl;
9494 std::cout << "md5=" << digest << std::endl;
9595 }
9696 if( !ref )
1111
1212 =========================================================================*/
1313 #include "gdcmPixelFormat.h"
14
15 struct frame_info {
16 gdcm::PixelFormat pixeltype;
17 };
1814
1915 int TestPixelFormat(int , char *[])
2016 {
141137 pf4.SetPixelRepresentation(1);
142138 if( pf4.GetScalarType() != gdcm::PixelFormat::INT16 ) return 1;
143139
144 frame_info fi = {};
145 (void)fi;
146140
147141 return 0;
148142 }
+0
-53
Testing/Source/MediaStorageAndFileFormat/Cxx/TestStringFilter4.cxx less more
0 /*=========================================================================
1
2 Program: GDCM (Grassroots DICOM). A DICOM library
3
4 Copyright (c) 2006-2011 Mathieu Malaterre
5 All rights reserved.
6 See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
7
8 This software is distributed WITHOUT ANY WARRANTY; without even
9 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
10 PURPOSE. See the above copyright notice for more information.
11
12 =========================================================================*/
13 #include "gdcmStringFilter.h"
14 #include "gdcmAttribute.h"
15 #include "gdcmSmartPointer.h"
16
17 // https://sourceforge.net/p/gdcm/bugs/485/
18 int TestStringFilter4(int , char *[])
19 {
20 gdcm::SmartPointer<gdcm::File> f = new gdcm::File;
21 gdcm::DataSet & ds = f->GetDataSet();
22
23 {
24 gdcm::Element<gdcm::VR::LO,gdcm::VM::VM1> priv_creator;
25 priv_creator.SetValue( "SIEMENS MED SP DXMG WH AWS 1" );
26 gdcm::DataElement de1 = priv_creator.GetAsDataElement();
27 de1.SetTag( gdcm::Tag(0x19,0x10) );
28 ds.Insert( de1 );
29
30 gdcm::Element<gdcm::VR::ST,gdcm::VM::VM1> el;
31 el.SetValue( "TestStringFilter4" );
32 gdcm::DataElement de2 = el.GetAsDataElement();
33 de2.SetTag( gdcm::Tag(0x19,0x1010) );
34 ds.Insert( de2 );
35 // std::cout << ds << std::endl;
36
37 gdcm::StringFilter filter;
38 filter.SetFile(*f);
39
40 gdcm::PrivateTag privTag(0x0019, 0x10, "SIEMENS MED SP DXMG WH AWS 1");
41
42 // Works as intended
43 std::string privTagValue1 = filter.ToString(ds.GetDataElement(privTag));
44 std::cout << privTagValue1 << std::endl;
45
46 // Does not work, returns string value of the private creator instead of the actual tag
47 std::string privTagValue2 = filter.ToString(privTag);
48 std::cout << privTagValue2 << std::endl;
49 }
50
51 return 0;
52 }
3333 if ds.FindDataElement( replacetag ):
3434 de = ds.GetDataElement( replacetag )
3535 #print dir(de)
36 patname = b"This^is^an^example"
36 patname = "This^is^an^example"
3737 de.SetByteStringValue( patname )
3838
3939 # let's insert a new dataelement
4040 # <entry group="0012" element="0062" vr="CS" vm="1" name="Patient Identity Removed"/>
4141 pir = gdcm.DataElement( gdcm.Tag(0x0012,0x0062) )
4242 pir.SetVR( gdcm.VR( gdcm.VR.CS ) ) # specify the VR explicitly
43 yes = b"YES"
43 yes = "YES"
4444 pir.SetByteStringValue( yes )
4545 ds.Insert( pir )
4646
5353 #print dictel.GetVR()
5454 deid = gdcm.DataElement( deidmethod )
5555 deid.SetVR( dictel.GetVR() )
56 methodstr = b"Well known Company"
56 methodstr = "Well known Company"
5757 #deid.SetByteStringValue( methodstr )
5858 deid.SetByteStringValue( methodstr )
5959 ds.Insert( deid )
1818
1919 major=3
2020 minor=0
21 patch=0
21 patch=5
2222 dirversion="$major.$minor"
2323 version="$major.$minor.$patch"
2424 version2="$major-$minor-$patch"
8686 GDCM_WRAP_CSHARP:BOOL=ON
8787 GDCM_WRAP_JAVA:BOOL=ON
8888 GDCM_WRAP_PYTHON:BOOL=ON
89 Python_ADDITIONAL_VERSIONS:STRING=2.7
89 Python_ADDITIONAL_VERSIONS:STRING=3.2
9090 CPACK_SOURCE_ZIP:BOOL=ON
9191 EOT
9292
115115
116116 # Let's start doing the VTK documentation then:
117117 #cmake -DGDCM_VTK_DOCUMENTATION:BOOL=ON -DGDCM_USE_VTK:BOOL=ON -DVTK_DIR:PATH=/home/mathieu/tmp/vtk-5.10.1+dfsg/Build .
118 cmake -DGDCM_VTK_DOCUMENTATION:BOOL=ON -DGDCM_USE_VTK:BOOL=ON -DVTK_DIR:PATH=/home/mathieu/tmp/vtk6-6.2.0+dfsg1/debian/build .
118 #cmake -DGDCM_VTK_DOCUMENTATION:BOOL=ON -DGDCM_USE_VTK:BOOL=ON -DVTK_DIR:PATH=/home/mathieu/tmp/vtk6-6.2.0+dfsg1/debian/build .
119 cmake -DVTK_SOURCE_DIR:PATH=/home/mmalaterre/tmp/vtk6-6.3.0+dfsg2/ -DGDCM_VTK_DOCUMENTATION:BOOL=ON -DGDCM_USE_VTK:BOOL=ON -DVTK_DIR:PATH=/home/mmalaterre/tmp/vtk6-6.3.0+dfsg2/debian/build .
119120 check_exit_value $? "cmake did not return properly" || exit 1
120121 #make -j4
121122 make rebuild_cache
1818
1919 major=3
2020 minor=0
21 patch=0
21 patch=5
2222 dirversion="$major.$minor"
2323 version="$major.$minor.$patch"
2424 version2="$major-$minor-$patch"
3131 #print v16.GetOutput()
3232
3333 w = vtkgdcm.vtkGDCMImageWriter()
34 w.SetInputConnection( v16.GetOutputPort() )
34 w.SetInput( v16.GetOutput() )
3535 w.SetFileDimensionality( 3 )
3636 w.SetFileName( "sc.dcm" )
3737 w.Write()
211211 <para><literallayout>$ gdcmanon --dumb --remove 400,500 --remove 12,62 --remove 12,63 anonymized_reversible.dcm anonymized_irreversible.dcm
212212 </literallayout></para>
213213
214 <para>In recent GDCM version those two independant gdcmanon steps can be executed using simply:<literallayout>$ gdcmanon input.dcm anonymized_irreversible.dcm</literallayout></para>
215 <para>Or if one want for readability:<literallayout>$ gdcmanon -e input.dcm anonymized_irreversible.dcm</literallayout></para>
216
214217 <para><formalpara><title>Remarks: </title>
215218
216219 <para>As mentionned in DICOM Sup 142, this anonymization is preferred over de-identification since: It is not required that the Encrypted Attributes Data Set be created; indeed, there may be circumstances where the Dataset is expected to be archived long enough that any contemporary encryption technology may be inadequate to provide long term protection against unauthorized recovery of identification</para>
7272 interface.cpp jpegls.cpp jpegmarkersegment.cpp jpegstreamreader.cpp jpegstreamwriter.cpp
7373 )
7474 target_compile_features(${CHARLS_LIBRARY_NAME}
75 # PUBLIC cxx_strong_enums
75 PUBLIC cxx_strong_enums
7676 PRIVATE cxx_nullptr)
7777 set_target_properties( ${CHARLS_LIBRARY_NAME} PROPERTIES
7878 VERSION ${CHARLS_MAJOR_VERSION}.${CHARLS_MINOR_VERSION}
127127 set(JPEGSTATIC 1)
128128 endif ()
129129
130 # By default support DICOMObjects bug, if this is a speed penalty for you
131 # you should consider disabling it
132 set(SUPPORT_DICOMOBJECTS_BUG ON)
133
130134 # Generate three libraries: jpeg 8bits, 12bits and 16bits
131135 # using only one source directory
132136
7171 * logically AND the result with 0xFFFF.
7272 */
7373
74 #define UNDIFFERENCE_2D(PREDICTOR) \
75 unsigned int xindex; \
76 int Ra, Rb, Rc; \
77 \
74 #define UNDIFFERENCE_2D_BUG(PREDICTOR) \
7875 Rb = GETJSAMPLE(prev_row[0]); \
7976 Ra = (diff_buf[0] + PREDICTOR2) & 0xFFFF; \
8077 undiff_buf[0] = Ra; \
8683 undiff_buf[xindex] = Ra; \
8784 }
8885
86 #define UNDIFFERENCE_2D(PREDICTOR) \
87 unsigned int xindex; \
88 int Ra, Rb, Rc; \
89 \
90 Rb = GETJSAMPLE(prev_row[0]); \
91 Ra = (diff_buf[0] + PREDICTOR2) & 0xFFFF; \
92 undiff_buf[0] = Ra; \
93 \
94 for (xindex = 1; xindex < width; xindex++) { \
95 Rc = Rb; \
96 Rb = GETJSAMPLE(prev_row[xindex]); \
97 Ra = (diff_buf[xindex] + PREDICTOR) & 0xFFFF; \
98 undiff_buf[xindex] = Ra; \
99 }
100
89101
90102 /*
91103 * Undifferencers for the all rows but the first in a scan or restart interval.
140152 (void)cinfo;(void)comp_index;(void)diff_buf;(void)prev_row;(void)undiff_buf;(void)width;
141153 }
142154
155 #ifdef SUPPORT_DICOMOBJECTS_BUG
156 /* uninitialized */
157 static int dicomobjectsbug = -1; /* 0 == nobug, 1 == bug */
158 #endif
159
143160 METHODDEF(void)
144161 jpeg_undifference6(j_decompress_ptr cinfo, int comp_index,
145162 JDIFFROW diff_buf, JDIFFROW prev_row,
146163 JDIFFROW undiff_buf, JDIMENSION width)
147164 {
165 #ifdef SUPPORT_DICOMOBJECTS_BUG
166 unsigned int xindex;
167 int Ra, Rb, Rc;
168 int min, max, temp;
169 SHIFT_TEMPS
170 if( dicomobjectsbug == -1 )
171 {
172 dicomobjectsbug = 0; /* no bug by default */
173
174 Rb = GETJSAMPLE(prev_row[0]);
175 Ra = (diff_buf[0] + PREDICTOR2) & 0xFFFF;
176 undiff_buf[0] = Ra;
177 temp = min = max = undiff_buf[0];
178
179 for (xindex = 1; xindex < width; xindex++) {
180 Rc = Rb;
181 Rb = GETJSAMPLE(prev_row[xindex]);
182 Ra = (diff_buf[xindex] + PREDICTOR6) & 0xFFFF;
183 temp = Ra;
184 min = temp < min ? temp : min;
185 max = temp > max ? temp : max;
186 }
187 if( (max - min) > 50000) /* magic number */
188 {
189 dicomobjectsbug = 1;
190 WARNMS(cinfo, JWRN_SIGNED_ARITH);
191 }
192 }
193 if(dicomobjectsbug)
194 {
195 UNDIFFERENCE_2D_BUG(PREDICTOR6_BUG);
196 }
197 else
198 {
199 UNDIFFERENCE_2D_BUG(PREDICTOR6);
200 }
201 #else
148202 SHIFT_TEMPS
149203 UNDIFFERENCE_2D(PREDICTOR6);
150 (void)cinfo;(void)comp_index;(void)diff_buf;(void)prev_row;(void)undiff_buf;(void)width;
204 #endif
205 (void)comp_index;(void)cinfo;
151206 }
152207
153208 METHODDEF(void)
2222 #define PREDICTOR4 (int) ((INT32) Ra + (INT32) Rb - (INT32) Rc)
2323 #define PREDICTOR5 (int) ((INT32) Ra + RIGHT_SHIFT((INT32) Rb - (INT32) Rc, 1))
2424 #define PREDICTOR6 (int) ((INT32) Rb + RIGHT_SHIFT((INT32) Ra - (INT32) Rc, 1))
25 #define PREDICTOR6_BUG (int) ((INT16) Rb + RIGHT_SHIFT((INT16) Ra - (INT16) Rc, 1))
2526 #define PREDICTOR7 (int) RIGHT_SHIFT((INT32) Ra + (INT32) Rb, 1)
2627
2728
2121 #cmakedefine JPEGDLL
2222 #cmakedefine JPEGSTATIC
2323
24 /* For more info on this bug see:
25 * [Broken JPEG from GE station] on comp.protocols.dicom
26 * and official publication at:
27 * http://www.medicalconnections.co.uk/html/lossless_bug.html
28 */
29 #cmakedefine SUPPORT_DICOMOBJECTS_BUG
30
2431 #define BITS_IN_JSAMPLE @CMAKE_BITS_IN_JSAMPLE@
2532
2633 #if BITS_IN_JSAMPLE == 8
+0
-58
Wrapping/Perl/CMakeLists.txt less more
0 # Required:
1 # sudo apt-get install libperl-dev
2
3 # http://www.swig.org/Doc2.0/Perl5.html
4 find_package(SWIG REQUIRED)
5 include(${SWIG_USE_FILE})
6
7 include_directories(
8 "${GDCM_BINARY_DIR}/Source/Common"
9 "${GDCM_SOURCE_DIR}/Source/Common"
10 "${GDCM_SOURCE_DIR}/Source/DataStructureAndEncodingDefinition"
11 "${GDCM_SOURCE_DIR}/Source/InformationObjectDefinition"
12 "${GDCM_SOURCE_DIR}/Source/MediaStorageAndFileFormat"
13 "${GDCM_SOURCE_DIR}/Source/DataDictionary"
14 )
15
16 find_package(PerlLibs REQUIRED)
17 include_directories(
18 ${PERL_INCLUDE_PATH}
19 )
20
21 set_source_files_properties(gdcm.i PROPERTIES CPLUSPLUS ON)
22
23 # TODO check convetion for perl module name:
24 SWIG_ADD_MODULE(perl_gdcm perl gdcm.i)
25 SWIG_LINK_LIBRARIES(perl_gdcm LINK_PRIVATE gdcmMSFF)
26
27 # Remove 'lib' prefix :no-op on windows and valid for UNIX based syste
28 set_target_properties(${SWIG_MODULE_perl_gdcm_REAL_NAME} PROPERTIES PREFIX "")
29 set_property(TARGET ${SWIG_MODULE_perl_gdcm_REAL_NAME} PROPERTY NO_SONAME 1)
30
31 if(UNIX)
32 set_target_properties(${SWIG_MODULE_perl_gdcm_REAL_NAME} PROPERTIES OUTPUT_NAME "gdcm")
33 endif()
34
35
36 # Let's copy gdcm.pm into the bin dir:
37 #add_custom_command(
38 # OUTPUT ${LIBRARY_OUTPUT_PATH}/gdcm.pm
39 # COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/gdcm.php ${LIBRARY_OUTPUT_PATH}/gdcm.pm
40 # DEPENDS "${swig_generated_file_fullname}"
41 # COMMENT "copying gdcm.pm"
42 #)
43 #add_custom_target(GDCMPERL ALL
44 # DEPENDS ${LIBRARY_OUTPUT_PATH}/gdcm.pm
45 # COMMENT "building gdcm.pm"
46 #)
47
48 # Module are always place in the library destination
49 # but for poor win32 user I decided to place them
50 # right next to the other dlls
51 if(NOT GDCM_INSTALL_NO_LIBRARIES)
52 install_swig_module(perl_gdcm Perl)
53 # because gdcm.pm is constructed with custom commands, it need the install(FILES signature:
54 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/gdcm.pm
55 DESTINATION ${GDCM_INSTALL_LIB_DIR} COMPONENT PerlModule
56 )
57 endif()
+0
-622
Wrapping/Perl/gdcm.i less more
0 /*=========================================================================
1
2 Program: GDCM (Grassroots DICOM). A DICOM library
3
4 Copyright (c) 2006-2011 Mathieu Malaterre
5 All rights reserved.
6 See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
7
8 This software is distributed WITHOUT ANY WARRANTY; without even
9 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
10 PURPOSE. See the above copyright notice for more information.
11
12 =========================================================================*/
13 // See docs:
14 // http://www.swig.org/Doc1.3/Php.html
15 // http://www.swig.org/Doc1.3/SWIGPlus.html#SWIGPlus
16
17 %module(docstring="A DICOM library",directors=1) gdcm
18 #pragma SWIG nowarn=302,303,312,362,383,389,401,503,504,509,510,514,516,842
19
20 #if defined(SWIGPERL)
21 %{
22 #define SWIGPERL
23 %}
24 #endif
25
26
27 %{
28 // http://www.swig.org/Doc2.0/Perl5.html#Perl5_nn9
29 #undef New
30
31 #include "gdcmTypes.h"
32 #include "gdcmASN1.h"
33 #include "gdcmSmartPointer.h"
34 #include "gdcmSwapCode.h"
35 #include "gdcmEvent.h"
36 #include "gdcmProgressEvent.h"
37 #include "gdcmAnonymizeEvent.h"
38 #include "gdcmDirectory.h"
39 #include "gdcmTesting.h"
40 #include "gdcmObject.h"
41 #include "gdcmPixelFormat.h"
42 #include "gdcmMediaStorage.h"
43 #include "gdcmTag.h"
44 #include "gdcmPrivateTag.h"
45 #include "gdcmVL.h"
46 #include "gdcmVR.h"
47 #include "gdcmVM.h"
48 #include "gdcmObject.h"
49 #include "gdcmValue.h"
50 #include "gdcmByteValue.h"
51 #include "gdcmDataElement.h"
52 #include "gdcmItem.h"
53 #include "gdcmSequenceOfItems.h"
54 #include "gdcmDataSet.h"
55 //#include "gdcmString.h"
56 //#include "gdcmCodeString.h"
57 #include "gdcmPreamble.h"
58 #include "gdcmFile.h"
59 #include "gdcmBitmap.h"
60 #include "gdcmPixmap.h"
61 #include "gdcmImage.h"
62 #include "gdcmIconImage.h"
63 #include "gdcmFragment.h"
64 #include "gdcmCSAHeader.h"
65 #include "gdcmPDBHeader.h"
66 #include "gdcmSequenceOfFragments.h"
67 #include "gdcmTransferSyntax.h"
68 #include "gdcmBasicOffsetTable.h"
69 //#include "gdcmLO.h"
70 #include "gdcmCSAElement.h"
71 #include "gdcmPDBElement.h"
72 #include "gdcmFileSet.h"
73
74 #include "gdcmReader.h"
75 #include "gdcmPixmapReader.h"
76 #include "gdcmImageReader.h"
77 #include "gdcmWriter.h"
78 #include "gdcmPixmapWriter.h"
79 #include "gdcmImageWriter.h"
80 #include "gdcmStringFilter.h"
81 #include "gdcmGlobal.h"
82 #include "gdcmDicts.h"
83 #include "gdcmDict.h"
84 #include "gdcmCSAHeaderDict.h"
85 #include "gdcmDictEntry.h"
86 #include "gdcmCSAHeaderDictEntry.h"
87 #include "gdcmUIDGenerator.h"
88 //#include "gdcmConstCharWrapper.h"
89 #include "gdcmScanner.h"
90 #include "gdcmAttribute.h"
91 #include "gdcmSubject.h"
92 #include "gdcmCommand.h"
93 #include "gdcmAnonymizer.h"
94 #include "gdcmSystem.h"
95 #include "gdcmTrace.h"
96 #include "gdcmUIDs.h"
97 #include "gdcmSorter.h"
98 #include "gdcmIPPSorter.h"
99 #include "gdcmSpectroscopy.h"
100 #include "gdcmPrinter.h"
101 #include "gdcmDumper.h"
102 #include "gdcmOrientation.h"
103 #include "gdcmFiducials.h"
104 #include "gdcmWaveform.h"
105 #include "gdcmPersonName.h"
106 #include "gdcmIconImage.h"
107 #include "gdcmCurve.h"
108 #include "gdcmDICOMDIR.h"
109 #include "gdcmValidate.h"
110 #include "gdcmApplicationEntity.h"
111 #include "gdcmDictPrinter.h"
112 #include "gdcmFilenameGenerator.h"
113 #include "gdcmVersion.h"
114 #include "gdcmFilename.h"
115 #include "gdcmEnumeratedValues.h"
116 #include "gdcmPatient.h"
117 #include "gdcmStudy.h"
118 #include "gdcmUsage.h"
119 #include "gdcmMacroEntry.h"
120 #include "gdcmModuleEntry.h"
121 #include "gdcmNestedModuleEntries.h"
122 #include "gdcmMacro.h"
123 #include "gdcmMacros.h"
124 #include "gdcmModule.h"
125 #include "gdcmModules.h"
126 #include "gdcmDefs.h"
127 #include "gdcmIOD.h"
128 #include "gdcmIODs.h"
129 #include "gdcmTableEntry.h"
130 #include "gdcmDefinedTerms.h"
131 #include "gdcmSeries.h"
132 #include "gdcmIODEntry.h"
133 #include "gdcmRescaler.h"
134 #include "gdcmSegmentedPaletteColorLookupTable.h"
135 #include "gdcmUnpacker12Bits.h"
136 //#include "gdcmPythonFilter.h"
137 #include "gdcmDirectionCosines.h"
138 #include "gdcmTagPath.h"
139 #include "gdcmPixmapToPixmapFilter.h"
140 #include "gdcmImageToImageFilter.h"
141 #include "gdcmSOPClassUIDToIOD.h"
142 #include "gdcmCoder.h"
143 #include "gdcmDecoder.h"
144 #include "gdcmCodec.h"
145 #include "gdcmImageCodec.h"
146 #include "gdcmJPEGCodec.h"
147 #include "gdcmJPEGLSCodec.h"
148 #include "gdcmJPEG2000Codec.h"
149 #include "gdcmPNMCodec.h"
150 #include "gdcmImageChangeTransferSyntax.h"
151 #include "gdcmImageApplyLookupTable.h"
152 #include "gdcmSplitMosaicFilter.h"
153 //#include "gdcmImageChangePhotometricInterpretation.h"
154 #include "gdcmImageChangePlanarConfiguration.h"
155 #include "gdcmImageFragmentSplitter.h"
156 #include "gdcmDataSetHelper.h"
157 #include "gdcmFileExplicitFilter.h"
158 #include "gdcmImageHelper.h"
159 #include "gdcmMD5.h"
160 #include "gdcmDummyValueGenerator.h"
161 #include "gdcmSHA1.h"
162 #include "gdcmBase64.h"
163 #include "gdcmCryptographicMessageSyntax.h"
164 #include "gdcmSpacing.h"
165 #include "gdcmSimpleSubjectWatcher.h"
166 #include "gdcmDICOMDIRGenerator.h"
167 #include "gdcmFileDerivation.h"
168
169 using namespace gdcm;
170 %}
171
172 //%include "docstrings.i"
173
174 // swig need to know what are uint16_t, uint8_t...
175 %include "stdint.i"
176
177 // gdcm does not use std::string in its interface, but we do need it for the
178 // %extend (see below)
179 %include "std_string.i"
180 //%include "std_set.i"
181 %include "std_vector.i"
182 %include "std_pair.i"
183 %include "std_map.i"
184 %include "exception.i"
185
186 // operator= is not needed in python AFAIK
187 %ignore operator=; // Ignore = everywhere.
188 %ignore operator++; // Ignore
189
190 %define EXTEND_CLASS_PRINT_GENERAL(classfuncname,classname)
191 %extend classname
192 {
193 const char *classfuncname() {
194 static std::string buffer;
195 std::ostringstream os;
196 os << *self;
197 buffer = os.str();
198 return buffer.c_str();
199 }
200 };
201 %enddef
202
203 #if defined(SWIGPERL)
204 %define EXTEND_CLASS_PRINT(classname)
205 EXTEND_CLASS_PRINT_GENERAL(toString,classname)
206 %enddef
207 #endif
208
209 //%feature("autodoc", "1")
210 %include "gdcmConfigure.h"
211 //%include "gdcmTypes.h"
212 //%include "gdcmWin32.h"
213 // I cannot include gdcmWin32.h without gdcmTypes.h, first. But gdcmTypes.h needs to know _MSC_VER at swig time...
214 #define GDCM_EXPORT
215 %include "gdcmLegacyMacro.h"
216
217 // The following must be define early on as gdcmVL.h get included real early
218 %rename(GetValueLength) gdcm::VL::operator uint32_t;
219 //%csmethodmodifiers gdcm::VL::GetValueLength "private"
220 //%csmethodmodifiers GetValueLength "private"
221 //%rename(GetValue) VL::operator uint32_t ();
222 // public static implicit operator int( MyType a )
223 // {
224 // return a.value;
225 // }
226 %include "gdcmSwapCode.h"
227
228 //%feature("director") Event;
229 //%feature("director") AnyEvent;
230 %include "gdcmEvent.h"
231
232 %include "gdcmPixelFormat.h"
233 EXTEND_CLASS_PRINT(gdcm::PixelFormat)
234 %include "gdcmMediaStorage.h"
235 EXTEND_CLASS_PRINT(gdcm::MediaStorage)
236 //%rename(__getitem__) gdcm::Tag::operator[];
237 //%rename(this ) gdcm::Tag::operator[];
238 %include "gdcmTag.h"
239 EXTEND_CLASS_PRINT(gdcm::Tag)
240 %include "gdcmPrivateTag.h"
241 EXTEND_CLASS_PRINT(gdcm::PrivateTag)
242
243 %include "gdcmProgressEvent.h"
244 //%feature("director") AnonymizeEvent;
245 %include "gdcmAnonymizeEvent.h"
246
247 %include "gdcmVL.h"
248 EXTEND_CLASS_PRINT(gdcm::VL)
249
250 %include "gdcmVR.h"
251 EXTEND_CLASS_PRINT(gdcm::VR)
252 %include "gdcmVM.h"
253 EXTEND_CLASS_PRINT(gdcm::VM)
254 //%template (FilenameType) std::string;
255 %template (FilenamesType) std::vector<std::string>;
256 %include "gdcmDirectory.h"
257 EXTEND_CLASS_PRINT(gdcm::Directory)
258 %include "gdcmObject.h"
259 %include "gdcmValue.h"
260 EXTEND_CLASS_PRINT(gdcm::Value)
261 // Array marshaling for arrays of primitives
262
263
264
265
266 %apply char[] { char* buffer }
267 %ignore gdcm::ByteValue::WriteBuffer(std::ostream &os) const;
268 //%ignore gdcm::ByteValue::GetPointer() const;
269 //%ignore gdcm::ByteValue::GetBuffer(char *buffer, unsigned long length) const;
270 %include "gdcmByteValue.h"
271 EXTEND_CLASS_PRINT(gdcm::ByteValue)
272 %clear char* buffer;
273
274
275 %apply char[] { const char* array }
276
277 %include "gdcmASN1.h"
278 %include "gdcmSmartPointer.h"
279 %template(SmartPtrSQ) gdcm::SmartPointer<gdcm::SequenceOfItems>;
280 %template(SmartPtrFrag) gdcm::SmartPointer<gdcm::SequenceOfFragments>;
281 %include "gdcmDataElement.h"
282 EXTEND_CLASS_PRINT(gdcm::DataElement)
283
284 %clear const char* array;
285 %extend gdcm::DataElement
286 {
287 void SetArray(unsigned char array[], unsigned int nitems) {
288 $self->SetByteValue((char*)array, nitems * sizeof(unsigned char) );
289 }
290 void SetArray(char array[], unsigned int nitems) {
291 $self->SetByteValue((char*)array, nitems * sizeof(char) );
292 }
293 void SetArray(unsigned short array[], unsigned int nitems) {
294 $self->SetByteValue((char*)array, nitems * sizeof(unsigned short) );
295 }
296 void SetArray(short array[], unsigned int nitems) {
297 $self->SetByteValue((char*)array, nitems * sizeof(short) );
298 }
299 void SetArray(float array[], unsigned int nitems) {
300 $self->SetByteValue((char*)array, nitems * sizeof(float) );
301 }
302 void SetArray(double array[], unsigned int nitems) {
303 $self->SetByteValue((char*)array, nitems * sizeof(double) );
304 }
305 };
306
307 %include "gdcmItem.h"
308 EXTEND_CLASS_PRINT(gdcm::Item)
309 /*
310 The following line is very important it properly convert :
311 SWIGTYPE_p_std__vectorT_int_t__size_type -> uint
312 */
313 %template() std::vector< gdcm::Item >;
314 %include "gdcmSequenceOfItems.h"
315 EXTEND_CLASS_PRINT(gdcm::SequenceOfItems)
316 %rename (PHPDataSet) SWIGDataSet;
317 %rename (PHPTagToValue) SWIGTagToValue;
318 %include "gdcmDataSet.h"
319 EXTEND_CLASS_PRINT(gdcm::DataSet)
320 //%include "gdcmString.h"
321 //%include "gdcmTransferSyntax.h"
322 %include "gdcmPhotometricInterpretation.h"
323 EXTEND_CLASS_PRINT(gdcm::PhotometricInterpretation)
324 %include "gdcmObject.h"
325 %include "gdcmLookupTable.h"
326 EXTEND_CLASS_PRINT(gdcm::LookupTable)
327 %include "gdcmOverlay.h"
328 EXTEND_CLASS_PRINT(gdcm::Overlay)
329 //%include "gdcmVR.h"
330 //%template (DataElementSet) std::set<gdcm::DataElement>;
331 %include "gdcmPreamble.h"
332 EXTEND_CLASS_PRINT(gdcm::Preamble)
333 %include "gdcmTransferSyntax.h"
334 EXTEND_CLASS_PRINT(gdcm::TransferSyntax)
335 %include "gdcmFileMetaInformation.h"
336 EXTEND_CLASS_PRINT(gdcm::FileMetaInformation)
337
338 //%template(File) gdcm::SmartPointer<gdcm::File>;
339 //%ignore gdcm::File;
340
341 %include "gdcmFile.h"
342 EXTEND_CLASS_PRINT(gdcm::File)
343 //%include "gdcm_arrays_csharp.i"
344
345 %apply char[] { char* buffer }
346 %apply unsigned int[] { unsigned int dims[3] }
347
348 //%apply byte OUTPUT[] { char* buffer } ;
349 //%ignore gdcm::Pixmap::GetBuffer(char*) const;
350 //%apply byte FIXED[] { char *buffer }
351 //%csmethodmodifiers gdcm::Pixmap::GetBuffer "public unsafe";
352 //%define %cs_marshal_array(TYPE, CSTYPE)
353 // %typemap(ctype) TYPE[] "void*"
354 // %typemap(imtype, inattributes="[MarshalAs(UnmanagedType.LPArray)]") TYPE[] "CSTYPE[]"
355 // %typemap(cstype) TYPE[] "CSTYPE[]"
356 // %typemap(in) TYPE[] %{ $1 = (TYPE*)$input; %}
357 // %typemap(csin) TYPE[] "$csinput"
358 //%enddef
359 //%cs_marshal_array(char, byte)
360 %include "gdcmBitmap.h"
361 EXTEND_CLASS_PRINT(gdcm::Bitmap)
362
363 %include "gdcmPixmap.h"
364 EXTEND_CLASS_PRINT(gdcm::Pixmap)
365
366 %include "gdcmImage.h"
367 EXTEND_CLASS_PRINT(gdcm::Image)
368 %include "gdcmIconImage.h"
369 EXTEND_CLASS_PRINT(gdcm::IconImage)
370 %include "gdcmFragment.h"
371 EXTEND_CLASS_PRINT(gdcm::Fragment)
372 %include "gdcmPDBElement.h"
373 EXTEND_CLASS_PRINT(gdcm::PDBElement)
374 %include "gdcmPDBHeader.h"
375 EXTEND_CLASS_PRINT(gdcm::PDBHeader)
376 %include "gdcmCSAElement.h"
377 EXTEND_CLASS_PRINT(gdcm::CSAElement)
378 %include "gdcmCSAHeader.h"
379 EXTEND_CLASS_PRINT(gdcm::CSAHeader)
380 %include "gdcmSequenceOfFragments.h"
381 EXTEND_CLASS_PRINT(gdcm::SequenceOfFragments)
382 %include "gdcmBasicOffsetTable.h"
383 EXTEND_CLASS_PRINT(gdcm::BasicOffsetTable)
384 //%include "gdcmLO.h"
385 %include "gdcmFileSet.h"
386 EXTEND_CLASS_PRINT(gdcm::FileSet)
387
388 //%include "gdcmGlobal.h"
389 //EXTEND_CLASS_PRINT(gdcm::Global)
390
391 %include "gdcmDictEntry.h"
392 EXTEND_CLASS_PRINT(gdcm::DictEntry)
393 %include "gdcmCSAHeaderDictEntry.h"
394 EXTEND_CLASS_PRINT(gdcm::CSAHeaderDictEntry)
395
396 %include "gdcmDict.h"
397 EXTEND_CLASS_PRINT(gdcm::Dict)
398 %include "gdcmCSAHeaderDict.h"
399 EXTEND_CLASS_PRINT(gdcm::CSAHeaderDictEntry)
400 %include "gdcmDicts.h"
401 EXTEND_CLASS_PRINT(gdcm::Dicts)
402 %include "gdcmReader.h"
403 //EXTEND_CLASS_PRINT(gdcm::Reader)
404 %include "gdcmPixmapReader.h"
405 //EXTEND_CLASS_PRINT(gdcm::PixmapReader)
406 %include "gdcmImageReader.h"
407 //EXTEND_CLASS_PRINT(gdcm::ImageReader)
408 %include "gdcmWriter.h"
409 //EXTEND_CLASS_PRINT(gdcm::Writer)
410 %include "gdcmPixmapWriter.h"
411 //EXTEND_CLASS_PRINT(gdcm::PixmapWriter)
412 %include "gdcmImageWriter.h"
413 //EXTEND_CLASS_PRINT(gdcm::ImageWriter)
414 %template (PairString) std::pair<std::string,std::string>;
415 //%template (MyM) std::map<gdcm::Tag,gdcm::ConstCharWrapper>;
416 %include "gdcmStringFilter.h"
417 //EXTEND_CLASS_PRINT(gdcm::StringFilter)
418 %include "gdcmUIDGenerator.h"
419 //%template (ValuesType) std::set<std::string>;
420 %rename (CSharpTagToValue) SWIGTagToValue;
421 %include "gdcmScanner.h"
422 EXTEND_CLASS_PRINT(gdcm::Scanner)
423 #define GDCM_STATIC_ASSERT(x)
424 %include "gdcmAttribute.h"
425 %include "gdcmSubject.h"
426 %include "gdcmCommand.h"
427 %template(SmartPtrAno) gdcm::SmartPointer<gdcm::Anonymizer>;
428 //%ignore gdcm::Anonymizer::Anonymizer;
429
430
431 //%template(Anonymizer) gdcm::SmartPointer<gdcm::Anonymizer>;
432 //
433 //%ignore gdcm::Anonymizer;
434 //%feature("unref") Anonymizer "coucou $this->Delete();"
435 // http://www.swig.org/Doc1.3/SWIGPlus.html#SWIGPlus%5Fnn34
436 %include "gdcmAnonymizer.h"
437
438
439 //EXTEND_CLASS_PRINT(gdcm::Anonymizer)
440 //%extend gdcm::Anonymizer
441 //{
442 //%typemap(cscode) gdcm::Anonymizer
443 //%{
444 // public Anonymizer() : this(gdcmPINVOKE.Anonymizer_New(), false) {
445 // }
446 //%}
447 //};
448
449 // System is a namespace in C#, need to rename to something different
450 %rename (PosixEmulation) System;
451 %include "gdcmSystem.h"
452 //EXTEND_CLASS_PRINT(gdcm::System)
453
454 %include "gdcmTrace.h"
455 //EXTEND_CLASS_PRINT(gdcm::Trace)
456 %include "gdcmUIDs.h"
457 EXTEND_CLASS_PRINT(gdcm::UIDs)
458 //%feature("director") gdcm::IPPSorter;
459
460 ////////////////////////////////////////////////////////////////////////////
461 // cs_callback is used to marshall callbacks. It allows a C# function to
462 // be passed to C++ as a function pointer through P/Invoke, which has the
463 // ability to make unmanaged-to-managed thunks. It does NOT allow you to
464 // pass C++ function pointers to C#.
465 //
466 // I would have liked to support FastDelegate<...> as the C++ argument
467 // type; this would have involved the cs_callback2 macro... but it turns
468 // out not to work under default project settings because .NET functions
469 // use the __stdcall calling convention, but FastDelegate uses the default
470 // convention which tends to be something else (__fastcall?). So nevermind.
471 //
472 // Anyway, to use this macro you need to declare the function pointer type
473 // TYPE in the appropriate header file (including the calling convention),
474 // declare a delegate named after CSTYPE in your C# project, and use this
475 // macro in your .i file. Here is an example:
476 //
477 // in C++ header file (%include this header in your .i file):
478 // typedef void (__stdcall *Callback)(PCWSTR);
479 // void Foo(Callback c);
480 //
481 // in C# code:
482 // public delegate void CppCallback([MarshalAs(UnmanagedType.LPWStr)] string message);
483 //
484 // in your .i file:
485 // %cs_callback(Callback, CppCallback)
486 //
487 // Remember to invoke %cs_callback before any code involving Callback.
488 %define %cs_callback(TYPE, CSTYPE)
489 %typemap(ctype) TYPE, TYPE& "void*"
490 %typemap(in) TYPE %{ $1 = (TYPE)$input; %}
491 %typemap(in) TYPE& %{ $1 = (TYPE*)&$input; %}
492 %typemap(imtype, out="IntPtr") TYPE, TYPE& "CSTYPE"
493 %typemap(cstype, out="IntPtr") TYPE, TYPE& "CSTYPE"
494 %typemap(csin) TYPE, TYPE& "$csinput"
495 %enddef
496 %define %cs_callback2(TYPE, CTYPE, CSTYPE)
497 %typemap(ctype) TYPE "CTYPE"
498 %typemap(in) TYPE %{ $1 = (TYPE)$input; %}
499 %typemap(imtype, out="IntPtr") TYPE "CSTYPE"
500 %typemap(cstype, out="IntPtr") TYPE "CSTYPE"
501 %typemap(csin) TYPE "$csinput"
502 %enddef
503
504 %cs_callback(Sorter::SortFunction, Sorter::CppSortFunction)
505
506 %include "gdcmSorter.h"
507 EXTEND_CLASS_PRINT(gdcm::Sorter)
508 %include "gdcmIPPSorter.h"
509 EXTEND_CLASS_PRINT(gdcm::IPPSorter)
510 %include "gdcmSpectroscopy.h"
511 //EXTEND_CLASS_PRINT(gdcm::Spectroscopy)
512 %include "gdcmPrinter.h"
513 //EXTEND_CLASS_PRINT(gdcm::Printer)
514 %include "gdcmDumper.h"
515 //EXTEND_CLASS_PRINT(gdcm::Dumper)
516 %include "gdcmOrientation.h"
517 EXTEND_CLASS_PRINT(gdcm::Orientation)
518 %include "gdcmDirectionCosines.h"
519 EXTEND_CLASS_PRINT(gdcm::DirectionCosines)
520
521 %include "gdcmFiducials.h"
522 %include "gdcmWaveform.h"
523 %include "gdcmPersonName.h"
524 %include "gdcmIconImage.h"
525 %include "gdcmCurve.h"
526 %include "gdcmDICOMDIR.h"
527 %include "gdcmValidate.h"
528 %include "gdcmApplicationEntity.h"
529 %include "gdcmDictPrinter.h"
530 %include "gdcmFilenameGenerator.h"
531 %include "gdcmVersion.h"
532 EXTEND_CLASS_PRINT(gdcm::Version)
533 %include "gdcmFilename.h"
534 %include "gdcmEnumeratedValues.h"
535 %include "gdcmPatient.h"
536 %include "gdcmStudy.h"
537 %include "gdcmUsage.h"
538 %include "gdcmMacroEntry.h"
539 %include "gdcmModuleEntry.h"
540 EXTEND_CLASS_PRINT(gdcm::ModuleEntry)
541 %include "gdcmNestedModuleEntries.h"
542 %include "gdcmMacro.h"
543 %include "gdcmMacros.h"
544 %include "gdcmModule.h"
545 %include "gdcmModules.h"
546 %include "gdcmDefs.h"
547 %include "gdcmIOD.h"
548 %include "gdcmIODs.h"
549 %include "gdcmTableEntry.h"
550 %include "gdcmDefinedTerms.h"
551 %include "gdcmSeries.h"
552 %include "gdcmIODEntry.h"
553
554 %apply char[] { char* out }
555 %apply char[] { char* in }
556 %include "gdcmRescaler.h"
557 //EXTEND_CLASS_PRINT(gdcm::Rescaler)
558 %extend gdcm::Rescaler
559 {
560 bool Rescale(double out[], const short in[], size_t n) {
561 return $self->Rescale((char*)out, (char*)in, n);
562 }
563 }
564 %clear char* out;
565 %clear char* in;
566
567 %include "gdcmSegmentedPaletteColorLookupTable.h"
568 %include "gdcmUnpacker12Bits.h"
569
570 %include "gdcmConfigure.h"
571 #ifdef GDCM_BUILD_TESTING
572 %include "gdcmTesting.h"
573 %ignore gdcm::Testing::ComputeMD5(const char *, const unsigned long , char []);
574 %ignore gdcm::Testing::ComputeFileMD5(const char*, char []);
575 %extend gdcm::Testing
576 {
577 static const char *ComputeFileMD5(const char *filename) {
578 static char buffer[33];
579 gdcm::Testing::ComputeFileMD5(filename, buffer);
580 return buffer;
581 }
582 };
583 #endif
584 //%include "gdcmPythonFilter.h"
585 %include "gdcmTagPath.h"
586 %include "gdcmPixmapToPixmapFilter.h"
587 %include "gdcmImageToImageFilter.h"
588 %include "gdcmSOPClassUIDToIOD.h"
589 //%feature("director") Coder;
590 //%include "gdcmCoder.h"
591 //%feature("director") Decoder;
592 //%include "gdcmDecoder.h"
593 //%feature("director") Codec;
594 //%include "gdcmCodec.h"
595 %feature("director") ImageCodec;
596 %include "gdcmImageCodec.h"
597 %include "gdcmJPEGCodec.h"
598 %include "gdcmJPEGLSCodec.h"
599 %include "gdcmJPEG2000Codec.h"
600 %include "gdcmPNMCodec.h"
601 %include "gdcmImageChangeTransferSyntax.h"
602 %include "gdcmImageApplyLookupTable.h"
603 %include "gdcmSplitMosaicFilter.h"
604 //%include "gdcmImageChangePhotometricInterpretation.h"
605 %include "gdcmImageChangePlanarConfiguration.h"
606 %include "gdcmImageFragmentSplitter.h"
607 %include "gdcmDataSetHelper.h"
608 %include "gdcmFileExplicitFilter.h"
609 %template (DoubleType) std::vector<double>;
610 %include "gdcmImageHelper.h"
611 %include "gdcmMD5.h"
612 %include "gdcmDummyValueGenerator.h"
613 %include "gdcmSHA1.h"
614 //%include "gdcmBase64.h"
615 %include "gdcmCryptographicMessageSyntax.h"
616 %include "gdcmSpacing.h"
617
618 %feature("director") SimpleSubjectWatcher;
619 %include "gdcmSimpleSubjectWatcher.h"
620 %include "gdcmDICOMDIRGenerator.h"
621 %include "gdcmFileDerivation.h"
38253825 Check if given event matches or derives from this event. ";
38263826
38273827 %feature("docstring") gdcm::Event::GetEventName "virtual const char*
3828 gdcm::Event::GetEventName() const =0
3828 gdcm::Event::GetEventName(void) const =0
38293829
38303830 Return the StringName associated with the event. ";
38313831
55985598 gdcm::ImageRegionReader::ReadIntoBuffer(char *inreadbuffer, size_t
55995599 buflen)
56005600
5601 Read into buffer: For Python, the buflen param is deduced directly
5602 from the input bytearray passed as parameter (function only takes one
5603 param). false upon error ";
5601 Read into buffer: false upon error ";
56045602
56055603 %feature("docstring") gdcm::ImageRegionReader::SetRegion "void
56065604 gdcm::ImageRegionReader::SetRegion(Region const &region)
56355633 %feature("docstring") gdcm::ImageWriter "
56365634
56375635 ImageWriter.
5638
5639 This is an extended version of the PixmapWriter. Pay attention that:
5640 It will populate missing attribute for Secondary Capture Image Storage
5641 instances,
5642
5643 It may also change an input MR Image Storage instance into a pseudo
5644 Enhanced MR Image Storage instance whenever Modality LUT is required.
5645
5646 Some DataElement related to gdcm::Image may be slightly altered.
56475636
56485637 C++ includes: gdcmImageWriter.h ";
56495638
81158104
81168105 C++ includes: gdcmPixelFormat.h ";
81178106
8118 %feature("docstring") gdcm::PixelFormat::PixelFormat "gdcm::PixelFormat::PixelFormat() ";
8119
8120 %feature("docstring") gdcm::PixelFormat::PixelFormat "gdcm::PixelFormat::PixelFormat(unsigned short samplesperpixel,
8107 %feature("docstring") gdcm::PixelFormat::PixelFormat "gdcm::PixelFormat::PixelFormat(unsigned short samplesperpixel=1,
81218108 unsigned short bitsallocated=8, unsigned short bitsstored=8, unsigned
81228109 short highbit=7, unsigned short pixelrepresentation=0) ";
81238110
96889675 const ";
96899676
96909677
9678 // File: structgdcm_1_1SerieHelper_1_1Rule.xml
9679
9680
96919681 // File: classgdcm_1_1Scanner.xml
96929682 %feature("docstring") gdcm::Scanner "
96939683
1129311283 gdcm::StringFilter::ToString(const Tag &t) const
1129411284
1129511285 Directly from a Tag: ";
11296
11297 %feature("docstring") gdcm::StringFilter::ToString "std::string
11298 gdcm::StringFilter::ToString(const PrivateTag &t) const ";
1129911286
1130011287 %feature("docstring") gdcm::StringFilter::ToStringPair "std::pair<std::string, std::string>
1130111288 gdcm::StringFilter::ToStringPair(const DataElement &de) const
1391113898 "vtkGDCMThreadedImageReader2::vtkSetVector6Macro(DataExtent, int) ";
1391213899
1391313900 %feature("docstring") vtkGDCMThreadedImageReader2::vtkTypeMacro "vtkGDCMThreadedImageReader2::vtkTypeMacro(vtkGDCMThreadedImageReader2,
13914 vtkThreadedImageAlgorithm) ";
13915
13916
13917 // File: classvtkGDCMThreadedImageReader3.xml
13918 %feature("docstring") vtkGDCMThreadedImageReader3 "C++ includes:
13919 vtkGDCMThreadedImageReader3.h ";
13920
13921 %feature("docstring") vtkGDCMThreadedImageReader3::GetFileName "virtual const char* vtkGDCMThreadedImageReader3::GetFileName(int i=0)
13922 ";
13923
13924 %feature("docstring") vtkGDCMThreadedImageReader3::PrintSelf "virtual void vtkGDCMThreadedImageReader3::PrintSelf(ostream &os,
13925 vtkIndent indent) ";
13926
13927 %feature("docstring") vtkGDCMThreadedImageReader3::SetFileName "virtual void vtkGDCMThreadedImageReader3::SetFileName(const char
13928 *filename) ";
13929
13930 %feature("docstring") vtkGDCMThreadedImageReader3::SetFileNames "virtual void vtkGDCMThreadedImageReader3::SetFileNames(vtkStringArray
13931 *) ";
13932
13933 %feature("docstring") vtkGDCMThreadedImageReader3::SplitExtent "int
13934 vtkGDCMThreadedImageReader3::SplitExtent(int splitExt[6], int
13935 startExt[6], int num, int total) ";
13936
13937 %feature("docstring") vtkGDCMThreadedImageReader3::vtkBooleanMacro "vtkGDCMThreadedImageReader3::vtkBooleanMacro(FileLowerLeft, int) ";
13938
13939 %feature("docstring") vtkGDCMThreadedImageReader3::vtkBooleanMacro "vtkGDCMThreadedImageReader3::vtkBooleanMacro(LoadOverlays, int) ";
13940
13941 %feature("docstring") vtkGDCMThreadedImageReader3::vtkGetMacro "vtkGDCMThreadedImageReader3::vtkGetMacro(FileLowerLeft, int) ";
13942
13943 %feature("docstring") vtkGDCMThreadedImageReader3::vtkGetMacro "vtkGDCMThreadedImageReader3::vtkGetMacro(NumberOfOverlays, int) ";
13944
13945 %feature("docstring") vtkGDCMThreadedImageReader3::vtkGetMacro "vtkGDCMThreadedImageReader3::vtkGetMacro(DataScalarType, int) ";
13946
13947 %feature("docstring") vtkGDCMThreadedImageReader3::vtkGetMacro "vtkGDCMThreadedImageReader3::vtkGetMacro(NumberOfScalarComponents,
13948 int) ";
13949
13950 %feature("docstring") vtkGDCMThreadedImageReader3::vtkGetMacro "vtkGDCMThreadedImageReader3::vtkGetMacro(LoadOverlays, int) ";
13951
13952 %feature("docstring") vtkGDCMThreadedImageReader3::vtkGetObjectMacro
13953 "vtkGDCMThreadedImageReader3::vtkGetObjectMacro(FileNames,
13954 vtkStringArray) ";
13955
13956 %feature("docstring") vtkGDCMThreadedImageReader3::vtkGetVector3Macro
13957 "vtkGDCMThreadedImageReader3::vtkGetVector3Macro(DataOrigin, double)
13958 ";
13959
13960 %feature("docstring") vtkGDCMThreadedImageReader3::vtkGetVector3Macro
13961 "vtkGDCMThreadedImageReader3::vtkGetVector3Macro(DataSpacing, double)
13962 ";
13963
13964 %feature("docstring") vtkGDCMThreadedImageReader3::vtkGetVector6Macro
13965 "vtkGDCMThreadedImageReader3::vtkGetVector6Macro(DataExtent, int) ";
13966
13967 %feature("docstring") vtkGDCMThreadedImageReader3::vtkSetMacro "vtkGDCMThreadedImageReader3::vtkSetMacro(FileLowerLeft, int) ";
13968
13969 %feature("docstring") vtkGDCMThreadedImageReader3::vtkSetMacro "vtkGDCMThreadedImageReader3::vtkSetMacro(DataScalarType, int) ";
13970
13971 %feature("docstring") vtkGDCMThreadedImageReader3::vtkSetMacro "vtkGDCMThreadedImageReader3::vtkSetMacro(NumberOfScalarComponents,
13972 int) ";
13973
13974 %feature("docstring") vtkGDCMThreadedImageReader3::vtkSetMacro "vtkGDCMThreadedImageReader3::vtkSetMacro(LoadOverlays, int) ";
13975
13976 %feature("docstring") vtkGDCMThreadedImageReader3::vtkSetVector3Macro
13977 "vtkGDCMThreadedImageReader3::vtkSetVector3Macro(DataOrigin, double)
13978 ";
13979
13980 %feature("docstring") vtkGDCMThreadedImageReader3::vtkSetVector3Macro
13981 "vtkGDCMThreadedImageReader3::vtkSetVector3Macro(DataSpacing, double)
13982 ";
13983
13984 %feature("docstring") vtkGDCMThreadedImageReader3::vtkSetVector6Macro
13985 "vtkGDCMThreadedImageReader3::vtkSetVector6Macro(DataExtent, int) ";
13986
13987 %feature("docstring")
13988 vtkGDCMThreadedImageReader3::vtkTypeRevisionMacro "vtkGDCMThreadedImageReader3::vtkTypeRevisionMacro(vtkGDCMThreadedImageReader3,
1398913901 vtkThreadedImageAlgorithm) ";
1399013902
1399113903
1561615528 // File: vtkGDCMThreadedImageReader2_8h.xml
1561715529
1561815530
15619 // File: vtkGDCMThreadedImageReader3_8h.xml
15620
15621
1562215531 // File: vtkImageColorViewer_8h.xml
1562315532
1562415533
1565215561 // File: bug.xml
1565315562
1565415563
15655 // File: dir_041d54874d9fecec94d9cb4ae010b51e.xml
15656
15657
15658 // File: dir_8021392154ea27d3da33100afd5b42a1.xml
15659
15660
15661 // File: dir_83a82e6a2bc4a0f6429532cb237ca746.xml
15662
15663
15664 // File: dir_9760e222fce508c3b7270d68e6523d76.xml
15665
15666
15667 // File: dir_90174c188c639015dd869d1a853f914f.xml
15668
15669
15670 // File: dir_aceed280bd27dc60f64c2cb4efae4f90.xml
15671
15672
15673 // File: dir_5aab2906425e8d9a7aa9fea4f8d0a2fa.xml
15674
15675
15676 // File: dir_5daaa9a41ac240f7de3019ff61b11839.xml
15677
15678
15679 // File: dir_b138abe427a068e1da5116454e79caa4.xml
15680
15681
15682 // File: dir_6b1a62c3f439db8dff4e3363f340e91f.xml
15683
15684
15685 // File: dir_776c231028699256e0cc13f46def7474.xml
15686
15687
15688 // File: dir_6285418b2babf39982c6f35dbd05cbb5.xml
15564 // File: dir_e040de17c0346d6e352713ff147418d5.xml
15565
15566
15567 // File: dir_c76daeb6f6dec6f3ea799fce56f7d2d8.xml
15568
15569
15570 // File: dir_dbf95c1d90c5a901881337453263e002.xml
15571
15572
15573 // File: dir_18f0eb58264c0e5251b09e2a1c43e69e.xml
15574
15575
15576 // File: dir_43e0a1f539e00dcfa1a6bc4d4fee4fc2.xml
15577
15578
15579 // File: dir_dbf5bd6b6031826eb661c0a6cc15a5dc.xml
15580
15581
15582 // File: dir_9bf5ea929d074a4376f8e7ab62cf44cb.xml
15583
15584
15585 // File: dir_1bf6655710ee689b67564d3c1ea81ded.xml
15586
15587
15588 // File: dir_1703a9a86ce09b357d10c179ef37187c.xml
15589
15590
15591 // File: dir_7d8a53dc7c6e118dc326634b1445bfbd.xml
15592
15593
15594 // File: dir_c65ec574e088a3fb8c01ccf67a472041.xml
15595
15596
15597 // File: dir_b7bc1d3f8c76b5f778038891003f2f25.xml
15598
15599
15600 // File: dir_2e6026c62002f4bb8a32f565fccc2e09.xml
15601
15602
15603 // File: dir_6737ba0c6e4d2f00b8b2ea67e96033d0.xml
15604
15605
15606 // File: dir_fc26ec98c29cdba1e5d03a2a0f4491e0.xml
1568915607
1569015608
1569115609 // File: AddPrivateAttribute_8py-example.xml
1577515693 // File: CStoreQtProgress_8cxx-example.xml
1577615694
1577715695
15696 // File: dctable_8cxx-example.xml
15697
15698
1577815699 // File: DecompressImage_8cs-example.xml
1577915700
1578015701
1615316074 // File: SimplePrint_8cs-example.xml
1615416075
1615516076
16156 // File: SimplePrint_8java-example.xml
16157
16158
1615916077 // File: SimplePrintPatientName_8cs-example.xml
1616016078
1616116079
11 # http://www.appveyor.com/docs/appveyor-yml
22
33 # Set build version format here instead of in the admin panel.
4 version: 3.0.0.{build}
4 version: 3.1.0.{build}
55
66 # http://www.appveyor.com/docs/build-cache#caching-chocolatey-packages
77 # https://github.com/kvirc/KVIrc/blob/master/.appveyor.yml
5757 - coverity_scan
5858
5959 #You can disable builds on new tags through UI (General tab of project settings) or in appveyor.yml:
60 #skip_tags: true
60 # skip tag building since v2.7.0 will trigger an infinite loop
61 skip_tags: true
6162
6263 # scripts that are called at very beginning, before repo cloning
6364 init:
110111 # scripts to run after build
111112 after_build:
112113 # create NSIS installer
113 - cpack -G NSIS -C %CONFIG%
114 # create NuGet installer
115 - cpack -G NuGet -C %CONFIG%
114 - cpack -G NSIS -C %CONFIG% || true
116115 # create binary zip
117 - cpack -G ZIP -C %CONFIG%
116 - cpack -G ZIP -C %CONFIG% || true
118117 # no need for source release on github
119118
120119 # to run your custom scripts instead of automatic MSBuild
140139 - path: GDCM-*-$(B_NAME).zip
141140 name: zip_executable
142141 type: zip
143 - path: GDCM-*-$(B_NAME).nupkg
144 name: nuget_package
145 type: nugetpackage
146142
147143 #---------------------------------#
148144 # deployment configuration #
163159 # commits from tags - the value is True if tag was pushed; otherwise it's
164160 # False. When it's True the name of tag is stored in APPVEYOR_REPO_TAG_NAME.
165161 deploy:
166 - provider: NuGet
167 api_key:
168 secure: T6GXp3POj8sDGZWmZ5tkLgdbyLjllar/ZVLNn96SkrI3IDBq+L3GFMH13FEZs0uR
169 skip_symbols: true
170 artifact: nuget_package
171162 - provider: GitHub
172163 auth_token:
173164 secure: 7HmfZp9O7bVdQo2hRk6FjOUs7jJosftv2rZ6JPBNzjPcAOMXDTvLqv3lvzdAzBfy
174 release: $(appveyor_repo_tag_name)
175 description: 'Release of GDCM $(appveyor_repo_tag_name)'
165 release: v3.1.0
166 description: 'Beta release of GDCM v$(appveyor_build_version)'
176167 # github automatically does source zip/tarball for us
177168 artifact: installer,zip_executable
178169 draft: false
179 prerelease: false
170 prerelease: true
180171 on:
181 branch: release # release from release branch only
182 appveyor_repo_tag: true # deploy on tag push only
172 branch: master # release from master branch only
173 appveyor_repo_tag: false # deploy on tag push only
183174 do_rel: true