gdcm-3.0.22/Copyright.txt 000664 001766 001770 00000003507 14517730450 017573 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2016 Mathieu Malaterre
Copyright (c) 1993-2005 CREATIS
(CREATIS = Centre de Recherche et d'Applications en Traitement de l'Image)
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither name of Mathieu Malaterre, or CREATIS, nor the names of any
contributors (CNRS, INSERM, UCB, Universite Lyon I), may be used to
endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
=========================================================================*/
gdcm-3.0.22/.travis.yml 000664 001766 001770 00000015231 14517730450 017170 0 ustar 00mmalaterre mmalaterre 000000 000000 # https://docs.travis-ci.com/user/environment-variables/#Default-Environment-Variables
# https://github.com/travis-ci/travis-ci/issues/3505
language: cpp
# Use the faster container-based infrastructure.
#sudo: false
dist: xenial
env:
global:
# The next declaration is the encrypted COVERITY_SCAN_TOKEN, created
# via the "travis encrypt" command using the project repo's public key
- secure: ClIqhtIIfQPhil8GH9bnJg70rvJfuYs7Z2Aq2SrdwQsIFNvvfFD5pVxQiaYbZI3nxNclggQ50BmGB96e6jLxbbd/xlIOjcU19W2nzyP6LGkXFHDHm8FwhqqDNpfYvirAOfqgjqf7khRe3ajF33jhrLrhb5QOO5640N93pdChu1sAvI0LZv8JFIUcN7A7To3+WYc7H4CK3U8B2V8nzqcBSHDZNBGAdeVdmldwrlBtQeWBg5wJAEzzUHn0x+kltqvuoPYi2ShpaUkEfHeUWYhOT1uoyXNRAqHXiM1jhiw3JCkqaf7sUKLzyx0ozjTnYntNMggtBzavKjuYg6RhdlNdNbdsi2nxrycCOyCZcF+d4limq+yDMqoP7g/DnPag7XFgjkG/ThULPu+pEK/6nV1NqGNWFu1CqgAwPW7hGbIUADPsMEb+Bz2L2KUof2wU1cdvGK4fzsM9Qpdipbagghn4b5eGtvyBzYzoCS02AKrYfimhcm8bVmlfaMVgd6PnJ19Y1+ADCWwStwaQL2S6udh66JVGNszY/kYSmZKn51RQQDkubmGpywzeNdn7gM9u8QR9s2Lsq0GaSdptcLOPmVNSg6mQJThbMRHM/H2UrSyo7/GLr28sNNbYNweGPevsnrRJPUdG2ENWVw5rg1sD1cLm8rLlD4H2f/b97X9NCl4bLxY=
# -m32 is not supported
# no poppler, openjpeg, uuid, json
# no swig
# using debian-sid I get:
# /usr/bin/ld: BFD (GNU Binutils for Ubuntu) 2.22 internal error, aborting at
# ../../bfd/reloc.c line 443 in bfd_get_reloc_size
matrix:
fast_finish: true
include:
- compiler: gcc
os: linux
env:
- CFLAGS="-g -O2"
- CXXFLAGS="-g -O2"
- CMAKE_EXTRA="-DGDCM_WRAP_PYTHON:BOOL=OFF -DGDCM_BUILD_DOCBOOK_MANPAGES:BOOL=OFF"
- B_NAME=default
- CPACK_NAME=Linux
- compiler: gcc
os: linux
# No docbook-xsl-ns
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]}}
env:
- CFLAGS="-Wall -Wextra -m64"
- CXXFLAGS="-Wall -Wextra -m64"
# Cant use manpage with old docbook
- 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"
- B_NAME=system
- CPACK_NAME=Linux
- compiler: clang
os: linux
env:
- CFLAGS="-g -O0 -Wall -Wextra -m64 -fsanitize=address,undefined,shift"
- CXXFLAGS="-g -O0 -Wall -Wextra -m64 -fsanitize=address,undefined,shift"
- CMAKE_EXTRA="-DGDCM_BUILD_DOCBOOK_MANPAGES:BOOL=OFF"
- B_NAME=fsanitize
- CPACK_NAME=Linux
- compiler: clang
os: osx
env:
- CFLAGS="-Wall -Wextra" # -m64 -fsanitize=address,undefined
- CXXFLAGS="-Wall -Wextra" # -m64 -fsanitize=address,undefined
# http://stackoverflow.com/questions/15678153/homebrew-python-on-mac-os-x-10-8-fatal-python-error-pythreadstate-get-no-cu
#- CMAKE_EXTRA="-DGDCM_WRAP_PYTHON:BOOL=ON -DGDCM_BUILD_DOCBOOK_MANPAGES:BOOL=OFF -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python2.7"
- 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"
- B_NAME=default
- CPACK_NAME=Darwin
before_install:
#- env
- cmake --version
- if [ "$B_NAME" == "system" ]; then swig -version; fi
# do not run the full test suite for now on fsanitize and osx (takes too long)
- if [ "$B_NAME" == "fsanitize" ]; then mv Testing/Data Testing/Data.old; fi
# https://docs.travis-ci.com/user/osx-ci-environment/#Environment-variables
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then mv Testing/Data Testing/Data.old; fi
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew update ; fi
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew install swig docbook-xsl ; fi
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then swig -version; fi
# https://github.com/travis-ci/travis-ci/issues/2312
#- if [ "$TRAVIS_OS_NAME" == "osx" ]; then virtualenv env -p python3 ; fi
#- if [ "$TRAVIS_OS_NAME" == "osx" ]; then source env/bin/activate ; fi
# kakadu setup for linux/system:
- if [ "$B_NAME" == "system" ]; then wget http://kakadusoftware.com/wp-content/uploads/KDU805_Demo_Apps_for_Linux-x86-64_200602.zip; fi
- if [ "$B_NAME" == "system" ]; then unzip KDU805_Demo_Apps_for_Linux-x86-64_200602.zip; fi
- if [ "$B_NAME" == "system" ]; then export PATH=$PATH:$PWD/KDU805_Demo_Apps_for_Linux-x86-64_200602; fi
install: true
before_script:
- 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} .
- ctest -D ExperimentalStart
script:
- ctest -D ExperimentalBuild -j2
- ctest -D ExperimentalTest -j2 || true
after_success:
- ctest -D ExperimentalSubmit || true
# prefer after_success since before_deploy is not called (conditions unmet)
- cpack -G TGZ
- cpack -G TBZ2
after_failure: true
before_deploy:
- VTAG=$(echo $TRAVIS_TAG | cut -f2 -dv)
deploy:
edge: true
provider: releases
api_key:
secure: R5+dbibdcgPHq6cAPC8uepifDuS3yjZu2dBB2oSeQtBZTAeN1VIfJMrF8TeQDqj2GC28RHxXm4BHwdJ2FUpBXjOS2eUE6Mto1Rbbvfi63MREnFPIAWkNyLtR2Jxq/Gzb8X05PbCWGwCNvX9eeo+qcWTpczuQvJ+/bds7MyRsk45+sUc+j7rglAbxewgijsXebCkObwaXmhqTYJwrvf2lyEnA2Jo1gL2WmK6iPjHvTOVS9JfBMqVRmlk7j8efnqag8fMCzNp1Ess5wBy5Jf58qvVs7RuuBi16s7vOOBtb9xVjcDB1KaAxc/dDQGQhRkrveBtH18ZpFrArOj6DBPbupS3+xuU4ywdYbCuGnvdpRFafBc+iNU4M81crkFUDmSPEQChBnL4wwpaYaQ1LlgdlF0r9/Rlu2/iqKe4t7rdZnkQqQ/3SNNf+x4AKnGmaSGasV/VUXstTGVrtl7hsDMzSdrVCXODao0SRv5tPSI3BgAZi7NzCJ/xv5LgA1EQVkGdTQN0ZpKZCQYfifL5K6oYDI+WlAFU0OcH+9dy4KNqF+QnzMh9iPwP0zR6BN9yE0w6ydnyNt0CkIUaxgaTtr+pHPXsmmtgXzQScESC8B9JHGocOXjT6MtyUmoP/ewlPz2G6x114PnAL7LlZ07jPqAASJwW/ZiXtBcVxv50hPhC7L80=
file:
- GDCM-$VTAG-$CPACK_NAME-x86_64.tar.gz
- GDCM-$VTAG-$CPACK_NAME-x86_64.tar.bz2
skip_cleanup: true
on:
repo: malaterre/GDCM
condition: $B_NAME = default
all_branches: true
tags: true
# final
after_script: true
addons:
coverity_scan:
project:
name: malaterre/GDCM
description: "Grassroots DICOM"
notification_email: mathieu.malaterre@gmail.com
build_command_prepend: cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo
-DGDCM_BUILD_SHARED_LIBS:BOOL=ON ..
build_command: cmake --build .
branch_pattern: coverity_scan
gdcm-3.0.22/PACKAGER 000664 001766 001770 00000003642 14517730450 016162 0 ustar 00mmalaterre mmalaterre 000000 000000 Info for packagers:
At a minimum you should consider the following cmake options:
CMAKE_SKIP_RPATH:BOOL=YES
CMAKE_INSTALL_PREFIX:PATH=/usr
To build the cmd line applications:
GDCM_BUILD_APPLICATIONS:BOOL=ON
To build shared libs:
GDCM_BUILD_SHARED_LIBS:BOOL=ON
To build the documentation (need doxygen >= 1.6.1)
GDCM_DOCUMENTATION:BOOL=ON
You should really consider:
GDCM_BUILD_TESTING:BOOL=OFF
Otherwise it build extra code only needed to run the unit test of gdcm...
unless you have some specific compiler optimization technique you should use the cmake default one:
CMAKE_BUILD_TYPE:STRING=Release
By default this will build pdf doc if you have all the required package, if you do not want the pdf:
GDCM_PDF_DOCUMENTATION:BOOL=ON
Wrapping:
GDCM support the following wrapped language
GDCM_WRAP_PYTHON:BOOL=ON
GDCM_WRAP_CSHARP:BOOL=ON
GDCM_WRAP_JAVA:BOOL=ON
There is an ongoing effort to make PHP another supported language (very experimental ATM)
GDCM_WRAP_PHP:BOOL=ON
For VTK user:
GDCM_USE_VTK:BOOL=ON
System libs:
- By default gdcm ships with system libs for ease of compilation on win32 system. So for most *nix system you may want:
GDCM_USE_SYSTEM_EXPAT:BOOL=ON
GDCM_USE_SYSTEM_ZLIB:BOOL=ON
GDCM_USE_SYSTEM_UUID:BOOL=ON
GDCM_USE_SYSTEM_OPENJPEG:BOOL=ON
OpenSSL option is slightly different as not 'convenient' openssl is shipped within GDCM, so the only
way to access the openssl functionalities is to have openssl installed in the target system.
GDCM_USE_SYSTEM_OPENSSL:BOOL=ON
Examples:
GDCM comes with some examples for user, but setting the following:
GDCM_BUILD_EXAMPLES:BOOL=ON
will not do anything since there is no install rule for examples...
The library attempts to provide a clean API, therefore it is highly suggested that you compile GDCM using:
$ CFLAGS=-fvisibility=hidden CXXFLAGS=-fvisibility=hidden cmake /path/to/gdcm/sources
This make sure that on UNIX, the API is actually identical at what is found on Windows.
gdcm-3.0.22/Testing/ 000775 001766 001770 00000000000 14517731550 016474 5 ustar 00mmalaterre mmalaterre 000000 000000 gdcm-3.0.22/Testing/CMakeLists.txt 000664 001766 001770 00000004041 14517730450 021231 0 ustar 00mmalaterre mmalaterre 000000 000000
find_package(DCMTK)
find_package(DICOM3TOOLS)
# Special CMake Module required when doing Python Testing
if(GDCM_WRAP_PYTHON)
include(${GDCM_SOURCE_DIR}/CMake/UsePythonTest.cmake)
endif()
# Special CMake Module required when doing Java Testing
if(GDCM_WRAP_JAVA)
include(${GDCM_SOURCE_DIR}/CMake/UseJavaTest.cmake)
endif()
# Special CMake Module required when doing C# Testing
if(GDCM_WRAP_CSHARP)
include(${GDCM_SOURCE_DIR}/CMake/UseCSharpTest.cmake)
endif()
add_subdirectory(
Source
)
#-----------------------------------------------------------------------------
# Here is one cool test: you can pretty much test all configuration using
# ctest...well except one, the case where a user set BUILD_TESTING=OFF
# since this would deactivate the dashboard and would not submit...doh!
# So instead let's create a test that would build gdcm with this option
if(GDCM_TEST_BOOTSTRAP)
add_test(BuildGDCM ${CMAKE_CTEST_COMMAND}
--build-and-test ${GDCM_SOURCE_DIR} ${GDCM_BINARY_DIR}/GDCMLocal
--build-two-config
--build-generator ${CMAKE_GENERATOR}
--build-makeprogram ${CMAKE_MAKE_PROGRAM}
--build-project GDCMLOCAL
--build-options -DGDCM_BUILD_TESTING:BOOL=OFF -DGDCM_BUILD_SHARED_LIBS:BOOL=ON -DGDCM_WRAP_PYTHON:BOOL=ON -DGDCM_WRAP_CSHARP:BOOL=ON -DGDCM_SUPPORT_BROKEN_IMPLEMENTATION:BOOL=OFF
)
add_test(InstallGDCM ${CMAKE_CTEST_COMMAND}
--build-and-test ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR}
--build-generator ${CMAKE_GENERATOR}
--build-project GDCM
--build-makeprogram ${CMAKE_MAKE_PROGRAM}
--build-noclean
--build-target install
)
add_test(BuildStaticGDCM ${CMAKE_CTEST_COMMAND}
--build-and-test ${GDCM_SOURCE_DIR} ${GDCM_BINARY_DIR}/GDCMLocal2
--build-two-config
--build-generator ${CMAKE_GENERATOR}
--build-makeprogram ${CMAKE_MAKE_PROGRAM}
--build-project GDCMLOCAL2
--build-options -DGDCM_BUILD_TESTING:BOOL=ON -DGDCM_BUILD_SHARED_LIBS:BOOL=OFF -DGDCM_SUPPORT_BROKEN_IMPLEMENTATION:BOOL=OFF -DGDCM_LEGACY_REMOVE:BOOL=ON
--test-command ${CMAKE_CTEST_COMMAND}
)
endif()
gdcm-3.0.22/Testing/Source/ 000775 001766 001770 00000000000 14517731550 017734 5 ustar 00mmalaterre mmalaterre 000000 000000 gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/ 000775 001766 001770 00000000000 14517731550 024674 5 ustar 00mmalaterre mmalaterre 000000 000000 gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/CMakeLists.txt 000664 001766 001770 00000000306 14517730450 027431 0 ustar 00mmalaterre mmalaterre 000000 000000 # Always
add_subdirectory(Cxx)
if(GDCM_WRAP_PYTHON)
add_subdirectory(Python)
endif()
if(GDCM_WRAP_CSHARP)
add_subdirectory(Csharp)
endif()
if(GDCM_WRAP_JAVA)
add_subdirectory(Java)
endif()
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Python/ 000775 001766 001770 00000000000 14517731550 026155 5 ustar 00mmalaterre mmalaterre 000000 000000 gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Python/TestStringFilter.py 000664 001766 001770 00000003356 14517730450 032010 0 ustar 00mmalaterre mmalaterre 000000 000000 ############################################################################
#
# Program: GDCM (Grassroots DICOM). A DICOM library
#
# Copyright (c) 2006-2011 Mathieu Malaterre
# All rights reserved.
# See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even
# the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the above copyright notice for more information.
#
############################################################################
import gdcm
import os,sys
def TestStringFilter(filename, verbose = False):
r = gdcm.Reader()
r.SetFileName( filename )
success = r.Read()
if( not success ): return 1
file = r.GetFile()
ds = file.GetDataSet()
# Change gdcm struct into something swig can digest:
pds = gdcm.PythonDataSet(ds)
sf = gdcm.StringFilter()
pds.Start() # Make iterator go at beginning
dic1={}
dic2={}
sf.SetFile(file) # extremely important
while(not pds.IsAtEnd() ):
t = str(pds.GetCurrent().GetTag())
res = sf.ToStringPair( pds.GetCurrent().GetTag() )
dic2[t] = res[1]
dic1[res[0]] = res[1]
pds.Next()
#print dic1
#print dic2
try:
print "Pixel Representation=",dic2[ '(0028,0103)' ]
except KeyError:
print "Tag not found in dataset"
return 0
if __name__ == "__main__":
success = 0
try:
filename = os.sys.argv[1]
success += TestStringFilter( filename, True )
except:
# loop over all files:
gdcm.Trace.WarningOff()
t = gdcm.Testing()
nfiles = t.GetNumberOfFileNames()
for i in range(0,nfiles):
filename = t.GetFileName(i)
success += TestStringFilter( filename )
# Test succeed ?
sys.exit(success == 0)
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Python/TestAnonymizer.py 000664 001766 001770 00000004677 14517730450 031536 0 ustar 00mmalaterre mmalaterre 000000 000000 ############################################################################
#
# Program: GDCM (Grassroots DICOM). A DICOM library
#
# Copyright (c) 2006-2011 Mathieu Malaterre
# All rights reserved.
# See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even
# the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the above copyright notice for more information.
#
############################################################################
import gdcm
import os,sys
def TestAnonymizer(filename, verbose = False):
r = gdcm.Reader()
r.SetFileName( filename )
success = r.Read()
if( not success ): return 1
#print r.GetFile().GetDataSet()
ano = gdcm.Anonymizer()
ano.SetFile( r.GetFile() )
# 1. Replace with another value
ano.Replace( gdcm.Tag(0x0010,0x0010), "Test^Anonymize" )
# 2. Remove a tag (even a SQ)
ano.Remove( gdcm.Tag(0x0008,0x2112) )
# 3. Make a tag empty
ano.Empty( gdcm.Tag(0x0008,0x0070) )
# Call the main function:
success = ano.RemovePrivateTags() # do it !
if( not success ): return 1
# Check we can also change value from binary field
#ano.Replace( gdcm.Tag(0x0010,0x0010), "16", gdcm. )
# Let's check if our anonymization worked:
if verbose:
print(ano.GetFile().GetDataSet())
# So at that point r.GetFile() was modified, let's simply passed it to the Writer:
# First find a place where to write it out:
subdir = "TestAnonymizerPython"
tmpdir = gdcm.Testing.GetTempDirectory( subdir )
if not gdcm.System.FileIsDirectory( tmpdir ):
gdcm.System.MakeDirectory( tmpdir )
# Ok directory does exist now, extract the name of the input file, and merge it in
# our newly created tmpdir:
outfilename = gdcm.Testing.GetTempFilename( filename, subdir )
w = gdcm.Writer()
w.SetFileName( outfilename )
w.SetFile( r.GetFile() )
w.SetCheckFileMetaInformation( False )
success = w.Write()
if( not success ): return 1
if verbose:
print("Success to write: %s"%outfilename)
return success
if __name__ == "__main__":
success = 0
try:
filename = os.sys.argv[1]
success += TestAnonymizer( filename, True )
except:
# loop over all files:
t = gdcm.Testing()
nfiles = t.GetNumberOfFileNames()
for i in range(0,nfiles):
filename = t.GetFileName(i)
success += TestAnonymizer( filename )
# Test succeed ?
sys.exit(success == 0)
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Python/TestUIDGenerator.py 000664 001766 001770 00000001561 14517730450 031660 0 ustar 00mmalaterre mmalaterre 000000 000000 ############################################################################
#
# Program: GDCM (Grassroots DICOM). A DICOM library
#
# Copyright (c) 2006-2011 Mathieu Malaterre
# All rights reserved.
# See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even
# the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the above copyright notice for more information.
#
############################################################################
import gdcm
import os,sys
if __name__ == "__main__":
uid = gdcm.UIDGenerator()
for i in range(0,100):
print(uid.Generate())
MY_ROOT = "1.2.3.4"
# static function:
gdcm.UIDGenerator_SetRoot( MY_ROOT )
for i in range(0,100):
print(uid.Generate())
# Test succeed ?
sys.exit(0)
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Python/CMakeLists.txt 000664 001766 001770 00000002005 14517730450 030710 0 ustar 00mmalaterre mmalaterre 000000 000000 # Define the tests for gdcm-python
# gdcm-python
set(GDCM_PYTHON_TEST_SRCS
#TestPythonFilter
#TestStringFilter
TestIPPSorter
TestOrientation
TestUIDGenerator
)
if(GDCM_DATA_ROOT)
set(GDCM_PYTHON_TEST_SRCS
${GDCM_PYTHON_TEST_SRCS}
TestAnonymizer
TestModifyFields
TestImageReader
TestScanner
)
endif()
if(BUILD_APPLICATIONS)
if(DCMTK_DCMDUMP_EXECUTABLE)
if(UNIX)
if(GDCM_DATA_ROOT)
set(GDCM_PYTHON_TEST_SRCS
${GDCM_PYTHON_TEST_SRCS}
TestDCMTKMD5 # need dcmdrle and dcmdjpeg
)
endif()
endif()
endif()
endif()
# Loop over files and create executables
foreach(name ${GDCM_PYTHON_TEST_SRCS})
ADD_PYTHON_TEST(${name}Python ${name}.py)
endforeach()
# Special test that need extra arg:
# TestKakaduDecompressionMD5
find_package(KAKADU)
if(BUILD_APPLICATIONS)
if(KDU_EXPAND_EXECUTABLE)
if(UNIX)
if(GDCM_DATA_ROOT)
ADD_PYTHON_TEST(TestKakaduDecompressionMD5Python TestKakaduDecompressionMD5.py ${KDU_EXPAND_EXECUTABLE})
endif()
endif()
endif()
endif()
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Python/TestPythonFilter.py 000664 001766 001770 00000003373 14517730450 032022 0 ustar 00mmalaterre mmalaterre 000000 000000 ############################################################################
#
# Program: GDCM (Grassroots DICOM). A DICOM library
#
# Copyright (c) 2006-2011 Mathieu Malaterre
# All rights reserved.
# See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even
# the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the above copyright notice for more information.
#
############################################################################
import gdcm
import os,sys
def TestPythonFilter(filename, verbose = False):
r = gdcm.Reader()
r.SetFileName( filename )
success = r.Read()
if( not success ): return 1
file = r.GetFile()
ds = file.GetDataSet()
# Change gdcm struct into something swig can digest:
pds = gdcm.PythonDataSet(ds)
sf = gdcm.PythonFilter()
pds.Start() # Make iterator go at beginning
dic1={}
dic2={}
sf.SetFile(file) # extremely important
while(not pds.IsAtEnd() ):
t = str(pds.GetCurrent().GetTag())
print(t)
res = sf.ToPyObject( pds.GetCurrent().GetTag() )
dic2[t] = res[1]
dic1[res[0]] = res[1]
pds.Next()
#print dic1
#print dic2
try:
print("Pixel Representation=",dic2[ '(0028,0103)' ])
except KeyError:
print("Tag not found in dataset")
return 0
if __name__ == "__main__":
success = 0
try:
filename = os.sys.argv[1]
success += TestPythonFilter( filename, True )
except:
# loop over all files:
gdcm.Trace.WarningOff()
t = gdcm.Testing()
nfiles = t.GetNumberOfFileNames()
for i in range(0,nfiles):
filename = t.GetFileName(i)
success += TestPythonFilter( filename )
# Test succeed ?
sys.exit(success == 0)
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Python/TestModifyFields.py 000664 001766 001770 00000005035 14517730450 031746 0 ustar 00mmalaterre mmalaterre 000000 000000 ###########################################################################
#
# Program: GDCM (Grassroots DICOM). A DICOM library
#
# Copyright (c) 2006-2011 Mathieu Malaterre
# All rights reserved.
# See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even
# the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the above copyright notice for more information.
#
############################################################################
import gdcm
import os,sys
def TestModifyFields(filename):
outfilename = filename + ".rewrite"
r = gdcm.Reader()
r.SetFileName( filename )
success = r.Read()
#print r.GetFile().GetDataSet()
ds = r.GetFile().GetDataSet()
#print dir(ds)
# eg, let's remove a tag
removetag = gdcm.Tag(0x0043,0x106f)
if ds.FindDataElement( removetag ):
ds.Remove( removetag )
# let's replace a value:
replacetag = gdcm.Tag(0x0010,0x0010)
if ds.FindDataElement( replacetag ):
de = ds.GetDataElement( replacetag )
#print dir(de)
patname = b"This^is^an^example"
de.SetByteStringValue( patname )
# let's insert a new dataelement
#
pir = gdcm.DataElement( gdcm.Tag(0x0012,0x0062) )
pir.SetVR( gdcm.VR( gdcm.VR.CS ) ) # specify the VR explicitly
yes = b"YES"
pir.SetByteStringValue( yes )
ds.Insert( pir )
# try again but pretend we don't know the VR
#
deidmethod = gdcm.Tag(0x0012,0x0063)
# retrieve the supreme global instance, sum of all knowledge in da whole universe:
dicomdicts = gdcm.GlobalInstance.GetDicts()
dictel = dicomdicts.GetDictEntry( deidmethod )
#print dictel.GetVR()
deid = gdcm.DataElement( deidmethod )
deid.SetVR( dictel.GetVR() )
methodstr = b"Well known Company"
#deid.SetByteStringValue( methodstr )
deid.SetByteStringValue( methodstr )
ds.Insert( deid )
#w = gdcm.Writer()
#w.SetFileName( outfilename )
#w.SetFile( r.GetFile() )
#success = w.Write()
return success
if __name__ == "__main__":
success = 0
try:
filename = os.sys.argv[1]
success += TestModifyFields( filename )
except:
# loop over all files:
t = gdcm.Testing()
nfiles = t.GetNumberOfFileNames()
for i in range(0,nfiles):
filename = t.GetFileName(i)
success += TestModifyFields( filename )
# Test succeed ?
sys.exit(success == 0)
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Python/TestScanner.py 000664 001766 001770 00000005004 14517730450 030755 0 ustar 00mmalaterre mmalaterre 000000 000000 ############################################################################
#
# Program: GDCM (Grassroots DICOM). A DICOM library
#
# Copyright (c) 2006-2011 Mathieu Malaterre
# All rights reserved.
# See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even
# the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the above copyright notice for more information.
#
############################################################################
import gdcm
import os,sys
def TestScan(dirname, recursive = False):
# Check the dirname is indeed a directory
system = gdcm.System()
if not system.FileIsDirectory(dirname):
print("Need a directory")
sys.exit(1)
# Retrieve all the files within that dir (recursively?)
d = gdcm.Directory()
nfiles = d.Load( dirname, recursive )
print("done retrieving all the",nfiles,"files")
s = gdcm.Scanner()
t1 = gdcm.Tag(0x0020,0x000d) # VR::UI
t2 = gdcm.Tag(0x0020,0x000e) # VR::UI
t3 = gdcm.Tag(0x0028,0x0011) # VR::US
# Some fun tags, with dual VR:
t4 = gdcm.Tag(0x0028,0x0106) # VR::US_SS
t5 = gdcm.Tag(0x0028,0x0107) # VR::US_SS
s.AddTag( t1 )
s.AddTag( t2 )
s.AddTag( t3 )
s.AddTag( t4 )
s.AddTag( t5 )
b = s.Scan( d.GetFilenames() )
if not b:
print("Scanner failed")
sys.exit(1)
# Raw Values found:
values = s.GetValues()
print("Values found for all tags are:")
print(values)
# get the main super-map :
mappings = s.GetMappings()
#file1 = d.GetFilenames()[0];
#print file1
#m1 = s.GetMapping( file1 )
#print m1
#print dir(m1)
#for k,v in m1.iteritems():
# print "item", k,v
# For each file get the value for tag t1:
for f in d.GetFilenames():
print("Working on:",f)
mapping = s.GetMapping(f)
pttv = gdcm.PythonTagToValue(mapping)
# reset iterator to start position
pttv.Start()
# iterate until the end:
while( not pttv.IsAtEnd() ):
# get current value for tag and associated value:
# if tag was not found, then it was simply not added to the internal std::map
# Warning value can be None
tag = pttv.GetCurrentTag()
value = pttv.GetCurrentValue()
print(tag,"->",value)
# increment iterator
pttv.Next()
if __name__ == "__main__":
try:
dirname = os.sys.argv[1]
recursive = True
except:
t = gdcm.Testing()
dirname = t.GetDataRoot()
recursive = False
TestScan( dirname, recursive)
sys.exit(0)
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Python/TestImageReader.py 000664 001766 001770 00000002324 14517730450 031533 0 ustar 00mmalaterre mmalaterre 000000 000000 ############################################################################
#
# Program: GDCM (Grassroots DICOM). A DICOM library
#
# Copyright (c) 2006-2011 Mathieu Malaterre
# All rights reserved.
# See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even
# the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the above copyright notice for more information.
#
############################################################################
import gdcm
import os,sys
def TestImageRead(filename, verbose = False):
r = gdcm.ImageReader()
r.SetFileName( filename )
success = r.Read()
if verbose: print(r.GetImage())
return success
if __name__ == "__main__":
success = 0
try:
filename = os.sys.argv[1]
success += TestImageRead( filename, True )
except:
# loop over all files:
gdcm.Trace.DebugOff()
gdcm.Trace.WarningOff()
t = gdcm.Testing()
nfiles = t.GetNumberOfFileNames()
for i in range(0,nfiles):
#print t.GetFileName(i)
filename = t.GetFileName(i)
success += TestImageRead( filename )
# Test succeed ?
sys.exit(success == 0)
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Python/TestKakaduDecompressionMD5.py 000664 001766 001770 00000006562 14517730450 033637 0 ustar 00mmalaterre mmalaterre 000000 000000 ############################################################################
#
# Program: GDCM (Grassroots DICOM). A DICOM library
#
# Copyright (c) 2006-2011 Mathieu Malaterre
# All rights reserved.
# See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even
# the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the above copyright notice for more information.
#
############################################################################
import gdcm
import os,sys
def TestKakadu(filename, kdu_expand):
fn = gdcm.Filename(filename)
testdir = fn.GetPath()
testbasename = fn.GetName()
ext = fn.GetExtension()
#print ext
#kakadu_path = '/home/mmalaterre/Software/Kakadu60'
kakadu_path = os.path.dirname( kdu_expand )
#kdu_expand = kakadu_path + '/kdu_expand'
kdu_args = ' -quiet -i '
output_dcm = testdir + '/kakadu/' + testbasename
output_j2k = output_dcm + '.j2k'
output_ppm = output_dcm + '.ppm' #
output_raw = output_dcm + '.rawl' # FIXME: little endian only...
kdu_expand += kdu_args + output_j2k + ' -o ' + output_raw
# $ ./bin/gdcmraw -i .../TestImageChangeTransferSyntax2/012345.002.050.dcm -o toto.j2k
executable_output_path = gdcm.GDCM_EXECUTABLE_OUTPUT_PATH
gdcmraw = executable_output_path + '/gdcmraw'
outputfilename = output_j2k
gdcmraw_args = ' -i ' + filename + ' -o ' + outputfilename
gdcmraw += gdcmraw_args
#print gdcmraw
ret = os.system( gdcmraw )
#print "ret:",ret
#print kdu_expand
os.environ["LD_LIBRARY_PATH"]=kakadu_path
ret = os.system( kdu_expand )
# now need to skip the ppm header:
dd_cmd = 'dd bs=15 skip=1 if=%s of = %s'%(output_ppm,output_raw)
#print "ret:",ret
md5 = gdcm.Testing.ComputeFileMD5( output_raw )
# ok this is the md5 as computed after decompression using kdu_expand
# let see if it match out previously (stored) md5:
ref = gdcm.Testing.GetMD5FromFile(filename)
#print ref
retval = 0
if ref != md5:
img = gdcm.ImageReader()
img.SetFileName( filename )
img.Read()
if img.GetImage().GetDimension(2) != 1:
print("Test do not handle multiframes for now")
elif img.GetImage().GetPixelFormat().GetSamplesPerPixel() != 1:
print("Test do not handle RGB for now. kdu_expand expand as RRR GGG BBB by default")
else:
print("md5 are different: %s should be: %s for file %s"%(md5,ref,filename))
print("raw file was: %s"%(output_raw))
retval = 1
return retval
if __name__ == "__main__":
success = 0
#try:
# filename = os.sys.argv[1]
# success += TestKakadu( filename )
#except:
# loop over all files:
#t = gdcm.Testing()
#nfiles = t.GetNumberOfFileNames()
#for i in range(0,nfiles):
# filename = t.GetFileName(i)
# success += TestKakadu( filename )
d = gdcm.Directory()
tempdir = gdcm.Testing.GetTempDirectory()
j2ksubdir = 'TestImageChangeTransferSyntax2' # FIXME hardcoded !
nfiles = d.Load( tempdir + '/' + j2ksubdir )
# make sure the output dir for temporary j2k files exists:
md = gdcm.System.MakeDirectory( tempdir + '/' + j2ksubdir + '/kakadu' );
if not md:
sys.exit(1)
files = d.GetFilenames()
for i in range(0,nfiles):
filename = files[i]
success += TestKakadu( filename, os.sys.argv[1] )
# Test succeed ?
sys.exit(success)
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Python/TestOrientation.py 000664 001766 001770 00000003141 14517730450 031657 0 ustar 00mmalaterre mmalaterre 000000 000000 ############################################################################
#
# Program: GDCM (Grassroots DICOM). A DICOM library
#
# Copyright (c) 2006-2011 Mathieu Malaterre
# All rights reserved.
# See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even
# the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the above copyright notice for more information.
#
############################################################################
import gdcm
import os,sys
if __name__ == "__main__":
success = True
ori1 = (1,0,0,0,1,0)
ori2 = (1,0,0,0,0,1)
ori3 = (0,1,0,0,0,1)
label1 = gdcm.Orientation.GetLabel( gdcm.Orientation.GetType( ori1 ) )
if label1 != 'AXIAL':
print("Found:",label1)
success = False
label2 = gdcm.Orientation.GetLabel( gdcm.Orientation.GetType( ori2 ) )
if label2 != 'CORONAL':
print("Found:",label2)
success = False
label3 = gdcm.Orientation.GetLabel( gdcm.Orientation.GetType( ori3 ) )
if label3 != 'SAGITTAL':
print("Found:",label3)
success = False
image = gdcm.Image()
image.SetNumberOfDimensions(2)
print(image)
print(image.GetDimensions())
print(image.GetOrigin())
print(image.GetSpacing())
print(image.GetDirectionCosines())
image.SetNumberOfDimensions(3)
image.SetDimensions( (512,256,128) )
print(image.GetDimensions())
#dircos = gdcm.DirectionCosines( (1,0,0,0,0,-1) )
dircos = gdcm.DirectionCosines()
print(dircos)
#print dircos.Cross()
# Test succeed ?
sys.exit(success == False)
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Python/TestIPPSorter.py 000664 001766 001770 00000001345 14517730450 031217 0 ustar 00mmalaterre mmalaterre 000000 000000 ############################################################################
#
# Program: GDCM (Grassroots DICOM). A DICOM library
#
# Copyright (c) 2006-2011 Mathieu Malaterre
# All rights reserved.
# See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even
# the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the above copyright notice for more information.
#
############################################################################
import gdcm
import os,sys
if __name__ == "__main__":
success = 0
s = gdcm.IPPSorter()
# black box test:
if not s.Sort([]):
sys.exit(1)
sys.exit(0)
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Python/TestDCMTKMD5.py 000664 001766 001770 00000014522 14517730450 030541 0 ustar 00mmalaterre mmalaterre 000000 000000 ############################################################################
#
# Program: GDCM (Grassroots DICOM). A DICOM library
#
# Copyright (c) 2006-2011 Mathieu Malaterre
# All rights reserved.
# See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even
# the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the above copyright notice for more information.
#
############################################################################
import gdcm
import os,sys,re
"""
You need to have dcmdump/dcmdrle/dcmdjpeg in your PATH
"""
def TestDCMTKMD5( filename, verbose = False ):
blacklist = [
# Get rid of DICOMDIR if any:
'DICOMDIR',
'DICOMDIR_MR_B_VA12A',
'DICOMDIR-Philips-EasyVision-4200-Entries',
'dicomdir_Acusson_WithPrivate_WithSR',
'dicomdir_Pms_With_heavy_embedded_sequence',
'dicomdir_Pms_WithVisit_WithPrivate_WithStudyComponents',
'dicomdir_With_embedded_icons',
# Unsupported file:
'MR_Spectroscopy_SIEMENS_OF.dcm',
'gdcm-CR-DCMTK-16-NonSamplePerPix.dcm', # this is not an image
'ELSCINT1_PMSCT_RLE1.dcm',
'SignedShortLosslessBug.dcm',
'JPEGDefinedLengthSequenceOfFragments.dcm', # dcmtk 3.6.0 gives garbage
'GE_DLX-8-MONO2-PrivateSyntax.dcm',
'PrivateGEImplicitVRBigEndianTransferSyntax16Bits.dcm',
#'DermaColorLossLess.dcm', # technically I could support this one...
#'LEADTOOLS_FLOWERS-24-RGB-JpegLossy.dcm', # idem
'ALOKA_SSD-8-MONO2-RLE-SQ.dcm'] # this one is not supported by dcmtk 3.5.4
for f in blacklist:
if f in filename:
print("%s is on the black list, giving up"%filename)
return 0
#print filename
#
#dcmdump_exec = "dcmdump -dc -E +P 2,10 -s " + filename + " 2> /dev/null"
# I had to remove the -dc for the following file:
# GE_GENESIS-16-MONO2-Uncompressed-UnusualVR.dcm there is trailing space instead of \0
dcmdump_exec = "dcmdump -E +P 2,10 -s " + filename + " 2> /dev/null"
#print dcmdump_exec
f = os.popen(dcmdump_exec)
ret = f.read()
#assert ret == 0
#print ret
jpegre = re.compile('^.*JPEGLossless.*$')
jpegre2 = re.compile('^.*JPEGExtended.*$')
jpegre3 = re.compile('^.*JPEGBaseline.*$')
j2kre = re.compile('^.*JPEG2000.*$')
jplsre = re.compile('^.*JPEGLS.*$')
rlere = re.compile('^.*RLELossless.*$')
lexre = re.compile('^.*LittleEndianExplicit.*$')
leire = re.compile('^.*LittleEndianImplicit.*$')
beire = re.compile('^.*BigEndianExplicit.*$')
testing = gdcm.Testing()
outputdir = testing.GetTempDirectory( "TestDCMTKMD5" )
gdcm.System.MakeDirectory( outputdir )
outputfilename = testing.GetTempFilename( filename, "TestDCMTKMD5" )
executable_output_path = gdcm.GDCM_EXECUTABLE_OUTPUT_PATH
gdcmraw = executable_output_path + '/gdcmraw -P'
if not ret:
#print "empty, problem with:", filename
return 0
elif type(ret) != type(''):
print("problem of type with:", filename)
return 0
#print ret
#print ret.__class__
elif( jpegre.match( ret ) or jpegre2.match(ret) or jpegre3.match(ret) ):
#print "jpeg: ",filename
# +cn : conv-never
# +px : color by pixel
dcmdjpeg_exec = "dcmdjpeg +cn +px " + filename + " " + outputfilename
ret = os.system( dcmdjpeg_exec )
if ret:
print("dcmdjpeg failed to decompress file. giving up")
return 0
gdcmraw_args = ' -i ' + outputfilename + ' -o ' + outputfilename + ".raw"
gdcmraw += gdcmraw_args
#print gdcmraw
ret = os.system( gdcmraw )
md5 = gdcm.Testing.ComputeFileMD5( outputfilename + ".raw" )
ref = gdcm.Testing.GetMD5FromFile(filename)
#print md5
retval = 0
if ref != md5:
print("md5 are different: %s should be: %s for file %s"%(md5,ref,filename))
retval = 1
#print outputfilename
return retval
elif( jplsre.match( ret ) ):
#print "jpegls: ",filename
dcmdjpls_exec = "dcmdjpls " + filename + " " + outputfilename
ret = os.system( dcmdjpls_exec )
if ret:
print("failed with: ", dcmdjpls_exec)
return 1
gdcmraw_args = ' -i ' + outputfilename + ' -o ' + outputfilename + ".raw"
gdcmraw += gdcmraw_args
#print gdcmraw
ret = os.system( gdcmraw )
md5 = gdcm.Testing.ComputeFileMD5( outputfilename + ".raw" )
ref = gdcm.Testing.GetMD5FromFile(filename)
#print md5
retval = 0
if ref != md5:
print("md5 are different: %s should be: %s for file %s"%(md5,ref,filename))
retval = 1
#print outputfilename
return retval
elif( rlere.match( ret ) ):
#print "rle: ",filename
dcmdrle_exec = "dcmdrle " + filename + " " + outputfilename
ret = os.system( dcmdrle_exec )
if ret:
print("failed with: ", dcmdrle_exec)
return 1
gdcmraw_args = ' -i ' + outputfilename + ' -o ' + outputfilename + ".raw"
gdcmraw += gdcmraw_args
#print gdcmraw
ret = os.system( gdcmraw )
md5 = gdcm.Testing.ComputeFileMD5( outputfilename + ".raw" )
ref = gdcm.Testing.GetMD5FromFile(filename)
#print md5
retval = 0
if ref != md5:
print("md5 are different: %s should be: %s for file %s"%(md5,ref,filename))
retval = 1
#print outputfilename
return retval
elif( j2kre.match( ret ) ):
return 0
elif( lexre.match( ret ) or leire.match(ret) or beire.match(ret) ):
#print "rle: ",filename
#dcmdrle_exec = "dcmdrle " + filename + " " + outputfilename
#ret = os.system( dcmdrle_exec )
gdcmraw_args = ' -i ' + filename + ' -o ' + outputfilename + ".raw"
gdcmraw += gdcmraw_args
#print gdcmraw
ret = os.system( gdcmraw )
if ret:
print("failed with: ", gdcmraw)
return 1
md5 = gdcm.Testing.ComputeFileMD5( outputfilename + ".raw" )
ref = gdcm.Testing.GetMD5FromFile(filename)
#print md5
retval = 0
if ref != md5:
print("md5 are different: %s should be: %s for file %s"%(md5,ref,filename))
retval = 1
#print outputfilename
return retval
#else
print("Unhandled:",filename,"with ret=",ret)
return 1
if __name__ == "__main__":
success = 0
try:
filename = os.sys.argv[1]
success += TestDCMTKMD5( filename, True )
except:
# loop over all files:
t = gdcm.Testing()
gdcm.Trace.WarningOff()
gdcm.Trace.DebugOff()
nfiles = t.GetNumberOfFileNames()
for i in range(0,nfiles):
filename = t.GetFileName(i)
success += TestDCMTKMD5( filename )
# Test succeed ?
sys.exit(success)
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Csharp/ 000775 001766 001770 00000000000 14517731550 026114 5 ustar 00mmalaterre mmalaterre 000000 000000 gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Csharp/FCTS_RLE.cs 000664 001766 001770 00000002746 14517730450 027713 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
using System;
using gdcm;
public class FCTS_RLE
{
public static int Main(string[] args)
{
string filename = args[0];
string outfilename = args[1];
using( var sfcts = FileChangeTransferSyntax.New() )
{
FileChangeTransferSyntax fcts = sfcts.__ref__();
//SimpleSubjectWatcher watcher = new SimpleSubjectWatcher(fcts, "FileChangeTransferSyntax");
gdcm.TransferSyntax ts = new TransferSyntax( TransferSyntax.TSType.RLELossless );
fcts.SetTransferSyntax( ts );
ImageCodec ic = fcts.GetCodec();
RLECodec rle = RLECodec.Cast( ic );
// need to call at least one member func to check not NULL:
long val = rle.GetBufferLength();
System.Console.WriteLine( val ); // use val to remove a warning
fcts.SetInputFileName( filename );
fcts.SetOutputFileName( outfilename );
if( !fcts.Change() )
{
return 1;
}
}
return 0;
}
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Csharp/CMakeLists.txt 000664 001766 001770 00000002175 14517730450 030657 0 ustar 00mmalaterre mmalaterre 000000 000000 # C# MSFF tests
set(MSFF_TEST_SRCS
FCTS_JPEG
FCTS_JPEGLS
FCTS_JPEG2000
FCTS_RLE
)
set(DEP)
set_source_files_properties(${GDCM_LIBRARY_DIR}/gdcm-sharp.dll PROPERTIES GENERATED 1)
foreach(test ${MSFF_TEST_SRCS})
file(TO_NATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/${test}.cs result)
add_custom_command(
OUTPUT ${GDCM_EXECUTABLE_DIR}/${test}.exe
COMMAND ${CMAKE_CSHARP_COMPILER} "${CSC_PLATFORM_FLAG}" "/r:${GDCM_LIBRARY_DIR}/gdcm-sharp.dll" "/out:${GDCM_EXECUTABLE_DIR}/${test}.exe" ${result}
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${test}.cs
COMMENT "Create ${test}.exe"
)
add_custom_target(gdcm_sharp_${test} DEPENDS ${GDCM_EXECUTABLE_DIR}/${test}.exe)
add_dependencies(gdcm_sharp_${test} GDCMCSharp)
list(APPEND DEP ${GDCM_EXECUTABLE_DIR}/${test}.exe)
# add test
if(GDCM_DATA_ROOT)
ADD_CSHARP_TEST(Test${test} ${GDCM_EXECUTABLE_DIR}/${test}.exe ${GDCM_DATA_ROOT}/GE_DLX-8-MONO2-Multiframe.dcm ${CMAKE_CURRENT_BINARY_DIR}/${test}.dcm)
endif()
endforeach()
add_custom_target(gdcmMSFFTestsCsharp ALL
DEPENDS ${DEP}
COMMENT "building MSFF C# tests"
)
add_dependencies(gdcmMSFFTestsCsharp GDCMCSharp)
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Csharp/FCTS_JPEG.cs 000664 001766 001770 00000002623 14517730450 030010 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
using System;
using gdcm;
public class FCTS_JPEG
{
public static int Main(string[] args)
{
string filename = args[0];
string outfilename = args[1];
using( var sfcts = FileChangeTransferSyntax.New() )
{
FileChangeTransferSyntax fcts = sfcts.__ref__();
//SimpleSubjectWatcher watcher = new SimpleSubjectWatcher(fcts, "FileChangeTransferSyntax");
gdcm.TransferSyntax ts = new TransferSyntax( TransferSyntax.TSType.JPEGBaselineProcess1 );
fcts.SetTransferSyntax( ts );
ImageCodec ic = fcts.GetCodec();
JPEGCodec jpeg = JPEGCodec.Cast( ic );
jpeg.SetLossless( false );
jpeg.SetQuality( 50 ); // poor quality !
fcts.SetInputFileName( filename );
fcts.SetOutputFileName( outfilename );
if( !fcts.Change() )
{
return 1;
}
}
return 0;
}
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Csharp/FCTS_JPEG2000.cs 000664 001766 001770 00000002620 14517730450 030307 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
using System;
using gdcm;
public class FCTS_JPEG2000
{
public static int Main(string[] args)
{
string filename = args[0];
string outfilename = args[1];
using( var sfcts = FileChangeTransferSyntax.New() )
{
FileChangeTransferSyntax fcts = sfcts.__ref__();
//SimpleSubjectWatcher watcher = new SimpleSubjectWatcher(fcts, "FileChangeTransferSyntax");
gdcm.TransferSyntax ts = new TransferSyntax( TransferSyntax.TSType.JPEG2000 );
fcts.SetTransferSyntax( ts );
ImageCodec ic = fcts.GetCodec();
JPEG2000Codec jpeg2000 = JPEG2000Codec.Cast( ic );
jpeg2000.SetReversible( false );
jpeg2000.SetQuality(0, 55);
fcts.SetInputFileName( filename );
fcts.SetOutputFileName( outfilename );
if( !fcts.Change() )
{
return 1;
}
}
return 0;
}
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Csharp/FCTS_JPEGLS.cs 000664 001766 001770 00000002615 14517730450 030250 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
using System;
using gdcm;
public class FCTS_JPEGLS
{
public static int Main(string[] args)
{
string filename = args[0];
string outfilename = args[1];
using( var sfcts = FileChangeTransferSyntax.New() )
{
FileChangeTransferSyntax fcts = sfcts.__ref__();
//SimpleSubjectWatcher watcher = new SimpleSubjectWatcher(fcts, "FileChangeTransferSyntax");
gdcm.TransferSyntax ts = new TransferSyntax( TransferSyntax.TSType.JPEGLSNearLossless );
fcts.SetTransferSyntax( ts );
ImageCodec ic = fcts.GetCodec();
JPEGLSCodec jpegls = JPEGLSCodec.Cast( ic );
jpegls.SetLossless( false );
jpegls.SetLossyError( 2 );
fcts.SetInputFileName( filename );
fcts.SetOutputFileName( outfilename );
if( !fcts.Change() )
{
return 1;
}
}
return 0;
}
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Java/ 000775 001766 001770 00000000000 14517731550 025555 5 ustar 00mmalaterre mmalaterre 000000 000000 gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Java/CMakeLists.txt 000664 001766 001770 00000002450 14517730450 030314 0 ustar 00mmalaterre mmalaterre 000000 000000 # Define the tests for gdcm-java
set(GDCM_JAVA_TEST_SRCS
TestStringFilter
)
# Do not change anything after here:
find_package(Java ${GDCM_DEFAULT_JAVA_VERSION} REQUIRED) # javac, jar
find_package(JNI REQUIRED)
include_directories(
${JNI_INCLUDE_PATH}
)
set(classfilesdep)
foreach(example ${GDCM_JAVA_TEST_SRCS})
add_custom_command(
OUTPUT ${GDCM_EXECUTABLE_DIR}/${example}.class
COMMAND ${Java_JAVAC_EXECUTABLE} ARGS ${CMAKE_CURRENT_SOURCE_DIR}/${example}.java -d ${GDCM_EXECUTABLE_DIR} -source ${GDCM_JAVA_SOURCE_VERSION} -target ${GDCM_JAVA_TARGET_VERSION} -classpath ${GDCM_LIBRARY_DIR}/gdcm.jar
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${example}.java
COMMENT "javac ${example}.java"
)
list(APPEND classfilesdep ${GDCM_EXECUTABLE_DIR}/${example}.class)
set(GDCM_LIBRARY_DIR2 ${LIBRARY_OUTPUT_PATH}/\${BUILD_TYPE})
set_source_files_properties(${GDCM_EXECUTABLE_DIR}/${example}.class PROPERTIES CLASSPATH "${GDCM_LIBRARY_DIR2}/gdcm.jar")
ADD_JAVA_TEST(${example}Java ${GDCM_EXECUTABLE_DIR}/${example})
endforeach()
# 3. ok now add the target
add_custom_target(GDCMJavaMSFFTests ALL
DEPENDS ${classfilesdep}
COMMENT "building gdcm java msff tests"
)
# make sure gdcm.jar is built
add_dependencies(GDCMJavaMSFFTests GDCMJavaJar)
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Java/TestStringFilter.java 000664 001766 001770 00000006000 14517730450 031666 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
/*
*/
import gdcm.*;
public class TestStringFilter
{
public static void main(String[] args) throws Exception
{
/*
System.out.println("PATH : "
+ System.getProperty("java.library.path"));
Properties p = System.getProperties();
Enumeration keys = p.keys();
while (keys.hasMoreElements()) {
String key = (String)keys.nextElement();
String value = (String)p.get(key);
System.out.println(key + ": " + value);
}
*/
long nfiles = Testing.GetNumberOfFileNames();
Trace.DebugOff();
Trace.WarningOff();
for( long i = 0; i < nfiles; ++i )
{
String filename = Testing.GetFileName( i );
if( filename.contains( "MR_Philips_Intera_No_PrivateSequenceImplicitVR.dcm" )) {
//System.out.println("Success reading: " + filename );
Reader reader = new Reader();
reader.SetFileName( filename );
if ( !reader.Read() )
{
throw new Exception("Could not read: " + filename );
}
File file = reader.GetFile();
DataSet ds = file.GetDataSet();
Tag t1 = new Tag(0x2005,0xe229);
StringFilter sf = new StringFilter();
sf.SetFile( file );
if( ds.FindDataElement( t1 ) ) {
DataElement de1 = ds.GetDataElement(t1);
System.out.println("de1: " + de1 );
String s1 = sf.ToString( de1 );
System.out.println("s1: " + s1 );
float array[] = { 5.1f, -4.9f };
de1.SetArray( array, array.length );
System.out.println("de1: " + de1 );
s1 = sf.ToString( de1 );
System.out.println("s1: " + s1 );
}
Tag t2 = new Tag(0x18,0x2043);
float array[] = { 2.5f, -1.6f };
DataElement de = new DataElement(t2);
//de.SetVR( new VR(VR.VRType.FL) );
de.SetArray( array, array.length );
String s = sf.ToString( de );
System.out.println("s: " + s );
ds.Replace( de );
if( ds.FindDataElement( t2 ) ) {
DataElement de2 = ds.GetDataElement(t2);
System.out.println("de2: " + de2 );
String s2 = sf.ToString( de2 );
System.out.println("s2: " + s2 );
//float array[] = { 51, 49 };
//de1.SetArray( array, array.length );
//System.out.println("de1: " + de1 );
//s1 = sf.ToString( de1 );
//System.out.println("s1: " + s1 );
//ds.Replace( de1 );
}
Writer writer = new Writer();
writer.SetFile( reader.GetFile() );
writer.SetFileName( "testsf.dcm" );
if ( !writer.Write() )
{
throw new Exception("Could not write: " + filename );
}
}
}
}
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/ 000775 001766 001770 00000000000 14517731550 025436 5 ustar 00mmalaterre mmalaterre 000000 000000 gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestDumper.cxx 000664 001766 001770 00000003722 14517730450 030260 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmReader.h"
#include "gdcmDumper.h"
#include "gdcmTesting.h"
#include "gdcmCSAHeader.h"
int TestDump(const char *filename)
{
gdcm::Reader r;
r.SetFileName( filename );
if( !r.Read() )
{
return 1;
}
std::ostringstream out;
{
gdcm::Dumper p;
p.SetFile( r.GetFile() );
//p.Print( std::cout );
p.Print( out );
}
// Test CSA Header here too
gdcm::CSAHeader csa;
const gdcm::DataSet& ds = r.GetFile().GetDataSet();
const gdcm::PrivateTag &t1 = csa.GetCSAImageHeaderInfoTag();
const gdcm::PrivateTag &t2 = csa.GetCSASeriesHeaderInfoTag();
if( ds.FindDataElement( t1 ) )
{
csa.LoadFromDataElement( ds.GetDataElement( t1 ) );
csa.Print( std::cout );
}
if( ds.FindDataElement( t2 ) )
{
csa.LoadFromDataElement( ds.GetDataElement( t2 ) );
csa.Print( std::cout );
}
if( csa.GetFormat() == gdcm::CSAHeader::DATASET_FORMAT )
{
gdcm::Dumper p;
gdcm::File f;
f.SetDataSet( csa.GetDataSet() );
p.SetFile( f );
//p.Print( std::cout );
p.Print( out );
}
return 0;
}
int TestDumper(int argc, char *argv[])
{
if( argc == 2 )
{
const char *filename = argv[1];
return TestDump(filename);
}
// else
int r = 0, i = 0;
const char *filename;
const char * const *filenames = gdcm::Testing::GetFileNames();
while( (filename = filenames[i]) )
{
r += TestDump( filename );
++i;
}
return r;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestUIDGenerator2.cxx 000664 001766 001770 00000004436 14517730450 031401 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmUIDGenerator.h"
#include
#include
#include
#include
#include
#include
const unsigned int nuids = 100;
void* func (void* argc)
{
gdcm::UIDGenerator g;
std::set *uids= reinterpret_cast< std::set* >(argc);
for(unsigned int i = 0; i < nuids; i++)
{
const char *s = g.Generate();
//std::cout << s << std::endl;
if ( uids->count(s) == 1 )
{
std::cerr << "Already found: " << s << std::endl;
//pthread_exit(); // How do I say this is an error...
}
uids->insert( s );
}
return nullptr;
}
int TestUIDGenerator2(int , char *[])
{
const unsigned int nthreads = 10; // multiple of 2 please
pthread_t th[nthreads];
std::set uids[nthreads];
unsigned int i;
for (i = 0; i < nthreads; i++)
{
const int ret = pthread_create (&th[i], nullptr, func, (void*)(uids+i));
if( ret ) return 1;
}
for (i = 0; i < nthreads; i++)
pthread_join (th[i], nullptr);
std::vector v_one(nuids*nthreads);
std::vector::iterator it = v_one.begin();
for(i = 0; i < nthreads; i+=2)
{
std::set_union(uids[i].begin(), uids[i].end(),
uids[i+1].begin(), uids[i+1].end(), it);
it += nuids*2;
}
std::cout << v_one.size() << std::endl;
assert( v_one.size() == nuids * nthreads ); // programmer error
std::copy(v_one.begin(), v_one.end(), std::ostream_iterator(std::cout, "\n"));
std::set global;
for(it = v_one.begin(); it != v_one.end(); ++it)
{
global.insert( *it );
}
std::cout << "set:" << global.size() << std::endl;
if( global.size() != nuids * nthreads )
{
return 1;
}
return 0;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestIPPSorter2.cxx 000664 001766 001770 00000005676 14517730450 030747 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmIPPSorter.h"
#include "gdcmDirectory.h"
#include "gdcmTesting.h"
#include "gdcmSystem.h"
#include "gdcmTrace.h"
#include "gdcmAttribute.h"
// Sort image using Instance Number:
bool mysort(gdcm::DataSet const & ds1, gdcm::DataSet const & ds2 )
{
gdcm::Attribute<0x0020,0x0013> at1; // Instance Number
at1.Set( ds1 );
gdcm::Attribute<0x0020,0x0013> at2;
at2.Set( ds2 );
return at1 < at2;
}
int TestIPPSorter2(int argc, char *argv[])
{
const char *directory = gdcm::Testing::GetDataRoot();
std::vector filenames;
if( argc == 2 )
{
gdcm::Trace::DebugOn();
directory = argv[1];
if( gdcm::System::FileIsDirectory( directory ) )
{
gdcm::Directory d;
unsigned int nfiles = d.Load( directory ); // no recursion
d.Print( std::cout );
std::cout << "done retrieving file list. " << nfiles << " files found." << std::endl;
filenames = d.GetFilenames();
}
else
{
std::cerr << "file:" << directory << " is not a directory" << std::endl;
return 1;
}
}
else
{
// default execution (nightly test)
// let's take 4 files that can be sorted:
std::string file0 = std::string(directory) + "/SIEMENS_MAGNETOM-12-MONO2-FileSeq0.dcm";
std::string file1 = std::string(directory) + "/SIEMENS_MAGNETOM-12-MONO2-FileSeq1.dcm";
std::string file2 = std::string(directory) + "/SIEMENS_MAGNETOM-12-MONO2-FileSeq2.dcm";
std::string file3 = std::string(directory) + "/SIEMENS_MAGNETOM-12-MONO2-FileSeq3.dcm";
// let's push them in random order (oh my god how are we going to succeed ??)
filenames.push_back( file1 );
filenames.push_back( file3 );
filenames.push_back( file2 );
filenames.push_back( file0 );
}
gdcm::IPPSorter s;
s.SetComputeZSpacing( true );
s.SetZSpacingTolerance( 1e-10 );
bool b = s.Sort( filenames );
if( !b )
{
std::cerr << "Failed to sort:" << directory << std::endl;
return 1;
}
std::cout << "Sorting succeeded:" << std::endl;
s.Print( std::cout );
double zspacing = s.GetZSpacing();
if(!zspacing)
{
std::cerr << "computation of ZSpacing failed." << std::endl;
return 1;
}
std::cout << "Found z-spacing:" << std::endl;
std::cout << s.GetZSpacing() << std::endl;
// Now apply a StableSort on them:
s.SetSortFunction( mysort );
s.StableSort( s.GetFilenames() );
s.Print( std::cout );
return 0;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageChangeTransferSyntax1.cxx 000664 001766 001770 00000013353 14517730450 034152 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmImageChangeTransferSyntax.h"
#include "gdcmImageReader.h"
#include "gdcmImageWriter.h"
#include "gdcmFilename.h"
#include "gdcmSystem.h"
#include "gdcmFileMetaInformation.h"
#include "gdcmTesting.h"
#include "gdcmByteSwap.h"
#include "gdcmImageChangePlanarConfiguration.h"
namespace gdcm
{
int TestImageChangeTransferSyntaxJPEG(const char *filename, bool verbose = false)
{
ImageReader reader;
reader.SetFileName( filename );
if ( !reader.Read() )
{
const FileMetaInformation &header = reader.GetFile().GetHeader();
MediaStorage ms = header.GetMediaStorage();
bool isImage = MediaStorage::IsImage( ms );
bool pixeldata = reader.GetFile().GetDataSet().FindDataElement( Tag(0x7fe0,0x0010) );
if( isImage && pixeldata )
{
std::cerr << "Failed to read: " << filename << std::endl;
return 1;
}
else
{
// not an image give up...
std::cerr << "Problem with: " << filename << " but that's ok" << std::endl;
return 0;
}
}
const gdcm::Image &image = reader.GetImage();
int pc = image.GetPlanarConfiguration();
gdcm::ImageChangeTransferSyntax change;
change.SetTransferSyntax( gdcm::TransferSyntax::JPEGLosslessProcess14_1 );
change.SetInput( image );
bool b = change.Change();
if( !b )
{
unsigned short ba = reader.GetImage().GetPixelFormat().GetBitsAllocated();
if( ba == 12 )
{
std::cerr << "fail to change, but that's ok" << std::endl;
return 0;
}
std::cerr << "Could not change the Transfer Syntax: " << filename << std::endl;
return 1;
}
// Create directory first:
const char subdir[] = "TestImageChangeTransferSyntax";
std::string tmpdir = Testing::GetTempDirectory( subdir );
if( !System::FileIsDirectory( tmpdir.c_str() ) )
{
System::MakeDirectory( tmpdir.c_str() );
//return 1;
}
std::string outfilename = Testing::GetTempFilename( filename, subdir );
ImageWriter writer;
writer.SetFileName( outfilename.c_str() );
writer.SetFile( reader.GetFile() ); // increase test goal
writer.SetImage( change.GetOutput() );
if( !writer.Write() )
{
std::cerr << "Failed to write: " << outfilename << std::endl;
return 1;
}
// Let's read that file back in !
ImageReader reader2;
reader2.SetFileName( outfilename.c_str() );
if ( !reader2.Read() )
{
std::cerr << "Could not even reread our generated file : " << outfilename << std::endl;
return 1;
}
// Check that after decompression we still find the same thing:
int res = 0;
gdcm::Image img = reader2.GetImage();
// When recompressing: US-RGB-8-epicard.dcm, make sure to compute the md5 using the
// same original Planar Configuration...
if( (int)img.GetPlanarConfiguration() != pc )
{
gdcm::ImageChangePlanarConfiguration icpc;
icpc.SetInput( reader2.GetImage() );
icpc.SetPlanarConfiguration( pc );
icpc.Change();
img = icpc.GetOutput();
}
//std::cerr << "Success to read image from file: " << filename << std::endl;
unsigned long len = img.GetBufferLength();
char* buffer = new char[len];
bool res2 = img.GetBuffer(buffer);
if( !res2 )
{
std::cerr << "could not get buffer: " << outfilename << std::endl;
return 1;
}
// On big Endian system we have byteswapped the buffer (duh!)
// Since the md5sum is byte based there is now way it would detect
// that the file is written in big endian word, so comparing against
// a md5sum computed on LittleEndian would fail. Thus we need to
// byteswap (again!) here:
#ifdef GDCM_WORDS_BIGENDIAN
if( img.GetPixelFormat().GetBitsAllocated() == 16 )
{
assert( !(len % 2) );
assert( img.GetPhotometricInterpretation() == gdcm::PhotometricInterpretation::MONOCHROME1
|| img.GetPhotometricInterpretation() == gdcm::PhotometricInterpretation::MONOCHROME2 );
gdcm::ByteSwap::SwapRangeFromSwapCodeIntoSystem(
(unsigned short*)buffer, gdcm::SwapCode::LittleEndian, len/2);
}
#endif
const char *ref = gdcm::Testing::GetMD5FromFile(filename);
char digest[33];
gdcm::Testing::ComputeMD5(buffer, len, digest);
if( !ref )
{
// new regression image needs a md5 sum
std::cerr << "Missing md5 " << digest << " for: " << filename << std::endl;
//assert(0);
res = 1;
}
else if( strcmp(digest, ref) != 0 )
{
std::cerr << "Problem reading image from: " << filename << std::endl;
std::cerr << "Found " << digest << " instead of " << ref << std::endl;
res = 1;
}
if(res)
{
std::cerr << "problem with: " << outfilename << std::endl;
}
if( verbose )
{
std::cout << "file was written in: " << outfilename << std::endl;
}
delete[] buffer;
return res;
}
} // end namespace gdcm
int TestImageChangeTransferSyntax1(int argc, char *argv[])
{
if( argc == 2 )
{
const char *filename = argv[1];
return gdcm::TestImageChangeTransferSyntaxJPEG(filename, true);
}
// else
gdcm::Trace::DebugOff();
gdcm::Trace::WarningOff();
int r = 0, i = 0;
const char *filename;
const char * const *filenames = gdcm::Testing::GetFileNames();
while( (filename = filenames[i]) )
{
r += gdcm::TestImageChangeTransferSyntaxJPEG( filename );
++i;
}
return r;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestIconImageGenerator.cxx 000664 001766 001770 00000044324 14517730450 032531 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmImageReader.h"
#include "gdcmImageWriter.h"
#include "gdcmFilename.h"
#include "gdcmSystem.h"
#include "gdcmFileMetaInformation.h"
#include "gdcmTesting.h"
#include "gdcmByteSwap.h"
#include "gdcmIconImageGenerator.h"
static const char * const iconimagearray[][2] = {
{"f4f187737b9646348844804cd4eda259" , "SIEMENS_SOMATOM-12-ACR_NEMA-ZeroLengthUs.acr" },
{"8659bcbae5479e03925ea51af0d42170" , "gdcm-MR-SIEMENS-16-2.acr" },
{"f50225bbd7de605fa5b32d47ab4d0f19" , "test.acr" },
{"890bd3ca8ab288128f520fd2a0c33539" , "MR-MONO2-12-an2.acr" },
{"8893470f6cbe6314c66763b709177c7a" , "CT-MONO2-12-lomb-an2.acr" },
{"2134b4b992ded28502f24ab3f21c6432" , "LIBIDO-8-ACR_NEMA-Lena_128_128.acr" },
{"f9d8a0796ebf5a6aabddb4e133d09770" , "gdcm-ACR-LibIDO.acr" },
{"68525a2313b5416fb6cf1f6b4fdb8d48" , "libido1.0-vol.acr" },
{"a6453c0e0abbaad98edd3fd2d76f9d31" , "SIEMENS_CSA2.dcm" },
{"84b514b71413607571b40dcc73a1e73b" , "gdcm-JPEG-LossLessThoravision.dcm" },
{"c58f9cbfa1fe616278f963b48b33ee9f" , "XA-MONO2-8-12x-catheter.dcm" },
{"d383b49843c5226c8f21cd5ee89b6da4" , "gdcm-MR-PHILIPS-16-Multi-Seq.dcm" },
{"5fd844186b04820e1a55d42e99d81466" , "PHILIPS_GDCM12xBug.dcm" },
{"5ec31742812dc9d3fd2a4eca8e8b8a48" , "MR_Philips_Intera_PrivateSequenceExplicitVR_in_SQ_2001_e05f_item_wrong_lgt_use_NOSHADOWSEQ.dcm" },
{"0132ce06e00b199446ebd14d957e6119" , "D_CLUNIE_CT1_J2KI.dcm" },
{"3f7cae9b920adb3ca4a96ace2c0c91d7" , "rle16sti.dcm" },
{"aa3c60bbe989c9f3ef5e59243e08af56" , "3E768EB7.dcm" },
{"e3dae1f82b71857960bad4103524a72b" , "D_CLUNIE_MR2_JPLY.dcm" },
{"5995fc49c087d64182a7dc2cabedb4b2" , "SIEMENS_MAGNETOM-12-MONO2-FileSeq1.dcm" },
{"b7051f50189e469f6fc52d5108080b6d" , "SIEMENS_MAGNETOM-12-MONO2-FileSeq0.dcm" },
{"17cd7bdeb852639b214377f0263a82d3" , "MR_Philips_Intera_SwitchIndianess_noLgtSQItem_in_trueLgtSeq.dcm" },
{"365049df79c7491d14476c21083283ee" , "LEADTOOLS_FLOWERS-16-MONO2-Uncompressed.dcm" },
{"2cc83519b459f49f22d37c56f0362c3a" , "D_CLUNIE_MR3_JPLY.dcm" },
{"e8b529fbe615b4c540318695913d02e7" , "D_CLUNIE_VL2_RLE.dcm" },
{"e223c80bb1ce7344559632777881fc98" , "OsirixFake16BitsStoredFakeSpacing.dcm" },
{"e1b4e64a3a665d9ad74dc8a14cdc882b" , "GE_RHAPSODE-16-MONO2-JPEG-Fragments.dcm" },
{"cb78acab107d772f3ef2353ffdc32360" , "MR_SIEMENS_forceLoad29-1010_29-1020.dcm" },
{"4755c9b837968ca19b7a9882d4662c33" , "fffc0000UN.dcm" },
{"796594769ee3570292de36fdb4509df1" , "LIBIDO-24-ACR_NEMA-Rectangle.dcm" },
{"ffab5ebdfe60100e71295fe50412a98f" , "IM-0001-0066.CommandTag00.dcm" },
{"4ce869f259e705d596bd459f7863c0ca" , "D_CLUNIE_NM1_JPLY.dcm" },
{"e1b4e64a3a665d9ad74dc8a14cdc882b" , "D_CLUNIE_CT1_J2KR.dcm" },
{"539914be101cd8a0fad88ea3e0827f59" , "TheralysGDCM120Bug.dcm" },
{"20ac559d51fd5685236979d165178dd6" , "SIEMENS_MAGNETOM-12-MONO2-VRUN.dcm" },
{"ed6e642ca59d3e90d7db08856330cf00" , "THERALYS-12-MONO2-Uncompressed-Even_Length_Tag.dcm" },
{"209400d084e2c179c8c3d4973e75c66a" , "ALOKA_SSD-8-MONO2-RLE-SQ.dcm" },
{"66bfea16c5837f976654e038b119af7a" , "GE_GENESIS-16-MONO2-WrongLengthItem.dcm" },
{"d4669bd89971c1affd311c7d1d8b20c7" , "US-RGB-8-esopecho.dcm" },
{"4b827f55ca36895f40bc47d27a0d7ea4" , "D_CLUNIE_MR4_RLE.dcm" },
{"7d1c251e29dcd79af32c791a6f8e24e9" , "D_CLUNIE_MR2_JPLL.dcm" },
{"5d642ed928e155551f3431f172e3378d" , "SIEMENS_Sonata-16-MONO2-Value_Multiplicity.dcm" },
{"365049df79c7491d14476c21083283ee" , "LEADTOOLS_FLOWERS-16-MONO2-JpegLossless.dcm" },
{"4305b70775ce53503ef93614815961e1" , "CT-MONO2-16-ankle.dcm" },
{"1a27a48d4efe2999b83bc89d3003d05c" , "LEADTOOLS_FLOWERS-8-PAL-RLE.dcm" },
{"2134b4b992ded28502f24ab3f21c6432" , "simpleImageWithIcon.dcm" },
{"a13e29a4a0ca1a31338589a45f21a9e2" , "CR-MONO1-10-chest.dcm" },
{"e1b4e64a3a665d9ad74dc8a14cdc882b" , "D_CLUNIE_CT1_RLE.dcm" },
{"32931c4b9131f43496ab4a3518527af1" , "D_CLUNIE_NM1_JPLL.dcm" },
{"efc58ca0ba4b51b511374f8e53f2af4e" , "MR_GE_with_Private_Compressed_Icon_0009_1110.dcm" },
{"620f0b67a91f7f74151bc5be745b7110" , "NM-MONO2-16-13x-heart.dcm" },
{"9abf5e3aadcfe2b9c1cfe41782b36704" , "US-IRAD-NoPreambleStartWith0003.dcm" },
{"f778aac834d5a68acaa97d8faec18e72" , "MR-MONO2-16-head.dcm" },
{"1a27a48d4efe2999b83bc89d3003d05c" , "LEADTOOLS_FLOWERS-8-PAL-Uncompressed.dcm" },
{"09e18d103bc8c9cf08b1455af2717310" , "MAROTECH_CT_JP2Lossy.dcm" },
{"bedb38b85f3bdb85c99b62e5b01a3ada" , "05115014-mr-siemens-avanto-syngo-with-palette-icone.dcm" },
{"fb5402472ee00639ef8dc1b09692c299" , "US-PAL-8-10x-echo.dcm" },
{"cea1ea10e8efc68bfb559bbefd1e4cc1" , "MR-SIEMENS-DICOM-WithOverlays.dcm" },
{"6246c70687f0deab108c889eacda1b8e" , "D_CLUNIE_MR1_JPLL.dcm" },
{"e1b4e64a3a665d9ad74dc8a14cdc882b" , "D_CLUNIE_CT1_JPLL.dcm" },
{"db6293d8adc92a2273b6ae2fee13c2e7" , "AMIInvalidPrivateDefinedLengthSQasUN.dcm" },
{"17cd7bdeb852639b214377f0263a82d3" , "ExplicitVRforPublicElementsImplicitVRforShadowElements.dcm" },
{"b041b08aa1786195f3f26a75c1b84b85" , "PHILIPS_Gyroscan-12-Jpeg_Extended_Process_2_4.dcm" },
{"9172854202523aa6688367efcbfc3bdc" , "D_CLUNIE_SC1_JPLY.dcm" },
{"d29e7ff251d7d754ce8b5368f61032b0" , "gdcm-MR-PHILIPS-16-NonSquarePixels.dcm" },
{"8a5d13f6c85b2eebc1c02432d729cd45" , "SIEMENS-MR-RGB-16Bits.dcm" },
{"3e8618fee9c8baca508eeef8206a340a" , "US-IRAD-NoPreambleStartWith0005.dcm" },
{"3a7816dc8359a0d8a935313909fcf817" , "PICKER-16-MONO2-Nested_icon.dcm" },
{"be5490cac843a7325027e578067d4eb3" , "gdcm-JPEG-Extended.dcm" },
{"c790d0a462907135c1991f10a4846f98" , "D_CLUNIE_US1_RLE.dcm" },
{"3ac268f0ec6f1005a72db89d182f143c" , "D_CLUNIE_RG2_JPLY.dcm" },
{"5e848e7bc12f27e598c3348a586def24" , "PHILIPS_Brilliance_ExtraBytesInOverlay.dcm" },
{"3bbe5ebe2ff7e260d56e40f670e3e335" , "MR_ELSCINT1_00e1_1042_SQ_feff_00e0_Item.dcm" },
{"9df1b097f3f7eb4a3725065e361b9213" , "TG18-CH-2k-01.dcm" },
{"365049df79c7491d14476c21083283ee" , "LEADTOOLS_FLOWERS-16-MONO2-RLE.dcm" },
{"27daf49ec13f58db1d800fc58378852e" , "OT-PAL-8-face.dcm" },
{"07fef244d4e14358d453c144770b2a55" , "LEADTOOLS_FLOWERS-24-RGB-JpegLossy.dcm" },
{"0c38dfd851a74ea2205a0a6b69c2ddf7" , "SIEMENS_MAGNETOM-12-MONO2-Uncompressed.dcm" },
{"620f0b67a91f7f74151bc5be745b7110" , "GDCMJ2K_TextGBR.dcm" },
{"5158679aaa379a50dec1e4a092d91455" , "MR16BitsAllocated_8BitsStored.dcm" },
{"22103a2ee208d18f8c4e60dc15e5444a" , "GE_GENESIS-16-MONO2-Uncompressed-UnusualVR.dcm" },
{"e1b4e64a3a665d9ad74dc8a14cdc882b" , "D_CLUNIE_CT1_JLSL.dcm" },
{"719505e71eafd643fa2e114acc83496f" , "ELSCINT1_JP2vsJ2K.dcm" },
{"09dd85a0f964f307f66f2b8727d22efb" , "D_CLUNIE_XA1_JPLL.dcm" },
{"a5019730f663a81b50d559c8a98da4a6" , "SIEMENS_Sonata-12-MONO2-SQ.dcm" },
{"ed0f5fc46b2e0bb6550d68686d956ca6" , "JPEGDefinedLengthSequenceOfFragments.dcm" },
{"5aaee8a979cb11627e56ca5757e5d4e3" , "PHILIPS_GDCM12xBug2.dcm" },
{"620f0b67a91f7f74151bc5be745b7110" , "ITK_GDCM124_MultiframeSecondaryCaptureInvalid.dcm" },
{"e34c7c8d406ceec07ff1c8b82b59d2e5" , "D_CLUNIE_RG2_JPLL.dcm" },
{"7478edd0202fde583138df8dfe2782f9" , "FUJI-10-MONO1-ACR_NEMA_2.dcm" },
{"c5d8e44435241965c400935d30b0d654" , "D_CLUNIE_MR1_JPLY.dcm" },
{"09dd85a0f964f307f66f2b8727d22efb" , "D_CLUNIE_XA1_RLE.dcm" },
{"2783d3ac71623cd136de7eb8af13753b" , "BugGDCM2_UndefItemWrongVL.dcm" },
{"8659bcbae5479e03925ea51af0d42170" , "SIEMENS_MAGNETOM-12-ACR_NEMA_2-Modern.dcm" },
{"477d801b27ef3cb21a8685cedbc9b12e" , "JDDICOM_Sample2.dcm" },
{"028dcdbc8e309eac282f73cff0751273" , "TOSHIBA_MRT150-16-MONO2-ACR_NEMA_2.dcm" },
{"7e183442aefeadbfff9f0d79a7064a5d" , "DCMTK_JPEGExt_12Bits.dcm" },
{"9f04afae98a960de78b31e416bdbe31b" , "US-MONO2-8-8x-execho.dcm" },
{"7cc0d00a56ec460d4025d4f9cea4e445" , "UnexpectedSequenceDelimiterInFixedLengthSequence.dcm" },
{"bee28068ae9edef69fef792583b3e20f" , "ACUSON-24-YBR_FULL-RLE-b.dcm" },
{"b171f7581c9cf15b2d32cfd62e9b6038" , "gdcm-US-ALOKA-16.dcm" },
{"b6ba84d4868436e0b44b19d75cefe239" , "DX_J2K_0Padding.dcm" },
{"76b3e5225e1914e61010eb11c50b0d13" , "D_CLUNIE_CT2_RLE.dcm" },
{"455aa24ef2085a6b57f8b29d4f42b558" , "D_CLUNIE_RG1_JPLL.dcm" },
{"e0a3fd5917c5a13a16981e1d0346af4d" , "D_CLUNIE_VL3_RLE.dcm" },
{"fd69a42d6ed9ac779fbdea5a874f27da" , "NM_Kakadu44_SOTmarkerincons.dcm" },
{"5a622115e307a024aeb6003ad45c87d7" , "CT-SIEMENS-Icone-With-PaletteColor.dcm" },
{"d687a5770da5430258c9354ef7283fb1" , "GE_DLX-8-MONO2-PrivateSyntax.dcm" },
{"48843eac44f481073e2349a9b40034e6" , "CT_16b_signed-UsedBits13.dcm" },
{"7b8f24a39d4d46d6898d0c868e2ead62" , "D_CLUNIE_RG3_JPLY.dcm" },
{"a1b35156bf0be7f0fe5054e13b6dc11f" , "DX_GE_FALCON_SNOWY-VOI.dcm" },
{"8745f035e70b8dad2a4b04b855c1974e" , "PrivateGEImplicitVRBigEndianTransferSyntax16Bits.dcm" },
{"608d7fd9e8cf15f95b75a12072a209d9" , "CT-MONO2-16-brain.dcm" },
{"c2de60330cda14759a117b937a7e5a95" , "D_CLUNIE_VL4_RLE.dcm" },
{"b4213e55f351e2c9e013050652c8fad4" , "D_CLUNIE_MR3_RLE.dcm" },
{"cdae2ce2d07ef1880f9eba78e72c7f03" , "undefined_length_un_vr.dcm" },
{"1e456d9eb136554a3d035d65999ac72f" , "CT-MONO2-16-ort.dcm" },
{"7022cd07ae0e9311ca2bb13372becee1" , "05148044-mr-siemens-avanto-syngo.dcm" },
{"5d6aaab5766479ec6e27de4eaa4a6438" , "GE_LOGIQBook-8-RGB-HugePreview.dcm" },
{"d8b9952cb72ea315ae4b81038ca7498f" , "RadBWLossLess.dcm" },
{"b7b5b0a05dde85a672529e896ffd34cc" , "KODAK-12-MONO1-Odd_Terminated_Sequence.dcm" },
{"c1b31ebeb79ba29263e59254af17eb88" , "CT-MONO2-16-chest.dcm" },
{"4085155ff0a36230f55dfd17c07b016f" , "PhilipsInteraSeqTermInvLen.dcm" },
{"4c80f49834a2f8cec23ff8c7c0e80613" , "D_CLUNIE_MR4_JPLY.dcm" },
{"dc04449fe2bdd8c5ff26f2b6b4f3a1aa" , "D_CLUNIE_RG3_JPLL.dcm" },
{"01d9c3bac1a49f874eb70640d9187657" , "MR_Philips-Intera_BreaksNOSHADOW.dcm" },
{"f86eb566e712fa57bf5bdd13af9233c6" , "GE_CT_With_Private_compressed-icon.dcm" },
{"b2ed24f5bad1fe7fe1ceb62a1a37bf03" , "D_CLUNIE_CT1_JLSN.dcm" },
{"20ac559d51fd5685236979d165178dd6" , "SIEMENS_MAGNETOM-12-MONO2-GDCM12-VRUN.dcm" },
{"cee47e57f6b1aaace74bb813e33a74eb" , "00191113.dcm" },
{"645a354b8bfbbda1c3e01a79c583eca0" , "MARCONI_MxTWin-12-MONO2-JpegLossless-ZeroLengthSQ.dcm" },
{"f8ef8fa89c0415c54ee8350db9bafc59" , "SignedShortLosslessBug.dcm" },
{"9274ed6683e657a8e6c95278cb93a971" , "GE_DLX-8-MONO2-Multiframe.dcm" },
{"cb7ccda2e8aed6d56df6350207c1d122" , "PHILIPS_Gyroscan-12-MONO2-Jpeg_Lossless.dcm" },
{"788c5bf06000799bd630c70ce0418430" , "LJPEG_BuginGDCM12.dcm" },
{"610b9ac0f1aac082eb1c0b140a85d2de" , "SIEMENS_MAGNETOM-12-MONO2-FileSeq3.dcm" },
{"dc04449fe2bdd8c5ff26f2b6b4f3a1aa" , "D_CLUNIE_RG3_RLE.dcm" },
{"587e56aa881d645ee67ac3afe317b11d" , "CT-SIEMENS-MissingPixelDataInIconSQ.dcm" },
{"7d1c251e29dcd79af32c791a6f8e24e9" , "MR-MONO2-12-shoulder.dcm" },
{"0b818ac3983d76cfdc535a46058a1a53" , "LEADTOOLS_FLOWERS-24-RGB-Uncompressed.dcm" },
{"ba8fb87069401e40d9c0dd5bf0f2bb06" , "PICKER-16-MONO2-No_DicomV3_Preamble.dcm" },
{"634fca1b1087cfb2dd4c74a567daf302" , "SIEMENS_MOSAIC_12BitsStored-16BitsJPEG.dcm" },
{"ba0654f3e7aae75bca8fc24705ddb78a" , "CT-MONO2-8-abdo.dcm" },
{"b4213e55f351e2c9e013050652c8fad4" , "D_CLUNIE_MR3_JPLL.dcm" },
{"03f25fb3e6e8ae53b9565553e2026a66" , "D_CLUNIE_VL6_RLE.dcm" },
{"365049df79c7491d14476c21083283ee" , "LEADTOOLS_FLOWERS-8-MONO2-RLE.dcm" },
{"99b13adb3932f9fcf50c0aa936b6e367" , "PHILIPS_Gyroscan-8-MONO2-Odd_Sequence.dcm" },
{"1f0795064ee1d19534780b7a4e92d5db" , "SIEMENS-12-Jpeg_Process_2_4-Lossy-a.dcm" },
{"de42da38e961881e7a68f4d9337007cd" , "gdcm-JPEG-LossLess3a.dcm" },
{"bec532ee78edb47bd0894dcbb2a7d1f5" , "D_CLUNIE_XA1_JPLY.dcm" },
{"455aa24ef2085a6b57f8b29d4f42b558" , "D_CLUNIE_RG1_RLE.dcm" },
{"e77b93eb953f2a21fa75d257da0514fb" , "US-RGB-8-epicard.dcm" },
{"ddc56ce334439f64953f1b11c82aeeb9" , "GE_MR_0025xx1bProtocolDataBlock.dcm" },
{"b9f48f54e75b7f1994cfe1a7152d9ab5" , "rle16loo.dcm" },
{"50bf4b4c98228d2f11fb0d8c4b49e3cc" , "DMCPACS_ExplicitImplicit_BogusIOP.dcm" },
{"76b3e5225e1914e61010eb11c50b0d13" , "D_CLUNIE_CT2_JPLL.dcm" },
{"477d801b27ef3cb21a8685cedbc9b12e" , "JDDICOM_Sample2-dcmdjpeg.dcm" },
{"17cd7bdeb852639b214377f0263a82d3" , "MR_Philips_Intera_No_PrivateSequenceImplicitVR.dcm" },
{"19cd0ebffc7541a5ec944d25200923ad" , "KODAK_CompressedIcon.dcm" },
{"486199008daf27f167efee9469fffd52" , "ACUSON-24-YBR_FULL-RLE.dcm" },
{"7d1c251e29dcd79af32c791a6f8e24e9" , "D_CLUNIE_MR2_RLE.dcm" },
{"b53c440c32a7bd20d24cc1997bd7c9e6" , "JPEG_LossyYBR.dcm" },
{"4c54ea0d88336020167a5cb9437a1dec" , "012345.002.050.dcm" },
{"e34c7c8d406ceec07ff1c8b82b59d2e5" , "D_CLUNIE_RG2_RLE.dcm" },
{"b209bb00a5bb920ebfb52b50132bd3cb" , "MR_Philips_Intera_PrivateSequenceImplicitVR.dcm" },
{"261065dc52f086beac57ed71977b40ec" , "SIEMENS_ImageLocationUN.dcm" },
{"17cd7bdeb852639b214377f0263a82d3" , "PHILIPS_Intera-16-MONO2-Uncompress.dcm" },
{"60e754c9dfc02bba3aee11e67653d844" , "MR-SIEMENS-DICOM-WithOverlays-extracted-overlays.dcm" },
{"0b818ac3983d76cfdc535a46058a1a53" , "LEADTOOLS_FLOWERS-24-RGB-JpegLossless.dcm" },
{"91b4da2ca9fd378ca404580c84c62984" , "US-GE-4AICL142.dcm" },
{"5b24d4a43d7c72090eabb88a06b56f15" , "D_CLUNIE_SC1_RLE.dcm" },
{"4b827f55ca36895f40bc47d27a0d7ea4" , "D_CLUNIE_MR4_JPLL.dcm" },
{"95ccb6a943e1ca82f3be78ceaa72b9d4" , "MR-Brucker-CineTagging-NonSquarePixels.dcm" },
{"552dd953ebd0575d124e44df0218b0ea" , "MR-MONO2-8-16x-heart.dcm" },
{"e73b404ca6d9b4b7ba54f46d2662deca" , "LEADTOOLS_FLOWERS-8-MONO2-JpegLossy.dcm" },
{"8a35a388332dbb40018ee6814ab27994" , "GE_DLX-8-MONO2-Multiframe-Jpeg_Lossless.dcm" },
{"32931c4b9131f43496ab4a3518527af1" , "D_CLUNIE_NM1_RLE.dcm" },
{"20e2f6cc2b60ae26adfdd3b3ee0e1915" , "D_CLUNIE_VL1_RLE.dcm" },
{"0b1cb469990edd0cabfa34c8b6cb427d" , "SIEMENS_MAGNETOM-12-MONO2-FileSeq2.dcm" },
{"620f0b67a91f7f74151bc5be745b7110" , "DermaColorLossLess.dcm" },
{"b9395dcfbb50e1af31147f80e8e0c1e7" , "OT-MONO2-8-a7.dcm" },
{"6246c70687f0deab108c889eacda1b8e" , "D_CLUNIE_MR1_RLE.dcm" },
{"365049df79c7491d14476c21083283ee" , "LEADTOOLS_FLOWERS-8-MONO2-Uncompressed.dcm" },
{"cee47e57f6b1aaace74bb813e33a74eb" , "00191113.dcm" },
{"07b6f4e2fba920d28e2f29dbb037b640" , "TOSHIBA_J2K_SIZ1_PixRep0.dcm" },
{"206713a8ff161546d664d1285f99f90b" , "TOSHIBA_J2K_OpenJPEGv2Regression.dcm" },
{"dc70ae52689ebf8f5003320e1c7f216b" , "TOSHIBA_J2K_SIZ0_PixRep1.dcm" },
{"3475cb96e0308cb84502be1c1531b588" , "NM-PAL-16-PixRep1.dcm" },
{"bcac830aae8652a88f4c4aa6d9e7e116" , "MEDILABInvalidCP246_EVRLESQasUN.dcm" },
{"5b8db1c8d42870f68bfd908529c58710" , "JPEGInvalidSecondFrag.dcm" },
{"37f43037574e53a0c27151443e27613f" , "SC16BitsAllocated_8BitsStoredJ2K.dcm" },
{"620f0b67a91f7f74151bc5be745b7110" , "SC16BitsAllocated_8BitsStoredJPEG.dcm" },
// sentinel
{ 0, 0 }
};
namespace gdcm
{
int TestIconImageGenerate(const char *subdir, const char* filename, bool verbose = false)
{
ImageReader reader;
reader.SetFileName( filename );
if ( !reader.Read() )
{
const FileMetaInformation &header = reader.GetFile().GetHeader();
MediaStorage ms = header.GetMediaStorage();
bool isImage = MediaStorage::IsImage( ms );
bool pixeldata = reader.GetFile().GetDataSet().FindDataElement( Tag(0x7fe0,0x0010) );
if( isImage && pixeldata )
{
std::cerr << "Failed to read: " << filename << std::endl;
return 1;
}
else
{
// not an image give up...
std::cerr << "Problem with: " << filename << " but that's ok" << std::endl;
return 0;
}
}
// Create directory first:
std::string tmpdir = Testing::GetTempDirectory( subdir );
if( !System::FileIsDirectory( tmpdir.c_str() ) )
{
System::MakeDirectory( tmpdir.c_str() );
//return 1;
}
std::string outfilename = Testing::GetTempFilename( filename, subdir );
IconImageGenerator iig;
iig.SetPixmap( reader.GetImage() );
const unsigned int idims[2] = { 64, 64 };
iig.SetOutputDimensions( idims );
bool b = iig.Generate();
gdcm::Filename fn( filename );
const char *name = fn.GetName();
unsigned int i = 0;
const char *p = iconimagearray[i][1];
while( p != 0 )
{
if( strcmp( name, p ) == 0 )
{
break;
}
++i;
p = iconimagearray[i][1];
}
const char *refmd5 = iconimagearray[i][0];
if( b )
{
const gdcm::IconImage &icon = iig.GetIconImage();
if( verbose ) icon.Print( std::cout );
unsigned long len = icon.GetBufferLength();
std::vector< char > vbuffer;
vbuffer.resize( len );
char *buffer = &vbuffer[0];
bool res2 = icon.GetBuffer(buffer);
if( !res2 )
{
std::cerr << "res2 failure:" << filename << std::endl;
return 1;
}
char digest[33];
gdcm::Testing::ComputeMD5(buffer, len, digest);
Image & img = reader.GetImage();
img.SetIconImage( iig.GetIconImage() );
ImageWriter writer;
writer.SetFileName( outfilename.c_str() );
#if 1
writer.SetImage( img );
#else
Image &ii = writer.GetImage();
(Bitmap&)ii = iig.GetIconImage();
#endif
if( !writer.Write() )
{
std::cerr << "Failed to write: " << outfilename << std::endl;
return 1;
}
if( verbose )
{
std::cout << "success: " << outfilename << std::endl;
std::cout << "ref=" << refmd5 << std::endl;
std::cout << "md5=" << digest << std::endl;
}
if( !refmd5 )
{
std::cerr << " missing md5= {\"" << digest << "\" , \"" << name << "\" }," << std::endl;
return 1;
}
if( strcmp( refmd5, digest) )
{
std::cerr << "Problem with : " << name << " " << refmd5 << " vs " << digest << std::endl;
return 1;
}
}
else
{
assert( refmd5 == 0 );
std::cerr << "Could not generate Icon for: " << filename << std::endl;
return 1;
}
return 0;
}
}
int TestIconImageGenerator(int argc, char *argv[])
{
if( argc == 2 )
{
const char *filename = argv[1];
return gdcm::TestIconImageGenerate(argv[0],filename, true);
}
// else
gdcm::Trace::DebugOff();
gdcm::Trace::WarningOff();
gdcm::Trace::ErrorOff();
int r = 0, i = 0;
const char *filename;
const char * const *filenames = gdcm::Testing::GetFileNames();
while( (filename = filenames[i]) )
{
r += gdcm::TestIconImageGenerate(argv[0], filename );
++i;
}
return r;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestStreamImageReader.cxx 000664 001766 001770 00000016350 14517730450 032346 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmStreamImageReader.h"
#include "gdcmFileMetaInformation.h"
#include "gdcmSystem.h"
#include "gdcmFilename.h"
#include "gdcmByteSwap.h"
#include "gdcmTrace.h"
#include "gdcmTesting.h"
#include "gdcmImageHelper.h"
#include "gdcmImageReader.h"
#include "gdcmImage.h"
#include "gdcmMediaStorage.h"
#include "gdcmRAWCodec.h"
#include "gdcmJPEGLSCodec.h"
int TestStreamImageRead(const char* filename, bool verbose = false, bool lossydump = false)
{
(void)lossydump;
if( verbose )
std::cerr << "Reading: " << filename << std::endl;
gdcm::StreamImageReader reader;
reader.SetFileName( filename );
bool canReadImageInformation = reader.ReadImageInformation();
if (!canReadImageInformation)
{
return 0; //unable to read tags as expected.
}
else
{
int res = 0;
//let's be tricky; each image will be read in portions, first the top half, then the bottom
//that way, we can test how the stream handles fragmentation of the data
//we could also loop this to get various different size combinations, but I'm not sure
//that's useful, yet.
std::vector extent =
gdcm::ImageHelper::GetDimensionsValue(reader.GetFile());
//at this point, these values aren't used, but may be in the future
//unsigned short xmin = 0;
//unsigned short xmax = extent[0];
//unsigned short ymin = 0;
//unsigned short ymax = extent[1];
//unsigned short zmin = 0;
//unsigned short zmax = extent[2];
reader.DefinePixelExtent(0, (uint16_t)extent[0], 0, (uint16_t)extent[1], 0, (uint16_t)extent[2]);
unsigned long len = reader.DefineProperBufferLength();
char* finalBuffer = new char[len];
memset(finalBuffer, 0, sizeof(char)*len);
if (reader.CanReadImage()){
bool result = reader.Read(finalBuffer, len);
if( !result ){
std::cerr << "res2 failure:" << filename << std::endl;
delete [] finalBuffer;
return 1;
}
} else {
delete [] finalBuffer;
return 0; //essentially, we're going to skip this file since it can't be read by the streamer
}
/*
//now, read in smaller buffer extents
reader.DefinePixelExtent(xmin, xmax, ymin, ymax);
len = reader.DefineProperBufferLength();
char* buffer = new char[len];
bool res2 = reader.Read(buffer, len);
if( !res2 ){
std::cerr << "res2 failure:" << filename << std::endl;
return 1;
}
//copy the result into finalBuffer
memcpy(finalBuffer, buffer, len);
//now read the next half of the image
ymin = ymax;
ymax = extent[1];
reader.DefinePixelExtent(xmin, xmax, ymin, ymax);
//std::cerr << "Success to read image from file: " << filename << std::endl;
unsigned long len2 = reader.DefineProperBufferLength();
char* buffer2 = new char[len2];
bool res3 = reader.Read(buffer2, len2);
if( !res3 ){
std::cerr << "res3 failure:" << filename << std::endl;
return 1;
}
//copy the result into finalBuffer
memcpy(&(finalBuffer[len]), buffer2, len2);
delete [] buffer;
delete [] buffer2;
*/
// On big Endian system we have byteswapped the buffer (duh!)
// Since the md5sum is byte based there is now way it would detect
// that the file is written in big endian word, so comparing against
// a md5sum computed on LittleEndian would fail. Thus we need to
// byteswap (again!) here:
const char *ref = gdcm::Testing::GetMD5FromFile(filename);
const char *correct_ref = gdcm::Testing::GetMD5FromBrokenFile(filename);
char digest[33];
gdcm::Testing::ComputeMD5(finalBuffer, len, digest);
if( verbose )
{
std::cout << "ref=" << ref << std::endl;
std::cout << "md5=" << digest << std::endl;
}
if( !ref )
{
// new regression image needs a md5 sum
std::cout << "Missing md5 " << digest << " for: " << filename << std::endl;
//assert(0);
res = 1;
}
else if( strcmp(digest, ref) != 0 )
{
// let's be nice for now and only truly fails when file is proper DICOM
if( correct_ref && !strcmp(correct_ref, ref) )
{
std::cerr << "Problem reading image from: " << filename << std::endl;
std::cerr << "Found " << digest << " instead of " << ref << std::endl;
/*
//uncomment this code to explicitly read and check the md5 hash
gdcm::ImageReader reader;
reader.SetFileName( filename );
if (reader.Read())
{
const gdcm::Image &img = reader.GetImage();
//std::cerr << "Success to read image from file: " << filename << std::endl;
unsigned long len2 = img.GetBufferLength();
char* buffer2 = new char[len];
bool res3 = img.GetBuffer(buffer2);
if (res3)
{
char digest2[33];
gdcm::Testing::ComputeMD5(buffer2, len2, digest2);
if (strcmp(digest2, digest))
{
std::cerr << "Second check read " << digest2 << " not " << digest << std::endl;
}
}
delete [] buffer2;
}
*/
res = 1;
}
#if 0
std::ofstream debug("/tmp/dump.gray",std::ios::binary);
debug.write(finalBuffer, len);
debug.close();
#endif
}
delete[] finalBuffer;
if (res == 0)
{
//uncomment this line to determine if a file was correctly read
//std::cerr << "Correctly read " << filename << std::endl;
}
return res;
}
#if 0
const gdcm::FileMetaInformation &header = reader.GetFile().GetHeader();
gdcm::MediaStorage ms = header.GetMediaStorage();
bool isImage = gdcm::MediaStorage::IsImage( ms );
if( isImage )
{
if( reader.GetFile().GetDataSet().FindDataElement( gdcm::Tag(0x7fe0,0x0010) ) )
{
std::cerr << "Failed to read image from file: " << filename << std::endl;
return 1;
}
else
{
std::cerr << "no Pixel Data Element found in the file:" << filename << std::endl;
return 0;
}
}
// else
// well this is not an image, so thankfully we fail to read it
std::cerr << "Could not read image(" << filename << "), since file is a: " << ms << std::endl;
//assert( ms != gdcm::MediaStorage::MS_END );
return 0;
#endif
}
int TestStreamImageReader(int argc, char *argv[])
{
if( argc == 2 )
{
const char *filename = argv[1];
return TestStreamImageRead(filename, true);
}
// else
// First of get rid of warning/debug message
gdcm::Trace::DebugOff();
gdcm::Trace::WarningOff();
int r = 0, i = 0;
const char *filename;
const char * const *filenames = gdcm::Testing::GetFileNames();
while( (filename = filenames[i]) )
{
r += TestStreamImageRead( filename);
++i;
}
return r;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestFileAnonymizer1.cxx 000664 001766 001770 00000007261 14517730450 032042 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmFileAnonymizer.h"
#include "gdcmTesting.h"
#include "gdcmSystem.h"
#include "gdcmReader.h"
#include "gdcmFilename.h"
int TestFileAnonymize1(const char *filename, bool verbose = false)
{
using namespace gdcm;
if( verbose )
std::cout << "Processing: " << filename << std::endl;
// Create directory first:
const char subdir[] = "TestFileAnonymize1";
std::string tmpdir = Testing::GetTempDirectory( subdir );
if( !System::FileIsDirectory( tmpdir.c_str() ) )
{
System::MakeDirectory( tmpdir.c_str() );
//return 1;
}
std::string outfilename = Testing::GetTempFilename( filename, subdir );
const gdcm::Tag t1(0x0018,0x5100);
const gdcm::Tag t2(0x0018,0x1312);
const gdcm::Tag t3(0x0018,0x1313);
const gdcm::Tag t4(0x0018,0x1317);
const gdcm::Tag t5(0x0008,0x2112);
const gdcm::Tag t6(0x0008,0x9215);
const gdcm::Tag t7(0x0018,0x1020);
const gdcm::Tag t8(0x0004,0x1130); // Test DICOMDIR !
const gdcm::Tag t9(0x0008,0x0000); // Earliest possible Data Element
const gdcm::Tag t0(0xffff,0xffff); // Latest Possible Element
std::vector tags;
tags.push_back( t0 );
tags.push_back( t1 );
tags.push_back( t2 );
tags.push_back( t3 );
tags.push_back( t4 );
tags.push_back( t5 );
tags.push_back( t6 );
tags.push_back( t7 );
tags.push_back( t8 );
tags.push_back( t9 );
// precondition, remove the file if present:
System::RemoveFile(outfilename.c_str());
gdcm::FileAnonymizer fa;
fa.SetInputFileName( filename );
fa.SetOutputFileName( outfilename.c_str() );
for( std::vector::const_iterator it = tags.begin();
it != tags.end(); ++it )
{
fa.Remove( *it );
}
if( !fa.Write() )
{
std::cerr << "Failed to write: " << outfilename << std::endl;
return 1;
}
// Read back and check:
gdcm::Reader r;
r.SetFileName( outfilename.c_str() );
if( !r.Read() )
{
std::cerr << "Failed to read: " << outfilename << std::endl;
return 1;
}
const File &f = r.GetFile();
const DataSet &ds = f.GetDataSet();
for( std::vector::const_iterator it = tags.begin();
it != tags.end(); ++it )
{
const gdcm::Tag & t = *it;
if( ds.FindDataElement( t ) )
{
gdcm::Filename fn( filename );
std::cerr << "Found element: " << t << " in " << outfilename << std::endl;
gdcm::MediaStorage ms;
ms.SetFromFile( f );
const bool isdicomdir = (ms == gdcm::MediaStorage::MediaStorageDirectoryStorage); // de-activate for now
if( strcmp(fn.GetName(), "ExplicitVRforPublicElementsImplicitVRforShadowElements.dcm") == 0 || isdicomdir )
{
return 0;
}
return 1;
}
}
return 0;
}
int TestFileAnonymizer1(int argc, char *argv[])
{
if( argc == 2 )
{
const char *filename = argv[1];
return TestFileAnonymize1(filename, true);
}
// else
gdcm::Trace::DebugOff();
gdcm::Trace::WarningOff();
gdcm::Trace::ErrorOff();
int r = 0, i = 0;
const char *filename;
const char * const *filenames = gdcm::Testing::GetFileNames();
while( (filename = filenames[i]) )
{
r += TestFileAnonymize1( filename );
++i;
}
return r;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestPixelFormat.cxx 000664 001766 001770 00000010301 14517730450 031245 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmPixelFormat.h"
struct frame_info {
gdcm::PixelFormat pixeltype;
};
int TestPixelFormat(int , char *[])
{
using gdcm::PixelFormat;
gdcm::PixelFormat pf;
pf.SetScalarType( gdcm::PixelFormat::UNKNOWN );
if( pf.GetScalarType() != gdcm::PixelFormat::UNKNOWN )
{
return 1;
}
pf.SetScalarType( gdcm::PixelFormat::UINT32 );
//pf.SetScalarType( gdcm::PixelFormat::UINT64 );
static const int64_t values[][2] = {
{ 0LL,255LL },
{ 0LL,4095LL },
{ 0LL,65535LL },
{ 0LL,4294967295LL },
{ -128LL,127LL },
{ -2048LL,2047LL },
{ -32768LL,32767LL },
{ -2147483648LL,2147483647LL },
// { -2147483648LL,2147483647LL }
};
static const size_t n = sizeof( values ) / sizeof( *values );
size_t c = 0;
pf.SetBitsStored( 8 );
if( pf.GetMin() != values[c][0] || pf.GetMax() != values[c][1] )
{
std::cerr << pf.GetMin() << "," << pf.GetMax() << std::endl;
return 1;
}
++c;
pf.SetBitsStored( 12 );
if( pf.GetMin() != values[c][0] || pf.GetMax() != values[c][1] )
{
std::cerr << pf.GetMin() << "," << pf.GetMax() << std::endl;
return 1;
}
++c;
pf.SetBitsStored( 16 );
if( pf.GetMin() != values[c][0] || pf.GetMax() != values[c][1] )
{
std::cerr << pf.GetMin() << "," << pf.GetMax() << std::endl;
return 1;
}
++c;
pf.SetBitsStored( 32 );
if( pf.GetMin() != values[c][0] || pf.GetMax() != values[c][1] )
{
std::cerr << pf.GetMin() << "," << pf.GetMax() << std::endl;
return 1;
}
// ++c;
// pf.SetBitsStored( 64 );
// if( pf.GetMin() != values[c][0] || pf.GetMax() != values[c][1] )
// {
// std::cerr << pf.GetMin() << "," << pf.GetMax() << std::endl;
// return 1;
// }
pf.SetPixelRepresentation( 1 );
++c;
pf.SetBitsStored( 8 );
if( pf.GetMin() != values[c][0] || pf.GetMax() != values[c][1] )
{
std::cerr << pf.GetMin() << "," << pf.GetMax() << std::endl;
return 1;
}
++c;
pf.SetBitsStored( 12 );
if( pf.GetMin() != values[c][0] || pf.GetMax() != values[c][1] )
{
std::cerr << pf.GetMin() << "," << pf.GetMax() << std::endl;
return 1;
}
++c;
pf.SetBitsStored( 16 );
if( pf.GetMin() != values[c][0] || pf.GetMax() != values[c][1] )
{
std::cerr << pf.GetMin() << "," << pf.GetMax() << std::endl;
return 1;
}
++c;
pf.SetBitsStored( 32 );
if( pf.GetMin() != values[c][0] || pf.GetMax() != values[c][1] )
{
std::cerr << pf.GetMin() << "," << pf.GetMax() << std::endl;
return 1;
}
// ++c;
// pf.SetBitsStored( 64 );
// if( pf.GetMin() != values[c][0] || pf.GetMax() != values[c][1] )
// {
// std::cerr << pf.GetMin() << "," << pf.GetMax() << std::endl;
// return 1;
// }
++c;
if ( c != n ) return 1;
for(unsigned int i = 0; i < PixelFormat::UNKNOWN; ++i)
{
PixelFormat::ScalarType st = (PixelFormat::ScalarType)i;
pf.SetScalarType( st );
gdcm::PixelFormat pf2 = st;
std::cout << pf << std::endl;
std::cout << pf.GetPixelRepresentation() << std::endl;
std::cout << pf.GetScalarTypeAsString() << std::endl;
if( pf2 != pf ) return 1;
}
// make to avoid user mistakes:
gdcm::PixelFormat pf3 = PixelFormat::UINT8;
if( pf3.GetBitsStored() != 8 ) return 1;
pf3.SetBitsStored( 32 );
// previous call should not execute
if( pf3.GetBitsStored() != 8 ) return 1;
pf3.SetHighBit( 8 );
if( pf3.GetHighBit() != 7 ) return 1;
gdcm::PixelFormat pf4 = PixelFormat::UINT16;
pf4.SetBitsStored(8);
if( pf4.GetScalarType() != gdcm::PixelFormat::UINT16 ) return 1;
pf4.SetPixelRepresentation(1);
if( pf4.GetScalarType() != gdcm::PixelFormat::INT16 ) return 1;
frame_info fi = {};
(void)fi;
return 0;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestFileStreamer5.cxx 000664 001766 001770 00000005313 14517730450 031471 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmFileStreamer.h"
#include "gdcmTesting.h"
#include "gdcmSystem.h"
#include "gdcmReader.h"
#include "gdcmDataSet.h"
#include "gdcmPrivateTag.h"
#include "gdcmFilename.h"
int TestFileStream5(const char *filename, bool verbose = false)
{
using namespace gdcm;
if( verbose )
std::cout << "Processing: " << filename << std::endl;
// Create directory first:
const char subdir[] = "TestFileStreamer5";
std::string tmpdir = Testing::GetTempDirectory( subdir );
if( !System::FileIsDirectory( tmpdir.c_str() ) )
{
System::MakeDirectory( tmpdir.c_str() );
//return 1;
}
std::string outfilename = Testing::GetTempFilename( filename, subdir );
if( verbose )
std::cout << "Generating: " << outfilename << std::endl;
gdcm::Filename fn( filename );
const char *name = fn.GetName();
// Special handling:
bool checktemplate = false;
if( strcmp(name, "DMCPACS_ExplicitImplicit_BogusIOP.dcm" ) == 0
|| strcmp(name, "ExplicitVRforPublicElementsImplicitVRforShadowElements.dcm") == 0
|| strcmp(name, "SIEMENS_MAGNETOM-12-MONO2-GDCM12-VRUN.dcm") == 0
)
{
checktemplate = true;
}
gdcm::FileStreamer fs;
fs.SetTemplateFileName( filename );
fs.CheckTemplateFileName( checktemplate );
fs.SetOutputFileName( outfilename.c_str() );
std::vector vbuffer;
vbuffer.resize( 8192 );
const char *buffer = vbuffer.data();
const size_t len = vbuffer.size();
PrivateTag pt( Tag(0x9,0x10), "MYTEST" );
fs.StartGroupDataElement( pt, 10 );
if( fs.AppendToGroupDataElement( pt, buffer, len ) )
{
std::cerr << "We should not succeed, we should fail this test" << std::endl;
return 1;
}
fs.StopGroupDataElement( pt );
return 0;
}
int TestFileStreamer5(int argc, char *argv[])
{
if( argc == 2 )
{
const char *filename = argv[1];
return TestFileStream5(filename, true);
}
// else
gdcm::Trace::DebugOff();
gdcm::Trace::WarningOff();
gdcm::Trace::ErrorOff();
int r = 0, i = 0;
const char *filename;
const char * const *filenames = gdcm::Testing::GetFileNames();
while( (filename = filenames[i]) )
{
r += TestFileStream5( filename );
++i;
}
return r;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestIconImage.cxx 000664 001766 001770 00000004524 14517730450 030660 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmIconImage.h"
// FIXME:
// gdcmData/US-GE-4AICL142.dcm has a private data element that is an Icon:
/*
(6003,0010) LO [GEMS_Ultrasound_ImageGroup_001] # 30, 1 PrivateCreator
(6003,1010) SQ (Sequence with explicit length #=1) # 12522, 1 Unknown Tag & Data
(fffe,e000) na (Item with explicit length #=15) # 12514, 1 Item
(0002,0010) UI =LittleEndianExplicit # 20, 1 TransferSyntaxUID
(0008,0008) CS [DERIVED\SECONDARY] # 18, 2 ImageType
(0008,2111) ST [SmallPreview] # 12, 1 DerivationDescription
(0028,0002) US 3 # 2, 1 SamplesPerPixel
(0028,0004) CS [RGB] # 4, 1 PhotometricInterpretation
(0028,0006) US 0 # 2, 1 PlanarConfiguration
(0028,0010) US 64 # 2, 1 Rows
(0028,0011) US 64 # 2, 1 Columns
(0028,0014) US 1 # 2, 1 UltrasoundColorDataPresent
(0028,0100) US 8 # 2, 1 BitsAllocated
(0028,0101) US 8 # 2, 1 BitsStored
(0028,0102) US 7 # 2, 1 HighBit
(0028,0103) US 0 # 2, 1 PixelRepresentation
(6003,0010) LO [GEMS_Ultrasound_ImageGroup_001] # 30, 1 PrivateCreator
(6003,1011) OB 00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00... # 12288, 1 Unknown Tag & Data
(fffe,e00d) na (ItemDelimitationItem for re-encoding) # 0, 0 ItemDelimitationItem
*/
int TestIconImage(int, char *[])
{
gdcm::IconImage icon;
return 0;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestOverlay2.cxx 000664 001766 001770 00000003431 14517730450 030524 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmOverlay.h"
#include "gdcmPixmapReader.h"
#include "gdcmTesting.h"
#include "gdcmSystem.h"
int TestOverlay2(int, char *[])
{
const char *extradataroot = gdcm::Testing::GetDataExtraRoot();
if( !extradataroot )
{
return 1;
}
if( !gdcm::System::FileIsDirectory(extradataroot) )
{
std::cerr << "No such directory: " << extradataroot << std::endl;
return 1;
}
std::string filename = extradataroot;
filename += "/gdcmSampleData/images_of_interest/XA_GE_JPEG_02_with_Overlays.dcm";
if( !gdcm::System::FileExists(filename.c_str()) )
{
return 1;
}
gdcm::PixmapReader reader;
reader.SetFileName( filename.c_str() );
if( !reader.Read() )
{
std::cerr << "could not read: " << filename << std::endl;
return 1;
}
gdcm::Pixmap &pixmap = reader.GetPixmap();
if( pixmap.GetNumberOfOverlays() != 8 )
{
return 1;
}
size_t numoverlays = pixmap.GetNumberOfOverlays();
for( size_t ovidx = 0; ovidx < numoverlays; ++ovidx )
{
const gdcm::Overlay& ov = pixmap.GetOverlay(ovidx);
if( ov.GetTypeAsEnum() != gdcm::Overlay::Graphics )
{
std::cerr << "Wrong Type for overlay #" << ovidx << std::endl;
return 1;
}
}
return 0;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestIconImageGenerator3.cxx 000664 001766 001770 00000044706 14517730450 032620 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmImageReader.h"
#include "gdcmImageWriter.h"
#include "gdcmFilename.h"
#include "gdcmSystem.h"
#include "gdcmFileMetaInformation.h"
#include "gdcmTesting.h"
#include "gdcmByteSwap.h"
#include "gdcmIconImageGenerator.h"
static const char * const iconimagearray3[][2] = {
{"18de6726bc64732057fb57ffa6f63482" , "SIEMENS_SOMATOM-12-ACR_NEMA-ZeroLengthUs.acr" },
{"e751b44ccfa55354e08ba04fade91687" , "gdcm-MR-SIEMENS-16-2.acr" },
{"a7ff57ec105e45b72d91ac750953befc" , "test.acr" },
{"464cc3218d282f534326f2323264f8ca" , "MR-MONO2-12-an2.acr" },
{"e23711964e5606b7cf8a9bf194e46a27" , "CT-MONO2-12-lomb-an2.acr" },
{"fc5db4e2e7fca8445342b83799ff16d8" , "LIBIDO-8-ACR_NEMA-Lena_128_128.acr" },
{"50ab781df5647feb681c6c24a1245d0d" , "gdcm-ACR-LibIDO.acr" },
{"ce338fe6899778aacfc28414f2d9498b" , "libido1.0-vol.acr" },
{"7acad6aa0274edfc797492128c2dd2bf" , "SIEMENS_CSA2.dcm" },
{"231db66c0b1a60cab9e8e879711ebc16" , "gdcm-JPEG-LossLessThoravision.dcm" },
{"353a62510cef13ce252f5e3a7ece54dc" , "XA-MONO2-8-12x-catheter.dcm" },
{"b992b65f8beed6adc2224541be339d68" , "gdcm-MR-PHILIPS-16-Multi-Seq.dcm" },
{"a9b91f5b18b1d7078ce597ec611a2c43" , "PHILIPS_GDCM12xBug.dcm" },
{"a0b26e46dc8920167cd6b9b5ed57d8df" , "MR_Philips_Intera_PrivateSequenceExplicitVR_in_SQ_2001_e05f_item_wrong_lgt_use_NOSHADOWSEQ.dcm" },
{"eff839f187f2dfa07204b6550a96d4b6" , "D_CLUNIE_CT1_J2KI.dcm" },
{"4f94be538667ad8d39abf42ee604bf7d" , "rle16sti.dcm" },
{"7acd654cb0176b7b6f1982245593e8e6" , "3E768EB7.dcm" },
{"6fe22e9a0983a07c5b1dde43373c36f3" , "D_CLUNIE_MR2_JPLY.dcm" },
{"f17269f3d2447ed0b523b41a98b03129" , "SIEMENS_MAGNETOM-12-MONO2-FileSeq1.dcm" },
{"311524ab5c9cb14812256c561c78e573" , "SIEMENS_MAGNETOM-12-MONO2-FileSeq0.dcm" },
{"35619ea28ae211558d526e63429d5cbb" , "MR_Philips_Intera_SwitchIndianess_noLgtSQItem_in_trueLgtSeq.dcm" },
{"a189258582a49855ae002d381016d02f" , "LEADTOOLS_FLOWERS-16-MONO2-Uncompressed.dcm" },
{"b9291915007d8fae5c2a67a691c33236" , "D_CLUNIE_MR3_JPLY.dcm" },
{"e2100ad66e70220df75ee60e9f69acdd" , "D_CLUNIE_VL2_RLE.dcm" },
{"985dd349809ef7d63feeb511a63b05d1" , "OsirixFake16BitsStoredFakeSpacing.dcm" },
{"046896d4baee6361e58217bd0a046162" , "GE_RHAPSODE-16-MONO2-JPEG-Fragments.dcm" },
{"54307dbe02cab5ee23efa8360eb0cbd5" , "MR_SIEMENS_forceLoad29-1010_29-1020.dcm" },
{"7e8bfa2560d883b45a0f868a81daac4d" , "fffc0000UN.dcm" },
{"00f59e7e071f7fdf7d2e700df06a1d6b" , "LIBIDO-24-ACR_NEMA-Rectangle.dcm" },
{"c1d31936337a3c65bba3edf67466a139" , "IM-0001-0066.CommandTag00.dcm" },
{"6d95a1855031ac5401ec2c8ba7ff8b18" , "D_CLUNIE_NM1_JPLY.dcm" },
{"046896d4baee6361e58217bd0a046162" , "D_CLUNIE_CT1_J2KR.dcm" },
{"a439396c24ce353e108bd0308e8a80e2" , "TheralysGDCM120Bug.dcm" },
{"e5155757353de1ad5c2b68c88fd34901" , "SIEMENS_MAGNETOM-12-MONO2-VRUN.dcm" },
{"338d45d1ee3ec0202cdfa637c491669a" , "THERALYS-12-MONO2-Uncompressed-Even_Length_Tag.dcm" },
{"5f90ef6a0621c658cfd2ae1f2bba351e" , "ALOKA_SSD-8-MONO2-RLE-SQ.dcm" },
{"c881ef5c9a6a643ac7e890279ffc010f" , "GE_GENESIS-16-MONO2-WrongLengthItem.dcm" },
{"13d97ddbcff7e14a89a6e5c337611881" , "US-RGB-8-esopecho.dcm" },
{"0464a1b7160b097ea33f25865cce8fc9" , "D_CLUNIE_MR4_RLE.dcm" },
{"3703d1695f0c02fa7a5cbe7142c8fc6f" , "D_CLUNIE_MR2_JPLL.dcm" },
{"f0b59feaa0499a68038b627f2df71d93" , "SIEMENS_Sonata-16-MONO2-Value_Multiplicity.dcm" },
{"a189258582a49855ae002d381016d02f" , "LEADTOOLS_FLOWERS-16-MONO2-JpegLossless.dcm" },
{"dcce1e8c7b5cdc15d315807b4ec2d34b" , "CT-MONO2-16-ankle.dcm" },
{"75c3cb93e002c788acc7eff4a93e2b5b" , "TOSHIBA_J2K_SIZ1_PixRep0.dcm" },
{"4e8c0f3b4154f54ae04756d61fb1c2f5" , "LEADTOOLS_FLOWERS-8-PAL-RLE.dcm" },
{"fc5db4e2e7fca8445342b83799ff16d8" , "simpleImageWithIcon.dcm" },
{"1c582b9b521c398ed55776bcd615af3e" , "CR-MONO1-10-chest.dcm" },
{"046896d4baee6361e58217bd0a046162" , "D_CLUNIE_CT1_RLE.dcm" },
{"f00d34662aeb08d14bcaf230053bfd5f" , "D_CLUNIE_NM1_JPLL.dcm" },
{"39faf30ee66e8c70dd2e772fcdbb1078" , "MR_GE_with_Private_Compressed_Icon_0009_1110.dcm" },
{"ce338fe6899778aacfc28414f2d9498b" , "NM-MONO2-16-13x-heart.dcm" },
{"5a4101fb01068d1b48afcacc9bca9f7e" , "US-IRAD-NoPreambleStartWith0003.dcm" },
{"3c18da99b3d3d53399d622aabdd96b64" , "MR-MONO2-16-head.dcm" },
{"4e8c0f3b4154f54ae04756d61fb1c2f5" , "LEADTOOLS_FLOWERS-8-PAL-Uncompressed.dcm" },
{"443c20bd84b91d30037ad1da84568c6e" , "MAROTECH_CT_JP2Lossy.dcm" },
{"488e407541a6c353f0540049ba36d61c" , "05115014-mr-siemens-avanto-syngo-with-palette-icone.dcm" },
{"50057b97e7c585ba31144867cd40c363" , "US-PAL-8-10x-echo.dcm" },
{"e189b6b3a44a8d929f654105f9842707" , "MR-SIEMENS-DICOM-WithOverlays.dcm" },
{"139f2ba3c6f578f883125d090163e730" , "D_CLUNIE_MR1_JPLL.dcm" },
{"046896d4baee6361e58217bd0a046162" , "D_CLUNIE_CT1_JPLL.dcm" },
{"bbc89a7b6e41d668f22b6e612cfb13e7" , "AMIInvalidPrivateDefinedLengthSQasUN.dcm" },
{"35619ea28ae211558d526e63429d5cbb" , "ExplicitVRforPublicElementsImplicitVRforShadowElements.dcm" },
{"8b2eca7c4d23a79a9e6d9437bff66d67" , "PHILIPS_Gyroscan-12-Jpeg_Extended_Process_2_4.dcm" },
{"4ef7021ed6522a730693574a37759940" , "D_CLUNIE_SC1_JPLY.dcm" },
{"ce338fe6899778aacfc28414f2d9498b" , "gdcm-MR-PHILIPS-16-NonSquarePixels.dcm" },
{"b92f9dcf1acd6dd998539d22a5296f74" , "SIEMENS-MR-RGB-16Bits.dcm" },
{"07c92897d0cbd052060f8a9d13a6386a" , "US-IRAD-NoPreambleStartWith0005.dcm" },
{"64b228a9c05e2f1b4a6371abf1ac7e21" , "PICKER-16-MONO2-Nested_icon.dcm" },
{"41d6ffef9d2edbad51c94a8d476bb1ab" , "gdcm-JPEG-Extended.dcm" },
{"5d8f3a1415c53f2b8b6ea459b4f3f6c1" , "D_CLUNIE_US1_RLE.dcm" },
{"d0dcc34bad0aa031269d3101fa044e4b" , "D_CLUNIE_RG2_JPLY.dcm" },
{"4a56065c6ab80bc0a32b39a143e58d5c" , "PHILIPS_Brilliance_ExtraBytesInOverlay.dcm" },
{"2888e58bfe4d11b2671f2cd6a35f9b7c" , "MR_ELSCINT1_00e1_1042_SQ_feff_00e0_Item.dcm" },
{"00d2f91bbf1f1d5c248f98220f85a860" , "TG18-CH-2k-01.dcm" },
{"a189258582a49855ae002d381016d02f" , "LEADTOOLS_FLOWERS-16-MONO2-RLE.dcm" },
{"703d03c5fb65c9493775c7ed6a9aa001" , "OT-PAL-8-face.dcm" },
{"12919f48891b07e74651efd5a2a52676" , "LEADTOOLS_FLOWERS-24-RGB-JpegLossy.dcm" },
{"94e0346dc7594b042c6e67a0f8ebfa71" , "SIEMENS_MAGNETOM-12-MONO2-Uncompressed.dcm" },
{"06148d96de1833da4518b6d97fdd4165" , "GDCMJ2K_TextGBR.dcm" },
{"59f3e40cbdd708b43dd818a953bd5ca0" , "MR16BitsAllocated_8BitsStored.dcm" },
{"fe4ee9d2fc8f068c7e5b61e8dc90811d" , "GE_GENESIS-16-MONO2-Uncompressed-UnusualVR.dcm" },
{"046896d4baee6361e58217bd0a046162" , "D_CLUNIE_CT1_JLSL.dcm" },
{"9f04eeafdcd85d84cc6f8edad761e3a1" , "ELSCINT1_JP2vsJ2K.dcm" },
{"531bfd1059c6396e9da4c9a4f5436e86" , "D_CLUNIE_XA1_JPLL.dcm" },
{"12ea2d93daec9fda8f26666dbaf21c30" , "SIEMENS_Sonata-12-MONO2-SQ.dcm" },
{"acf0d5ea13eb09415ffe3ec2d0800590" , "JPEGDefinedLengthSequenceOfFragments.dcm" },
{"6b9e6ee648acb3ca92814bc6642d0b96" , "PHILIPS_GDCM12xBug2.dcm" },
{"ce338fe6899778aacfc28414f2d9498b" , "ITK_GDCM124_MultiframeSecondaryCaptureInvalid.dcm" },
{"941378c3e000b34264342b1d46ce6dce" , "D_CLUNIE_RG2_JPLL.dcm" },
{"9efc87377ac56dd01476046bbbd5bf7b" , "FUJI-10-MONO1-ACR_NEMA_2.dcm" },
{"99b4254ecb0b4075b8005b775b02bea1" , "D_CLUNIE_MR1_JPLY.dcm" },
{"531bfd1059c6396e9da4c9a4f5436e86" , "D_CLUNIE_XA1_RLE.dcm" },
{"8058ebaf622a0108d12a387c75de5aae" , "BugGDCM2_UndefItemWrongVL.dcm" },
{"e751b44ccfa55354e08ba04fade91687" , "SIEMENS_MAGNETOM-12-ACR_NEMA_2-Modern.dcm" },
{"c860f1795d0be70b310f5b653b34f06f" , "JDDICOM_Sample2.dcm" },
{"5fcd3432874ea0f3cbc59a317534a0b0" , "TOSHIBA_MRT150-16-MONO2-ACR_NEMA_2.dcm" },
{"ce338fe6899778aacfc28414f2d9498b" , "DCMTK_JPEGExt_12Bits.dcm" },
{"7abf9227edf8f7106198b320c5daa538" , "US-MONO2-8-8x-execho.dcm" },
{"16fff764b95a60d83e4b6781da292cea" , "UnexpectedSequenceDelimiterInFixedLengthSequence.dcm" },
{"d600407a5f79393f294518be3bba7fed" , "ACUSON-24-YBR_FULL-RLE-b.dcm" },
{"eb1c07547d036c3f778700cfef1ad24c" , "gdcm-US-ALOKA-16.dcm" },
{"9805da917d916632cf3a22b6b9140bce" , "DX_J2K_0Padding.dcm" },
{"4d6a3590ae425105315a0995f8a7da41" , "D_CLUNIE_CT2_RLE.dcm" },
{"f1b14732b392da7ea5fba9b47225945c" , "D_CLUNIE_RG1_JPLL.dcm" },
{"86362d24addeeaaa8b1b4e485ff49ea7" , "D_CLUNIE_VL3_RLE.dcm" },
{"5d590fa042089bbd62f771e403ad3068" , "NM_Kakadu44_SOTmarkerincons.dcm" },
{"790f684146906a7f0b9d8c3838066579" , "CT-SIEMENS-Icone-With-PaletteColor.dcm" },
{"336e557af65d34ae7cb5dcc18582b12b" , "GE_DLX-8-MONO2-PrivateSyntax.dcm" },
{"848ee1315da8c58064a685e70378dae5" , "CT_16b_signed-UsedBits13.dcm" },
{"29db994be059e339ab881eb760878a54" , "D_CLUNIE_RG3_JPLY.dcm" },
{"d1bd49bdf8ce55652f7802f8f8820f97" , "DX_GE_FALCON_SNOWY-VOI.dcm" },
{"7dcb5cdba4bfc242dbcc0d275ad14970" , "PrivateGEImplicitVRBigEndianTransferSyntax16Bits.dcm" },
{"d66fddd6bc26af655f500cd37de3b135" , "CT-MONO2-16-brain.dcm" },
{"351d2c3befec588fe7798ae0884908e7" , "D_CLUNIE_VL4_RLE.dcm" },
{"97e8c927ca201a2f932b5b3ecc6453e5" , "D_CLUNIE_MR3_RLE.dcm" },
{"bbb1be6461a9c8b1a0fd507b5c19ec20" , "undefined_length_un_vr.dcm" },
{"ae8fe4406652ca3e6b93d2ade029d94e" , "CT-MONO2-16-ort.dcm" },
{"ab976b85e44c2332d826067520f6c2e6" , "05148044-mr-siemens-avanto-syngo.dcm" },
{"8a9c001007c43fff520fada2b75e1e72" , "GE_LOGIQBook-8-RGB-HugePreview.dcm" },
{"3808ac31fbf6ede5d0a1ca47ff604f8d" , "RadBWLossLess.dcm" },
{"0ceae99a40ae6ee2ad5cf1fa06a86820" , "KODAK-12-MONO1-Odd_Terminated_Sequence.dcm" },
{"e8dd9e61c1eb37c4ab54003ef9fd2842" , "CT-MONO2-16-chest.dcm" },
{"63808ab2b6faa36b6914e01907358eb7" , "PhilipsInteraSeqTermInvLen.dcm" },
{"3a1f7960887aa18084a6f7347926c8b5" , "D_CLUNIE_MR4_JPLY.dcm" },
{"91c2703f4a5dec2d780539c29b450d47" , "D_CLUNIE_RG3_JPLL.dcm" },
{"96f9a1224838a0695b3d2cc8b0b26b97" , "MR_Philips-Intera_BreaksNOSHADOW.dcm" },
{"c75d2a8866ccdb2a96f7634bcc81adef" , "GE_CT_With_Private_compressed-icon.dcm" },
{"4c600037ef23dbf2da360db9f8d7e28b" , "TOSHIBA_J2K_OpenJPEGv2Regression.dcm" },
{"6c004779f7e43673883f04742aae9541" , "D_CLUNIE_CT1_JLSN.dcm" },
{"e5155757353de1ad5c2b68c88fd34901" , "SIEMENS_MAGNETOM-12-MONO2-GDCM12-VRUN.dcm" },
{"afccf775abd15a6c053c7f134b204762" , "00191113.dcm" },
{"9670e5f8c163087d75cc4044356359c3" , "MARCONI_MxTWin-12-MONO2-JpegLossless-ZeroLengthSQ.dcm" },
{"ac1abc22d5d52b21c74c9f34b6178cd1" , "SignedShortLosslessBug.dcm" },
{"0f5efe869ef6b9846707e89fbef18f2c" , "GE_DLX-8-MONO2-Multiframe.dcm" },
{"6763fff05fa5b5dc2b842a40573b18a3" , "PHILIPS_Gyroscan-12-MONO2-Jpeg_Lossless.dcm" },
{"10151c9ee27d40cfd58f0d79e693f38e" , "LJPEG_BuginGDCM12.dcm" },
{"d1779fd58242dc231aa021cbd9687b04" , "SIEMENS_MAGNETOM-12-MONO2-FileSeq3.dcm" },
{"91c2703f4a5dec2d780539c29b450d47" , "D_CLUNIE_RG3_RLE.dcm" },
{"ab0815dcb84bd5a42972134ea9c0493d" , "CT-SIEMENS-MissingPixelDataInIconSQ.dcm" },
{"3703d1695f0c02fa7a5cbe7142c8fc6f" , "MR-MONO2-12-shoulder.dcm" },
{"5a898d46c28350c4f55b9915b9001852" , "LEADTOOLS_FLOWERS-24-RGB-Uncompressed.dcm" },
{"654e4af3861f475c16bf498efc5df861" , "PICKER-16-MONO2-No_DicomV3_Preamble.dcm" },
{"885cd1e48a980257534d3c88380ec259" , "SIEMENS_MOSAIC_12BitsStored-16BitsJPEG.dcm" },
{"dbe025b7a22b829898b6eb2b35580171" , "CT-MONO2-8-abdo.dcm" },
{"97e8c927ca201a2f932b5b3ecc6453e5" , "D_CLUNIE_MR3_JPLL.dcm" },
{"5cffc4c262df7534f4008aa49aaef3ae" , "D_CLUNIE_VL6_RLE.dcm" },
{"a189258582a49855ae002d381016d02f" , "LEADTOOLS_FLOWERS-8-MONO2-RLE.dcm" },
{"051d73b41bb387005e1dbcc3af7253b3" , "PHILIPS_Gyroscan-8-MONO2-Odd_Sequence.dcm" },
{"e20e59c88037bbe676e8c67bee2a9540" , "TOSHIBA_J2K_SIZ0_PixRep1.dcm" },
{"ca3a2e9d6d2813df183a9fd9c9d2e9a1" , "SIEMENS-12-Jpeg_Process_2_4-Lossy-a.dcm" },
{"f073eb11257017c6422158aa5cfb372c" , "gdcm-JPEG-LossLess3a.dcm" },
{"9b2dfd69af52cd8625fe1faa73f51493" , "D_CLUNIE_XA1_JPLY.dcm" },
{"f1b14732b392da7ea5fba9b47225945c" , "D_CLUNIE_RG1_RLE.dcm" },
{"8b86324f5b7b88f06dffe975a06f1544" , "US-RGB-8-epicard.dcm" },
{"5a478d37f436a6687a07fd43aaef79ee" , "GE_MR_0025xx1bProtocolDataBlock.dcm" },
{"43d75fbe29085c5760d6ff4c083a9726" , "rle16loo.dcm" },
{"cbebb7b25f11a1c39194566b194e84e5" , "DMCPACS_ExplicitImplicit_BogusIOP.dcm" },
{"4d6a3590ae425105315a0995f8a7da41" , "D_CLUNIE_CT2_JPLL.dcm" },
{"c860f1795d0be70b310f5b653b34f06f" , "JDDICOM_Sample2-dcmdjpeg.dcm" },
{"35619ea28ae211558d526e63429d5cbb" , "MR_Philips_Intera_No_PrivateSequenceImplicitVR.dcm" },
{"2f2f0a482fc0c1b8d99db02a57122b22" , "KODAK_CompressedIcon.dcm" },
{"1b28808b244d86f4b6ec626b4d538680" , "ACUSON-24-YBR_FULL-RLE.dcm" },
{"3703d1695f0c02fa7a5cbe7142c8fc6f" , "D_CLUNIE_MR2_RLE.dcm" },
{"22a67114d4ae8e036665e1a1a508ca8d" , "JPEG_LossyYBR.dcm" },
{"3646c27f6fb60d66ab916934d331d550" , "012345.002.050.dcm" },
{"941378c3e000b34264342b1d46ce6dce" , "D_CLUNIE_RG2_RLE.dcm" },
{"0ba3c7de165ffe7fb43733f25de2fdf1" , "MR_Philips_Intera_PrivateSequenceImplicitVR.dcm" },
{"e344c9a95328db382caf8a7b86c91992" , "SIEMENS_ImageLocationUN.dcm" },
{"35619ea28ae211558d526e63429d5cbb" , "PHILIPS_Intera-16-MONO2-Uncompress.dcm" },
{"42aa4fa1ac9421f083927baaf7230cf6" , "MR-SIEMENS-DICOM-WithOverlays-extracted-overlays.dcm" },
{"5a898d46c28350c4f55b9915b9001852" , "LEADTOOLS_FLOWERS-24-RGB-JpegLossless.dcm" },
{"00e15542d31e48490442eb4c336103e8" , "US-GE-4AICL142.dcm" },
{"2bacf42b57e957883e35451c5ff26f50" , "D_CLUNIE_SC1_RLE.dcm" },
{"0464a1b7160b097ea33f25865cce8fc9" , "D_CLUNIE_MR4_JPLL.dcm" },
{"9b801c57776e5f7c4b45f2c6c47795d8" , "MR-Brucker-CineTagging-NonSquarePixels.dcm" },
{"373a42fc21d411b4c060d2cf2a4e85f4" , "MR-MONO2-8-16x-heart.dcm" },
{"6e9d26218dce3f54b41efbe442a2154b" , "LEADTOOLS_FLOWERS-8-MONO2-JpegLossy.dcm" },
{"ccda9f1170c12f443d83990e9777ca8e" , "GE_DLX-8-MONO2-Multiframe-Jpeg_Lossless.dcm" },
{"f00d34662aeb08d14bcaf230053bfd5f" , "D_CLUNIE_NM1_RLE.dcm" },
{"a2b00a80955b1f368dcff51264b9e2e7" , "D_CLUNIE_VL1_RLE.dcm" },
{"f00ef30b32dd57515c2c0d5c921c6ee1" , "SIEMENS_MAGNETOM-12-MONO2-FileSeq2.dcm" },
{"0638ee027ccf94fd7ecca641b6fd402c" , "DermaColorLossLess.dcm" },
{"5340e9111251343c6a932992241b299e" , "OT-MONO2-8-a7.dcm" },
{"139f2ba3c6f578f883125d090163e730" , "D_CLUNIE_MR1_RLE.dcm" },
{"a189258582a49855ae002d381016d02f" , "LEADTOOLS_FLOWERS-8-MONO2-Uncompressed.dcm" },
{"afccf775abd15a6c053c7f134b204762" , "00191113.dcm" },
{"f4f35d60b3cc18aaa6d8d92f0cd3708a" , "NM-PAL-16-PixRep1.dcm" },
{"843f097f2161014cd1b11be5413eace9" , "MEDILABInvalidCP246_EVRLESQasUN.dcm" },
{"c103d405ae61aa4ed148e17157e5afc1" , "JPEGInvalidSecondFrag.dcm" },
{"c103d405ae61aa4ed148e17157e5afc1" , "Osirix10vs8BitsStored.dcm" },
{"c103d405ae61aa4ed148e17157e5afc1" , "Bug_Siemens_PrivateIconNoItem.dcm" },
{"c103d405ae61aa4ed148e17157e5afc1" , "HardcopyColor_YBR_RCT_J2K_PC1.dcm" },
{"c103d405ae61aa4ed148e17157e5afc1" , "PET-GE-dicomwrite-PixelDataSQUNv2.dcm" },
// sentinel
{ 0, 0 }
};
namespace gdcm
{
int TestIconImageGenerate3(const char *subdir, const char* filename, bool verbose = false)
{
ImageReader reader;
reader.SetFileName( filename );
if ( !reader.Read() )
{
const FileMetaInformation &header = reader.GetFile().GetHeader();
MediaStorage ms = header.GetMediaStorage();
bool isImage = MediaStorage::IsImage( ms );
bool pixeldata = reader.GetFile().GetDataSet().FindDataElement( Tag(0x7fe0,0x0010) );
if( isImage && pixeldata )
{
std::cerr << "Failed to read: " << filename << std::endl;
return 1;
}
else
{
// not an image give up...
std::cerr << "Problem with: " << filename << " but that's ok" << std::endl;
return 0;
}
}
// Create directory first:
std::string tmpdir = Testing::GetTempDirectory( subdir );
if( !System::FileIsDirectory( tmpdir.c_str() ) )
{
System::MakeDirectory( tmpdir.c_str() );
//return 1;
}
std::string outfilename = Testing::GetTempFilename( filename, subdir );
IconImageGenerator iig;
iig.SetPixmap( reader.GetImage() );
iig.ConvertRGBToPaletteColor( false );
const unsigned int idims[2] = { 128, 128};
//const unsigned int idims[2] = { 552,421 };
iig.SetOutputDimensions( idims );
bool b = iig.Generate();
gdcm::Filename fn( filename );
const char *name = fn.GetName();
unsigned int i = 0;
const char *p = iconimagearray3[i][1];
while( p != 0 )
{
if( strcmp( name, p ) == 0 )
{
break;
}
++i;
p = iconimagearray3[i][1];
}
const char *refmd5 = iconimagearray3[i][0];
if( b )
{
const gdcm::IconImage &icon = iig.GetIconImage();
if( verbose ) icon.Print( std::cout );
unsigned long len = icon.GetBufferLength();
std::vector< char > vbuffer;
vbuffer.resize( len );
char *buffer = &vbuffer[0];
bool res2 = icon.GetBuffer(buffer);
if( !res2 )
{
std::cerr << "res2 failure:" << filename << std::endl;
return 1;
}
char digest[33];
gdcm::Testing::ComputeMD5(buffer, len, digest);
Image & img = reader.GetImage();
img.SetIconImage( iig.GetIconImage() );
ImageWriter writer;
writer.SetFileName( outfilename.c_str() );
#if 1
writer.SetImage( img );
#else
Image &ii = writer.GetImage();
(Bitmap&)ii = iig.GetIconImage();
#endif
if( !writer.Write() )
{
std::cerr << "Failed to write: " << outfilename << std::endl;
return 1;
}
if( verbose )
{
std::cout << "success: " << outfilename << std::endl;
std::cout << "ref=" << refmd5 << std::endl;
std::cout << "md5=" << digest << std::endl;
}
if( !refmd5 )
{
std::cerr << " missing md5= {\"" << digest << "\" , \"" << name << "\" }," << std::endl;
return 1;
}
if( strcmp( refmd5, digest) )
{
std::cerr << "Problem with : " << name << " " << refmd5 << " vs " << digest << std::endl;
return 1;
}
}
else
{
assert( refmd5 == 0 );
std::cerr << "Could not generate Icon for: " << filename << std::endl;
return 1;
}
return 0;
}
}
int TestIconImageGenerator3(int argc, char *argv[])
{
if( argc == 2 )
{
const char *filename = argv[1];
return gdcm::TestIconImageGenerate3(argv[0],filename, true);
}
// else
gdcm::Trace::DebugOff();
gdcm::Trace::WarningOff();
gdcm::Trace::ErrorOff();
int r = 0, i = 0;
const char *filename;
const char * const *filenames = gdcm::Testing::GetFileNames();
while( (filename = filenames[i]) )
{
r += gdcm::TestIconImageGenerate3(argv[0], filename );
++i;
}
return r;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestPrinter2.cxx 000664 001766 001770 00000003545 14517730450 030534 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmReader.h"
#include "gdcmPrinter.h"
#include "gdcmFilename.h"
#include "gdcmTesting.h"
#include "gdcmGlobal.h"
#include "gdcmDicts.h"
/*
This test exercise a very obscure section of gdcm::Printer
when it handles a SQ when it is hidden as VR::UN + undefined
length which means this is a Implicit VR Little Endian
encoded SQ in an Explicit VR Little Endian DataSet
*/
int TestPrinter2(int , char *[])
{
const char *directory = gdcm::Testing::GetDataRoot();
std::string filename = std::string(directory) + "/undefined_length_un_vr.dcm";
gdcm::Reader r;
r.SetFileName( filename.c_str() );
if( !r.Read() )
{
return 1;
}
gdcm::Printer print;
print.SetFile( r.GetFile() );
std::ostringstream out;
print.Print( out );
gdcm::Global &g = gdcm::Global::GetInstance();
gdcm::Dicts &dicts = g.GetDicts();
gdcm::PrivateDict &priv_dict = dicts.GetPrivateDict();
gdcm::PrivateTag pt(0x2001,0x005f,"Philips Imaging DD 001");
if( !priv_dict.RemoveDictEntry( pt ) )
{
return 1;
}
gdcm::Reader r2;
r2.SetFileName( filename.c_str() );
if( !r2.Read() )
{
return 1;
}
gdcm::Printer print2;
print2.SetFile( r.GetFile() );
std::ostringstream out2;
print2.Print( out2 );
// if( out2.str() != out.str() )
// {
// return 1;
// }
return 0;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestCopyDataSet.cxx 000664 001766 001770 00000003547 14517730450 031211 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmReader.h"
#include "gdcmDataSet.h"
#include "gdcmWriter.h"
#include "gdcmTesting.h"
int TestCopyDataSet(int, char *[])
{
std::string dataroot = gdcm::Testing::GetDataRoot();
std::string filename = dataroot + "/test.acr";
gdcm::Reader reader;
reader.SetFileName( filename.c_str() );
if ( !reader.Read() )
{
return 1;
}
const gdcm::DataSet &ds = reader.GetFile().GetDataSet();
gdcm::DataSet ds_copy = ds;
gdcm::DataElement n( gdcm::Tag(0x0028,0x0005) );
n.SetByteValue( "3", 1 );
std::cout << n << std::endl;
ds_copy.Replace( n );
std::cout << ds_copy << std::endl;
// roup="0018" element="1020" vr="LO" vm="1-n" na
gdcm::DataElement n2( gdcm::Tag(0x0018,0x1020) );
//const char versions[] = "1234567890\\1234567890\\1234567890\\1234567890\\1234567890\\1234567890";
const char versions[] = "12345678901234567890123456789012345678901234567890123\\45678901234567890";
n2.SetByteValue( versions, (uint32_t)strlen(versions) );
ds_copy.Replace( n2 );
std::string outfilename = gdcm::Testing::GetTempFilename( "TestCopyDataSet.dcm" );
gdcm::Writer writer;
writer.SetFile( reader.GetFile() );
writer.GetFile().GetDataSet().Replace( n2 );
writer.SetFileName( outfilename.c_str() );
writer.SetCheckFileMetaInformation( false );
writer.Write();
return 0;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestFileExplicitFilter.cxx 000664 001766 001770 00000006253 14517730450 032555 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmFileExplicitFilter.h"
#include "gdcmReader.h"
#include "gdcmWriter.h"
#include "gdcmTesting.h"
#include "gdcmSystem.h"
int TestFileExplicitFilt(const char *subdir, const char *filename, bool verbose = false)
{
if( verbose )
std::cerr << "Reading: " << filename << std::endl;
gdcm::Reader reader;
reader.SetFileName( filename );
if ( !reader.Read() )
{
std::cerr << "could not read: " << filename << std::endl;
return 1;
}
//const gdcm::FileMetaInformation &h = reader.GetFile().GetHeader();
//const gdcm::DataSet &ds = reader.GetFile().GetDataSet();
gdcm::FileExplicitFilter im2ex;
im2ex.SetFile( reader.GetFile() );
if( !im2ex.Change() )
{
std::cerr << "Could not im2ex change: " << filename << std::endl;
return 1;
}
// Create directory first:
std::string tmpdir = gdcm::Testing::GetTempDirectory( subdir );
if( !gdcm::System::FileIsDirectory( tmpdir.c_str() ) )
{
gdcm::System::MakeDirectory( tmpdir.c_str() );
//return 1;
}
std::string outfilename = gdcm::Testing::GetTempFilename( filename, subdir );
gdcm::Writer writer;
writer.SetFileName( outfilename.c_str() );
writer.SetFile( reader.GetFile() );
writer.SetCheckFileMetaInformation( false );
if( !writer.Write() )
{
std::cerr << "Failed to write: " << outfilename << std::endl;
return 1;
}
if(verbose)
std::cerr << "write out: " << outfilename << std::endl;
char digest1[33] = {};
char digest2[33] = {};
bool b1 = gdcm::Testing::ComputeFileMD5(filename, digest1);
if( !b1 )
{
std::cerr << "Could not compute md5:" << filename << std::endl;
return 1;
}
bool b2 = gdcm::Testing::ComputeFileMD5(outfilename.c_str(), digest2);
if( !b2 )
{
std::cerr << "Could not compute md5:" << outfilename << std::endl;
return 1;
}
if( strcmp(digest1, digest2 ) == 0 )
{
// Easy case input file was explicit
return 0;
}
else
{
if(verbose)
{
std::cerr << "input file contained wrong VR: " << filename << std::endl;
std::cerr << "see: " << outfilename << std::endl;
}
}
return 0;
}
int TestFileExplicitFilter(int argc, char *argv[])
{
if( argc == 2 )
{
const char *filename = argv[1];
return TestFileExplicitFilt(argv[0], filename, true);
}
// else
// First of get rid of warning/debug message
gdcm::Trace::DebugOff();
gdcm::Trace::WarningOff();
int r = 0, i = 0;
const char *filename;
const char * const *filenames = gdcm::Testing::GetFileNames();
while( (filename = filenames[i]) )
{
r += TestFileExplicitFilt( argv[0], filename );
++i;
}
return r;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestDirectionCosines.cxx 000664 001766 001770 00000012663 14517730450 032274 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmDirectionCosines.h"
#include
#include
/*
* Let's use the CrossDot API to compare IOP safely
*/
static const char * ImageOrientationPatientList[] = {
R"(0.999081\0.0426953\0.00369275\-0.0419025\0.955059\0.293439)",
R"(0.999081\0.0426953\0.00369272\-0.0419025\0.955059\0.293439)",
R"(0.999081\0.0426953\0.00369275\-0.0419025\0.955059\0.293439)",
R"(0.999081\0.0426953\0.00369272\-0.0419025\0.955059\0.293439)",
R"(0.999081\0.0426953\0.00369275\-0.0419025\0.955059\0.293439)",
R"(0.999081\0.0426952\0.00369272\-0.0419025\0.955059\0.293439)",
R"(0.999081\0.0426953\0.00369272\-0.0419025\0.955059\0.293439)",
R"(0.999081\0.0426953\0.00369274\-0.0419025\0.955059\0.293439)",
R"(0.999081\0.0426953\0.00369274\-0.0419025\0.955059\0.293439)",
R"(0.999081\0.0426953\0.00369272\-0.0419025\0.955059\0.293439)",
R"(0.999081\0.0426953\0.00369272\-0.0419025\0.955059\0.293439)",
R"(0.999081\0.0426953\0.00369273\-0.0419025\0.955059\0.293439)",
R"(0.999081\0.0426953\0.00369273\-0.0419025\0.955059\0.293439)",
R"(0.999081\0.0426953\0.00369273\-0.0419025\0.955059\0.293439)",
R"(0.999081\0.0426952\0.00369273\-0.0419025\0.955059\0.293439)",
R"(0.999081\0.0426953\0.00369273\-0.0419025\0.955059\0.293439)",
R"(0.999081\0.0426953\0.00369273\-0.0419025\0.955059\0.293439)",
R"(0.999081\0.0426953\0.00369273\-0.0419025\0.955059\0.293439)",
R"(0.999081\0.0426953\0.00369273\-0.0419025\0.955059\0.293439)",
R"(0.999081\0.0426953\0.00369273\-0.0419025\0.955059\0.293439)",
R"(0.999081\0.0426953\0.00369273\-0.0419025\0.955059\0.293439)",
R"(0.999081\0.0426953\0.00369273\-0.0419025\0.955059\0.293439)",
R"(0.999081\0.0426952\0.00369273\-0.0419025\0.955059\0.293439)",
R"(0.999081\0.0426953\0.00369273\-0.0419025\0.955059\0.293439)",
R"(0.999081\0.0426953\0.00369273\-0.0419025\0.955059\0.293439)",
R"(0.999081\0.0426953\0.00369274\-0.0419025\0.955059\0.293439)",
R"(0.999081\0.0426953\0.00369274\-0.0419025\0.955059\0.293439)",
R"(0.999081\0.0426953\0.00369274\-0.0419025\0.955059\0.293439)",
R"(0.999081\0.0426953\0.00369275\-0.0419025\0.955059\0.293439)",
R"(0.999081\0.0426953\0.00369272\-0.0419025\0.955059\0.293439)",
R"(0.999081\0.0426953\0.00369275\-0.0419025\0.955059\0.293439)",
R"(0.999081\0.0426953\0.00369272\-0.0419025\0.955059\0.293439)",
R"(0.999081\0.0426953\0.00369275\-0.0419025\0.955059\0.293439)",
R"(0.999081\0.0426952\0.00369272\-0.0419025\0.955059\0.293439)",
R"(0.999081\0.0426953\0.00369272\-0.0419025\0.955059\0.293439)",
R"(0.999081\0.0426953\0.00369274\-0.0419025\0.955059\0.293439)",
R"(0.999081\0.0426953\0.00369274\-0.0419025\0.955059\0.293439)",
R"(0.999081\0.0426953\0.00369272\-0.0419025\0.955059\0.293439)",
R"(0.999081\0.0426953\0.00369272\-0.0419025\0.955059\0.293439)",
R"(0.999081\0.0426953\0.00369273\-0.0419025\0.955059\0.293439)",
R"(0.999081\0.0426953\0.00369273\-0.0419025\0.955059\0.293439)",
R"(0.999081\0.0426953\0.00369273\-0.0419025\0.955059\0.293439)",
R"(0.999081\0.0426952\0.00369273\-0.0419025\0.955059\0.293439)",
R"(0.999081\0.0426953\0.00369273\-0.0419025\0.955059\0.293439)",
R"(0.999081\0.0426953\0.00369273\-0.0419025\0.955059\0.293439)",
R"(0.999081\0.0426953\0.00369273\-0.0419025\0.955059\0.293439)",
R"(0.999081\0.0426953\0.00369273\-0.0419025\0.955059\0.293439)",
R"(0.999081\0.0426953\0.00369273\-0.0419025\0.955059\0.293439)",
R"(0.999081\0.0426953\0.00369273\-0.0419025\0.955059\0.293439)",
R"(0.999081\0.0426953\0.00369273\-0.0419025\0.955059\0.293439)",
R"(0.999081\0.0426952\0.00369273\-0.0419025\0.955059\0.293439)",
R"(0.999081\0.0426953\0.00369273\-0.0419025\0.955059\0.293439)",
R"(0.999081\0.0426953\0.00369273\-0.0419025\0.955059\0.293439)",
R"(0.999081\0.0426953\0.00369274\-0.0419025\0.955059\0.293439)",
R"(0.999081\0.0426953\0.00369274\-0.0419025\0.955059\0.293439)",
R"(0.999081\0.0426953\0.00369274\-0.0419025\0.955059\0.293439)",
};
bool TestCrossDot()
{
std::set< std::string > myset;
const unsigned int nipp = sizeof(ImageOrientationPatientList) / sizeof(*ImageOrientationPatientList);
for( unsigned int i = 0; i < nipp; ++i )
{
myset.insert( ImageOrientationPatientList[i] );
}
if( myset.size() <= 1 ) return false;
std::set< std::string >::const_iterator it = myset.begin();
gdcm::DirectionCosines ref;
gdcm::DirectionCosines dc;
for( ; it != myset.end(); ++it )
{
ref.SetFromString( it->c_str() );
for( unsigned int i = 0; i < nipp; ++i )
{
dc.SetFromString( ImageOrientationPatientList[i] );
const double crossdot = ref.CrossDot( dc);
const double eps = 1. - crossdot;
if( eps > 1e-6 || eps < 0 ) return false;
}
}
return true;
}
int TestDirectionCosines(int, char *[])
{
gdcm::DirectionCosines dc;
//const double *dircos = dc;
if( !dc.IsValid() )
{
return 1;
}
const double cross[3] = {0,0,1};
double z[3];
dc.Cross(z);
if( z[0] != cross[0]
|| z[1] != cross[1]
|| z[2] != cross[2] )
{
return 1;
}
bool b = TestCrossDot();
if( !b ) return 1;
return 0;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestPersonName.cxx 000664 001766 001770 00000006147 14517730450 031077 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmPersonName.h"
#include "gdcmByteValue.h"
#include
int TestPersonName(int, char *[])
{
using PN = gdcm::PersonName;
PN pn0;
pn0.SetComponents();
std::cout << "NumComp:" << pn0.GetNumberOfComponents() << std::endl;
pn0.Print( std::cout );
std::cout << std::endl;
PN pn00 = {{ "" }};
std::cout << "NumComp:" << pn00.GetNumberOfComponents() << std::endl;
PN pn1 = {{ "abc123", "def", "ghi", "klm", "opq" }};
pn1.Print( std::cout );
std::cout << std::endl;
std::cout << "NumComp:" << pn1.GetNumberOfComponents() << std::endl;
PN pn2 = {{ "malaterre", "mathieu olivier patrick"}};
pn2.Print( std::cout );
std::cout << std::endl;
std::cout << "NumComp:" << pn2.GetNumberOfComponents() << std::endl;
// Rev. John Robert Quincy Adams, B.A. M.Div. Adams^John Robert Quincy^^Rev.^B.A. M.Div. [One family name; three given names; no middle name; one prefix; two suffixes.]
PN pn3 = {{ "Adams", "John Robert Quincy", "", "Rev.", "B.A. M.Div." }};
pn3.Print( std::cout );
std::cout << std::endl;
std::cout << "NumComp:" << pn3.GetNumberOfComponents() << std::endl;
// Susan Morrison-Jones, Ph.D., Chief Executive Officer Morrison-Jones^Susan^^^Ph.D., Chief Executive Officer [Two family names; one given name; no middle name; no prefix; two suffixes.]
PN pn4 = {{ "Morrison-Jones", "Susan", "", "", "Ph.D., Chief Executive Officer" }};
pn4.Print( std::cout );
std::cout << std::endl;
std::cout << "NumComp:" << pn4.GetNumberOfComponents() << std::endl;
// John Doe Doe^John [One family name; one given name; no middle name, prefix, or suffix. Delimiters have been omitted for the three trailing null components.]
PN pn5 = {{ "Doe", "John" }};
pn5.Print( std::cout );
std::cout << std::endl;
std::cout << "NumComp:" << pn5.GetNumberOfComponents() << std::endl;
// (for examples of the encoding of Person Names using multi-byte character sets see Annex H)
// Smith^Fluffy [A cat, rather than a
//human, whose responsible party family name is Smith, and whose own name is Fluffy]
PN pn6 = {{ "Smith", "Fluffy" }};
pn6.Print( std::cout );
std::cout << std::endl;
std::cout << "NumComp:" << pn6.GetNumberOfComponents() << std::endl;
//ABC Farms^Running on Water [A horse whose responsible organization is named ABC Farms, and whose name is Running On Water]
PN pn7 = {{ "ABC Farms", "Running on Water" }};
pn7.Print( std::cout );
std::cout << std::endl;
std::cout << "NumComp:" << pn7.GetNumberOfComponents() << std::endl;
gdcm::ByteValue bv;
PN pn8;
pn8.SetBlob( bv );
return 0;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestStringFilter2.cxx 000664 001766 001770 00000004511 14517730450 031517 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmStringFilter.h"
#include "gdcmReader.h"
#include "gdcmSequenceOfItems.h"
#include "gdcmTesting.h"
#include "gdcmTrace.h"
static int TestStringFilt(const char *filename)
{
gdcm::StringFilter sf;
gdcm::Reader r;
r.SetFileName( filename );
if( !r.Read() )
{
return 1;
}
gdcm::DataSet const& ds = r.GetFile().GetDataSet();
sf.SetFile( r.GetFile() );
int ret = 0;
gdcm::DataSet::ConstIterator it = ds.Begin();
for( ; it != ds.End(); ++it)
{
const gdcm::DataElement &ref = *it;
std::pair s = sf.ToStringPair( ref );
if( !s.second.empty() || ref.GetVL() == 0 )
{
std::cout << s.first << " -> " << s.second << std::endl;
std::string s2 = sf.FromString( ref.GetTag(), s.second.c_str(), s.second.size() );
//std::cout << s.first << " -> " << s2 << std::endl;
}
else if( !ref.GetByteValue() ) // It means it's a SQ
{
std::cout << "SQ:" << ref.GetTag() << std::endl;
}
else if( ref.GetTag().IsPrivate() )
{
//std::cout << "Private:" << ref.GetTag() << std::endl;
std::string s2 = sf.FromString( ref.GetTag(), s.second.c_str(), s.second.size() );
}
else
{
std::cerr << "Not supported: " << ref << std::endl;
//ret += 1;
}
}
return ret;
}
int TestStringFilter2(int argc, char *argv[])
{
if( argc == 2 )
{
const char *filename = argv[1];
return TestStringFilt(filename);
}
// else
// First of get rid of warning/debug message
gdcm::Trace::DebugOff();
gdcm::Trace::WarningOff();
int r = 0, i = 0;
const char *filename;
const char * const *filenames = gdcm::Testing::GetFileNames();
while( (filename = filenames[i]) )
{
r += TestStringFilt( filename );
++i;
}
return r;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestFileStreamer1.cxx 000664 001766 001770 00000010176 14517730450 031470 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmFileStreamer.h"
#include "gdcmTesting.h"
#include "gdcmSystem.h"
#include "gdcmReader.h"
#include "gdcmDataSet.h"
#include "gdcmPrivateTag.h"
#include "gdcmFilename.h"
int TestFileStream1(const char *filename, bool verbose = false)
{
using namespace gdcm;
if( verbose )
std::cout << "Processing: " << filename << std::endl;
// Create directory first:
const char subdir[] = "TestFileStreamer1";
std::string tmpdir = Testing::GetTempDirectory( subdir );
if( !System::FileIsDirectory( tmpdir.c_str() ) )
{
System::MakeDirectory( tmpdir.c_str() );
//return 1;
}
std::string outfilename = Testing::GetTempFilename( filename, subdir );
if( verbose )
std::cout << "Generating: " << outfilename << std::endl;
gdcm::Filename fn( filename );
const char *name = fn.GetName();
// Special handling:
bool checktemplate = false;
if( strcmp(name, "DMCPACS_ExplicitImplicit_BogusIOP.dcm" ) == 0
|| strcmp(name, "ExplicitVRforPublicElementsImplicitVRforShadowElements.dcm") == 0
|| strcmp(name, "SIEMENS_MAGNETOM-12-MONO2-GDCM12-VRUN.dcm") == 0
)
{
checktemplate = true;
}
gdcm::FileStreamer fs;
fs.SetTemplateFileName( filename );
fs.CheckTemplateFileName( checktemplate );
fs.SetOutputFileName( outfilename.c_str() );
std::vector vbuffer;
vbuffer.resize( 8192 );
const char *buffer = vbuffer.data();
const size_t len = vbuffer.size();
PrivateTag pt( Tag(0x9,0x10), "MYTEST" );
if( !fs.ReserveGroupDataElement( 20 ) )
{
return 1;
}
const uint8_t startoffset = 0x13; // why not ?
fs.StartGroupDataElement( pt, 1000, startoffset );
fs.AppendToGroupDataElement( pt, buffer, len );
fs.AppendToGroupDataElement( pt, buffer, len );
fs.StopGroupDataElement( pt );
// Read back and check:
gdcm::Reader r;
r.SetFileName( outfilename.c_str() );
if( !r.Read() )
{
std::cerr << "Failed to read: " << outfilename << std::endl;
return 1;
}
gdcm::File & f = r.GetFile();
gdcm::DataSet & ds = f.GetDataSet();
const DataElement private_creator = pt.GetAsDataElement();
if( !ds.FindDataElement( private_creator.GetTag() ) )
{
std::cerr << "Could not find priv creator: " << outfilename << std::endl;
return 1;
}
// Check all the group:
const size_t nels = (2 * vbuffer.size() + 999) / 1000;
if( nels != 17 ) return 1;
PrivateTag check = pt;
for( size_t i = startoffset; i < startoffset + nels; ++i )
{
#if 1
check.SetElement( (uint16_t)i );
check.SetPrivateCreator( pt );
#else
check.SetElement( check.GetElement() + 1 );
#endif
if( !ds.FindDataElement( check ) )
{
std::cerr << "Could not find priv tag: " << check << " " << outfilename << std::endl;
return 1;
}
const DataElement & de = ds.GetDataElement( check );
const int vl = de.GetVL();
int reflen = 0;
if( i == (startoffset + nels - 1) )
{
reflen = 384;
}
else
{
reflen = 1000;
}
if( vl != reflen )
{
std::cerr << "Wrong length for: " << check << ":" << vl << " should be :" << reflen << std::endl;
return 1;
}
}
return 0;
}
int TestFileStreamer1(int argc, char *argv[])
{
if( argc == 2 )
{
const char *filename = argv[1];
return TestFileStream1(filename, true);
}
// else
gdcm::Trace::DebugOff();
gdcm::Trace::WarningOff();
gdcm::Trace::ErrorOff();
int r = 0, i = 0;
const char *filename;
const char * const *filenames = gdcm::Testing::GetFileNames();
while( (filename = filenames[i]) )
{
r += TestFileStream1( filename );
++i;
}
return r;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestPDFCodec.cxx 000664 001766 001770 00000001332 14517730450 030366 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmPDFCodec.h"
#include "gdcmTransferSyntax.h"
int TestPDFCodec(int , char *[])
{
gdcm::PDFCodec c;
c.CanCode(gdcm::TransferSyntax());
return 0;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestFileAnonymizer4.cxx 000664 001766 001770 00000012121 14517730450 032034 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmFileAnonymizer.h"
#include "gdcmTesting.h"
#include "gdcmSystem.h"
#include "gdcmReader.h"
#include "gdcmFilename.h"
#include
// in-place replace checking
static int TestFileAnonymize4(const char *filename, bool verbose = false)
{
using namespace gdcm;
if( verbose )
std::cout << "Processing: " << filename << std::endl;
// Create directory first:
const char subdir[] = "TestFileAnonymize4";
std::string tmpdir = Testing::GetTempDirectory( subdir );
if( !System::FileIsDirectory( tmpdir.c_str() ) )
{
System::MakeDirectory( tmpdir.c_str() );
//return 1;
}
std::string outfilename = Testing::GetTempFilename( filename, subdir );
if( verbose )
std::cout << "Generating: " << outfilename << std::endl;
const gdcm::Tag t1(0x0018,0x5100);
const gdcm::Tag t2(0x0018,0x1312);
const gdcm::Tag t3(0x0018,0x1313);
const gdcm::Tag t4(0x0018,0x1317);
//const gdcm::Tag t5(0x0008,0x2112); // SQ
//const gdcm::Tag t6(0x0008,0x9215); // SQ
const gdcm::Tag t7(0x0018,0x1020);
const gdcm::Tag t8(0x0004,0x1130); // Test DICOMDIR !
const gdcm::Tag t9(0x0008,0x0000); // Earliest possible Data Element
const gdcm::Tag t0(0xffff,0xffff); // Latest Possible Element
std::vector tags;
tags.push_back( t0 );
tags.push_back( t1 );
tags.push_back( t2 );
tags.push_back( t3 );
tags.push_back( t4 );
tags.push_back( t7 );
tags.push_back( t8 );
tags.push_back( t9 );
// precondition, remove the file if present:
System::RemoveFile(outfilename.c_str());
{
gdcm::FileAnonymizer fa;
fa.SetInputFileName( filename );
fa.SetOutputFileName( outfilename.c_str() );
for( std::vector::const_iterator it = tags.begin();
it != tags.end(); ++it )
{
fa.Replace( *it, "TOTO" );
}
if( !fa.Write() )
{
std::cerr << "Failed to write (1): " << outfilename << std::endl;
return 1;
}
}
{
// Read back and check:
gdcm::Reader r;
r.SetFileName( outfilename.c_str() );
if( !r.Read() )
{
gdcm::Filename fn( filename );
if( strcmp(fn.GetName(), "SIEMENS_MAGNETOM-12-MONO2-GDCM12-VRUN.dcm") == 0
|| strcmp(fn.GetName(), "DMCPACS_ExplicitImplicit_BogusIOP.dcm") == 0
|| strcmp(fn.GetName(), "ExplicitVRforPublicElementsImplicitVRforShadowElements.dcm") == 0 )
{
return 0;
}
std::cerr << "Failed to read: " << outfilename << std::endl;
return 1;
}
}
{
gdcm::FileAnonymizer fa;
fa.SetInputFileName( outfilename.c_str() );
fa.SetOutputFileName( outfilename.c_str() );
for( std::vector::const_iterator it = tags.begin();
it != tags.end(); ++it )
{
fa.Replace( *it, "TATA" );
}
if( !fa.Write() )
{
gdcm::Filename fn( filename );
if( strcmp(fn.GetName(), "JPEGInvalidSecondFrag.dcm") == 0 )
{
}
else
{
std::cerr << "Failed to write (2): " << outfilename << std::endl;
return 1;
}
}
}
// Read back and check:
gdcm::Reader r;
r.SetFileName( outfilename.c_str() );
if( !r.Read() )
{
std::cerr << "Failed to read (2): " << outfilename << std::endl;
return 1;
}
const File &f = r.GetFile();
gdcm::MediaStorage ms;
ms.SetFromFile( f );
const DataSet &ds = f.GetDataSet();
for( std::vector::const_iterator it = tags.begin();
it != tags.end(); ++it )
{
const gdcm::Tag & t = *it;
// Special handling of t8 (DICOMDIR only)
const bool iserror = (ms == gdcm::MediaStorage::MediaStorageDirectoryStorage && t == t8) && false; // de-activate for now
if( !ds.FindDataElement( t ) )
{
if( iserror )
{
std::cerr << "Not found element: " << t << " in " << outfilename << std::endl;
return 1;
}
}
const gdcm::DataElement & de = ds.GetDataElement( t );
if( de.GetVL() != 4 )
{
if( iserror )
{
std::cerr << "Wrong VL for: " << t << " in " << outfilename << std::endl;
return 1;
}
}
}
return 0;
}
int TestFileAnonymizer4(int argc, char *argv[])
{
if( argc == 2 )
{
const char *filename = argv[1];
return TestFileAnonymize4(filename, true);
}
// else
gdcm::Trace::DebugOff();
gdcm::Trace::WarningOff();
gdcm::Trace::ErrorOff();
int r = 0, i = 0;
const char *filename;
const char * const *filenames = gdcm::Testing::GetFileNames();
while( (filename = filenames[i]) )
{
r += TestFileAnonymize4( filename );
++i;
}
return r;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageHelper.cxx 000664 001766 001770 00000013247 14517730450 031211 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmImageHelper.h"
#include "gdcmMediaStorage.h"
#include "gdcmDataSet.h"
#include "gdcmAttribute.h"
#include "gdcmDirectionCosines.h"
int TestImageHelper(int, char *[])
{
// gdcm::ImageHelper sh;
const double pos[] = { 0,0,0,
1,1,1};
//const double answer[3] = {1,1,1};
std::vector impos(pos,pos+6);
std::vector spacing;
spacing.resize(3);
if( !gdcm::ImageHelper::ComputeSpacingFromImagePositionPatient(impos, spacing) )
{
return 1;
}
std::cout << spacing[0] << std::endl;
std::cout << spacing[1] << std::endl;
std::cout << spacing[2] << std::endl;
std::vector dircos;
// make it an invalid call
dircos.resize(6);
dircos[0] = 1;
dircos[1] = 0;
dircos[2] = 0;
dircos[3] = 1;
dircos[4] = 0;
dircos[5] = 0;
// Try SC
{
gdcm::MediaStorage ms( gdcm::MediaStorage::SecondaryCaptureImageStorage );
gdcm::DataSet ds;
gdcm::DataElement de( gdcm::Tag(0x0008, 0x0016) );
const char* msstr = gdcm::MediaStorage::GetMSString(ms);
de.SetByteValue( msstr, (uint32_t)strlen(msstr) );
de.SetVR( gdcm::Attribute<0x0008, 0x0016>::GetVR() );
ds.Insert( de );
// Since SC this is a no-op
gdcm::ImageHelper::SetDirectionCosinesValue( ds, dircos );
// previous call removed the attribute
gdcm::Tag iop(0x0020,0x0037);
if( ds.FindDataElement( iop ) ) return 1;
}
// MR now
{
gdcm::MediaStorage ms( gdcm::MediaStorage::MRImageStorage );
gdcm::DataSet ds;
gdcm::DataElement de( gdcm::Tag(0x0008, 0x0016) );
const char* msstr = gdcm::MediaStorage::GetMSString(ms);
de.SetByteValue( msstr, (uint32_t)strlen(msstr) );
de.SetVR( gdcm::Attribute<0x0008, 0x0016>::GetVR() );
ds.Insert( de );
// Since SC this is a no-op
gdcm::ImageHelper::SetDirectionCosinesValue( ds, dircos );
// previous call should not have replaced tag with default value
gdcm::Tag iop(0x0020,0x0037);
if( !ds.FindDataElement( iop ) ) return 1;
const gdcm::DataElement &iopde = ds.GetDataElement( iop );
gdcm::Attribute<0x0020,0x0037> at;
at.SetFromDataElement( iopde );
dircos.clear();
dircos.push_back( at.GetValue(0) );
dircos.push_back( at.GetValue(1) );
dircos.push_back( at.GetValue(2) );
dircos.push_back( at.GetValue(3) );
dircos.push_back( at.GetValue(4) );
dircos.push_back( at.GetValue(5) );
gdcm::DirectionCosines dc( dircos.data() );
if (!dc.IsValid()) return 1;
if ( (at.GetValue(0) != 1) || (at.GetValue(1) != 0) || (at.GetValue(2) != 0) ||
(at.GetValue(3) != 0) || (at.GetValue(4) != 1) || (at.GetValue(5) != 0) ) return 1;
}
// SC family
//ms = gdcm::MediaStorage::SecondaryCaptureImageStorage;
gdcm::PixelFormat pf;
gdcm::PhotometricInterpretation pi = gdcm::PhotometricInterpretation::MONOCHROME2;
gdcm::MediaStorage ms;
ms = gdcm::ImageHelper::ComputeMediaStorageFromModality( "OT", 2 );
if( ms != gdcm::MediaStorage::SecondaryCaptureImageStorage )
{
std::cerr << "SecondaryCaptureImageStorage 1" << std::endl;
return 1;
}
ms = gdcm::ImageHelper::ComputeMediaStorageFromModality( "OT", 2, pf );
if( ms != gdcm::MediaStorage::SecondaryCaptureImageStorage )
{
std::cerr << "SecondaryCaptureImageStorage 2" << std::endl;
return 1;
}
ms = gdcm::ImageHelper::ComputeMediaStorageFromModality( "OT", 2, pf, pi );
if( ms != gdcm::MediaStorage::SecondaryCaptureImageStorage )
{
std::cerr << "SecondaryCaptureImageStorage 3" << std::endl;
return 1;
}
ms = gdcm::ImageHelper::ComputeMediaStorageFromModality( "OT", 3, pf, pi );
if( ms != gdcm::MediaStorage::MultiframeGrayscaleByteSecondaryCaptureImageStorage )
{
std::cerr << "MultiframeGrayscaleByteSecondaryCaptureImageStorage" << std::endl;
return 1;
}
pf.SetBitsAllocated( 1 );
ms = gdcm::ImageHelper::ComputeMediaStorageFromModality( "OT", 3, pf, pi );
if( ms != gdcm::MediaStorage::MultiframeSingleBitSecondaryCaptureImageStorage )
{
std::cerr << "MultiframeSingleBitSecondaryCaptureImageStorage" << std::endl;
return 1;
}
pf.SetBitsAllocated( 16 );
ms = gdcm::ImageHelper::ComputeMediaStorageFromModality( "OT", 3, pf, pi );
if( ms != gdcm::MediaStorage::MultiframeGrayscaleWordSecondaryCaptureImageStorage )
{
std::cerr << "MultiframeGrayscaleWordSecondaryCaptureImageStorage" << std::endl;
return 1;
}
pf.SetBitsAllocated( 8 );
pf.SetSamplesPerPixel( 3 );
pi = gdcm::PhotometricInterpretation::RGB;
ms = gdcm::ImageHelper::ComputeMediaStorageFromModality( "OT", 3, pf, pi );
if( ms != gdcm::MediaStorage::MultiframeTrueColorSecondaryCaptureImageStorage )
{
std::cerr << "MultiframeTrueColorSecondaryCaptureImageStorage" << std::endl;
return 1;
}
ms = gdcm::ImageHelper::ComputeMediaStorageFromModality( "OT", 3, pf, pi, -1024, 1 );
if( ms != gdcm::MediaStorage::MS_END )
{
std::cerr << "MultiframeTrueColorSecondaryCaptureImageStorage 2" << std::endl;
return 1;
}
ms = gdcm::ImageHelper::ComputeMediaStorageFromModality( "OT", 3, pf, pi, 0, 2 );
if( ms != gdcm::MediaStorage::MS_END )
{
std::cerr << "MultiframeTrueColorSecondaryCaptureImageStorage 3" << std::endl;
return 1;
}
return 0;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/CMakeLists.txt 000664 001766 001770 00000024213 14517730450 030176 0 ustar 00mmalaterre mmalaterre 000000 000000 # Define the tests for Media Storage and File Format
# MSFF
set(MSFF_TEST_SRCS
TestAnonymizer.cxx
TestAnonymizer4.cxx
TestDataSetHelper.cxx
TestEquipmentManufacturer.cxx
TestFileChangeTransferSyntax1.cxx
TestFileChangeTransferSyntax2.cxx
TestFileChangeTransferSyntax3.cxx
TestFileChangeTransferSyntax4.cxx
TestFileStreamer1.cxx
TestFileStreamer2.cxx
TestFileStreamer3.cxx
TestFileStreamer4.cxx
TestFileStreamer5.cxx
TestFileStreamer6.cxx
TestFileAnonymizer1.cxx
TestFileAnonymizer2.cxx
TestFileAnonymizer3.cxx
TestFileAnonymizer4.cxx
TestIconImageFilter.cxx
#TestIconImageGenerator.cxx
#TestIconImageGenerator2.cxx
#TestIconImageGenerator3.cxx
#TestIconImageGenerator4.cxx
TestParseXPATH.cxx
TestValidate.cxx
TestAnonymizeEvent.cxx
TestFileDerivation.cxx
TestSegmentedPaletteColorLookupTable.cxx
TestPNMCodec.cxx
TestSpacing.cxx
TestSerieHelper.cxx
TestFileExplicitFilter.cxx
TestImageFragmentSplitter.cxx
TestTagPath.cxx
TestDPath.cxx
TestOrientation.cxx
TestIconImage.cxx
TestImageHelper.cxx
TestImageToImageFilter.cxx
TestImageChangeTransferSyntax1.cxx
#TestImageChangePhotometricInterpretation.cxx
#TestImageChangePhotometricInterpretation2.cxx # does not compile on mingw...
TestImageChangeTransferSyntax2.cxx
TestImageChangeTransferSyntax3.cxx
TestImageChangeTransferSyntax4.cxx
# see below
TestImageChangeTransferSyntax6.cxx
TestImageChangeTransferSyntax7.cxx
TestImageApplyLookupTable.cxx
TestFileDecompressLookupTable.cxx
TestImageChangePlanarConfiguration.cxx
TestCoder.cxx
TestDecoder.cxx
TestRescaler1.cxx
TestRescaler2.cxx
TestDumper.cxx
TestDictPrinter.cxx
TestApplicationEntity.cxx
TestStringFilter1.cxx
TestStringFilter2.cxx
TestStringFilter3.cxx
TestStringFilter4.cxx
TestUIDGenerator.cxx
TestUUIDGenerator.cxx
#TestUIDGenerator3.cxx
TestXMLPrinter.cxx
TestPrinter1.cxx
TestPrint.cxx
TestSorter.cxx
TestImageReader.cxx
TestStreamImageReader.cxx
TestImageRegionReader1.cxx
TestImageRegionReader2.cxx
TestImageRegionReader3.cxx
#TestStreamImageWriter.cxx
TestImageReaderRandomEmpty.cxx
TestDirectionCosines.cxx
TestImageWriter.cxx
TestCodec.cxx
TestPDFCodec.cxx
TestRLECodec.cxx
TestAudioCodec.cxx
TestImage.cxx
TestPhotometricInterpretation.cxx
TestLookupTable.cxx
TestOverlay.cxx
TestOverlay3.cxx
TestCurve.cxx
TestCurve2.cxx
TestPixelFormat.cxx
TestPersonName.cxx
TestImageCodec.cxx
TestImageConverter.cxx
TestJPEGCodec.cxx
TestRAWCodec.cxx
TestDICOMDIR.cxx
TestWaveform.cxx
TestFiducials.cxx
TestEncapsulatedDocument.cxx
TestSpectroscopy.cxx
TestSurfaceWriter.cxx
TestSurfaceWriter2.cxx
)
if(GDCM_DATA_ROOT)
set(MSFF_TEST_SRCS
${MSFF_TEST_SRCS}
TestCleaner1.cxx
TestCleaner2.cxx
TestCleaner3.cxx
TestCleaner4.cxx
TestSplitMosaicFilter3.cxx
TestStrictScanner1.cxx
TestStrictScanner2_1.cxx
TestStrictScanner2.cxx
TestStrictScanner2_2.cxx
TestScanner1.cxx
TestScanner2_1.cxx
TestScanner2.cxx
TestScanner2_2.cxx
TestImageHelper2.cxx
TestPrinter2.cxx
TestIPPSorter.cxx
TestIPPSorter2.cxx
TestIPPSorter3.cxx
TestCopyDataSet.cxx
TestDataElementValueAsSQ.cxx
TestImageWriter2.cxx
TestDICOMDIRGenerator1.cxx # Must be after TestImageChangeTransferSyntax4
TestDICOMDIRGenerator2.cxx # Must be after TestImageChangeTransferSyntax4
)
# Those tests requires that openssl be linked in:
if(GDCM_USE_SYSTEM_OPENSSL)
set(MSFF_TEST_SRCS
${MSFF_TEST_SRCS}
TestAnonymizer2.cxx
TestAnonymizer3.cxx
)
endif()
if(GDCM_USE_SYSTEM_JSON)
set(MSFF_TEST_SRCS
${MSFF_TEST_SRCS}
TestJSON1.cxx
)
endif()
endif()
# gdcmDataExtra
if(GDCM_DATA_EXTRA_ROOT)
set(MSFF_TEST_SRCS
${MSFF_TEST_SRCS}
TestSplitMosaicFilter.cxx
TestSplitMosaicFilter2.cxx
TestOverlay2.cxx
TestImageRegionReader4.cxx
)
endif()
if(GDCM_USE_JPEGLS)
set(MSFF_TEST_SRCS
${MSFF_TEST_SRCS}
TestImageChangeTransferSyntax5.cxx
)
endif()
if(GDCM_HAVE_PTHREAD_H)
set(MSFF_TEST_SRCS
${MSFF_TEST_SRCS}
TestUIDGenerator2.cxx
)
endif()
if(GDCM_PIXEL_SPACING_DATA_ROOT)
set(MSFF_TEST_SRCS
${MSFF_TEST_SRCS}
TestImageReaderPixelSpacing.cxx
)
endif()
# Add the include paths
include_directories(
"${GDCM_BINARY_DIR}/Source/Common"
"${GDCM_SOURCE_DIR}/Source/Common"
"${GDCM_SOURCE_DIR}/Testing/Source/Data"
"${GDCM_BINARY_DIR}/Testing/Source/Data"
"${GDCM_SOURCE_DIR}/Source/DataStructureAndEncodingDefinition"
"${GDCM_SOURCE_DIR}/Source/DataDictionary"
"${GDCM_SOURCE_DIR}/Source/MediaStorageAndFileFormat"
)
create_test_sourcelist(MSFFTests gdcmMSFFTests.cxx ${MSFF_TEST_SRCS}
EXTRA_INCLUDE gdcmTestDriver.h
)
add_executable(gdcmMSFFTests ${MSFFTests})
target_link_libraries(gdcmMSFFTests gdcmMSFF)
if(GDCM_HAVE_PTHREAD_H)
target_link_libraries(gdcmMSFFTests pthread)
endif()
# Loop over files and create executables
foreach(name ${MSFF_TEST_SRCS})
get_filename_component(testname ${name} NAME_WE)
add_test(NAME ${testname} COMMAND gdcmMSFFTests ${testname})
endforeach()
if(GDCM_DATA_ROOT)
set_tests_properties(TestDICOMDIRGenerator2 PROPERTIES WILL_FAIL ON)
endif()
# We can only run the dcmtk cross-checking test *only* after all the tests have run
# in particular once the TestWriter is done.
foreach(filename ${gdcm_data_filenames_glob})
get_filename_component(filename_name ${filename} NAME)
string(REGEX MATCH ${filename_name} bad_dicom ${black_list_reader})
if(NOT bad_dicom)
if(GDCM_TEST_DCMTK)
if(DCMTK_DCMDUMP_EXECUTABLE)
# -M : load short tags
# -dc: disable correction
add_test(NAME "DCMDUMP-${filename_name}" COMMAND ${DCMTK_DCMDUMP_EXECUTABLE} -M -dc
"${GDCM_TEMP_DIRECTORY}/TestWriter/${filename_name}")
endif()
endif()
endif()
endforeach()
# Repeat for dcdump
foreach(filename ${gdcm_data_filenames_glob})
get_filename_component(filename_name ${filename} NAME)
string(REGEX MATCH ${filename_name} bad_dicom ${black_list_reader})
if(NOT bad_dicom)
if(GDCM_TEST_DICOM3TOOLS)
if(DCDUMP_EXECUTABLE)
add_test(NAME "DCDUMP-${filename_name}" COMMAND "${DCDUMP_EXECUTABLE}"
"${GDCM_TEMP_DIRECTORY}/TestWriter/${filename_name}")
endif()
endif()
endif()
endforeach()
# There is a new test that compress all images using the jpeg compression alg:
# try to decompress them with dcmtk:
file(MAKE_DIRECTORY "${GDCM_TEMP_DIRECTORY}/TestImageChangeTransferSyntax/dcmdjpeg/")
foreach(filename ${gdcm_data_filenames_glob})
get_filename_component(filename_name ${filename} NAME)
string(REGEX MATCH ${filename_name} bad_dicom ${black_list_reader})
if(NOT bad_dicom)
if(GDCM_TEST_DCMTK)
if(DCMTK_DCMDJPEG_EXECUTABLE)
add_test(NAME "DCMDJPEG-${filename_name}" COMMAND ${DCMTK_DCMDJPEG_EXECUTABLE}
"${GDCM_TEMP_DIRECTORY}/TestImageChangeTransferSyntax/${filename_name}"
"${GDCM_TEMP_DIRECTORY}/TestImageChangeTransferSyntax/dcmdjpeg/${filename_name}")
# Special handling of the DICOMDIR files:
string(REGEX MATCH ${filename_name} is_dicomdir ${gdcm_data_dicomdir_filenames_glob})
if(is_dicomdir)
#message("IS DICOMDIR ${filename_name}")
set_tests_properties("DCMDJPEG-${filename_name}" PROPERTIES WILL_FAIL TRUE)
endif()
endif()
endif()
endif()
endforeach()
file(MAKE_DIRECTORY "${GDCM_TEMP_DIRECTORY}/TestImageChangeTransferSyntax3/dcmdrle/")
foreach(filename ${gdcm_data_filenames_glob})
get_filename_component(filename_name ${filename} NAME)
string(REGEX MATCH ${filename_name} bad_dicom ${black_list_reader})
if(NOT bad_dicom)
if(GDCM_TEST_DCMTK)
if(DCMTK_DCMDRLE_EXECUTABLE)
add_test(NAME "DCMDRLE-${filename_name}" COMMAND ${DCMTK_DCMDRLE_EXECUTABLE}
"${GDCM_TEMP_DIRECTORY}/TestImageChangeTransferSyntax3/${filename_name}"
"${GDCM_TEMP_DIRECTORY}/TestImageChangeTransferSyntax3/dcmdrle/${filename_name}")
# Special handling of the DICOMDIR files:
string(REGEX MATCH ${filename_name} is_dicomdir ${gdcm_data_dicomdir_filenames_glob})
if(is_dicomdir)
#message("IS DICOMDIR ${filename_name}")
set_tests_properties("DCMDRLE-${filename_name}" PROPERTIES WILL_FAIL TRUE)
endif()
#
endif()
endif()
endif()
endforeach()
file(MAKE_DIRECTORY "${GDCM_TEMP_DIRECTORY}/TestImageChangeTransferSyntax5/dcmdjpls/")
foreach(filename ${gdcm_data_filenames_glob})
get_filename_component(filename_name ${filename} NAME)
string(REGEX MATCH ${filename_name} bad_dicom ${black_list_reader})
if(NOT bad_dicom)
if(GDCM_TEST_DCMTK)
if(DCMTK_DCMDJPLS_EXECUTABLE)
#if(EXISTS "${GDCM_TEMP_DIRECTORY}/TestImageChangeTransferSyntax5/${filename_name}")
add_test(NAME "DCMDJPLS-${filename_name}" COMMAND ${DCMTK_DCMDJPLS_EXECUTABLE}
"${GDCM_TEMP_DIRECTORY}/TestImageChangeTransferSyntax5/${filename_name}"
"${GDCM_TEMP_DIRECTORY}/TestImageChangeTransferSyntax5/dcmdjpls/${filename_name}")
# Special handling of the DICOMDIR files:
string(REGEX MATCH ${filename_name} is_dicomdir ${gdcm_data_dicomdir_filenames_glob})
if(is_dicomdir)
#message("IS DICOMDIR ${filename_name}")
set_tests_properties("DCMDJPLS-${filename_name}" PROPERTIES WILL_FAIL TRUE)
endif()
#endif()
#
endif()
endif()
endif()
endforeach()
# Need to SET_TESTS_PROPERTIES only *after* the loop is done (test need to have been declared first)
if(GDCM_TEST_DCMTK)
if(GDCM_DATA_ROOT)
if(DCMTK_DCMDJPLS_EXECUTABLE)
# No pixel data
set_tests_properties("DCMDJPLS-ELSCINT1_PMSCT_RLE1.dcm" PROPERTIES WILL_FAIL TRUE)
endif()
if(DCMTK_DCMDJPEG_EXECUTABLE)
# No pixel data
set_tests_properties("DCMDJPEG-ELSCINT1_PMSCT_RLE1.dcm" PROPERTIES WILL_FAIL TRUE)
endif()
if(DCMTK_DCMDRLE_EXECUTABLE)
# No pixel data
set_tests_properties("DCMDRLE-ELSCINT1_PMSCT_RLE1.dcm" PROPERTIES WILL_FAIL TRUE)
# It is missing the very last pixel, so technically is illegal
set_tests_properties("DCMDRLE-ALOKA_SSD-8-MONO2-RLE-SQ.dcm" PROPERTIES WILL_FAIL TRUE)
endif()
endif()
endif()
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageApplyLookupTable.cxx 000664 001766 001770 00000011376 14517730450 033222 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmImageApplyLookupTable.h"
#include "gdcmTesting.h"
#include "gdcmSystem.h"
#include "gdcmImageReader.h"
#include "gdcmImageWriter.h"
#include "gdcmImage.h"
#include "gdcmFilename.h"
static const char * const lutarray[][2] = {
{ "d613050ca0f9c924fb5282d140281fcc", "LEADTOOLS_FLOWERS-8-PAL-RLE.dcm" },
{ "d613050ca0f9c924fb5282d140281fcc", "LEADTOOLS_FLOWERS-8-PAL-Uncompressed.dcm" },
{ "7b8d795eaf99f1fff176c43f9cf76bfb", "NM-PAL-16-PixRep1.dcm" },
{ "47715f0a5d5089268bbef6f83251a8ad", "OT-PAL-8-face.dcm" },
{ "c70309b66045140b8e08c11aa319c0ab", "US-PAL-8-10x-echo.dcm" },
{ "c370ca934dc910eb4b629a2fa8650b67", "gdcm-US-ALOKA-16.dcm" },
{ "49ca8ad45fa7f24b0406a5a03ba8aff6", "rle16loo.dcm" },
{ "964ea27345a7004325896d34b257f289", "rle16sti.dcm" },
// sentinel
{ nullptr, nullptr }
};
int TestImageApplyLookupTableFunc(const char *filename, bool verbose = false)
{
gdcm::ImageReader reader;
reader.SetFileName( filename );
if ( !reader.Read() )
{
const gdcm::FileMetaInformation &header = reader.GetFile().GetHeader();
gdcm::MediaStorage ms = header.GetMediaStorage();
bool isImage = gdcm::MediaStorage::IsImage( ms );
bool pixeldata = reader.GetFile().GetDataSet().FindDataElement( gdcm::Tag(0x7fe0,0x0010) );
if( isImage && pixeldata )
{
std::cout << "Could not read: " << filename << std::endl;
return 1;
}
return 0;
}
const gdcm::Image &image = reader.GetImage();
const gdcm::PhotometricInterpretation &pi = image.GetPhotometricInterpretation();
if( pi != gdcm::PhotometricInterpretation::PALETTE_COLOR )
{
// yeah well not much I can do here...
if( verbose )
{
std::cout << "PhotometricInterpretation is: " << pi << " cannot apply LUT then..." << std::endl;
}
return 0;
}
gdcm::ImageApplyLookupTable lutfilt;
lutfilt.SetInput( image );
bool b = lutfilt.Apply();
if( !b )
{
std::cerr << "Could not apply lut: " << filename << std::endl;
return 1;
}
// Create directory first:
const char subdir[] = "TestImageApplyLookupTable";
std::string tmpdir = gdcm::Testing::GetTempDirectory( subdir );
if( !gdcm::System::FileIsDirectory( tmpdir.c_str() ) )
{
gdcm::System::MakeDirectory( tmpdir.c_str() );
//return 1;
}
std::string outfilename = gdcm::Testing::GetTempFilename( filename, subdir );
gdcm::ImageWriter writer;
writer.SetFileName( outfilename.c_str() );
writer.SetFile( reader.GetFile() );
writer.SetImage( lutfilt.GetOutput() );
if( !writer.Write() )
{
std::cerr << "Failed to write: " << outfilename << std::endl;
return 1;
}
// Let's read that file back in !
gdcm::ImageReader reader2;
reader2.SetFileName( outfilename.c_str() );
if ( !reader2.Read() )
{
std::cerr << "Failed to read back: " << outfilename << std::endl;
return 1;
}
const gdcm::Image &img = reader2.GetImage();
unsigned long len = img.GetBufferLength();
char* buffer = new char[len];
img.GetBuffer(buffer);
gdcm::Filename fn( filename );
const char *name = fn.GetName();
unsigned int i = 0;
const char *p = lutarray[i][1];
while( p != nullptr )
{
if( strcmp( name, p ) == 0 )
{
break;
}
++i;
p = lutarray[i][1];
}
const char *ref = lutarray[i][0];
char digest[33] = {};
gdcm::Testing::ComputeMD5(buffer, len, digest);
int res = 0;
if( !ref )
{
std::cerr << "Missing LUT-applied MD5 for image from: " << filename << std::endl;
res = 1;
}
else if( strcmp(digest, ref) != 0 )
{
std::cerr << "Problem reading image from: " << filename << std::endl;
std::cerr << "Found " << digest << " instead of " << ref << std::endl;
res = 1;
}
delete[] buffer;
return res;
}
int TestImageApplyLookupTable(int argc, char *argv[])
{
if( argc == 2 )
{
const char *filename = argv[1];
return TestImageApplyLookupTableFunc(filename, true);
}
// else
gdcm::Trace::DebugOff();
gdcm::Trace::WarningOff();
int r = 0, i = 0;
const char *filename;
const char * const *filenames = gdcm::Testing::GetFileNames();
while( (filename = filenames[i]) )
{
r += TestImageApplyLookupTableFunc( filename );
++i;
}
return r;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestRescaler2.cxx 000664 001766 001770 00000014534 14517730450 030651 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmRescaler.h"
#include
#include
template < typename T >
struct TypeToPixelFormat;
template<> struct TypeToPixelFormat { enum { Type = gdcm::PixelFormat::FLOAT64 }; };
template<> struct TypeToPixelFormat { enum { Type = gdcm::PixelFormat::FLOAT32 }; };
template<> struct TypeToPixelFormat { enum { Type = gdcm::PixelFormat::INT16 }; };
template<> struct TypeToPixelFormat { enum { Type = gdcm::PixelFormat::UINT16 }; };
template<> struct TypeToPixelFormat { enum { Type = gdcm::PixelFormat::UINT8 }; };
template<> struct TypeToPixelFormat { enum { Type = gdcm::PixelFormat::INT8 }; };
template<> struct TypeToPixelFormat { enum { Type = gdcm::PixelFormat::INT32 }; };
template
bool TestRescaler2Func(
const double intercept,
const double slope,
const unsigned short bitsallocated,
const unsigned short bitsstored,
const unsigned short pixelrepresentation,
const bool best_fit
)
{
const gdcm::PixelFormat pixeltype(1,bitsallocated,bitsstored,
(unsigned short)(bitsstored-1),pixelrepresentation);
uint8_t ps = pixeltype.GetPixelSize();
// programmer error:
if( ps != sizeof( input_pixel ) ) return false;
if( pixelrepresentation ) // signed
{
if( std::numeric_limits::min() == 0 ) return false;
}
else
{
if( std::numeric_limits::min() != 0 ) return false;
}
gdcm::Rescaler r;
r.SetIntercept( intercept );
r.SetSlope( slope );
r.SetPixelFormat( pixeltype );
const int64_t min = pixeltype.GetMin();
const int64_t max = pixeltype.GetMax();
gdcm::PixelFormat::ScalarType outputpt;
outputpt = r.ComputeInterceptSlopePixelType();
gdcm::PixelFormat::ScalarType targetpixeltype =
(gdcm::PixelFormat::ScalarType)TypeToPixelFormat::Type;
if( best_fit )
{
if( targetpixeltype != outputpt )
{
return false;
}
}
else
{
if( targetpixeltype == outputpt )
{
return false;
}
}
r.SetTargetPixelType( targetpixeltype );
r.SetUseTargetPixelType(true);
std::vector values;
const int nvalues = 1 << bitsstored;
values.reserve( nvalues );
for( int i = 0; i < nvalues; ++i )
{
//values.push_back( (input_pixel)(std::numeric_limits::min() + i) );
values.push_back( (input_pixel)(min + i) );
}
std::vector output;
output.resize( nvalues );
if( !r.Rescale((char*)output.data(),(char*)values.data(),nvalues * sizeof( values[0] ) ) )
return false;
// get the min/max:
double min2 = (double)output[0];
double max2 = (double)output[nvalues-1];
if( min2 > max2 ) return false;
if( intercept == 0 && slope == 1 )
{
if( min != min2 ) return false;
if( max != max2 ) return false;
}
gdcm::Rescaler ir;
ir.SetIntercept( intercept );
ir.SetSlope( slope );
ir.SetPixelFormat( targetpixeltype );
ir.SetMinMaxForPixelType( min2, max2 );
const gdcm::PixelFormat pf2 = ir.ComputePixelTypeFromMinMax();
if( pf2 != pixeltype ) return false;
std::vector check;
check.resize( nvalues );
if( check == values ) // dummy check
return false;
if( !ir.InverseRescale((char*)check.data(),(char*)output.data(), nvalues * sizeof( output[0] ) ) )
return false;
if( check != values )
return false;
return true;
}
int TestRescaler2(int, char *[])
{
{
double intercept = 0.000061;
double slope = 3.774114;
// Case 1.
// gdcmData/MR-MONO2-12-shoulder.dcm
// (0028,0100) US 16 # 2,1 Bits Allocated
// (0028,0101) US 12 # 2,1 Bits Stored
// (0028,0102) US 11 # 2,1 High Bit
// (0028,0103) US 0 # 2,1 Pixel Representation
// [...]
// (0028,1052) DS [0.000061] # 8,1 Rescale Intercept
// (0028,1053) DS [3.774114] # 8,1 Rescale Slope
if( !TestRescaler2Func(intercept, slope,16,12,0,true) ) return 1;
// Case 2.
// use float instead of default double
if( !TestRescaler2Func(intercept, slope,16,12,0,false) ) return 1;
}
{
double intercept = 0;
double slope = 1;
// Case 3.
if( !TestRescaler2Func(intercept, slope,16,12,0,false) ) return 1;
// Case 4.
if( !TestRescaler2Func(intercept, slope,16,12,0,false) ) return 1;
// Case 5. best fit
if( !TestRescaler2Func(intercept, slope,16,12,0,true) ) return 1;
// Case 6. unsigned char:
if( !TestRescaler2Func(intercept,slope,8,8,0,true) ) return 1;
// Case 7. char
if( !TestRescaler2Func(intercept,slope,8,7,0,false) ) return 1;
}
{
double intercept = 0;
double slope = 1;
// Case 8.
if( !TestRescaler2Func(intercept,slope,16,12,1,false) ) return 1;
// Case 9.
if( !TestRescaler2Func(intercept, slope,16,12,1,false) ) return 1;
// Case 10. best fit
if( !TestRescaler2Func(intercept, slope,16,12,1,true) ) return 1;
// Case 11. unsigned char:
if( !TestRescaler2Func(intercept,slope,8,8,1,true) ) return 1;
// Case 12. char
if( !TestRescaler2Func(intercept,slope,8,7,1,true) ) return 1;
}
{
double intercept = -1024;
double slope = 1;
// Case 13.
if( !TestRescaler2Func(intercept, slope,16,12,0,true) ) return 1;
// Case 14.
if( !TestRescaler2Func(intercept, slope,16,12,0,false) ) return 1;
// Case 15.
if( !TestRescaler2Func(intercept, slope,8,8,0,true) ) return 1;
// Case 16.
if( !TestRescaler2Func(intercept, slope,8,8,0,false) ) return 1;
}
return 0;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestSurfaceWriter2.cxx 000664 001766 001770 00000015777 14517730450 031710 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmTesting.h"
#include "gdcmSurfaceWriter.h"
#include "gdcmSurfaceReader.h"
#include "gdcmFileMetaInformation.h"
#include "gdcmFilename.h"
#include "gdcmSystem.h"
#include "gdcmAttribute.h"
#include
namespace gdcm
{
/**
* Test surface reading and writing method.
*/
int TestSurfaceWriter2(const char *subdir, const char* filename)
{
SurfaceReader reader;
reader.SetFileName( filename );
if ( !reader.Read() )
{
int ret = 1;
gdcm::MediaStorage ms;
if( ms.SetFromFile( reader.GetFile() ) )
{
if( ms == gdcm::MediaStorage::SurfaceSegmentationStorage )
{
ret = 0;
}
}
if( !ret )
{
std::cerr << "Failed to read: " << filename << std::endl;
std::cerr << "MediaStorage is: " << ms.GetString() << std::endl;
}
return !ret;
}
// std::cout << "success to read" << std::endl;
if (reader.GetNumberOfSurfaces() < 2)
{
std::cerr << "File with not enough surfaces (min : 2): " << filename << std::endl;
return 1;
}
// Modify data to test other writing/reading way
SmartPointer< Segment > segment = new Segment;
srand( (unsigned int)time(nullptr));
SegmentHelper::BasicCodedEntry processingAlgo("123", "TEST", "Test123");
{
SegmentReader::SegmentVector segments = reader.GetSegments();
Segment::SurfaceVector tmp;
SegmentReader::SegmentVector::iterator itSegments = segments.begin();
SegmentReader::SegmentVector::iterator itEndSegments = segments.end();
for (; itSegments != itEndSegments; itSegments++)
{
tmp = (*itSegments)->GetSurfaces();
Segment::SurfaceVector::iterator itSurfaces = tmp.begin();
Segment::SurfaceVector::iterator itEndSurfaces = tmp.end();
for (; itSurfaces != itEndSurfaces; itSurfaces++)
{
SmartPointer< Surface > surf = *itSurfaces;
surf->SetSurfaceProcessing( true );
surf->SetSurfaceProcessingRatio( 0.42f );
surf->SetSurfaceProcessingDescription( "Test processing" );
surf->SetProcessingAlgorithm( processingAlgo );
if (surf->GetNumberOfVectors() > 0)
surf->SetNumberOfVectors( 42 );
surf->SetSurfaceNumber( rand()%1000 );
segment->AddSurface(surf);
}
}
segment->SetSegmentDescription("Surface test");
// segment.SetSurfaceCount( segment.GetSurfaces().size() );
}
// Create directory first:
std::string tmpdir = Testing::GetTempDirectory( subdir );
if( !System::FileIsDirectory( tmpdir.c_str() ) )
{
System::MakeDirectory( tmpdir.c_str() );
//return 1;
}
std::string outfilename = Testing::GetTempFilename( filename, subdir );
// Write file from content reader
{
SurfaceWriter writer;
writer.SetFileName( outfilename.c_str() );
writer.AddSegment( segment );
// writer.SetNumberOfSurfaces( segment.GetSurfaces().size() );
// Set same header to write file
const FileMetaInformation & header = reader.GetFile().GetHeader();
writer.GetFile().SetHeader( header );
if( !writer.Write() )
{
std::cerr << "Failed to write: " << outfilename << std::endl;
return 1;
}
// std::cout << "success to write" << std::endl;
}
SurfaceReader reader2;
reader2.SetFileName( outfilename.c_str() );
if ( !reader2.Read() )
{
std::cerr << "Failed to read again: " << outfilename << std::endl;
return 1;
}
// std::cout << "success to read again" << std::endl;
SegmentReader::SegmentVector segments2 = reader2.GetSegments();
if ( strcmp(segment->GetSegmentDescription(), segments2[0]->GetSegmentDescription()) != 0)
{
std::cerr << "Find different segment description"<< std::endl;
return 1;
}
Segment::SurfaceVector surfaces2 = segments2[0]->GetSurfaces();
if ( segment->GetSurfaces().size() != surfaces2.size() )
{
std::cerr << "Find different surface count"<< std::endl;
return 1;
}
Segment::SurfaceVector::iterator itSurfaces2 = surfaces2.begin();
Segment::SurfaceVector::iterator itEndSurfaces2 = surfaces2.end();
SegmentHelper::BasicCodedEntry processingAlgo2;
Segment::SurfaceVector surfaces = segment->GetSurfaces();
Segment::SurfaceVector::iterator itSurfaces = surfaces.begin();
Segment::SurfaceVector::iterator itEndSurfaces = surfaces.end();
for (; itSurfaces2 != itEndSurfaces2; itSurfaces2++)
{
SmartPointer< Surface > surf = *itSurfaces2;
if (!surf->GetSurfaceProcessing())
{
std::cerr << "Find different surface processing"<< std::endl;
return 1;
}
if ( 0.41f > surf->GetSurfaceProcessingRatio() || surf->GetSurfaceProcessingRatio() > 0.43f)
{
std::cerr << "Find different surface processing ratio"<< std::endl;
return 1;
}
String<> str;
str = surf->GetSurfaceProcessingDescription();
if (str.Trim() != "Test processing")
{
std::cerr << "Find different surface processing description"<< std::endl;
return 1;
}
processingAlgo2 = surf->GetProcessingAlgorithm();
str = processingAlgo2.CV;
processingAlgo2.CV = str.Trim();
str = processingAlgo2.CSD;
processingAlgo2.CSD = str.Trim();
str = processingAlgo2.CM;
processingAlgo2.CM = str.Trim();
if (processingAlgo2.CV != processingAlgo.CV
|| processingAlgo2.CSD != processingAlgo.CSD
|| processingAlgo2.CM != processingAlgo.CM )
{
std::cerr << "Find different surface processing algorithm"<< std::endl;
return 1;
}
if (itSurfaces != itEndSurfaces)
{
if (surf->GetSurfaceNumber() != (*itSurfaces)->GetSurfaceNumber())
{
std::cerr << "Find different surface number"<< std::endl;
return 1;
}
if (surf->GetNumberOfVectors() > 0)
{
std::cerr << "Find different number of vectors"<< std::endl;
return 1;
}
itSurfaces++;
}
else
{
std::cerr << "Find different surface organization"<< std::endl;
return 1;
}
}
return 0;
}
}
int TestSurfaceWriter2(int argc, char *argv[])
{
if( argc == 2 )
{
const char *filename = argv[1];
return gdcm::TestSurfaceWriter2(argv[0],filename);
}
// else
gdcm::Trace::DebugOff();
gdcm::Trace::WarningOff();
int r = 0, i = 0;
const char *filename;
const char * const *filenames = gdcm::Testing::GetFileNames();
while( (filename = filenames[i]) )
{
r += gdcm::TestSurfaceWriter2(argv[0], filename );
++i;
}
return r;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestApplicationEntity.cxx 000664 001766 001770 00000001257 14517730450 032465 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmApplicationEntity.h"
int TestApplicationEntity(int, char *[])
{
gdcm::ApplicationEntity ae;
return 0;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestRAWCodec.cxx 000664 001766 001770 00000001245 14517730450 030411 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmRAWCodec.h"
int TestRAWCodec(int argc, char *argv[])
{
(void)argc;
(void)argv;
return 0;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestPrint.cxx 000664 001766 001770 00000003164 14517730450 030120 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmStringFilter.h"
#include "gdcmReader.h"
#include "gdcmSequenceOfItems.h"
#include "gdcmTrace.h"
#include "gdcmTesting.h"
int TestSimplePrint(const char *filename, bool verbose = false)
{
gdcm::Reader r;
r.SetFileName( filename );
if( !r.Read() )
{
return 1;
}
gdcm::DataSet const& ds = r.GetFile().GetDataSet();
int ret = 0;
gdcm::DataSet::ConstIterator it = ds.Begin();
std::ostringstream os;
for( ; it != ds.End(); ++it)
{
const gdcm::DataElement &ref = *it;
os << ref << std::endl;
}
if( verbose ) std::cout << os.str();
return ret;
}
int TestPrint(int argc, char *argv[])
{
if( argc == 2 )
{
const char *filename = argv[1];
return TestSimplePrint(filename, true);
}
// else
// First of get rid of warning/debug message
gdcm::Trace::DebugOff();
gdcm::Trace::WarningOff();
int r = 0, i = 0;
const char *filename;
const char * const *filenames = gdcm::Testing::GetFileNames();
while( (filename = filenames[i]) )
{
r += TestSimplePrint( filename );
++i;
}
return r;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestCleaner3.cxx 000664 001766 001770 00000011702 14517730450 030455 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmCleaner.h"
#include "gdcmFilename.h"
#include "gdcmReader.h"
#include "gdcmSmartPointer.h"
#include "gdcmSystem.h"
#include "gdcmTesting.h"
#include "gdcmWriter.h"
namespace gdcm {
static const DataSet &GetNestedDataSet(const DataSet &ds,
const PrivateTag &path) {
const DataElement &de = ds.GetDataElement(path);
SmartPointer sqi = de.GetValueAsSQ();
assert(sqi && sqi->GetNumberOfItems() == 1);
const Item &item = sqi->GetItem(1);
const DataSet &subds = item.GetNestedDataSet();
return subds;
}
static bool IsTagIn(const DataSet &ds, const PrivateTag &path,
const PrivateTag &pt) {
const DataSet &subds = GetNestedDataSet(ds, path);
return subds.FindDataElement(pt);
}
} // namespace gdcm
int TestCleaner3Impl(std::string const &filename,
std::string const &outfilename, bool useDPath) {
using namespace gdcm;
// Setup DPath
DPath dpath1, dpath2;
PrivateTag pt1, pt2;
// This attribute is a SQ. make sure we can Empty a SQ:
static const char ref1[] = "0029,e0,SPI-P-Private_ICS Release 1;4";
static const char ref2[] = "0029,00,SPI-P-Private_ICS Release 1;1";
if (useDPath) {
if (!dpath1.ConstructFromString(ref1)) {
return 1;
}
if (!dpath2.ConstructFromString(ref2)) {
return 1;
}
}
if (!pt1.ReadFromCommaSeparatedString(ref1)) {
return 1;
}
if (!pt2.ReadFromCommaSeparatedString(ref2)) {
return 1;
}
PrivateTag path1(0x0029, 0xf, "SPI-P-Private_ICS Release 1");
PrivateTag path2(0x0029, 0xcd, "SPI-P-Private_ICS Release 1;1");
PrivateTag path3(0x0029, 0x1b, "SPI-P-Private_ICS Release 1");
PrivateTag path4(0x0029, 0x4c, "SPI-P-Private_ICS Release 1");
// first pass
{
Reader reader;
reader.SetFileName(filename.c_str());
if (!reader.Read()) {
std::cerr << "Could not read: " << filename << std::endl;
return 1;
}
File &file = reader.GetFile();
DataSet &ds = file.GetDataSet();
const bool b0 = IsTagIn(ds, path4, pt1);
const bool b1 = IsTagIn(ds, path1, pt2);
const DataSet &ds1 = GetNestedDataSet(ds, path1);
const bool b2 = IsTagIn(ds1, path2, pt2);
const bool b3 = IsTagIn(ds, path3, pt2);
const bool b4 = IsTagIn(ds, path4, pt2);
if (!b0 || !b1 || !b2 || !b3 || !b4) {
std::cerr << "Test not setup correctly" << std::endl;
return 1;
}
Cleaner cleaner;
cleaner.SetFile(file);
cleaner.RemoveAllGroupLength(false);
if (useDPath) {
if (!cleaner.Remove(dpath1)) {
return 1;
}
if (!cleaner.Remove(dpath2)) {
return 1;
}
} else {
if (!cleaner.Remove(pt1)) {
return 1;
}
if (!cleaner.Remove(pt2)) {
return 1;
}
}
if (!cleaner.Clean()) {
return 1;
}
Writer writer;
writer.SetFileName(outfilename.c_str());
writer.SetFile(cleaner.GetFile());
if (!writer.Write()) {
std::cerr << "Failed to write: " << outfilename << std::endl;
return 1;
}
}
// re-read, written out:
{
Reader reader;
reader.SetFileName(outfilename.c_str());
if (!reader.Read()) {
std::cerr << "Could not read: " << outfilename << std::endl;
return 1;
}
File &file = reader.GetFile();
DataSet &ds = file.GetDataSet();
const bool b0 = IsTagIn(ds, path4, pt1);
const bool b1 = IsTagIn(ds, path1, pt2);
const DataSet &ds1 = GetNestedDataSet(ds, path1);
const bool b2 = IsTagIn(ds1, path2, pt2);
const bool b3 = IsTagIn(ds, path3, pt2);
const bool b4 = IsTagIn(ds, path4, pt2);
if (b0 || b1 || b2 || b3 || b4) {
std::cerr << "At least one tag was not removed" << std::endl;
return 1;
}
}
return 0;
}
int TestCleaner3(int, char *[]) {
using namespace gdcm;
const char *directory = gdcm::Testing::GetDataRoot();
std::string sfilename =
std::string(directory) + "/PhilipsInteraSeqTermInvLen.dcm";
const char *filename = sfilename.c_str();
// Create directory first:
const char subdir[] = "TestCleaner3";
std::string tmpdir = Testing::GetTempDirectory(subdir);
if (!System::FileIsDirectory(tmpdir.c_str())) {
System::MakeDirectory(tmpdir.c_str());
}
std::string outfilename = Testing::GetTempFilename(filename, subdir);
int res1 = 0; // TestCleaner3Impl(filename, outfilename, true);
int res2 = TestCleaner3Impl(filename, outfilename, false);
return res1 + res2;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestEquipmentManufacturer.cxx 000664 001766 001770 00000017125 14517730450 033352 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmEquipmentManufacturer.h"
#include "gdcmFilename.h"
#include "gdcmReader.h"
#include "gdcmTesting.h"
static int TestEquipmentManufacturerFunc(const char *filename,
bool verbose = false) {
if (verbose) std::cerr << "Reading: " << filename << std::endl;
const gdcm::Tag pixeldata(0x7fe0, 0x0010);
gdcm::Reader reader;
reader.SetFileName(filename);
if (!reader.ReadUpToTag(pixeldata)) {
std::cerr << "TestReadError: Failed to read: " << filename << std::endl;
return 1;
}
gdcm::File &file = reader.GetFile();
gdcm::MediaStorage ms;
ms.SetFromFile(file);
if (ms == gdcm::MediaStorage::MediaStorageDirectoryStorage)
return 0; // skip DICOMDIR
gdcm::Filename fn(filename);
const char *name = fn.GetName();
// Special handling:
if (strcmp(name, "OsirixFake16BitsStoredFakeSpacing.dcm") == 0 ||
strcmp(name, "simpleImageWithIcon.dcm") == 0 ||
strcmp(name, "rle16sti.dcm") == 0 || strcmp(name, "rle16loo.dcm") == 0 ||
strcmp(name, "gdcm-CR-DCMTK-16-NonSamplePerPix.dcm") == 0 ||
strcmp(name, "XA-MONO2-8-12x-catheter.dcm") == 0 ||
strcmp(name, "US-RGB-8-esopecho.dcm") == 0 ||
strcmp(name, "US-PAL-8-10x-echo.dcm") == 0 ||
strcmp(name, "US-MONO2-8-8x-execho.dcm") == 0 ||
strcmp(name, "THERALYS-12-MONO2-Uncompressed-Even_Length_Tag.dcm") == 0 ||
strcmp(name, "SignedShortLosslessBug.dcm") == 0 ||
strcmp(name, "SC16BitsAllocated_8BitsStoredJPEG.dcm") == 0 ||
strcmp(name, "SC16BitsAllocated_8BitsStoredJ2K.dcm") == 0 ||
strcmp(name, "RadBWLossLess.dcm") == 0 ||
strcmp(name, "RLEDebianBug816607Orig.dcm") == 0 ||
strcmp(name, "DermaColorLossLess.dcm") == 0 ||
strcmp(name, "00191113.dcm") == 0 || strcmp(name, "test.acr") == 0 ||
strcmp(name, "MARCONI_MxTWin-12-MONO2-JpegLossless-ZeroLengthSQ.dcm") ==
0 ||
strcmp(name, "PICKER-16-MONO2-Nested_icon.dcm") == 0 ||
strcmp(name, "MR_ELSCINT1_00e1_1042_SQ_feff_00e0_Item.dcm") == 0 ||
strcmp(name, "PrivateGEImplicitVRBigEndianTransferSyntax16Bits.dcm") ==
0 ||
strcmp(name, "LIBIDO-8-ACR_NEMA-Lena_128_128.acr") == 0 ||
strcmp(name, "gdcm-ACR-LibIDO.acr") == 0 ||
strcmp(name, "libido1.0-vol.acr") == 0 ||
strcmp(name, "DCMTK_JPEGExt_12Bits.dcm") == 0 ||
strcmp(name, "DMCPACS_ExplicitImplicit_BogusIOP.dcm") == 0 ||
strcmp(name, "DX_J2K_0Padding.dcm") == 0 ||
strcmp(name, "GDCMJ2K_TextGBR.dcm") == 0 ||
strcmp(name, "ITK_GDCM124_MultiframeSecondaryCaptureInvalid.dcm") == 0 ||
strcmp(name, "JPEGLS_CharLS_10742.dcm") == 0 ||
strcmp(name, "JPEGLosslessYBR_FULL_422.dcm") == 0 ||
strcmp(name, "JPEGLosslessSeNonZero.dcm") == 0 ||
strcmp(name, "US-YBR_FULL_422-EVRLE.dcm") == 0 ||
strcmp(name, "LIBIDO-24-ACR_NEMA-Rectangle.dcm") == 0 ||
strcmp(name, "MR-Brucker-CineTagging-NonSquarePixels.dcm") == 0 ||
strcmp(name, "MR16BitsAllocated_8BitsStored.dcm") == 0 ||
strcmp(name, "NM-MONO2-16-13x-heart.dcm") == 0 ||
strcmp(name, "NM-PAL-16-PixRep1.dcm") == 0 ||
strcmp(name, "NM_Kakadu44_SOTmarkerincons.dcm") == 0 ||
strcmp(name, "PICKER-16-MONO2-No_DicomV3_Preamble.dcm") == 0 ||
strcmp(name, "OT-PAL-8-face.dcm") == 0 ||
strcmp(name, "TG18-CH-2k-01.dcm") == 0 // wotsit ?
|| strcmp(name, "HardcopyColor_YBR_RCT_J2K_PC1.dcm") == 0 // RamSoft Inc.
|| strncmp(name, "D_CLUNIE", 8) == 0 // D_CLUNIE*
|| strncmp(name, "LEADTOOLS_FLOWERS", 17) == 0 // LEADTOOLS_FLOWERS*
|| strncmp(name, "JDDICOM", 7) == 0 // JDDICOM*
|| strncmp(name, "JPEGNote", 8) == 0 // JPEGNote*
|| strncmp(name, "KODAK", 5) == 0 // KODAK*
|| strncmp(name, "DICOMDIR", 8) == 0 // DICOMDIR*
|| strncmp(name, "dicomdir", 8) == 0 // dicomdir*
) {
if (verbose) std::cout << "skip: " << filename << std::endl;
return 0;
}
gdcm::DataSet &ds = file.GetDataSet();
gdcm::EquipmentManufacturer::Type manufacturer =
gdcm::EquipmentManufacturer::Compute(ds);
if (verbose) {
std::cout << "Found: "
<< gdcm::EquipmentManufacturer::TypeToString(manufacturer)
<< " -> " << manufacturer << std::endl;
}
if (manufacturer == gdcm::EquipmentManufacturer::UNKNOWN) {
std::cerr << "Unknown: " << filename << std::endl;
return 1;
}
ds.Remove(gdcm::Tag(0x8, 0x70));
gdcm::EquipmentManufacturer::Type manufacturer2 =
gdcm::EquipmentManufacturer::Compute(ds);
if (manufacturer2 == gdcm::EquipmentManufacturer::UNKNOWN) {
if (strcmp(name, "gdcm-US-ALOKA-16.dcm") == 0 ||
strcmp(name, "US-RGB-8-epicard.dcm") == 0 ||
strcmp(name, "OT-MONO2-8-a7.dcm") == 0 ||
strcmp(name, "MR-MONO2-8-16x-heart.dcm") == 0 ||
strcmp(name, "MR-MONO2-16-head.dcm") == 0 ||
strcmp(name, "MR-MONO2-12-shoulder.dcm") == 0 ||
strcmp(name, "MR-MONO2-12-an2.acr") == 0 ||
strcmp(name, "LJPEG_BuginGDCM12.dcm") == 0 ||
strcmp(name, "ELSCINT1_PMSCT_RLE1.dcm") == 0 ||
strcmp(name, "ELSCINT1_JP2vsJ2K.dcm") == 0 ||
strcmp(name, "MAROTECH_CT_JP2Lossy.dcm") == 0 ||
strcmp(name, "ALOKA_SSD-8-MONO2-RLE-SQ.dcm") == 0 ||
strcmp(name, "CR-MONO1-10-chest.dcm") == 0 ||
strcmp(name, "CT-MONO2-12-lomb-an2.acr") == 0 ||
strcmp(name, "CT-MONO2-16-ankle.dcm") == 0 ||
strcmp(name, "CT-MONO2-8-abdo.dcm") == 0 ||
strcmp(name, "CT-MONO2-16-ort.dcm") == 0 ||
strcmp(name, "CT-MONO2-16-chest.dcm") == 0 ||
strcmp(name, "CT-MONO2-16-brain.dcm") == 0 ||
strcmp(name, "EnhancedWithIPPPerFrameIOPShared.dcm") == 0 ||
strcmp(name, "FUJI-10-MONO1-ACR_NEMA_2.dcm") == 0 ||
strcmp(name, "JPEGDefinedLengthSequenceOfFragments.dcm") == 0 ||
strcmp(name, "IM-0001-0066.CommandTag00.dcm") == 0 ||
strcmp(name, "GE_GENESIS-16-MONO2-WrongLengthItem.dcm") == 0 ||
strcmp(name, "MR_Spectroscopy_SIEMENS_OF.dcm") == 0 ||
strcmp(name, "US-IRAD-NoPreambleStartWith0005.dcm") == 0 ||
strcmp(name, "US-IRAD-NoPreambleStartWith0003.dcm") == 0 ||
strcmp(name, "PHILIPS_Brilliance_ExtraBytesInOverlay.dcm") == 0 ||
strcmp(name, "TOSHIBA_MRT150-16-MONO2-ACR_NEMA_2.dcm") == 0 ||
strcmp(name, "fffc0000UN.dcm") == 0) {
} else {
std::cerr << "Unknown2: " << filename << std::endl;
return 1;
}
} else if (manufacturer2 != manufacturer) {
std::cerr << "Incompatible: " << filename << std::endl;
return 1;
}
return 0;
}
int TestEquipmentManufacturer(int argc, char *argv[]) {
if (argc == 2) {
const char *filename = argv[1];
return TestEquipmentManufacturerFunc(filename, true);
}
// else
// First of get rid of warning/debug message
gdcm::Trace::DebugOff();
gdcm::Trace::WarningOff();
int r = 0, i = 0;
const char *filename;
const char *const *filenames = gdcm::Testing::GetFileNames();
while ((filename = filenames[i])) {
r += TestEquipmentManufacturerFunc(filename);
++i;
}
return r;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestAnonymizer2.cxx 000664 001766 001770 00000014535 14517730450 031245 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmAnonymizer.h"
#include "gdcmSimpleSubjectWatcher.h"
#include "gdcmFilename.h"
#include "gdcmTesting.h"
#include "gdcmCryptographicMessageSyntax.h"
#include "gdcmCryptoFactory.h"
#include "gdcmSmartPointer.h"
#include "gdcmReader.h"
#include "gdcmWriter.h"
#include "gdcmGlobal.h"
#include "gdcmSystem.h"
#include // std::unique_ptr
namespace gdcm
{
int TestAnonymize2(const char *subdir, const char *filename, bool verbose = false)
{
gdcm::Global& g = gdcm::Global::GetInstance();
if( !g.LoadResourcesFiles() )
{
return 1;
}
std::string certpath = gdcm::Filename::Join(gdcm::Testing::GetSourceDirectory(), "/Testing/Source/Data/certificate.pem" );
std::string keypath = gdcm::Filename::Join(gdcm::Testing::GetSourceDirectory(), "/Testing/Source/Data/privatekey.pem" );
// Create directory first:
std::string tmpdir = Testing::GetTempDirectory( subdir );
if( !System::FileIsDirectory( tmpdir.c_str() ) )
{
System::MakeDirectory( tmpdir.c_str() );
//return 1;
}
if(verbose) std::cout << "Processing: " << filename << std::endl;
std::string outfilename = Testing::GetTempFilename( filename, subdir );
// Create directory first:
const char subdir2[] = "TestAnonymizer2_2";
std::string tmpdir2 = Testing::GetTempDirectory( subdir2 );
if( !System::FileIsDirectory( tmpdir2.c_str() ) )
{
System::MakeDirectory( tmpdir2.c_str() );
//return 1;
}
std::string outfilename2 = Testing::GetTempFilename( filename, subdir2 );
// Encrypt
{
gdcm::CryptoFactory* cryptoFactory = gdcm::CryptoFactory::GetFactoryInstance();
if (cryptoFactory == NULL)
{
std::cerr << "Crypto library not available" << std::endl;
return 1;
}
std::unique_ptr cms_ptr(cryptoFactory->CreateCMSProvider());
gdcm::CryptographicMessageSyntax& cms = *cms_ptr;
if( !cms.ParseCertificateFile( certpath.c_str() ) )
{
std::cerr << "Could not parse cert: " << certpath << std::endl;
return 1;
}
gdcm::SmartPointer ano = new gdcm::Anonymizer;
ano->SetCryptographicMessageSyntax( &cms );
//gdcm::SimpleSubjectWatcher watcher(ano, "Anonymizer");
gdcm::Reader reader;
reader.SetFileName( filename );
if( !reader.Read() )
{
std::cerr << "Could not read: " << filename << std::endl;
return 1;
}
const DataSet &ds = reader.GetFile().GetDataSet();
bool hasinstanceuid = true;
if( !ds.FindDataElement( Tag(0x0008,0x0018) )
|| ds.GetDataElement( Tag(0x0008,0x0018) ).IsEmpty() )
{
hasinstanceuid = false;
}
gdcm::MediaStorage ms;
ms.SetFromFile( reader.GetFile() );
ano->SetFile( reader.GetFile() );
if( !ano->BasicApplicationLevelConfidentialityProfile() )
{
gdcm::Filename fn( filename );
if( strcmp(fn.GetName(), "EmptyIcon_Bug417.dcm") == 0 // not supported for now (already anonymized)
|| strcmp(fn.GetName(), "PET-GE-dicomwrite-PixelDataSQUNv2.dcm") == 0 // not supported for now (already anonymized)
|| strcmp(fn.GetName(), "HardcopyColor_YBR_RCT_J2K_PC1.dcm") == 0 // deprecated SOP Class UID
)
{
return 0;
}
if( ms != gdcm::MediaStorage::MS_END )
{
std::cerr << "BasicApplicationLevelConfidentialityProfile fails for: " << filename << std::endl;
return 1;
}
}
gdcm::Writer writer;
//writer.SetFileName( "/tmp/ano.dcm" );
writer.SetFileName( outfilename.c_str() );
writer.SetFile( reader.GetFile() );
if( !writer.Write() )
{
if( hasinstanceuid )
{
std::cerr << "Failed to write: " << outfilename << std::endl;
return 1;
}
return 0;
}
}
// Decrypt
{
gdcm::CryptoFactory* cryptoFactory = gdcm::CryptoFactory::GetFactoryInstance();
if (cryptoFactory == NULL)
{
std::cerr << "Crypto library not available" << std::endl;
return 1;
}
std::unique_ptr cms_ptr(cryptoFactory->CreateCMSProvider());
gdcm::CryptographicMessageSyntax& cms = *cms_ptr;
if( !cms.ParseKeyFile( keypath.c_str() ) )
{
std::cerr << "Could not parse key: " << keypath << std::endl;
return 1;
}
gdcm::SmartPointer ano = new gdcm::Anonymizer;
ano->SetCryptographicMessageSyntax( &cms );
//gdcm::SimpleSubjectWatcher watcher(ano, "Anonymizer");
gdcm::Reader reader;
reader.SetFileName( outfilename.c_str() );
if( !reader.Read() )
{
std::cerr << "Could not read: " << outfilename << std::endl;
return 1;
}
ano->SetFile( reader.GetFile() );
if( !ano->BasicApplicationLevelConfidentialityProfile(false) )
{
std::cerr << "BasicApplicationLevelConfidentialityProfile (false) fails for: " << outfilename << std::endl;
return 1;
}
const DataSet &ds = reader.GetFile().GetDataSet();
bool hasinstanceuid = true;
if( !ds.FindDataElement( Tag(0x0008,0x0018) )
|| ds.GetDataElement( Tag(0x0008,0x0018) ).IsEmpty() )
{
hasinstanceuid = false;
}
// TODO Need to compare filename to decrypted one.
gdcm::Writer writer;
writer.SetFileName( outfilename2.c_str() );
writer.SetFile( reader.GetFile() );
if( !writer.Write() )
{
if( hasinstanceuid )
{
std::cerr << "Failed to write (2): " << outfilename2 << std::endl;
std::cerr << "Orig file was : " << outfilename << std::endl;
return 1;
}
return 0;
}
}
return 0;
}
}
int TestAnonymizer2(int argc, char *argv[])
{
if( argc == 2 )
{
const char *filename = argv[1];
return gdcm::TestAnonymize2(argv[0], filename, true);
}
// else
gdcm::Trace::DebugOff();
gdcm::Trace::WarningOff();
gdcm::Trace::ErrorOff();
int r = 0, i = 0;
const char *filename;
const char * const *filenames = gdcm::Testing::GetFileNames();
while( (filename = filenames[i]) )
{
r += gdcm::TestAnonymize2( argv[0], filename );
++i;
}
return r;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestFileStreamer3.cxx 000664 001766 001770 00000010517 14517730450 031471 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmFileStreamer.h"
#include "gdcmTesting.h"
#include "gdcmSystem.h"
#include "gdcmReader.h"
#include "gdcmFilename.h"
int TestFileStream3(const char *filename, bool verbose = false)
{
using namespace gdcm;
if( verbose )
std::cout << "Processing: " << filename << std::endl;
// Create directory first:
const char subdir[] = "TestFileStreamer3";
std::string tmpdir = Testing::GetTempDirectory( subdir );
if( !System::FileIsDirectory( tmpdir.c_str() ) )
{
System::MakeDirectory( tmpdir.c_str() );
//return 1;
}
std::string outfilename = Testing::GetTempFilename( filename, subdir );
if( verbose )
std::cout << "Generating: " << outfilename << std::endl;
gdcm::Filename fn( filename );
const char *name = fn.GetName();
// Special handling:
bool checktemplate = false;
if( strcmp(name, "DMCPACS_ExplicitImplicit_BogusIOP.dcm" ) == 0
|| strcmp(name, "ExplicitVRforPublicElementsImplicitVRforShadowElements.dcm") == 0
|| strcmp(name, "SIEMENS_MAGNETOM-12-MONO2-GDCM12-VRUN.dcm") == 0
)
{
checktemplate = true;
}
gdcm::FileStreamer fs;
fs.SetTemplateFileName( filename );
fs.CheckTemplateFileName( checktemplate );
fs.SetOutputFileName( outfilename.c_str() );
const gdcm::Tag t1(0x0008,0x0010);
const gdcm::Tag t2(0x0010,0x0010);
// Try a small buffer to find a case where existing element is larger
bool b;
const char buffer[] = " ";
const size_t len = strlen( buffer );
// Recognition Code
b = fs.StartDataElement( t1 );
if( !b )
{
std::cerr << "Could not StartDataElement" << std::endl;
return 1;
}
b = fs.AppendToDataElement( t1, buffer, len );
if( !b )
{
std::cerr << "Could not AppendToDataElement (t1)" << std::endl;
return 1;
}
b = fs.StopDataElement( t1 );
if( !b )
{
std::cerr << "Could not StopDataElement" << std::endl;
return 1;
}
// Patient's Name
b = fs.StartDataElement( t2 );
if( !b )
{
std::cerr << "Could not StartDataElement" << std::endl;
return 1;
}
b = fs.AppendToDataElement( t2, buffer, len );
if( !b )
{
std::cerr << "Could not AppendToDataElement" << std::endl;
return 1;
}
b = fs.StopDataElement( t2 );
if( !b )
{
std::cerr << "Could not StopDataElement" << std::endl;
return 1;
}
// Read back and check:
gdcm::Reader r;
r.SetFileName( outfilename.c_str() );
if( !r.Read() )
{
std::cerr << "Failed to read: " << outfilename << std::endl;
return 1;
}
gdcm::File & f = r.GetFile();
gdcm::DataSet & ds = f.GetDataSet();
if( !ds.FindDataElement( t1 ) )
{
std::cerr << "Could not find tag: " << t1 << std::endl;
return 1;
}
{
const DataElement & de = ds.GetDataElement( t1 );
const ByteValue * bv = de.GetByteValue();
if( !bv ) return 1;
if( bv->GetLength() != 2 )
{
std::cerr << "Wrong length: " << bv->GetLength() << std::endl;
return 1;
}
if( memcmp( bv->GetPointer(), buffer, 2 ) != 0 )
{
std::cerr << "Wrong content" << std::endl;
return 1;
}
}
{
const DataElement & de = ds.GetDataElement( t2 );
const ByteValue * bv = de.GetByteValue();
if( !bv ) return 1;
if( bv->GetLength() != 2 ) return 1;
if( memcmp( bv->GetPointer(), buffer, 2 ) != 0 )
{
std::cerr << "Wrong content" << std::endl;
return 1;
}
}
return 0;
}
int TestFileStreamer3(int argc, char *argv[])
{
if( argc == 2 )
{
const char *filename = argv[1];
return TestFileStream3(filename, true);
}
// else
gdcm::Trace::DebugOff();
gdcm::Trace::WarningOff();
gdcm::Trace::ErrorOff();
int r = 0, i = 0;
const char *filename;
const char * const *filenames = gdcm::Testing::GetFileNames();
while( (filename = filenames[i]) )
{
r += TestFileStream3( filename );
++i;
}
return r;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageHelper2.cxx 000664 001766 001770 00000007503 14517730450 031271 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmTesting.h"
#include "gdcmImageHelper.h"
#include "gdcmImageReader.h"
#include "gdcmImageWriter.h"
#include "gdcmMediaStorage.h"
#include "gdcmDataSet.h"
#include "gdcmAttribute.h"
#include "gdcmDirectionCosines.h"
/*
* Let's check this is easy with GDCM to handle the new
* Real World Value Mapping Sequence mechanism
*/
int TestImageHelper2(int, char *[])
{
static const char *filenames[] = {
"D_CLUNIE_MR2_JPLL.dcm",
"D_CLUNIE_MR2_JPLY.dcm",
"D_CLUNIE_MR2_RLE.dcm",
"D_CLUNIE_MR4_JPLL.dcm",
"D_CLUNIE_MR4_JPLY.dcm",
"D_CLUNIE_MR4_RLE.dcm",
"MR-MONO2-12-shoulder.dcm",
"MR_Philips-Intera_BreaksNOSHADOW.dcm",
"MR_Philips_Intera_No_PrivateSequenceImplicitVR.dcm",
"MR_Philips_Intera_PrivateSequenceExplicitVR_in_SQ_2001_e05f_item_wrong_lgt_use_NOSHADOWSEQ.dcm",
"MR_Philips_Intera_SwitchIndianess_noLgtSQItem_in_trueLgtSeq.dcm",
"PHILIPS_GDCM12xBug.dcm",
"PHILIPS_GDCM12xBug2.dcm",
"PHILIPS_Gyroscan-12-Jpeg_Extended_Process_2_4.dcm",
"PHILIPS_Gyroscan-12-MONO2-Jpeg_Lossless.dcm",
"PHILIPS_Gyroscan-8-MONO2-Odd_Sequence.dcm",
"PHILIPS_Intera-16-MONO2-Uncompress.dcm",
"PhilipsInteraSeqTermInvLen.dcm",
"SIEMENS_MOSAIC_12BitsStored-16BitsJPEG.dcm",
"THERALYS-12-MONO2-Uncompressed-Even_Length_Tag.dcm",
"gdcm-MR-PHILIPS-16-Multi-Seq.dcm",
"gdcm-MR-PHILIPS-16-NonSquarePixels.dcm",
"PHILIPS_Gyroscan-12-Jpeg_Extended_Process_2_4.dcm", // need PVRG option
};
const unsigned int nfiles = sizeof(filenames)/sizeof(*filenames);
const char *root = gdcm::Testing::GetDataRoot();
if( !root || !*root )
{
std::cerr << "root is not defined" << std::endl;
return 1;
}
std::string sroot = root;
sroot += "/";
gdcm::Trace::WarningOff();
for(unsigned int i = 0; i < nfiles; ++i)
{
const char * filename = filenames[i];
std::string fullpath = sroot + filename;
gdcm::ImageHelper::SetForceRescaleInterceptSlope(true);
gdcm::ImageReader r;
r.SetFileName( fullpath.c_str() );
if( !r.Read() )
{
return 1;
}
gdcm::ImageHelper::SetForceRescaleInterceptSlope(false);
gdcm::Image & img = r.GetImage();
//std::cout << img.GetIntercept() << std::endl;
//std::cout << img.GetSlope() << std::endl;
// Create directory first:
const char subdir[] = "TestImageHelper2";
std::string tmpdir = gdcm::Testing::GetTempDirectory( subdir );
if( !gdcm::System::FileIsDirectory( tmpdir.c_str() ) )
{
gdcm::System::MakeDirectory( tmpdir.c_str() );
//return 1;
}
std::string outfilename = gdcm::Testing::GetTempFilename( filename, subdir );
gdcm::ImageWriter writer;
writer.SetFileName( outfilename.c_str() );
writer.SetFile( r.GetFile() );
writer.SetImage( r.GetImage() );
if( !writer.Write() )
{
std::cerr << "Failed to write: " << outfilename << std::endl;
return 1;
}
gdcm::ImageReader r2;
r2.SetFileName( outfilename.c_str() );
if( !r2.Read() )
{
return 1;
}
gdcm::Image & img2 = r2.GetImage();
if( img.GetIntercept() != img2.GetIntercept() )
{
std::cerr << img2.GetIntercept() << std::endl;
return 1;
}
if( img.GetSlope() != img2.GetSlope() )
{
std::cout << img2.GetSlope() << std::endl;
return 1;
}
}
return 0;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageConverter.cxx 000664 001766 001770 00000001261 14517730450 031732 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmImageConverter.h"
int TestImageConverter(int argc, char *argv[])
{
(void)argc;
(void)argv;
return 0;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestDataElementValueAsSQ.cxx 000664 001766 001770 00000003574 14517730450 032741 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmTesting.h"
#include "gdcmReader.h"
#include "gdcmDataElement.h"
#include "gdcmSequenceOfItems.h"
int TestDataElementValueAsSQ(int , char *[])
{
int ret = 0;
const char *filenames[] = {
"D_CLUNIE_CT1_J2KI.dcm",
"PET-cardio-Multiframe-Papyrus.dcm"
};
const gdcm::Tag tags[] = {
gdcm::Tag(0x8,0x2112),
gdcm::Tag(0x41,0x1010)
};
const unsigned int nfiles = sizeof(filenames)/sizeof(*filenames);
const char *root = gdcm::Testing::GetDataRoot();
if( !root || !*root )
{
std::cerr << "root is not defined" << std::endl;
return 1;
}
std::string sroot = root;
//sroot += "/DISCIMG/IMAGES/";
sroot += "/";
for(unsigned int i = 0; i < nfiles; ++i)
{
std::string filename = sroot + filenames[i];
//std::cout << filename << std::endl;
gdcm::Reader r;
r.SetFileName( filename.c_str() );
if( !r.Read() )
{
ret++;
std::cerr << "could not read: " << filename << std::endl;
}
const gdcm::Tag &tag = tags[i];
gdcm::DataSet &ds = r.GetFile().GetDataSet();
const gdcm::DataElement &roicsq = ds.GetDataElement( tag );
gdcm::SmartPointer sqi = roicsq.GetValueAsSQ();
if(!sqi)
{
++ret;
std::cerr << "could not get SQ " << tag << " from: " << filename << std::endl;
}
}
return ret;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestSpacing.cxx 000664 001766 001770 00000002736 14517730450 030414 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmSpacing.h"
int TestSpacing(int argc, char *argv[])
{
(void)argc;
(void)argv;
gdcm::Spacing s;
// gdcmData/gdcm-MR-PHILIPS-16-NonSquarePixels.dcm
// (0028,0030) DS [ 0.487416\0.194966] # 18,2 Pixel Spacing
// 0.487416 / 0.194966 = 2.5000051290994327
// Simple case ratio 1:1
gdcm::Attribute<0x28,0x30> pixelspacing = {{0.5, 0.5}};
gdcm::Attribute<0x28,0x34> par = gdcm::Spacing::ComputePixelAspectRatioFromPixelSpacing(pixelspacing);
if( par[0] != 1 || par[1] != 1 )
{
std::cerr << "par[0] = " << par[0] << " par[1]=" << par[1] << std::endl;
return 1;
}
// More complex
pixelspacing[0] = 0.487416;
pixelspacing[1] = 0.194966;
par = gdcm::Spacing::ComputePixelAspectRatioFromPixelSpacing(pixelspacing);
if( par[0] != 5 || par[1] != 2 )
{
std::cerr << "par[0] = " << par[0] << " par[1]=" << par[1] << std::endl;
return 1;
}
return 0;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestSerieHelper.cxx 000664 001766 001770 00000001235 14517730450 031230 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmSerieHelper.h"
int TestSerieHelper(int, char *[])
{
gdcm::SerieHelper sh;
return 0;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestSpectroscopy.cxx 000664 001766 001770 00000001320 14517730450 031511 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmSpectroscopy.h"
int TestSpectroscopy(int argc, char *argv[])
{
(void)argc;
(void)argv;
gdcm::Spectroscopy w;
(void)w;
return 0;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestLookupTable.cxx 000664 001766 001770 00000001236 14517730450 031243 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmLookupTable.h"
int TestLookupTable(int, char *[])
{
gdcm::LookupTable lut;
return 0;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestAudioCodec.cxx 000664 001766 001770 00000001246 14517730450 031022 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmAudioCodec.h"
int TestAudioCodec(int , char *[])
{
gdcm::AudioCodec c;
(void)c;
return 0;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestScanner1.cxx 000664 001766 001770 00000015144 14517730450 030477 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmScanner.h"
#include "gdcmDirectory.h"
#include "gdcmSystem.h"
#include "gdcmTesting.h"
#include "gdcmTrace.h"
// dcmdump /path/to/image/*.dcm 2>&/dev/null| grep 0020 | grep "000e\|000d" | sort | uniq
//
// $ find /images/ -type f -exec dcmdump -s +P 0010,0010 {} \;
static int TestScannerExtra()
{
const char *extradataroot = gdcm::Testing::GetDataExtraRoot();
if( !extradataroot )
{
return 1;
}
if( !gdcm::System::FileIsDirectory(extradataroot) )
{
std::cerr << "No such directory: " << extradataroot << std::endl;
return 1;
}
gdcm::Directory d;
unsigned int nfiles = d.Load( extradataroot, true ); // no recursion
std::cout << "done retrieving file list. " << nfiles << " files found." << std::endl;
gdcm::Scanner s;
const gdcm::Tag t1(0x0020,0x000d); // Study Instance UID
const gdcm::Tag t2(0x0020,0x000e); // Series Instance UID
const gdcm::Tag t3(0x0010,0x0010); // Patient's Name
const gdcm::Tag t4(0x0004,0x5678); // DUMMY element
const gdcm::Tag t5(0x0028,0x0010); // Rows
const gdcm::Tag t6(0x0028,0x0011); // Columns
s.AddTag( t1 );
s.AddTag( t2 );
s.AddTag( t3 );
s.AddTag( t4 );
s.AddTag( t5 );
s.AddTag( t6 );
bool b = s.Scan( d.GetFilenames() );
if( !b )
{
std::cerr << "Scanner failed" << std::endl;
return 1;
}
//s.Print( std::cout );
return 0;
}
int TestScanner1(int argc, char *argv[])
{
gdcm::Trace::WarningOff();
gdcm::Trace::ErrorOff();
const char *directory = gdcm::Testing::GetDataRoot();
if( argc == 2 )
{
directory = argv[1];
}
if( !gdcm::System::FileIsDirectory(directory) )
{
std::cerr << "No such directory: " << directory << std::endl;
return 1;
}
gdcm::Directory d;
unsigned int nfiles = d.Load( directory ); // no recursion
// d.Print( std::cout );
std::cout << "done retrieving file list. " << nfiles << " files found." << std::endl;
gdcm::Scanner s;
const gdcm::Tag t1(0x0020,0x000d); // Study Instance UID
const gdcm::Tag t2(0x0020,0x000e); // Series Instance UID
const gdcm::Tag t3(0x0010,0x0010); // Patient's Name
const gdcm::Tag t4(0x0004,0x5678); // DUMMY element
const gdcm::Tag t5(0x0028,0x0010); // Rows
const gdcm::Tag t6(0x0028,0x0011); // Columns
const gdcm::Tag t7(0x0008,0x0016); //
s.AddTag( t1 );
s.AddTag( t2 );
s.AddTag( t3 );
s.AddTag( t4 );
s.AddTag( t5 );
s.AddTag( t6 );
s.AddTag( t7 );
bool b = s.Scan( d.GetFilenames() );
if( !b )
{
std::cerr << "Scanner failed" << std::endl;
return 1;
}
// s.Print( std::cout );
gdcm::Directory::FilenamesType const & files = s.GetFilenames();
if( files != d.GetFilenames() )
{
return 1;
}
int numerrors = 0;
for( gdcm::Directory::FilenamesType::const_iterator it = files.begin(); it != files.end(); ++it )
{
const char *filename = it->c_str();
const char* value = s.GetValue(filename, t7);
const char *msstr = gdcm::Testing::GetMediaStorageFromFile(filename);
if( msstr && strcmp(msstr, "1.2.840.10008.1.3.10" ) == 0 )
{
// would need to check (0002,0002)...
}
if( value && msstr )
{
if( strcmp( value, msstr ) != 0 )
{
std::cerr << "Problem with file " << filename << std::endl;
std::cerr << value << "/" << msstr << std::endl;
++numerrors;
}
}
else
{
if ( !msstr )
{
std::cerr << "Problem with file " << filename << std::endl;
if( value ) std::cerr << "Value found: " << value << std::endl;
++numerrors;
}
}
}
if( numerrors )
return numerrors;
// Check dummy filename:
bool iskey = s.IsKey( "gdcm.rocks.invalid.name" );
if( iskey )
{
std::cout << "IsKey returned: " << iskey << std::endl;
return 1;
}
// Let's get the value for tag t1 in first file:
gdcm::Scanner::MappingType const &mt = s.GetMappings();
std::string sfilename;
sfilename = gdcm::Testing::GetDataRoot();
sfilename+= "/test.acr";
{
//const char *filename = d.GetFilenames()[0].c_str();
const char *filename = sfilename.c_str();
// The following breaks with Papyrus file: PET-cardio-Multiframe-Papyrus.dcm
unsigned int i = 0;
gdcm::Scanner::MappingType::const_iterator it = mt.find(filename);
assert( it != mt.end() );
while( it == mt.end() )
{
++i;
if( i == d.GetFilenames().size() )
{
return 1;
}
filename = d.GetFilenames()[i].c_str();
it = mt.find(filename);
}
std::cout << "Mapping for " << filename << " is :" << std::endl;
const gdcm::Scanner::TagToValue &tv = it->second;
//const std::string &filename = d.GetFilenames()[0];
gdcm::Scanner::TagToValue::const_iterator it2 = tv.find( t5 );
if( it2 == tv.end() || t5 != it2->first )
{
std::cerr << "Could not find tag:" << t5 << std::endl;
return 1;
}
const char * t1value = it2->second;
std::cout << filename << " -> " << t1 << " = " << (*t1value ? t1value : "none" ) << std::endl;
}
const gdcm::Directory::FilenamesType &filenames = d.GetFilenames();
{
gdcm::Directory::FilenamesType::const_iterator it = filenames.begin();
for(; it != filenames.end(); ++it)
{
const char *filename = it->c_str();
const gdcm::Tag &reftag = t6;
const char *value = s.GetValue( filename, reftag );
if( value )
{
assert( value );
std::cout << filename << " has " << reftag << " = " << value << std::endl;
}
else
{
std::cout << filename << " has " << reftag << " = no value or not DICOM" << std::endl;
}
}
}
/*
{
std::vector keys = s.GetKeys();
for( std::vector::const_iterator it = keys.begin(); it != keys.end(); ++it)
{
const char *filename = *it;
const gdcm::Directory::FilenamesType::const_iterator it2
= std::find(filenames.begin(), filenames.end(), filename);
if( it2 == filenames.end() )
{
return 1;
}
if( !s.IsKey( filename ) )
{
return 1;
}
}
}
*/
// puposely discard gdcmDataExtra test, this is just an 'extra' test...
int b2 = TestScannerExtra(); (void)b2;
return 0;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestFileStreamer4.cxx 000664 001766 001770 00000012301 14517730450 031463 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmFileStreamer.h"
#include "gdcmTesting.h"
#include "gdcmSystem.h"
#include "gdcmReader.h"
#include "gdcmFilename.h"
#include "gdcmImageRegionReader.h"
#include "gdcmImageHelper.h"
int TestFileStream4(const char *filename, bool verbose = false)
{
using namespace gdcm;
// Create directory first:
const char subdir[] = "TestFileStreamer4";
std::string tmpdir = Testing::GetTempDirectory( subdir );
if( !System::FileIsDirectory( tmpdir.c_str() ) )
{
System::MakeDirectory( tmpdir.c_str() );
//return 1;
}
std::string outfilename = Testing::GetTempFilename( filename, subdir );
gdcm::Filename fn( filename );
const char *name = fn.GetName();
// Special handling:
bool checktemplate = false;
if( strcmp(name, "DMCPACS_ExplicitImplicit_BogusIOP.dcm" ) == 0
|| strcmp(name, "ExplicitVRforPublicElementsImplicitVRforShadowElements.dcm") == 0
|| strcmp(name, "SIEMENS_MAGNETOM-12-MONO2-GDCM12-VRUN.dcm") == 0
)
{
checktemplate = true;
}
if( strcmp(name, "JPEGNote_empty.dcm" ) == 0
|| strcmp(name, "JPEGNote_missing.dcm" ) == 0 )
{
// cannot read dims from DICOM header...
return 0;
}
gdcm::ImageRegionReader irr;
irr.SetFileName( filename );
if( !irr.ReadInformation() )
{
//std::cerr << "not an image: " << filename << std::endl;
return 0;
}
gdcm::File & file = irr.GetFile();
std::vector dims =
gdcm::ImageHelper::GetDimensionsValue(file);
PixelFormat pf = gdcm::ImageHelper::GetPixelFormatValue(file);
int pixsize = pf.GetPixelSize();
const size_t computedlen = dims[0] * dims[1] * dims[2] * pixsize;
const FileMetaInformation &header = file.GetHeader();
const TransferSyntax &ts = header.GetDataSetTransferSyntax();
if( verbose )
{
std::cout << "Processing: " << filename << std::endl;
std::cout << "Generating: " << outfilename << std::endl;
}
std::vector vbuffer;
assert( dims[0] );
vbuffer.resize( dims[0] * pixsize );
char *buffer = vbuffer.data();
const size_t len = vbuffer.size();
gdcm::FileStreamer fs;
fs.ReserveDataElement( computedlen );
fs.SetTemplateFileName( filename );
fs.CheckTemplateFileName( checktemplate );
fs.SetOutputFileName( outfilename.c_str() );
const gdcm::Tag pixeldata(0x7fe0,0x0010);
bool b = true;
if( strcmp(name, "libido1.0-vol.acr" ) != 0 ) // use Planes instead of Number of Frames
{
b = fs.CheckDataElement( pixeldata ); // will be checking file size
}
if( !b )
{
std::cerr << "Failed to CheckDataElement: " << outfilename << std::endl;
return 1;
}
b = fs.StartDataElement( pixeldata );
if( !b )
{
std::cerr << "Failed to StartDataElement: " << outfilename << std::endl;
return 1;
}
for( unsigned int z = 0; z < dims[2]; ++z )
for( unsigned int y = 0; y < dims[1]; ++y )
{
b = fs.AppendToDataElement( pixeldata, buffer, len );
if( !b )
{
std::cerr << "Failed to AppendToDataElement: " << outfilename << std::endl;
return 1;
}
}
if( !fs.StopDataElement( pixeldata ) )
{
if( ts.IsEncapsulated() )
{
// Everything is under control
return 0;
}
std::cerr << "Failed to StopDataElement: " << outfilename << std::endl;
return 1;
}
// Read back and check:
gdcm::Reader r;
r.SetFileName( outfilename.c_str() );
if( !r.Read() )
{
std::cerr << "Failed to read: " << outfilename << std::endl;
return 1;
}
gdcm::File & f = r.GetFile();
gdcm::DataSet & ds = f.GetDataSet();
if( !ds.FindDataElement( pixeldata ) )
{
std::cerr << "No pixel data: " << outfilename << std::endl;
return 1;
}
const gdcm::DataElement & de = ds.GetDataElement( pixeldata );
const gdcm::ByteValue *bv = de.GetByteValue();
if( bv->GetLength() != computedlen )
{
std::cerr << "Mismatch len: " << outfilename << " : " << bv->GetLength() <<
" vs " << computedlen << std::endl;
return 1;
}
const char *p = bv->GetPointer();
const char *end = p + dims[0] * dims[1] * dims[2];
int res = 0;
for( ; p != end; ++p )
{
res += *p;
}
if( res )
{
std::cerr << "Mismatch: " << outfilename << std::endl;
}
return res;
}
int TestFileStreamer4(int argc, char *argv[])
{
if( argc == 2 )
{
const char *filename = argv[1];
return TestFileStream4(filename, true);
}
// else
gdcm::Trace::DebugOff();
gdcm::Trace::WarningOff();
gdcm::Trace::ErrorOff();
int r = 0, i = 0;
const char *filename;
const char * const *filenames = gdcm::Testing::GetFileNames();
while( (filename = filenames[i]) )
{
r += TestFileStream4( filename );
++i;
}
return r;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageCodec.cxx 000664 001766 001770 00000001251 14517730450 030777 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmImageCodec.h"
int TestImageCodec(int argc, char *argv[])
{
(void)argc;
(void)argv;
return 0;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestStringFilter3.cxx 000664 001766 001770 00000004155 14517730450 031524 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmStringFilter.h"
#include "gdcmAttribute.h"
#include "gdcmSmartPointer.h"
// reproduce a bug with multi value binary attribute
int TestStringFilter3(int , char *[])
{
gdcm::SmartPointer f = new gdcm::File;
gdcm::DataSet & ds = f->GetDataSet();
// (0020,0032) DS [-85.000000\ 21.600000\108.699997] # 32,3 Image Position (Patient)
{
gdcm::Attribute<0x20,0x32> at = {{ -85, 21.6, 108.699997 }};
gdcm::DataElement de = at.GetAsDataElement();
const gdcm::ByteValue * bv = de.GetByteValue();
const std::string ref( bv->GetPointer(), bv->GetLength() );
ds.Insert( de );
gdcm::StringFilter sf;
sf.SetFile( *f );
const gdcm::Tag & t = at.GetTag();
std::string s1 = sf.ToString( t );
std::string s2 = sf.FromString(t, s1.data(), s1.size() );
std::cout << s1 << std::endl;
//std::cout << s2 << std::endl;
if( s2 != ref ) return 1;
}
// (0018,1310) US 0\256\256\0 # 8,4 Acquisition Matrix
{
gdcm::Attribute<0x18,0x1310> at = {{ 0, 256, 256, 0 }};
gdcm::DataElement de = at.GetAsDataElement();
const gdcm::ByteValue * bv = de.GetByteValue();
const std::string ref( bv->GetPointer(), bv->GetLength() );
ds.Insert( de );
gdcm::StringFilter sf;
sf.SetFile( *f );
const gdcm::Tag & t = at.GetTag();
std::string s1 = sf.ToString( t );
std::string s2 = sf.FromString(t, s1.data(), s1.size() );
std::cout << "[" << s1 << "]" << std::endl;
//std::cout << s2 << std::endl;
if( s2 != ref ) return 1;
}
return 0;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageChangeTransferSyntax2.cxx 000664 001766 001770 00000013401 14517730450 034145 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmImageChangeTransferSyntax.h"
#include "gdcmImageReader.h"
#include "gdcmImageWriter.h"
#include "gdcmFilename.h"
#include "gdcmSystem.h"
#include "gdcmFileMetaInformation.h"
#include "gdcmTesting.h"
#include "gdcmByteSwap.h"
#include "gdcmImageChangePlanarConfiguration.h"
namespace gdcm
{
int TestImageChangeTransferSyntaxJ2K(const char *filename, bool verbose = false)
{
ImageReader reader;
reader.SetFileName( filename );
if ( !reader.Read() )
{
const FileMetaInformation &header = reader.GetFile().GetHeader();
MediaStorage ms = header.GetMediaStorage();
bool isImage = MediaStorage::IsImage( ms );
bool pixeldata = reader.GetFile().GetDataSet().FindDataElement( Tag(0x7fe0,0x0010) );
if( isImage && pixeldata )
{
std::cerr << "Failed to read: " << filename << std::endl;
return 1;
}
else
{
// not an image give up...
std::cerr << "Problem with: " << filename << " but that's ok" << std::endl;
return 0;
}
}
const gdcm::Image &image = reader.GetImage();
int pc = image.GetPlanarConfiguration();
gdcm::ImageChangeTransferSyntax change;
change.SetTransferSyntax( gdcm::TransferSyntax::JPEG2000Lossless );
change.SetInput( image );
bool b = change.Change();
if( !b )
{
unsigned short ba = reader.GetImage().GetPixelFormat().GetBitsAllocated();
if( ba == 12 )
{
std::cerr << "fail to change, but that's ok: " << filename << std::endl;
return 0;
}
std::cerr << "Could not change the Transfer Syntax: " << filename << std::endl;
return 1;
}
// Create directory first:
const char subdir[] = "TestImageChangeTransferSyntax2";
std::string tmpdir = Testing::GetTempDirectory( subdir );
if( !System::FileIsDirectory( tmpdir.c_str() ) )
{
System::MakeDirectory( tmpdir.c_str() );
//return 1;
}
std::string outfilename = Testing::GetTempFilename( filename, subdir );
ImageWriter writer;
writer.SetFileName( outfilename.c_str() );
writer.SetFile( reader.GetFile() ); // important for palette + multiframes
writer.SetImage( change.GetOutput() );
if( !writer.Write() )
{
std::cerr << "Failed to write: " << outfilename << std::endl;
return 1;
}
// Let's read that file back in !
ImageReader reader2;
reader2.SetFileName( outfilename.c_str() );
if ( !reader2.Read() )
{
std::cerr << "Could not even reread our generated file : " << outfilename << std::endl;
return 1;
}
// Check that after decompression we still find the same thing:
int res = 0;
gdcm::Image img = reader2.GetImage();
// When recompressing: US-RGB-8-epicard.dcm, make sure to compute the md5 using the
// same original Planar Configuration...
if( (int)img.GetPlanarConfiguration() != pc )
{
gdcm::ImageChangePlanarConfiguration icpc;
icpc.SetInput( reader2.GetImage() );
icpc.SetPlanarConfiguration( pc );
icpc.Change();
img = icpc.GetOutput();
}
//std::cerr << "Success to read image from file: " << filename << std::endl;
unsigned long len = img.GetBufferLength();
char* buffer = new char[len];
bool res2 = img.GetBuffer(buffer);
if( !res2 )
{
std::cerr << "could not get buffer: " << outfilename << std::endl;
return 1;
}
// On big Endian system we have byteswapped the buffer (duh!)
// Since the md5sum is byte based there is now way it would detect
// that the file is written in big endian word, so comparing against
// a md5sum computed on LittleEndian would fail. Thus we need to
// byteswap (again!) here:
#ifdef GDCM_WORDS_BIGENDIAN
if( img.GetPixelFormat().GetBitsAllocated() == 16 )
{
assert( !(len % 2) );
assert( img.GetPhotometricInterpretation() == gdcm::PhotometricInterpretation::MONOCHROME1
|| img.GetPhotometricInterpretation() == gdcm::PhotometricInterpretation::MONOCHROME2 );
gdcm::ByteSwap::SwapRangeFromSwapCodeIntoSystem(
(unsigned short*)buffer, gdcm::SwapCode::LittleEndian, len/2);
}
#endif
const char *ref = gdcm::Testing::GetMD5FromFile(filename);
char digest[33];
gdcm::Testing::ComputeMD5(buffer, len, digest);
if( !ref )
{
// new regression image needs a md5 sum
std::cerr << "Missing md5 " << digest << " for: " << filename << std::endl;
//assert(0);
res = 1;
}
else if( strcmp(digest, ref) != 0 )
{
std::cerr << "Problem reading image from: " << filename << std::endl;
std::cerr << "Found " << digest << " instead of " << ref << std::endl;
res = 1;
}
if(res)
{
std::cerr << "problem with: " << outfilename << std::endl;
}
if( verbose )
{
std::cout << "file was written in: " << outfilename << std::endl;
}
delete[] buffer;
return res;
}
} // end namespace gdcm
int TestImageChangeTransferSyntax2(int argc, char *argv[])
{
if( argc == 2 )
{
const char *filename = argv[1];
return gdcm::TestImageChangeTransferSyntaxJ2K(filename, true);
}
// else
gdcm::Trace::DebugOff();
gdcm::Trace::WarningOff();
int r = 0, i = 0;
const char *filename;
const char * const *filenames = gdcm::Testing::GetFileNames();
while( (filename = filenames[i]) )
{
r += gdcm::TestImageChangeTransferSyntaxJ2K( filename );
++i;
}
return r;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestSplitMosaicFilter2.cxx 000664 001766 001770 00000014055 14517730450 032504 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmSplitMosaicFilter.h"
#include "gdcmTesting.h"
#include "gdcmSystem.h"
#include "gdcmReader.h"
#include "gdcmAnonymizer.h"
#include "gdcmPrivateTag.h"
#include "gdcmCSAHeader.h"
#include "gdcmElement.h"
#include "gdcmDirectionCosines.h"
int TestSplitMosaicFilter2(int argc, char *argv[])
{
std::string filename;
if( argc == 2 )
{
filename = argv[1];
}
else
{
const char *extradataroot = gdcm::Testing::GetDataExtraRoot();
if( !extradataroot )
{
return 1;
}
if( !gdcm::System::FileIsDirectory(extradataroot) )
{
std::cerr << "No such directory: " << extradataroot << std::endl;
return 1;
}
filename = extradataroot;
filename += "/gdcmSampleData/images_of_interest/MR-sonata-3D-as-Tile.dcm";
}
gdcm::SplitMosaicFilter s;
if( !gdcm::System::FileExists(filename.c_str()) )
{
return 1;
}
gdcm::Reader reader;
reader.SetFileName( filename.c_str() );
if( !reader.Read() )
{
std::cerr << "could not read: " << filename << std::endl;
return 1;
}
gdcm::SplitMosaicFilter filter;
filter.SetFile( reader.GetFile() );
bool inverted;
double slicenormal[3];
bool b = filter.ComputeMOSAICSliceNormal( slicenormal, inverted );
if( !b )
{
std::cerr << "Could not ComputeMOSAICSliceNormal: " << filename << std::endl;
return 1;
}
// SliceNormalVector is slightly less precise that sNormal:
//const double refnormal[3] = {-0.08193696,0.08808136,0.99273763};
// Value as read from sNormal (sSlice)
const double refnor[3] = { -0.08193693363, 0.08808135446, 0.992737636 };
const double eps = 1e-6;
gdcm::DirectionCosines dc;
const double dot = dc.Dot( slicenormal, refnor );
if( std::fabs( 1.0 - dot ) > eps )
{
std::cerr << "Invalid ComputeMOSAICSliceNormal: " << filename << std::endl;
return 1;
}
double slicepos[3];
b = filter.ComputeMOSAICSlicePosition( slicepos, inverted );
if( !b )
{
std::cerr << "Could not ComputeMOSAICSlicePosition: " << filename << std::endl;
return 1;
}
const double refpos[3] = { 2.24891108,-52.65585315,-26.94105767 };
for( int i = 0; i < 3; ++i )
{
if( std::fabs( refpos[i] - slicepos[i] ) > eps )
{
std::cerr << "Invalid ComputeMOSAICSlicePosition: " << filename << std::endl;
return 1;
}
}
gdcm::CSAHeader csa;
gdcm::DataSet & ds = reader.GetFile().GetDataSet();
gdcm::MrProtocol mrprot;
if( !csa.GetMrProtocol(ds, mrprot))
{
std::cerr << "No MrProtocol" << filename << std::endl;
return 1;
}
gdcm::MrProtocol::SliceArray sa;
b = mrprot.GetSliceArray(sa);
if( !b || sa.Slices.size() != 31 )
{
return 1;
}
gdcm::MrProtocol::Slice & slice0 = sa.Slices[0];
gdcm::MrProtocol::Vector3 & p0 = slice0.Position;
double pos0[3];
pos0[0] = p0.dSag;
pos0[1] = p0.dCor;
pos0[2] = p0.dTra;
for( int i = 0; i < 3; ++i )
{
if( std::fabs( refpos[i] - pos0[i] ) > eps )
{
std::cerr << "Invalid slice0: " << filename << std::endl;
return 1;
}
}
gdcm::MrProtocol::Slice & slice1 = sa.Slices[1];
gdcm::MrProtocol::Vector3 & p1 = slice1.Position;
double pos1[3];
pos1[0] = p1.dSag;
pos1[1] = p1.dCor;
pos1[2] = p1.dTra;
double altnor[3];
for( int i = 0; i < 3; ++i )
{
altnor[i] = pos1[i] - pos0[i];
}
dc.Normalize( altnor );
const double dot2 = dc.Dot( altnor, refnor );
if( std::fabs( 1.0 - dot2 ) > eps )
{
std::cerr << "Incompatible alt " << filename << std::endl;
return 1;
}
for( int k = 0; k < 31; ++k )
{
gdcm::MrProtocol::Slice & slice = sa.Slices[k];
gdcm::MrProtocol::Vector3 & nor = slice.Normal;
double normal[3];
normal[0] = nor.dSag;
normal[1] = nor.dCor;
normal[2] = nor.dTra;
for( int i = 0; i < 3; ++i )
{
if( std::fabs( refnor[i] - normal[i] ) > eps )
{
std::cerr << "Invalid normal: " << filename << std::endl;
return 1;
}
}
}
gdcm::Anonymizer ano;
ano.SetFile( reader.GetFile() );
const gdcm::PrivateTag &t1 = csa.GetCSAImageHeaderInfoTag();
ano.Remove( t1 );
unsigned int modims[3];
b = filter.ComputeMOSAICDimensions( modims );
if( !b ) return 1;
const unsigned int ref0[3] = { 64u, 64u, 36u }; // padded with black
if( modims[0] != ref0[0] || modims[1] != ref0[1] || modims[2] != ref0[2] )
{
std::cerr << "Invalid ComputeMOSAICDimensions " << filename << std::endl;
return 1;
}
// alternate code path:
gdcm::PrivateTag t2 (0x0019,0x0a, "SIEMENS MR HEADER");
if( ds.FindDataElement( t2 ) )
{
return 1;
}
else
{
// Create a fake one:
std::string creator = ds.GetPrivateCreator( t2 );
if( !creator.empty() ) return 1;
gdcm::Tag t3 (0x0019,0x10);
ano.Replace( t3, t2.GetOwner() );
gdcm::Element elem;
elem.SetValue( 31 );
gdcm::DataElement de = elem.GetAsDataElement();
de.SetTag( t2 );
const uint16_t el = de.GetTag().GetElement();
de.GetTag().SetElement( 0x1000 + el );
if( de.GetVR() != gdcm::VR::US ) return 1;
ds.Insert( de );
creator = ds.GetPrivateCreator( de.GetTag() );
if( creator.empty() ) return 1;
}
b = filter.ComputeMOSAICDimensions( modims );
if( !b )
{
std::cerr << "Could not ComputeMOSAICDimensions " << filename << std::endl;
return 1;
}
const unsigned int ref[3] = { 64u, 64u, 31u };
if( modims[0] != ref[0] || modims[1] != ref[1] || modims[2] != ref[2] )
{
std::cerr << "Invalid ComputeMOSAICDimensions " << filename << std::endl;
return 1;
}
return 0;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageToImageFilter.cxx 000664 001766 001770 00000001261 14517730450 032456 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmImageToImageFilter.h"
int TestImageToImageFilter(int, char *[])
{
gdcm::ImageToImageFilter f;
return 0;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestCleaner4.cxx 000664 001766 001770 00000031027 14517730450 030460 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmCleaner.h"
#include "gdcmFilename.h"
#include "gdcmReader.h"
#include "gdcmSmartPointer.h"
#include "gdcmSystem.h"
#include "gdcmTesting.h"
#include "gdcmWriter.h"
namespace gdcm {
template
static const DataSet &GetNestedDataSet(const DataSet &ds, const T &path) {
const DataElement &de = ds.GetDataElement(path);
SmartPointer sqi = de.GetValueAsSQ();
assert(sqi && sqi->GetNumberOfItems() == 1);
const Item &item = sqi->GetItem(1);
const DataSet &subds = item.GetNestedDataSet();
return subds;
}
template
static bool IsTagIn(const DataSet &ds, const T &pt) {
return ds.FindDataElement(pt);
}
template
static bool IsTagIn(const DataSet &ds, const T1 &path, const T2 &pt) {
const DataSet &subds = GetNestedDataSet(ds, path);
return subds.FindDataElement(pt);
}
template
static bool IsTagEmpty(const DataSet &ds, const T &pt) {
if (!ds.FindDataElement(pt)) return false;
const DataElement &de = ds.GetDataElement(pt);
return de.IsEmpty();
}
template
static bool IsTagEmpty(const DataSet &ds, const T1 &path, const T2 &pt) {
const DataSet &subds = GetNestedDataSet(ds, path);
if (!subds.FindDataElement(pt)) return false;
const DataElement &de = subds.GetDataElement(pt);
return de.IsEmpty();
}
} // namespace gdcm
struct TestCleaner4Impl {
virtual ~TestCleaner4Impl() = default;
virtual bool check_before(gdcm::DataSet &ds) = 0;
virtual bool check_after(gdcm::DataSet &ds, bool preservePatientName) = 0;
int run(std::string const &filename, std::string const &outfilename,
bool useDPath, bool preservePatientName = false) {
using namespace gdcm;
// Setup DPath
DPath dpath1, dpath2;
if (useDPath) {
}
// first pass
{
Reader reader;
reader.SetFileName(filename.c_str());
if (!reader.Read()) {
std::cerr << "Could not read: " << filename << std::endl;
return 1;
}
File &file = reader.GetFile();
DataSet &ds = file.GetDataSet();
if (!check_before(ds)) {
std::cerr << "Test not setup correctly" << std::endl;
return 1;
}
Cleaner cleaner;
cleaner.SetFile(file);
cleaner.RemoveAllGroupLength(false);
if (preservePatientName) {
DPath dpath;
dpath.ConstructFromString("\\0010,0010");
cleaner.Preserve(dpath);
}
if (useDPath) {
if (!cleaner.Empty(dpath1)) {
return 1;
}
} else {
if (!cleaner.Empty(VR(VR::PN))) {
return 1;
}
}
if (!cleaner.Clean()) {
return 1;
}
Writer writer;
writer.SetFileName(outfilename.c_str());
writer.SetFile(cleaner.GetFile());
#if 0
gdcm::FileMetaInformation::SetSourceApplicationEntityTitle("gdcmconv");
file.GetHeader().Clear();
writer.SetCheckFileMetaInformation(true);
#endif
if (!writer.Write()) {
std::cerr << "Failed to write: " << outfilename << std::endl;
return 1;
}
}
// re-read, written out:
{
Reader reader;
reader.SetFileName(outfilename.c_str());
if (!reader.Read()) {
std::cerr << "Could not read: " << outfilename << std::endl;
return 1;
}
File &file = reader.GetFile();
DataSet &ds = file.GetDataSet();
if (!check_after(ds, preservePatientName)) {
std::cerr << "At least one tag was not empty" << std::endl;
return 1;
}
}
return 0;
}
};
struct TestCleaner4Impl1 : public TestCleaner4Impl {
bool check_before(gdcm::DataSet &ds) override {
const gdcm::Tag t1(0x0008, 0x0090); //
const gdcm::Tag t2(0x0008, 0x1050); //
const gdcm::Tag t3(0x0008, 0x1070); //
const gdcm::Tag t4(0x0010, 0x0010); //
{
const bool b1 = IsTagIn(ds, t1);
const bool b2 = IsTagIn(ds, t2);
const bool b3 = IsTagIn(ds, t3);
const bool b4 = IsTagIn(ds, t4);
if (!b1 || !b2 || !b3 || !b4) {
return false;
}
}
{
const bool b1 = IsTagEmpty(ds, t1);
const bool b2 = IsTagEmpty(ds, t2);
const bool b3 = IsTagEmpty(ds, t3);
const bool b4 = IsTagEmpty(ds, t4);
if (b1 || b2 || b3 || b4) {
return false;
}
}
return true;
}
bool check_after(gdcm::DataSet &ds, bool /*preservePatientName*/) override {
const gdcm::Tag t1(0x0008, 0x0090); //
const gdcm::Tag t2(0x0008, 0x1050); //
const gdcm::Tag t3(0x0008, 0x1070); //
const gdcm::Tag t4(0x0010, 0x0010); //
const bool b1 = IsTagEmpty(ds, t1);
const bool b2 = IsTagEmpty(ds, t2);
const bool b3 = IsTagEmpty(ds, t3);
const bool b4 = IsTagEmpty(ds, t4);
if (!b1 || !b2 || !b3 || !b4) {
return false;
}
return true;
}
};
struct TestCleaner4Impl2 : public TestCleaner4Impl {
bool check_before(gdcm::DataSet &ds) override {
const gdcm::Tag t1(0x0008, 0x0090); // PN 6 EU^^^^
const gdcm::Tag t2(0x0008, 0x1050); // PN 4 ^^^^
const gdcm::Tag t3(0x0008, 0x1060); // PN 16 DR.H.DOOLITTLER
const gdcm::Tag t4(0x0008, 0x1070); // PN 4 CNA
const gdcm::Tag t5(0x0010, 0x0010); // PN 16 ABCDEF^GHIJK^^MR
const gdcm::Tag t6(0x0032, 0x1032); // PN 10 EMERG-UNIT
{
const bool b1 = IsTagIn(ds, t1);
const bool b2 = IsTagIn(ds, t2);
const bool b3 = IsTagIn(ds, t3);
const bool b4 = IsTagIn(ds, t4);
const bool b5 = IsTagIn(ds, t5);
const bool b6 = IsTagIn(ds, t6);
if (!b1 || !b2 || !b3 || !b4 || !b5 || !b6) {
return false;
}
}
{
const bool b1 = IsTagEmpty(ds, t1);
const bool b2 = IsTagEmpty(ds, t2);
const bool b3 = IsTagEmpty(ds, t3);
const bool b4 = IsTagEmpty(ds, t4);
const bool b5 = IsTagEmpty(ds, t5);
const bool b6 = IsTagEmpty(ds, t6);
if (b1 || b2 || b3 || b4 || b5 || b6) {
return false;
}
}
return true;
}
bool check_after(gdcm::DataSet &ds, bool /*preservePatientName*/) override {
const gdcm::Tag t1(0x0008, 0x0090); // PN 6 EU^^^^
const gdcm::Tag t2(0x0008, 0x1050); // PN 4 ^^^^
const gdcm::Tag t3(0x0008, 0x1060); // PN 16 DR.H.DOOLITTLER
const gdcm::Tag t4(0x0008, 0x1070); // PN 4 CNA
const gdcm::Tag t5(0x0010, 0x0010); // PN 16 ABCDEF^GHIJK^^MR
const gdcm::Tag t6(0x0032, 0x1032); // PN 10 EMERG-UNIT
const bool b1 = IsTagEmpty(ds, t1);
const bool b2 = IsTagEmpty(ds, t2);
const bool b3 = IsTagEmpty(ds, t3);
const bool b4 = IsTagEmpty(ds, t4);
const bool b5 = IsTagEmpty(ds, t5);
const bool b6 = IsTagEmpty(ds, t6);
if (!b1 || !b2 || !b3 || !b4 || !b5 || !b6) {
return false;
}
return true;
}
};
struct TestCleaner4Impl3 : public TestCleaner4Impl {
bool check_before(gdcm::DataSet &ds) override {
const gdcm::Tag t1(0x0008, 0x0090); //
const gdcm::Tag t2(0x0008, 0x1070); //
const gdcm::Tag t3(0x0010, 0x0010); //
const gdcm::PrivateTag path1(0x2001, 0x00, "Philips Imaging DD 129");
const gdcm::Tag t4(0x0070, 0x0084); //
const gdcm::PrivateTag pt5(0x2005, 0x91, "Philips MR Imaging DD 004"); //
{
const bool b1 = IsTagIn(ds, t1);
const bool b2 = IsTagIn(ds, t2);
const bool b3 = IsTagIn(ds, t3);
const bool b4 = IsTagIn(ds, path1, t4);
const bool b5 = IsTagIn(ds, pt5);
if (!b1 || !b2 || !b3 || !b4 || !b5) {
return false;
}
}
{
const bool b1 = IsTagEmpty(ds, t1);
const bool b2 = IsTagEmpty(ds, t2);
const bool b3 = IsTagEmpty(ds, t3);
const bool b4 = IsTagEmpty(ds, path1, t4);
const bool b5 = IsTagEmpty(ds, pt5);
if (!b1 || !b2 || b3 || b4 || !b5) {
return false;
}
}
return true;
}
bool check_after(gdcm::DataSet &ds, bool /*preservePatientName*/) override {
const gdcm::Tag t1(0x0008, 0x0090); //
const gdcm::Tag t2(0x0008, 0x1070); //
const gdcm::Tag t3(0x0010, 0x0010); //
const gdcm::PrivateTag path1(0x2001, 0x00, "Philips Imaging DD 129");
const gdcm::Tag t4(0x0070, 0x0084); //
const gdcm::PrivateTag pt5(0x2005, 0x91, "Philips MR Imaging DD 004"); //
const bool b1 = IsTagEmpty(ds, t1);
const bool b2 = IsTagEmpty(ds, t2);
const bool b3 = IsTagEmpty(ds, t3);
const bool b4 = IsTagEmpty(ds, path1, t4);
const bool b5 = IsTagEmpty(ds, pt5);
if (!b1 || !b2 || !b3 || !b4 || !b5) {
return false;
}
return true;
}
};
struct TestCleaner4Impl4 : public TestCleaner4Impl {
bool check_before(gdcm::DataSet &ds) override {
const gdcm::Tag t1(0x0008, 0x0090); //
const gdcm::Tag t2(0x0008, 0x1070); //
const gdcm::Tag t3(0x0010, 0x0010); //
const gdcm::PrivateTag path1(0xe1, 0x39, "ELSCINT1");
const gdcm::Tag t4(0x0008, 0x0090); //
const gdcm::Tag t5(0x0032, 0x1032); //
{
const bool b1 = IsTagIn(ds, t1);
const bool b2 = IsTagIn(ds, t2);
const bool b3 = IsTagIn(ds, t3);
const bool b4 = IsTagIn(ds, path1, t4);
const bool b5 = IsTagIn(ds, path1, t5);
if (!b1 || !b2 || !b3 || !b4 || !b5) {
return false;
}
}
{
const bool b1 = IsTagEmpty(ds, t1);
const bool b2 = IsTagEmpty(ds, t2);
const bool b3 = IsTagEmpty(ds, t3);
const bool b4 = IsTagEmpty(ds, path1, t4);
const bool b5 = IsTagEmpty(ds, path1, t5);
if (!b1 || b2 || b3 || !b4 || !b5) {
return false;
}
}
return true;
}
bool check_after(gdcm::DataSet &ds, bool preservePatientName) override {
const gdcm::Tag t1(0x0008, 0x0090); //
const gdcm::Tag t2(0x0008, 0x1070); //
const gdcm::Tag t3(0x0010, 0x0010); //
const gdcm::PrivateTag path1(0xe1, 0x39, "ELSCINT1");
const gdcm::Tag t4(0x0008, 0x0090); //
const gdcm::Tag t5(0x0032, 0x1032); //
const bool b1 = IsTagEmpty(ds, t1);
const bool b2 = IsTagEmpty(ds, t2);
const bool b3 =
preservePatientName ? !IsTagEmpty(ds, t3) : IsTagEmpty(ds, t3);
const bool b4 = IsTagEmpty(ds, path1, t4);
const bool b5 = IsTagEmpty(ds, path1, t5);
if (!b1 || !b2 || !b3 || !b4 || !b5) {
assert(0);
return false;
}
return true;
}
};
int TestCleaner4(int, char *[]) {
using namespace gdcm;
const char *directory = gdcm::Testing::GetDataRoot();
std::string sfilename1 =
std::string(directory) + "/GE_DLX-8-MONO2-Multiframe.dcm"; // implicit
const char *filename1 = sfilename1.c_str();
std::string sfilename2 =
std::string(directory) + "/JPEGInvalidSecondFrag.dcm"; // OB => PN
const char *filename2 = sfilename2.c_str();
std::string sfilename3 =
std::string(directory) + "/undefined_length_un_vr.dcm"; // => nested
const char *filename3 = sfilename3.c_str();
std::string sfilename4 =
std::string(directory) + "/MAROTECH_CT_JP2Lossy.dcm"; // => nested
const char *filename4 = sfilename4.c_str();
// Create directory first:
const char subdir[] = "TestCleaner4";
std::string tmpdir = Testing::GetTempDirectory(subdir);
if (!System::FileIsDirectory(tmpdir.c_str())) {
System::MakeDirectory(tmpdir.c_str());
}
std::string outfilename1 = Testing::GetTempFilename(filename1, subdir);
std::string outfilename2 = Testing::GetTempFilename(filename2, subdir);
std::string outfilename3 = Testing::GetTempFilename(filename3, subdir);
std::string outfilename4 = Testing::GetTempFilename(filename4, subdir);
TestCleaner4Impl1 testCleaner1;
TestCleaner4Impl2 testCleaner2;
TestCleaner4Impl3 testCleaner3;
TestCleaner4Impl4 testCleaner4;
int res1 = testCleaner1.run(filename1, outfilename1, false);
int res2 = testCleaner2.run(filename2, outfilename2, false);
int res3 = testCleaner3.run(filename3, outfilename3, false);
int res4 = testCleaner4.run(filename4, outfilename4, false, false);
int res5 = testCleaner4.run(filename4, outfilename4, false, true);
return res1 + res2 + res3 + res4 + res5;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestStrictScanner2.cxx 000664 001766 001770 00000004054 14517730450 031667 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmStrictScanner.h"
#include "gdcmDirectory.h"
#include "gdcmSystem.h"
#include "gdcmTesting.h"
#include "gdcmTrace.h"
int TestStrictScanner2(int argc, char *argv[])
{
gdcm::Trace::WarningOff();
gdcm::Trace::ErrorOff();
const char *directory = gdcm::Testing::GetDataRoot();
std::string tmpdir = gdcm::Testing::GetTempDirectory( "TestWriter" );
directory = tmpdir.c_str();
if( argc == 2 )
{
directory = argv[1];
}
if( !gdcm::System::FileIsDirectory(directory) )
{
std::cerr << "No such directory: " << directory << std::endl;
return 1;
}
gdcm::Directory d;
unsigned int nfiles = d.Load( directory ); // no recursion
std::cout << "done retrieving file list. " << nfiles << " files found." << std::endl;
gdcm::StrictScanner s;
const gdcm::Tag t2(0x0020,0x000e); // Series Instance UID
s.AddTag( t2 );
bool b = s.Scan( d.GetFilenames() );
if( !b )
{
std::cerr << "Scanner failed" << std::endl;
return 1;
}
gdcm::Directory::FilenamesType const & files = s.GetFilenames();
if( files != d.GetFilenames() )
{
return 1;
}
const char str1[] = "1.3.12.2.1107.5.2.4.7630.20010301125744000008";
gdcm::Directory::FilenamesType fns = s.GetAllFilenamesFromTagToValue(t2, str1);
// all SIEMENS_MAGNETOM-12-MONO2-FileSeq*.dcm:
if( fns.size() != 4 ) return 1;
const char str2[] = "1.3.12.2.1107.5.2.4.7630.2001030112574400000";
fns = s.GetAllFilenamesFromTagToValue(t2, str2);
if( !fns.empty() ) return 1;
return 0;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestValidate.cxx 000664 001766 001770 00000001245 14517730450 030553 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmValidate.h"
int TestValidate(int, char *[])
{
gdcm::Validate v;
v.Validation();
return 0;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestDecoder.cxx 000664 001766 001770 00000001444 14517730450 030370 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmDecoder.h"
namespace gdcm
{
class DummyDecoder : public Decoder
{
public:
bool CanDecode(TransferSyntax const &) const override { return false; }
};
}
int TestDecoder(int, char *[])
{
gdcm::DummyDecoder d;
return 0;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageChangeTransferSyntax4.cxx 000664 001766 001770 00000012770 14517730450 034157 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmImageChangeTransferSyntax.h"
#include "gdcmImageReader.h"
#include "gdcmImageWriter.h"
#include "gdcmFilename.h"
#include "gdcmSystem.h"
#include "gdcmFileMetaInformation.h"
#include "gdcmTesting.h"
#include "gdcmByteSwap.h"
namespace gdcm
{
int TestImageChangeTransferSyntaxRAW(const char *filename, bool verbose = false)
{
ImageReader reader;
reader.SetFileName( filename );
if ( !reader.Read() )
{
const FileMetaInformation &header = reader.GetFile().GetHeader();
MediaStorage ms = header.GetMediaStorage();
bool isImage = MediaStorage::IsImage( ms );
bool pixeldata = reader.GetFile().GetDataSet().FindDataElement( Tag(0x7fe0,0x0010) );
if( isImage && pixeldata )
{
std::cerr << "Failed to read: " << filename << std::endl;
return 1;
}
else
{
// not an image give up...
std::cerr << "Problem with: " << filename << " but that's ok" << std::endl;
return 0;
}
}
const gdcm::Image &image = reader.GetImage();
const TransferSyntax &ts = reader.GetFile().GetHeader().GetDataSetTransferSyntax();
gdcm::ImageChangeTransferSyntax change;
if( ts == gdcm::TransferSyntax::ExplicitVRLittleEndian )
{
// TODO: I think that duplicate goals of TestImageWriter2 ...
//change.SetTransferSyntax( gdcm::TransferSyntax::ImplicitVRLittleEndian );
change.SetTransferSyntax( gdcm::TransferSyntax::ExplicitVRLittleEndian );
}
else
{
change.SetTransferSyntax( gdcm::TransferSyntax::ExplicitVRLittleEndian );
}
change.SetInput( image );
bool b = change.Change();
if( !b )
{
std::cerr << "Could not change the Transfer Syntax: " << filename << std::endl;
return 1;
}
// Create directory first:
const char subdir[] = "TestImageChangeTransferSyntax4";
std::string tmpdir = Testing::GetTempDirectory( subdir );
if( !System::FileIsDirectory( tmpdir.c_str() ) )
{
System::MakeDirectory( tmpdir.c_str() );
//return 1;
}
std::string outfilename = Testing::GetTempFilename( filename, subdir );
ImageWriter writer;
writer.SetFileName( outfilename.c_str() );
writer.SetFile( reader.GetFile() ); // increase test goal
writer.SetImage( change.GetOutput() );
if( !writer.Write() )
{
std::cerr << "Failed to write: " << outfilename << std::endl;
return 1;
}
// Let's read that file back in !
ImageReader reader2;
reader2.SetFileName( outfilename.c_str() );
if ( !reader2.Read() )
{
std::cerr << "Could not even reread our generated file : " << outfilename << std::endl;
return 1;
}
// Check that after decompression we still find the same thing:
int res = 0;
const gdcm::Image &img = reader2.GetImage();
//std::cerr << "Success to read image from file: " << filename << std::endl;
unsigned long len = img.GetBufferLength();
char* buffer = new char[len];
bool res2 = img.GetBuffer(buffer);
if( !res2 )
{
std::cerr << "could not get buffer: " << outfilename << std::endl;
return 1;
}
// On big Endian system we have byteswapped the buffer (duh!)
// Since the md5sum is byte based there is now way it would detect
// that the file is written in big endian word, so comparing against
// a md5sum computed on LittleEndian would fail. Thus we need to
// byteswap (again!) here:
#ifdef GDCM_WORDS_BIGENDIAN
if( img.GetPixelFormat().GetBitsAllocated() == 16 )
{
assert( !(len % 2) );
assert( img.GetPhotometricInterpretation() == gdcm::PhotometricInterpretation::MONOCHROME1
|| img.GetPhotometricInterpretation() == gdcm::PhotometricInterpretation::MONOCHROME2 );
gdcm::ByteSwap::SwapRangeFromSwapCodeIntoSystem(
(unsigned short*)buffer, gdcm::SwapCode::LittleEndian, len/2);
}
#endif
const char *ref = gdcm::Testing::GetMD5FromFile(filename);
char digest[33];
gdcm::Testing::ComputeMD5(buffer, len, digest);
if( !ref )
{
// new regression image needs a md5 sum
std::cerr << "Missing md5 " << digest << " for: " << filename << std::endl;
//assert(0);
res = 1;
}
else if( strcmp(digest, ref) != 0 )
{
std::cerr << "Problem reading image from: " << filename << std::endl;
std::cerr << "Found " << digest << " instead of " << ref << std::endl;
res = 1;
}
if(res)
{
std::cerr << "problem with: " << outfilename << std::endl;
}
if( verbose )
{
std::cout << "file was written in: " << outfilename << std::endl;
}
delete[] buffer;
return res;
}
} // end namespace gdcm
int TestImageChangeTransferSyntax4(int argc, char *argv[])
{
if( argc == 2 )
{
const char *filename = argv[1];
return gdcm::TestImageChangeTransferSyntaxRAW(filename, true);
}
// else
gdcm::Trace::DebugOff();
gdcm::Trace::WarningOff();
int r = 0, i = 0;
const char *filename;
const char * const *filenames = gdcm::Testing::GetFileNames();
while( (filename = filenames[i]) )
{
r += gdcm::TestImageChangeTransferSyntaxRAW( filename );
++i;
}
return r;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestCodec.cxx 000664 001766 001770 00000001557 14517730450 030045 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmCodec.h"
namespace gdcm
{
class DummyCodec : public Codec
{
public:
bool CanDecode(TransferSyntax const &) const override { return false; }
bool CanCode(TransferSyntax const &) const override { return false; }
};
}
int TestCodec(int , char *[])
{
gdcm::DummyCodec c;
(void)c;
return 0;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestSorter.cxx 000664 001766 001770 00000002533 14517730450 030301 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmSorter.h"
#include "gdcmTesting.h"
int TestSorter(int argc, char *argv[])
{
// Black box:
gdcm::Directory::FilenamesType fns;
gdcm::Sorter s;
// No sort function and fns is empty
if( !s.Sort( fns ) )
{
return 1;
}
// White box:
const char *directory = gdcm::Testing::GetDataRoot();
if( argc == 2 )
{
directory = argv[1];
}
gdcm::Directory d;
unsigned int nfiles = d.Load( directory ); // no recursion
d.Print( std::cout );
std::cout << "done retrieving file list. " << nfiles << " files found." << std::endl;
/* bool b = s.Sort( d.GetFilenames() );
if( !b )
{
std::cerr << "Failed to sort:" << directory << std::endl;
return 1;
}
std::cout << "Sorting succeeded:" << std::endl;
s.Print( std::cout );
*/
return 0;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestAnonymizer4.cxx 000664 001766 001770 00000005533 14517730450 031245 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmAnonymizer.h"
#include "gdcmReader.h"
#include "gdcmWriter.h"
#include "gdcmTesting.h"
#include "gdcmSystem.h"
#include "gdcmUIDGenerator.h"
namespace gdcm
{
static int TestAnonymize(const char *subdir, const char* filename)
{
Reader reader;
reader.SetFileName( filename );
if ( !reader.Read() )
{
return 1;
}
Anonymizer anonymizer;
anonymizer.SetFile( reader.GetFile() );
// Setup some actions:
const char empty[] = "";
const PrivateTag ptag1 = PrivateTag(0x0029,0x20,"SIEMENS MEDCOM HEADER");
const PrivateTag ptag2 = PrivateTag(0x0029,0x60,"SIEMENS MEDCOM HEADER2");
const PrivateTag ptag3 = PrivateTag(0x0029,0x10,"SIEMENS CSA HEADER");
anonymizer.Replace( ptag1 , empty );
anonymizer.Remove( ptag2 );
anonymizer.Empty( ptag3 );
anonymizer.Clear( ptag3 );
// Create directory first:
std::string tmpdir = Testing::GetTempDirectory( subdir );
if( !System::FileIsDirectory( tmpdir.c_str() ) )
{
System::MakeDirectory( tmpdir.c_str() );
//return 1;
}
std::string outfilename = Testing::GetTempFilename( filename, subdir );
Writer writer;
writer.SetFileName( outfilename.c_str() );
writer.SetFile( reader.GetFile() );
writer.SetCheckFileMetaInformation( false );
if( !writer.Write() )
{
std::cerr << "Failed to write: " << outfilename << std::endl;
return 1;
}
std::cout << "Success to write: " << outfilename << std::endl;
// now let's try to read it back in:
Reader reader2;
reader2.SetFileName( outfilename.c_str() );
if ( !reader2.Read() )
{
std::cerr << "Could not reread written file: " << outfilename << std::endl;
return 1;
}
const DataSet & ds = reader.GetFile().GetDataSet();
//std::cout << ds << std::endl;
const ByteValue *bv = ds.GetDataElement( ptag2 ).GetByteValue();
if( !bv )
{
return 1;
}
if( bv->GetLength() != 0 )
{
return 1;
}
return 0;
}
}
int TestAnonymizer4(int argc, char *argv[])
{
if( argc == 2 )
{
const char *filename = argv[1];
return gdcm::TestAnonymize(argv[0], filename);
}
// else
int r = 0, i = 0;
const char *filename;
const char * const *filenames = gdcm::Testing::GetFileNames();
while( (filename = filenames[i]) )
{
r += gdcm::TestAnonymize( argv[0], filename );
++i;
}
return r;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestSurfaceWriter.cxx 000664 001766 001770 00000006525 14517730450 031615 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmTesting.h"
#include "gdcmSurfaceWriter.h"
#include "gdcmSurfaceReader.h"
#include "gdcmFileMetaInformation.h"
#include "gdcmFilename.h"
#include "gdcmSystem.h"
#include "gdcmAttribute.h"
namespace gdcm
{
int TestSurfaceWriter(const char *subdir, const char* filename)
{
SurfaceReader reader;
reader.SetFileName( filename );
if ( !reader.Read() )
{
int ret = 1;
gdcm::MediaStorage ms;
if( ms.SetFromFile( reader.GetFile() ) )
{
if( ms == gdcm::MediaStorage::SurfaceSegmentationStorage )
{
ret = 0;
}
}
if( !ret )
{
std::cerr << "Failed to read: " << filename << std::endl;
std::cerr << "MediaStorage is: " << ms.GetString() << std::endl;
}
return !ret;
}
// Get content of filename
const File & FReader = reader.GetFile();
const FileMetaInformation & fmiReader = FReader.GetHeader();
const DataSet & dsReader = FReader.GetDataSet();
// Create directory first:
std::string tmpdir = Testing::GetTempDirectory( subdir );
if( !System::FileIsDirectory( tmpdir.c_str() ) )
{
System::MakeDirectory( tmpdir.c_str() );
//return 1;
}
std::string outfilename = Testing::GetTempFilename( filename, subdir );
// Write file from content reader
SurfaceWriter writer;
writer.SetFileName( outfilename.c_str() );
SegmentReader::SegmentVector segments = reader.GetSegments();
writer.SetSegments( segments );
writer.SetNumberOfSurfaces( reader.GetNumberOfSurfaces() );
// Set content from filename
File & FWriter = writer.GetFile();
FWriter.SetHeader(fmiReader);
FWriter.SetDataSet(dsReader);
if( !writer.Write() )
{
std::cerr << "Failed to write: " << outfilename << std::endl;
return 1;
}
// reuse the filename, since outfilename is simply the new representation
// of the old filename
const char * ref = Testing::GetMD5FromFile(filename);
char digest[33] = {};
Testing::ComputeFileMD5(outfilename.c_str(), digest);
if( ref == nullptr )
{
// new regression file needs a md5 sum
std::cout << "Missing md5 " << digest << " for: " << outfilename << std::endl;
return 1;
}
else if( strcmp(digest, ref) != 0 )
{
std::cerr << "Found " << digest << " instead of " << ref << std::endl;
return 1;
}
return 0;
}
}
int TestSurfaceWriter(int argc, char *argv[])
{
if( argc == 2 )
{
const char *filename = argv[1];
return gdcm::TestSurfaceWriter(argv[0],filename);
}
// else
gdcm::Trace::DebugOff();
gdcm::Trace::WarningOff();
int r = 0, i = 0;
const char *filename;
const char * const *filenames = gdcm::Testing::GetFileNames();
while( (filename = filenames[i]) )
{
r += gdcm::TestSurfaceWriter(argv[0], filename );
++i;
}
return r;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestFiducials.cxx 000664 001766 001770 00000001307 14517730450 030724 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmFiducials.h"
int TestFiducials(int argc, char *argv[])
{
(void)argc;
(void)argv;
gdcm::Fiducials f;
(void)f;
return 0;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestFileAnonymizer2.cxx 000664 001766 001770 00000010223 14517730450 032033 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmFileAnonymizer.h"
#include "gdcmTesting.h"
#include "gdcmSystem.h"
#include "gdcmReader.h"
#include "gdcmFilename.h"
static int TestFileAnonymize2(const char *filename, bool verbose = false)
{
using namespace gdcm;
if( verbose )
std::cout << "Processing: " << filename << std::endl;
// Create directory first:
const char subdir[] = "TestFileAnonymize2";
std::string tmpdir = Testing::GetTempDirectory( subdir );
if( !System::FileIsDirectory( tmpdir.c_str() ) )
{
System::MakeDirectory( tmpdir.c_str() );
//return 1;
}
std::string outfilename = Testing::GetTempFilename( filename, subdir );
const gdcm::Tag t1(0x0018,0x5100);
const gdcm::Tag t2(0x0018,0x1312);
const gdcm::Tag t3(0x0018,0x1313);
const gdcm::Tag t4(0x0018,0x1317);
const gdcm::Tag t5(0x0008,0x2112);
const gdcm::Tag t6(0x0008,0x9215);
const gdcm::Tag t7(0x0018,0x1020);
const gdcm::Tag t8(0x0004,0x1130); // Test DICOMDIR !
const gdcm::Tag t9(0x0008,0x0000); // Earliest possible Data Element
const gdcm::Tag t0(0xffff,0xffff); // Latest Possible Element
std::vector tags;
tags.push_back( t0 );
tags.push_back( t1 );
tags.push_back( t2 );
tags.push_back( t3 );
tags.push_back( t4 );
tags.push_back( t5 );
tags.push_back( t6 );
tags.push_back( t7 );
tags.push_back( t8 );
tags.push_back( t9 );
// precondition, remove the file if present:
System::RemoveFile(outfilename.c_str());
gdcm::FileAnonymizer fa;
fa.SetInputFileName( filename );
fa.SetOutputFileName( outfilename.c_str() );
for( std::vector::const_iterator it = tags.begin();
it != tags.end(); ++it )
{
fa.Empty( *it );
}
if( !fa.Write() )
{
std::cerr << "Failed to write: " << outfilename << std::endl;
return 1;
}
// Read back and check:
gdcm::Reader r;
r.SetFileName( outfilename.c_str() );
if( !r.Read() )
{
gdcm::Filename fn( filename );
std::cerr << "Failed to read: " << outfilename << std::endl;
if( strcmp(fn.GetName(), "SIEMENS_MAGNETOM-12-MONO2-GDCM12-VRUN.dcm") == 0
|| strcmp(fn.GetName(), "DMCPACS_ExplicitImplicit_BogusIOP.dcm") == 0
|| strcmp(fn.GetName(), "ExplicitVRforPublicElementsImplicitVRforShadowElements.dcm") == 0 )
{
return 0;
}
return 1;
}
const File &f = r.GetFile();
gdcm::MediaStorage ms;
ms.SetFromFile( f );
const DataSet &ds = f.GetDataSet();
for( std::vector::const_iterator it = tags.begin();
it != tags.end(); ++it )
{
const gdcm::Tag & t = *it;
// Special handling of t8 (DICOMDIR only)
const bool iserror = (ms == gdcm::MediaStorage::MediaStorageDirectoryStorage && t == t8) && false; // de-activate for now
if( !ds.FindDataElement( t ) )
{
if( iserror )
{
std::cerr << "Not found element: " << t << " in " << outfilename << std::endl;
return 1;
}
}
const gdcm::DataElement & de = ds.GetDataElement( t );
if( de.GetVL() != 0 )
{
if( iserror )
{
std::cerr << "Wrong VL for: " << t << " in " << outfilename << std::endl;
return 1;
}
}
}
return 0;
}
int TestFileAnonymizer2(int argc, char *argv[])
{
if( argc == 2 )
{
const char *filename = argv[1];
return TestFileAnonymize2(filename, true);
}
// else
gdcm::Trace::DebugOff();
gdcm::Trace::WarningOff();
gdcm::Trace::ErrorOff();
int r = 0, i = 0;
const char *filename;
const char * const *filenames = gdcm::Testing::GetFileNames();
while( (filename = filenames[i]) )
{
r += TestFileAnonymize2( filename );
++i;
}
return r;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageReader.cxx 000664 001766 001770 00000011546 14517730450 031174 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmImageReader.h"
#include "gdcmFileMetaInformation.h"
#include "gdcmSystem.h"
#include "gdcmFilename.h"
#include "gdcmByteSwap.h"
#include "gdcmTrace.h"
#include "gdcmTesting.h"
int TestImageRead(const char* filename, bool verbose = false, bool lossydump = false)
{
if( verbose )
std::cerr << "Reading: " << filename << std::endl;
gdcm::ImageReader reader;
reader.SetFileName( filename );
if ( reader.Read() )
{
int res = 0;
const gdcm::Image &img = reader.GetImage();
//std::cerr << "Success to read image from file: " << filename << std::endl;
unsigned long len = img.GetBufferLength();
if ( lossydump )
{
int lossy = img.IsLossy();
std::cout << lossy << "," << filename << std::endl;
}
int reflossy = gdcm::Testing::GetLossyFlagFromFile( filename );
if( reflossy == -1 )
{
std::cerr << "Missing lossy flag for: " << filename << std::endl;
return 1;
}
if( img.IsLossy() != (reflossy > 0 ? true : false) )//vs10 has a stupid bool/int cast warning
{
std::cerr << "Inconsistency for lossy flag for: " << filename << std::endl;
return 1;
}
char* buffer = new char[len];
bool res2 = img.GetBuffer(buffer);
if( !res2 )
{
std::cerr << "res2 failure: " << filename << std::endl;
return 1;
}
// On big Endian system we have byteswapped the buffer (duh!)
// Since the md5sum is byte based there is now way it would detect
// that the file is written in big endian word, so comparing against
// a md5sum computed on LittleEndian would fail. Thus we need to
// byteswap (again!) here:
#ifdef GDCM_WORDS_BIGENDIAN
if( img.GetPixelFormat().GetBitsAllocated() == 16 )
{
assert( !(len % 2) );
// gdcm-US-ALOKA is a 16 bits image with PALETTE
//assert( img.GetPhotometricInterpretation() == gdcm::PhotometricInterpretation::MONOCHROME1
// || img.GetPhotometricInterpretation() == gdcm::PhotometricInterpretation::MONOCHROME2 );
gdcm::ByteSwap::SwapRangeFromSwapCodeIntoSystem(
(unsigned short*)buffer, gdcm::SwapCode::LittleEndian, len/2);
}
#endif
const char *ref = gdcm::Testing::GetMD5FromFile(filename);
char digest[33];
gdcm::Testing::ComputeMD5(buffer, len, digest);
if( verbose )
{
std::cout << "ref=" << ref << std::endl;
std::cout << "md5=" << digest << std::endl;
}
if( !ref )
{
// new regression image needs a md5 sum
std::cout << "Missing md5 " << digest << " for: " << filename << std::endl;
//assert(0);
res = 1;
}
else if( strcmp(digest, ref) != 0 )
{
std::cerr << "Problem reading image from: " << filename << std::endl;
std::cerr << "Found " << digest << " instead of " << ref << std::endl;
res = 1;
#if 0
std::ofstream debug("/tmp/dump.gray",std::ios::binary);
debug.write(buffer, len);
debug.close();
//assert(0);
#endif
}
delete[] buffer;
return res;
}
const gdcm::FileMetaInformation &header = reader.GetFile().GetHeader();
gdcm::MediaStorage ms = header.GetMediaStorage();
bool isImage = gdcm::MediaStorage::IsImage( ms );
if( isImage )
{
if( reader.GetFile().GetDataSet().FindDataElement( gdcm::Tag(0x7fe0,0x0010) ) )
{
std::cerr << "Failed to read image from file: " << filename << std::endl;
return 1;
}
else
{
std::cerr << "no Pixel Data Element found in the file:" << filename << std::endl;
return 0;
}
}
// else
// well this is not an image, so thankfully we fail to read it
std::cerr << "Could not read image(" << filename << "), since file is a: " << ms << std::endl;
//assert( ms != gdcm::MediaStorage::MS_END );
return 0;
}
int TestImageReader(int argc, char *argv[])
{
if( argc == 2 )
{
const char *filename = argv[1];
return TestImageRead(filename, true);
}
// else
// First of get rid of warning/debug message
gdcm::Trace::DebugOff();
gdcm::Trace::WarningOff();
gdcm::Trace::ErrorOff();
int r = 0, i = 0;
const char *filename;
const char * const *filenames = gdcm::Testing::GetFileNames();
while( (filename = filenames[i]) )
{
r += TestImageRead( filename);
//r += TestImageRead( filename, false, true );
++i;
}
return r;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestAnonymizer3.cxx 000664 001766 001770 00000017032 14517730450 031241 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmAnonymizer.h"
#include "gdcmSimpleSubjectWatcher.h"
#include "gdcmUIDGenerator.h"
#include "gdcmFilename.h"
#include "gdcmTesting.h"
#include "gdcmCryptographicMessageSyntax.h"
#include "gdcmSmartPointer.h"
#include "gdcmReader.h"
#include "gdcmWriter.h"
#include "gdcmGlobal.h"
#include "gdcmFileDerivation.h"
#include "gdcmSystem.h"
#include "gdcmCryptoFactory.h"
#include // std::unique_ptr
int TestAnonymizer3(int , char *[])
{
using namespace gdcm;
gdcm::Global& g = gdcm::Global::GetInstance();
if( !g.LoadResourcesFiles() )
{
return 1;
}
const char *directory = gdcm::Testing::GetDataRoot();
std::string sfilename = std::string(directory) + "/012345.002.050.dcm";
const char *filename = sfilename.c_str();
std::string certpath = gdcm::Filename::Join(gdcm::Testing::GetSourceDirectory(), "/Testing/Source/Data/certificate.pem" );
std::string keypath = gdcm::Filename::Join(gdcm::Testing::GetSourceDirectory(), "/Testing/Source/Data/privatekey.pem" );
// Create directory first:
const char subdir[] = "TestAnonymizer3";
std::string tmpdir = Testing::GetTempDirectory( subdir );
if( !System::FileIsDirectory( tmpdir.c_str() ) )
{
System::MakeDirectory( tmpdir.c_str() );
//return 1;
}
std::string outfilename = Testing::GetTempFilename( filename, subdir );
std::string outfilenamelossy = Testing::GetTempFilename( "012345.002.050.lossy.dcm" , subdir );
std::string outfilenamelossy2 = Testing::GetTempFilename( "012345.002.050.lossy.anon.dcm" , subdir );
// Derive
{
gdcm::Reader reader;
reader.SetFileName( filename );
if( !reader.Read() )
{
std::cerr << "Could not read: " << filename << std::endl;
return 1;
}
File& file = reader.GetFile();
DataSet &ds = file.GetDataSet();
DataElement instanceuid = ds.GetDataElement( Tag(0x8,0x18) );
UIDGenerator uid;
const char *s = uid.Generate();
instanceuid.SetByteValue( s, (uint32_t)strlen(s) );
ds.Replace( instanceuid );
FileDerivation fd;
fd.SetFile( file );
// FIXME hardcoded:
fd.AddReference( "1.2.840.10008.5.1.4.1.1.4",
"1.2.840.113619.2.5.1762386977.1328.985934491.693" );
// CID 7202 Source Image Purposes of Reference
// {"DCM",121320,"Uncompressed predecessor"},
fd.SetPurposeOfReferenceCodeSequenceCodeValue( 121320 );
// CID 7203 Image Derivation
// { "DCM",113040,"Lossy Compression" },
fd.SetDerivationCodeSequenceCodeValue( 113040 );
fd.SetDerivationDescription( "lossy conversion" );
if( !fd.Derive() )
{
std::cerr << "Sorry could not derive using input info" << std::endl;
return 1;
}
gdcm::Writer writer;
writer.SetFileName( outfilenamelossy.c_str() );
writer.SetFile( fd.GetFile() );
if( !writer.Write() )
{
std::cerr << "Failed to write: " << outfilenamelossy << std::endl;
return 1;
}
}
// Encrypt
{
gdcm::CryptoFactory* cryptoFactory = gdcm::CryptoFactory::GetFactoryInstance();
if (cryptoFactory == NULL)
{
std::cerr << "Crypto library not available" << std::endl;
return 1;
}
std::unique_ptr cms_ptr(cryptoFactory->CreateCMSProvider());
gdcm::CryptographicMessageSyntax& cms = *cms_ptr;
if( !cms.ParseCertificateFile( certpath.c_str() ) )
{
return 1;
}
gdcm::SmartPointer ano = new gdcm::Anonymizer;
ano->SetCryptographicMessageSyntax( &cms );
{
// original file
gdcm::Reader reader;
reader.SetFileName( filename );
if( !reader.Read() )
{
std::cerr << "Could not read: " << filename << std::endl;
return 1;
}
// order of operation is important
ano->SetFile( reader.GetFile() );
if( !ano->BasicApplicationLevelConfidentialityProfile() )
{
return 1;
}
gdcm::Writer writer;
writer.SetFileName( outfilename.c_str() );
writer.SetFile( reader.GetFile() );
if( !writer.Write() )
{
std::cerr << "Failed to write: " << outfilename << std::endl;
return 1;
}
}
{
// derived file
gdcm::Reader reader;
reader.SetFileName( outfilenamelossy.c_str() );
if( !reader.Read() )
{
std::cerr << "Could not read: " << outfilenamelossy << std::endl;
return 1;
}
// order of operation is important
ano->SetFile( reader.GetFile() );
if( !ano->BasicApplicationLevelConfidentialityProfile() )
{
return 1;
}
gdcm::Writer writer;
writer.SetFileName( outfilenamelossy2.c_str() );
writer.SetFile( reader.GetFile() );
if( !writer.Write() )
{
std::cerr << "Failed to write: " << outfilenamelossy2 << std::endl;
return 1;
}
}
}
// Make sure UID is consistent:
{
std::string sopinstanceuid_str1;
{
// original anonymized file
gdcm::Reader reader;
reader.SetFileName( outfilename.c_str() );
if( !reader.Read() )
{
std::cerr << "Could not read: " << filename << std::endl;
return 1;
}
File &file = reader.GetFile();
DataSet &ds = file.GetDataSet();
if( !ds.FindDataElement( Tag(0x0008,0x0018) )
|| ds.GetDataElement( Tag(0x0008,0x0018) ).IsEmpty() )
{
return 1;
}
const DataElement &sopinstanceuid = ds.GetDataElement( Tag(0x0008,0x0018) );
sopinstanceuid_str1 = std::string( sopinstanceuid.GetByteValue()->GetPointer(), sopinstanceuid.GetByteValue()->GetLength() );
}
std::string sopinstanceuid_str2;
std::string refsopinstanceuid_str2;
{
// derived anonymized file
gdcm::Reader reader;
reader.SetFileName( outfilenamelossy2.c_str() );
if( !reader.Read() )
{
std::cerr << "Could not read: " << outfilenamelossy << std::endl;
return 1;
}
File &file = reader.GetFile();
DataSet &ds = file.GetDataSet();
if( !ds.FindDataElement( Tag(0x0008,0x0018) )
|| ds.GetDataElement( Tag(0x0008,0x0018) ).IsEmpty() )
{
return 1;
}
const DataElement &sopinstanceuid = ds.GetDataElement( Tag(0x0008,0x0018) );
sopinstanceuid_str2 = std::string( sopinstanceuid.GetByteValue()->GetPointer(), sopinstanceuid.GetByteValue()->GetLength() );
// Source Image Sequence
if( !ds.FindDataElement( Tag(0x0008,0x2112) )
|| ds.GetDataElement( Tag(0x0008,0x2112) ).IsEmpty() )
{
return 1;
}
const DataElement &sourceimagesq = ds.GetDataElement( Tag(0x0008,0x2112) );
SmartPointer sq = sourceimagesq.GetValueAsSQ();
gdcm::SequenceOfItems::SizeType n = sq->GetNumberOfItems();
if( n != 1 ) return 1;
Item &item = sq->GetItem( 1 );
DataSet &nested = item.GetNestedDataSet();
if( !nested.FindDataElement( Tag(0x0008,0x1155) )
|| nested.GetDataElement( Tag(0x0008,0x1155) ).IsEmpty() )
{
return 1;
}
const DataElement &refsopinstanceuid = nested.GetDataElement(
Tag(0x0008,0x1155) );
refsopinstanceuid_str2 = std::string( refsopinstanceuid.GetByteValue()->GetPointer(), refsopinstanceuid.GetByteValue()->GetLength() );
}
std::cout << sopinstanceuid_str1 << std::endl;
std::cout << sopinstanceuid_str2 << std::endl;
std::cout << refsopinstanceuid_str2 << std::endl;
if( sopinstanceuid_str1 == sopinstanceuid_str2 )
{
return 1;
}
if( sopinstanceuid_str1 != refsopinstanceuid_str2 )
{
return 1;
}
}
return 0;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestSplitMosaicFilter.cxx 000664 001766 001770 00000010034 14517730450 032413 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmSplitMosaicFilter.h"
#include "gdcmTesting.h"
#include "gdcmSystem.h"
#include "gdcmImageReader.h"
static bool reorganize_mosaic_invert(unsigned short *input,
const unsigned int *inputdims, unsigned int square,
const unsigned int *outputdims, const unsigned short *output )
{
for(unsigned x = 0; x < outputdims[0]; ++x)
{
for(unsigned y = 0; y < outputdims[1]; ++y)
{
for(unsigned z = 0; z < outputdims[2]; ++z)
{
size_t outputidx = x + y*outputdims[0] + z*outputdims[0]*outputdims[1];
size_t inputidx = (x + (z%square)*outputdims[0]) +
(y + (z/square)*outputdims[1])*inputdims[0];
input[ inputidx ] = output[ outputidx ];
}
}
}
return true;
}
int TestSplitMosaicFilter(int argc, char *argv[])
{
std::string filename;
if( argc == 2 )
{
filename = argv[1];
}
else
{
const char *extradataroot = gdcm::Testing::GetDataExtraRoot();
if( !extradataroot )
{
return 1;
}
if( !gdcm::System::FileIsDirectory(extradataroot) )
{
std::cerr << "No such directory: " << extradataroot << std::endl;
return 1;
}
filename = extradataroot;
filename += "/gdcmSampleData/images_of_interest/MR-sonata-3D-as-Tile.dcm";
}
gdcm::SplitMosaicFilter s;
// std::cout << filename << std::endl;
if( !gdcm::System::FileExists(filename.c_str()) )
{
return 1;
}
gdcm::ImageReader reader;
reader.SetFileName( filename.c_str() );
if( !reader.Read() )
{
std::cerr << "could not read: " << filename << std::endl;
return 1;
}
const gdcm::Image &image = reader.GetImage();
unsigned int inputdims[3] = { 0, 0, 1 };
const unsigned int *dims = image.GetDimensions();
inputdims[0] = dims[0];
inputdims[1] = dims[1];
gdcm::SplitMosaicFilter filter;
filter.SetImage( reader.GetImage() );
filter.SetFile( reader.GetFile() );
bool b = filter.Split();
if( !b )
{
std::cerr << "Could not split << " << filename << std::endl;
return 1;
}
unsigned int modims[3];
b = filter.ComputeMOSAICDimensions( modims );
if( !b )
{
std::cerr << "Could not ComputeMOSAICDimensions << " << filename << std::endl;
return 1;
}
const unsigned int ref[3] = { 64u, 64u, 31u };
if( modims[0] != ref[0] || modims[1] != ref[1] || modims[2] != ref[2] )
{
std::cerr << "Invalid ComputeMOSAICDimensions << " << filename << std::endl;
return 1;
}
// const gdcm::Image &image = filter.GetImage();
unsigned long l = image.GetBufferLength();
std::vector buf;
buf.resize(l);
if( !image.GetBuffer( &buf[0] ) )
{
std::cerr << "Could not GetBuffer << " << filename << std::endl;
return 1;
}
std::vector outbuf;
unsigned long ll = inputdims[0] * inputdims[1] * sizeof( unsigned short );
outbuf.resize(ll);
const unsigned int *mos_dims = image.GetDimensions();
unsigned int div = (unsigned int )ceil(sqrt( (double)mos_dims[2]) );
reorganize_mosaic_invert((unsigned short *)&outbuf[0], inputdims,
div, mos_dims, (const unsigned short*)&buf[0] );
#if 0
std::ofstream o( "/tmp/debug", std::ios::binary );
o.write( &outbuf[0], ll );
o.close();
#endif
char digest[33];
gdcm::Testing::ComputeMD5(&outbuf[0], ll, digest);
// $ gdcminfo --md5sum gdcmSampleData/images_of_interest/MR-sonata-3D-as-Tile.dcm
if( strcmp(digest, "be96c01db8a0ec0753bd43f6a985345c" ) != 0 )
{
std::cerr << "Problem found: " << digest << std::endl;
return 1;
}
return 0;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestRescaler1.cxx 000664 001766 001770 00000010675 14517730450 030652 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmRescaler.h"
#include
#include // atof
static bool check_roundtrip(const gdcm::PixelFormat & pf )
{
gdcm::Rescaler r;
r.SetIntercept( 0. );
r.SetSlope( 1. );
r.SetPixelFormat( pf );
r.SetMinMaxForPixelType((double)pf.GetMin(),(double)pf.GetMax());
const gdcm::PixelFormat outputpt = r.ComputePixelTypeFromMinMax();
if( outputpt != pf ) return false;
return true;
}
int TestRescaler1(int, char *[])
{
gdcm::Rescaler ir;
/*
gdcmData/MR-MONO2-12-shoulder.dcm
(gdb) p intercept
$1 = 6.0999999999999999e-05
(gdb) p slope
$2 = 3.774114
(gdb) p in[i]
$3 = 3.77417493
...
p (in[i] - intercept)/slope
$7 = 0.99999998109891775
$10 = {Intercept = 6.0999999999999999e-05, Slope = 3.774114, PF = {SamplesPerPixel = 1, BitsAllocated = 32, BitsStored = 32, HighBit = 31, PixelRepresentation = 3}, ScalarRangeMin = 6.0999998822808266e-05,
ScalarRangeMax = 247336.561051}
*/
// (0028,1052) DS [0.000061] # 8, 1 RescaleIntercept
// (0028,1053) DS [3.774114] # 8, 1 RescaleSlope
const double intercept = atof( "0.000061" );
const double slope = atof( "3.774114" );
ir.SetIntercept( intercept );
ir.SetSlope( slope );
ir.SetPixelFormat( gdcm::PixelFormat::FLOAT64 );
const double smin = 6.0999998822808266e-05;
const double smax = 247336.561051;
ir.SetMinMaxForPixelType( smin, smax );
double outref[] = { 0 };
{
char *copy = (char*)outref;
const uint16_t in[] = { 1 };
const char *tempimage = (const char*)in;
size_t vtklen = sizeof(in);
ir.SetPixelFormat( gdcm::PixelFormat::UINT16 );
bool b = ir.Rescale(copy,tempimage,vtklen);
if( !b ) return 1;
std::cout << outref[0] << std::endl;
}
ir.SetPixelFormat( gdcm::PixelFormat::FLOAT64 );
uint16_t out[] = { 0 };
char *copy = (char*)out;
//const double in[] = { 3.77417493 };
const double in[] = { 3.774175 };
if( outref[0] != in[0] )
{
std::cerr << "Wrong input/output:" << std::endl;
std::cerr << outref[0] << " vs " << in[0] << std::endl;
std::cerr << (outref[0] - in[0]) << std::endl;
return 1;
}
const char *tempimage = (const char*)in;
size_t vtklen = sizeof(in);
ir.InverseRescale(copy,tempimage,vtklen);
std::cout << out[0] << std::endl;
if( out[0] != 1 )
{
return 1;
}
// Let's make sure that rescaler works in the simplest case
// it should be idempotent:
{
gdcm::PixelFormat pixeltype = gdcm::PixelFormat::INT16;
gdcm::Rescaler r;
r.SetIntercept( 0.0 );
r.SetSlope( 1.0 );
r.SetPixelFormat( pixeltype );
gdcm::PixelFormat::ScalarType outputpt;
outputpt = r.ComputeInterceptSlopePixelType();
if( outputpt != pixeltype )
{
return 1;
}
if( ! (outputpt == pixeltype) )
{
return 1;
}
}
{
gdcm::PixelFormat::ScalarType outputpt ;
double shift = -1024;
double scale = 1;
// gdcmData/CT-MONO2-16-ort.dcm
gdcm::PixelFormat pixeltype( 1, 16, 16, 15, 1 );
gdcm::Rescaler r;
r.SetIntercept( shift );
r.SetSlope( scale );
r.SetPixelFormat( pixeltype );
outputpt = r.ComputeInterceptSlopePixelType();
// min,max = [-33792, 31743]
// we need at least int32 to store that
if( outputpt != gdcm::PixelFormat::INT32 )
{
return 1;
}
// let's pretend image is really the full range:
// FIXME: I think it is ok to compute this way since shift is double anyway:
r.SetMinMaxForPixelType(std::numeric_limits::min() + shift,std::numeric_limits::max() + shift );
gdcm::PixelFormat pf2 = r.ComputePixelTypeFromMinMax();
if( pf2 != pixeltype )
{
return 1;
}
}
// ComputePixelTypeFromMinMax()
{
if( !check_roundtrip(gdcm::PixelFormat(1,16,12,11,0) ) ) return 1;
if( !check_roundtrip(gdcm::PixelFormat(1,16,12,11,1) ) ) return 1;
if( !check_roundtrip(gdcm::PixelFormat(1,8,8,7,0) ) ) return 1;
if( !check_roundtrip(gdcm::PixelFormat(1,8,8,7,1) ) ) return 1;
}
return 0;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestFileChangeTransferSyntax3.cxx 000664 001766 001770 00000016147 14517730450 034015 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmFileChangeTransferSyntax.h"
#include "gdcmTesting.h"
#include "gdcmSystem.h"
#include "gdcmReader.h"
#include "gdcmImageReader.h"
#include "gdcmFilename.h"
#include "gdcmImageChangePlanarConfiguration.h"
#include "gdcmByteSwap.h"
static int TestFileChangeTransferSyntax3Func(const char *filename, bool verbose = false)
{
using namespace gdcm;
if( verbose )
std::cout << "Processing: " << filename << std::endl;
// Create directory first:
const char subdir[] = "TestFileChangeTransferSyntax3";
std::string tmpdir = Testing::GetTempDirectory( subdir );
if( !System::FileIsDirectory( tmpdir.c_str() ) )
{
System::MakeDirectory( tmpdir.c_str() );
//return 1;
}
std::string outfilename = Testing::GetTempFilename( filename, subdir );
if( verbose )
std::cout << "Generating: " << outfilename << std::endl;
const gdcm::TransferSyntax ts( TransferSyntax::JPEG2000Lossless );
gdcm::FileChangeTransferSyntax fcts;
fcts.SetTransferSyntax( ts );
fcts.SetInputFileName( filename );
fcts.SetOutputFileName( outfilename.c_str() );
ImageCodec *ic = fcts.GetCodec();
if( !ic )
{
return 1;
}
if( !fcts.Change() )
{
gdcm::Reader reader;
reader.SetFileName( filename );
if( !reader.Read() )
{
std::cerr << "not dicom" << std::endl;
return 1;
}
const gdcm::File & file = reader.GetFile();
const gdcm::FileMetaInformation & fmi = file.GetHeader();
const TransferSyntax &tsref = fmi.GetDataSetTransferSyntax();
if( tsref.IsEncapsulated() )
{
if( verbose )
std::cout << "Will not generate (encaps): " << outfilename << std::endl;
return 0;
}
gdcm::Filename fn( filename );
const char *name = fn.GetName();
// Special handling:
if( strcmp(name, "CT-MONO2-12-lomb-an2.acr" ) == 0
|| strcmp(name, "LIBIDO-8-ACR_NEMA-Lena_128_128.acr") == 0
|| strcmp(name, "gdcm-ACR-LibIDO.acr") == 0
|| strcmp(name, "gdcm-MR-SIEMENS-16-2.acr") == 0
|| strcmp(name, "libido1.0-vol.acr") == 0
|| strcmp(name, "test.acr") == 0
|| strcmp(name, "LIBIDO-24-ACR_NEMA-Rectangle.dcm") == 0
|| strcmp(name, "MR_Spectroscopy_SIEMENS_OF.dcm") == 0 // not an image
|| strcmp(name, "ELSCINT1_PMSCT_RLE1.dcm") == 0
|| strcmp(name, "ELSCINT1_PMSCT_RLE1_priv.dcm") == 0
|| strcmp(name, "gdcm-CR-DCMTK-16-NonSamplePerPix.dcm") == 0
|| strcmp(name, "SIEMENS_MAGNETOM-12-ACR_NEMA_2-Modern.dcm") == 0
|| strcmp(name, "PrivateGEImplicitVRBigEndianTransferSyntax16Bits.dcm") == 0 // Implicit VR Big Endian DLX (G.E Private)
|| strcmp(name, "MR_GE_with_Private_Compressed_Icon_0009_1110.dcm") == 0 // Explicit VR Big Endian
|| strcmp(name, "US-RGB-8-epicard.dcm") == 0 // Explicit VR Big Endian
|| strcmp(name, "GE_DLX-8-MONO2-PrivateSyntax.dcm") == 0 // Implicit VR Big Endian DLX (G.E Private)
|| strcmp(name, "GE_CT_With_Private_compressed-icon.dcm") == 0 // Explicit VR Big Endian
|| strcmp(name, "JDDICOM_Sample2-dcmdjpeg.dcm") == 0 // cannot recreate FMI
|| strcmp(name, "DMCPACS_ExplicitImplicit_BogusIOP.dcm") == 0 // ImageRegionReader does not handle it
|| strcmp(name, "unreadable.dcm") == 0 // No Pixel Data (old ACR-NEMA)
|| strcmp(name, "US-YBR_FULL_422-EVRLE.dcm") == 0 // packed ybr422
|| strncmp(name, "DICOMDIR", 8) == 0 // DICOMDIR*
|| strncmp(name, "dicomdir", 8) == 0 // dicomdir*
)
{
if( verbose )
std::cout << "Will not generate: " << outfilename << std::endl;
return 0;
}
std::cerr << "Could not change: " << filename << std::endl;
return 1;
}
// Let's read that file back in !
gdcm::ImageReader reader2;
reader2.SetFileName( outfilename.c_str() );
if ( !reader2.Read() )
{
std::cerr << "Could not even reread our generated file : " << outfilename << std::endl;
return 1;
}
// Check that after decompression we still find the same thing:
int res = 0;
gdcm::Image img = reader2.GetImage();
int pc = 0;
// When recompressing: US-RGB-8-epicard.dcm, make sure to compute the md5 using the
// same original Planar Configuration...
if( (int)img.GetPlanarConfiguration() != pc )
{
gdcm::ImageChangePlanarConfiguration icpc;
icpc.SetInput( reader2.GetImage() );
icpc.SetPlanarConfiguration( pc );
icpc.Change();
img = icpc.GetOutput();
}
//std::cerr << "Success to read image from file: " << filename << std::endl;
unsigned long len = img.GetBufferLength();
char* buffer = new char[len];
bool res2 = img.GetBuffer(buffer);
if( !res2 )
{
std::cerr << "could not get buffer: " << outfilename << std::endl;
return 1;
}
// On big Endian system we have byteswapped the buffer (duh!)
// Since the md5sum is byte based there is now way it would detect
// that the file is written in big endian word, so comparing against
// a md5sum computed on LittleEndian would fail. Thus we need to
// byteswap (again!) here:
#ifdef GDCM_WORDS_BIGENDIAN
if( img.GetPixelFormat().GetBitsAllocated() == 16 )
{
assert( !(len % 2) );
assert( img.GetPhotometricInterpretation() == gdcm::PhotometricInterpretation::MONOCHROME1
|| img.GetPhotometricInterpretation() == gdcm::PhotometricInterpretation::MONOCHROME2 );
gdcm::ByteSwap::SwapRangeFromSwapCodeIntoSystem(
(unsigned short*)buffer, gdcm::SwapCode::LittleEndian, len/2);
}
#endif
const char *ref = gdcm::Testing::GetMD5FromFile(filename);
char digest[33];
gdcm::Testing::ComputeMD5(buffer, len, digest);
if( !ref )
{
// new regression image needs a md5 sum
std::cerr << "Missing md5 " << digest << " for: " << filename << std::endl;
//assert(0);
res = 1;
}
else if( strcmp(digest, ref) != 0 )
{
std::cerr << "Problem reading image from: " << filename << std::endl;
std::cerr << "Found " << digest << " instead of " << ref << std::endl;
res = 1;
}
if(res)
{
std::cerr << "problem with: " << outfilename << std::endl;
}
if( verbose )
{
std::cout << "file was written in: " << outfilename << std::endl;
}
delete[] buffer;
return res;
}
int TestFileChangeTransferSyntax3(int argc, char *argv[])
{
if( argc == 2 )
{
const char *filename = argv[1];
return TestFileChangeTransferSyntax3Func(filename, true);
}
// else
gdcm::Trace::DebugOff();
gdcm::Trace::WarningOff();
gdcm::Trace::ErrorOff();
int r = 0, i = 0;
const char *filename;
const char * const *filenames = gdcm::Testing::GetFileNames();
while( (filename = filenames[i]) )
{
r += TestFileChangeTransferSyntax3Func( filename );
++i;
}
return r;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestXMLPrinter.cxx 000664 001766 001770 00000003433 14517730450 031027 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmReader.h"
#include "gdcmXMLPrinter.h"
#include "gdcmFilename.h"
#include "gdcmTesting.h"
int TestXMLPrint(const char *filename, bool verbose= false)
{
gdcm::Reader r;
r.SetFileName( filename );
if( !r.Read() )
{
std::cerr << "Could not read: " << filename << std::endl;
return 1;
}
gdcm::XMLPrinter print;
//print.SetStyle( gdcm::XMLPrinter::LOADBULKDATA );
print.SetFile( r.GetFile() );
std::ostringstream out;
if( verbose )
print.Print( std::cout );
print.Print( out );
gdcm::Filename fn( filename );
const char *name = fn.GetName();
std::string buf = out.str();
if( buf.find( "GDCM:UNKNOWN" ) != std::string::npos )
{
std::cerr << "UNKNOWN Attribute with : " << name << std::endl;
return 1;
}
return 0;
}
int TestXMLPrinter(int argc, char *argv[])
{
if( argc == 2 )
{
const char *filename = argv[1];
return TestXMLPrint(filename, true);
}
// else
int r = 0, i = 0;
gdcm::Trace::DebugOff();
gdcm::Trace::WarningOff();
gdcm::Trace::ErrorOff();
const char *filename;
const char * const *filenames = gdcm::Testing::GetFileNames();
while( (filename = filenames[i]) )
{
r += TestXMLPrint( filename );
++i;
}
return r;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestStrictScanner2_2.cxx 000664 001766 001770 00000004103 14517730450 032103 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmStrictScanner2.h"
#include "gdcmDirectory.h"
#include "gdcmSystem.h"
#include "gdcmTesting.h"
#include "gdcmTrace.h"
int TestStrictScanner2_2(int argc, char *argv[])
{
gdcm::Trace::WarningOff();
gdcm::Trace::ErrorOff();
const char *directory = gdcm::Testing::GetDataRoot();
std::string tmpdir = gdcm::Testing::GetTempDirectory( "TestWriter" );
directory = tmpdir.c_str();
if( argc == 2 )
{
directory = argv[1];
}
if( !gdcm::System::FileIsDirectory(directory) )
{
std::cerr << "No such directory: " << directory << std::endl;
return 1;
}
gdcm::Directory d;
unsigned int nfiles = d.Load( directory ); // no recursion
std::cout << "done retrieving file list. " << nfiles << " files found." << std::endl;
gdcm::StrictScanner2 s;
const gdcm::Tag t2(0x0020,0x000e); // Series Instance UID
s.AddPublicTag( t2 );
bool b = s.Scan( d.GetFilenames() );
if( !b )
{
std::cerr << "Scanner2 failed" << std::endl;
return 1;
}
gdcm::Directory::FilenamesType const & files = s.GetFilenames();
if( files != d.GetFilenames() )
{
return 1;
}
const char str1[] = "1.3.12.2.1107.5.2.4.7630.20010301125744000008";
gdcm::Directory::FilenamesType fns = s.GetAllFilenamesFromPublicTagToValue(t2, str1);
// all SIEMENS_MAGNETOM-12-MONO2-FileSeq*.dcm:
if( fns.size() != 4 ) return 1;
const char str2[] = "1.3.12.2.1107.5.2.4.7630.2001030112574400000";
fns = s.GetAllFilenamesFromPublicTagToValue(t2, str2);
if( !fns.empty() ) return 1;
return 0;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageChangeTransferSyntax5.cxx 000664 001766 001770 00000013046 14517730450 034155 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmImageChangeTransferSyntax.h"
#include "gdcmImageReader.h"
#include "gdcmImageWriter.h"
#include "gdcmFilename.h"
#include "gdcmSystem.h"
#include "gdcmFileMetaInformation.h"
#include "gdcmTesting.h"
#include "gdcmByteSwap.h"
#include "gdcmImageChangePlanarConfiguration.h"
namespace gdcm
{
int TestImageChangeTransferSyntaxJPEGLS(const char *filename, bool verbose = false)
{
ImageReader reader;
reader.SetFileName( filename );
if ( !reader.Read() )
{
const FileMetaInformation &header = reader.GetFile().GetHeader();
MediaStorage ms = header.GetMediaStorage();
bool isImage = MediaStorage::IsImage( ms );
bool pixeldata = reader.GetFile().GetDataSet().FindDataElement( Tag(0x7fe0,0x0010) );
if( isImage && pixeldata )
{
std::cerr << "Failed to read: " << filename << std::endl;
return 1;
}
else
{
// not an image give up...
std::cerr << "Problem with: " << filename << " but that's ok" << std::endl;
return 0;
}
}
const gdcm::Image &image = reader.GetImage();
int pc = image.GetPlanarConfiguration();
gdcm::ImageChangeTransferSyntax change;
change.SetTransferSyntax( gdcm::TransferSyntax::JPEGLSLossless );
change.SetInput( image );
bool b = change.Change();
if( !b )
{
std::cerr << "Could not change the Transfer Syntax: " << filename << std::endl;
return 1;
}
// Create directory first:
const char subdir[] = "TestImageChangeTransferSyntax5";
std::string tmpdir = Testing::GetTempDirectory( subdir );
if( !System::FileIsDirectory( tmpdir.c_str() ) )
{
System::MakeDirectory( tmpdir.c_str() );
//return 1;
}
std::string outfilename = Testing::GetTempFilename( filename, subdir );
ImageWriter writer;
writer.SetFileName( outfilename.c_str() );
writer.SetFile( reader.GetFile() ); // increase test goal
writer.SetImage( change.GetOutput() );
if( !writer.Write() )
{
std::cerr << "Failed to write: " << outfilename << std::endl;
return 1;
}
// Let's read that file back in !
ImageReader reader2;
reader2.SetFileName( outfilename.c_str() );
if ( !reader2.Read() )
{
std::cerr << "Could not even reread our generated file : " << outfilename << std::endl;
return 1;
}
// Check that after decompression we still find the same thing:
int res = 0;
gdcm::Image img = reader2.GetImage();
// When recompressing: US-RGB-8-epicard.dcm, make sure to compute the md5 using the
// same original Planar Configuration...
if( (int)img.GetPlanarConfiguration() != pc )
{
gdcm::ImageChangePlanarConfiguration icpc;
icpc.SetInput( reader2.GetImage() );
icpc.SetPlanarConfiguration( pc );
icpc.Change();
img = icpc.GetOutput();
}
//std::cerr << "Success to read image from file: " << filename << std::endl;
unsigned long len = img.GetBufferLength();
char* buffer = new char[len];
bool res2 = img.GetBuffer(buffer);
if( !res2 )
{
std::cerr << "could not get buffer: " << outfilename << std::endl;
return 1;
}
// On big Endian system we have byteswapped the buffer (duh!)
// Since the md5sum is byte based there is now way it would detect
// that the file is written in big endian word, so comparing against
// a md5sum computed on LittleEndian would fail. Thus we need to
// byteswap (again!) here:
#ifdef GDCM_WORDS_BIGENDIAN
if( img.GetPixelFormat().GetBitsAllocated() == 16 )
{
assert( !(len % 2) );
assert( img.GetPhotometricInterpretation() == gdcm::PhotometricInterpretation::MONOCHROME1
|| img.GetPhotometricInterpretation() == gdcm::PhotometricInterpretation::MONOCHROME2 );
gdcm::ByteSwap::SwapRangeFromSwapCodeIntoSystem(
(unsigned short*)buffer, gdcm::SwapCode::LittleEndian, len/2);
}
#endif
const char *ref = gdcm::Testing::GetMD5FromFile(filename);
char digest[33];
gdcm::Testing::ComputeMD5(buffer, len, digest);
if( !ref )
{
// new regression image needs a md5 sum
std::cerr << "Missing md5 " << digest << " for: " << filename << std::endl;
//assert(0);
res = 1;
}
else if( strcmp(digest, ref) != 0 )
{
std::cerr << "Problem reading image from: " << filename << std::endl;
std::cerr << "Found " << digest << " instead of " << ref << std::endl;
res = 1;
}
if(res)
{
std::cerr << "problem with: " << outfilename << std::endl;
}
if( verbose )
{
std::cout << "file was written in: " << outfilename << std::endl;
}
delete[] buffer;
return res;
}
} // end namespace gdcm
int TestImageChangeTransferSyntax5(int argc, char *argv[])
{
if( argc == 2 )
{
const char *filename = argv[1];
return gdcm::TestImageChangeTransferSyntaxJPEGLS(filename, true);
}
// else
gdcm::Trace::DebugOff();
gdcm::Trace::WarningOff();
int r = 0, i = 0;
const char *filename;
const char * const *filenames = gdcm::Testing::GetFileNames();
while( (filename = filenames[i]) )
{
r += gdcm::TestImageChangeTransferSyntaxJPEGLS( filename );
++i;
}
return r;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestScanner2.cxx 000664 001766 001770 00000003665 14517730450 030505 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmScanner.h"
#include "gdcmDirectory.h"
#include "gdcmSystem.h"
#include "gdcmTesting.h"
#include "gdcmTrace.h"
int TestScanner2(int argc, char *argv[])
{
gdcm::Trace::WarningOff();
gdcm::Trace::ErrorOff();
const char *directory = gdcm::Testing::GetDataRoot();
if( argc == 2 )
{
directory = argv[1];
}
if( !gdcm::System::FileIsDirectory(directory) )
{
std::cerr << "No such directory: " << directory << std::endl;
return 1;
}
gdcm::Directory d;
unsigned int nfiles = d.Load( directory ); // no recursion
std::cout << "done retrieving file list. " << nfiles << " files found." << std::endl;
gdcm::Scanner s;
const gdcm::Tag t2(0x0020,0x000e); // Series Instance UID
s.AddTag( t2 );
bool b = s.Scan( d.GetFilenames() );
if( !b )
{
std::cerr << "Scanner failed" << std::endl;
return 1;
}
gdcm::Directory::FilenamesType const & files = s.GetFilenames();
if( files != d.GetFilenames() )
{
return 1;
}
const char str1[] = "1.3.12.2.1107.5.2.4.7630.20010301125744000008";
gdcm::Directory::FilenamesType fns = s.GetAllFilenamesFromTagToValue(t2, str1);
// all SIEMENS_MAGNETOM-12-MONO2-FileSeq*.dcm:
if( fns.size() != 4 ) return 1;
const char str2[] = "1.3.12.2.1107.5.2.4.7630.2001030112574400000";
fns = s.GetAllFilenamesFromTagToValue(t2, str2);
if( !fns.empty() ) return 1;
return 0;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestStringFilter4.cxx 000664 001766 001770 00000003435 14517730450 031525 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmStringFilter.h"
#include "gdcmAttribute.h"
#include "gdcmSmartPointer.h"
// https://sourceforge.net/p/gdcm/bugs/485/
int TestStringFilter4(int , char *[])
{
gdcm::SmartPointer f = new gdcm::File;
gdcm::DataSet & ds = f->GetDataSet();
{
gdcm::Element priv_creator;
priv_creator.SetValue( "SIEMENS MED SP DXMG WH AWS 1" );
gdcm::DataElement de1 = priv_creator.GetAsDataElement();
de1.SetTag( gdcm::Tag(0x19,0x10) );
ds.Insert( de1 );
gdcm::Element el;
el.SetValue( "TestStringFilter4" );
gdcm::DataElement de2 = el.GetAsDataElement();
de2.SetTag( gdcm::Tag(0x19,0x1010) );
ds.Insert( de2 );
// std::cout << ds << std::endl;
gdcm::StringFilter filter;
filter.SetFile(*f);
gdcm::PrivateTag privTag(0x0019, 0x10, "SIEMENS MED SP DXMG WH AWS 1");
// Works as intended
std::string privTagValue1 = filter.ToString(ds.GetDataElement(privTag));
std::cout << privTagValue1 << std::endl;
// Does not work, returns string value of the private creator instead of the actual tag
std::string privTagValue2 = filter.ToString(privTag);
std::cout << privTagValue2 << std::endl;
}
return 0;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestUIDGenerator.cxx 000664 001766 001770 00000011522 14517730450 031311 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmUIDGenerator.h"
#include
#include
#include
#include
int TestUIDGeneratorValid()
{
gdcm::UIDGenerator uid;
uid.SetRoot( "1.2.3.4.0.0.1" );
const char *s = uid.Generate();
if( !gdcm::UIDGenerator::IsValid( s ) )
{
return 1;
}
const char invalid0[] = ".0.123";
if( gdcm::UIDGenerator::IsValid( invalid0 ) )
{
return 1;
}
const char invalid1[] = "abcd";
if( gdcm::UIDGenerator::IsValid( invalid1 ) )
{
return 1;
}
const char invalid2[] = "1.2.3.4.0.0.123.a";
if( gdcm::UIDGenerator::IsValid( invalid2 ) )
{
return 1;
}
const char invalid3[] = "1.2.3.4.0.0.123..";
if( gdcm::UIDGenerator::IsValid( invalid3 ) )
{
return 1;
}
const char invalid4[] = "1.2.3.4.0.0..123";
if( gdcm::UIDGenerator::IsValid( invalid4 ) )
{
return 1;
}
const char invalid5[] = "1.2.3.4.00.123";
if( gdcm::UIDGenerator::IsValid( invalid5 ) )
{
return 1;
}
const char invalid6[] = "1.2.3.4.00.123.";
if( gdcm::UIDGenerator::IsValid( invalid6 ) )
{
return 1;
}
const char invalid7[] = "1234567890.1234567890.1234567890.1234567890.1234567890.1234567890";
if( gdcm::UIDGenerator::IsValid( invalid7 ) )
{
return 1;
}
const char invalid8[] = "1234567890.1234567890.1234567890.1234567890.1234567890/123456789";
if( gdcm::UIDGenerator::IsValid( invalid8 ) )
{
return 1;
}
const char invalid9[] = "";
if( gdcm::UIDGenerator::IsValid( invalid9 ) )
{
return 1;
}
const char invalid10[] = ".";
if( gdcm::UIDGenerator::IsValid( invalid10 ) )
{
return 1;
}
const char invalid11[] = "00.1";
if( gdcm::UIDGenerator::IsValid( invalid11 ) )
{
return 1;
}
return 0; // no error
}
int TestUIDGenerator(int , char *[])
{
gdcm::UIDGenerator uid;
std::cout << gdcm::UIDGenerator::GetGDCMUID() << std::endl;
std::cout << uid.GetRoot() << std::endl;
if( strcmp( gdcm::UIDGenerator::GetGDCMUID(), uid.GetRoot() ) != 0 )
{
return 1;
}
/*
* Purposely take a very long root, to test the robustness of the generator
* since we are left with fewer bytes to still generate uniq UID
*/
// let's test 27 bytes root:
const char myroot[] = "9876543210.9876543210.98765"; // 26 bytes is the length of GDCM root
//if( strlen(myroot) != 26 )
// {
// return 1;
// }
uid.SetRoot( myroot );
std::cerr << "before generate" << std::endl;
const char *s = uid.Generate();
std::cerr << "after generate" << std::endl;
std::cout << "s:" << s << std::endl;
if( strcmp( myroot, uid.GetRoot() ) != 0 )
{
std::cerr << "1 failed" << std::endl;
return 1;
}
if( strcmp( gdcm::UIDGenerator::GetGDCMUID(), myroot ) == 0 )
{
std::cerr << "2 failed" << std::endl;
return 1;
}
if( strncmp( s, uid.GetRoot(), strlen( uid.GetRoot() ) ) != 0 )
{
std::cerr << "3 failed" << std::endl;
return 1;
}
/*
std::string s0 = "123456";
std::cout << (s0.c_str() + s0.find_first_not_of('0')) << std::endl;
std::string s1 = "0123456";
std::cout << (s1.c_str() + s1.find_first_not_of('0')) << std::endl;
std::string s2 = "00123456";
std::cout << (s2.c_str() + s2.find_first_not_of('0')) << std::endl;
std::string s3 = "000";
if( s3.find_first_not_of('0') != std::string::npos )
std::cout << (s3.c_str() + s3.find_first_not_of('0')) << std::endl;
*/
// Threading issue, make sure that two different UIDs cannot generate same UID
gdcm::UIDGenerator uid1;
gdcm::UIDGenerator uid2;
const unsigned int n = 100;
std::set uids;
for(unsigned int i = 0; i < n; ++i)
{
const char *unique1 = uid1.Generate();
const char *unique2 = uid2.Generate();
if( !unique1 || !unique2 ) return 1;
std::cout << unique1 << std::endl;
std::cout << unique2 << std::endl;
if ( uids.count(unique1) == 1 )
{
std::cerr << "Already found: " << unique1 << std::endl;
return 1;
}
uids.insert( unique1 );
if ( uids.count(unique2) == 1 )
{
std::cerr << "Already found: " << unique2 << std::endl;
return 1;
}
uids.insert( unique2 );
if( strcmp(unique1 , unique2 ) == 0 )
{
// That would be very bad !
return 1;
}
}
int ret = 0;
ret += TestUIDGeneratorValid();
return ret;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestStreamImageWriter.cxx 000664 001766 001770 00000020172 14517730450 032415 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmStreamImageReader.h"
#include "gdcmStreamImageWriter.h"
#include "gdcmFileMetaInformation.h"
#include "gdcmSystem.h"
#include "gdcmFilename.h"
#include "gdcmByteSwap.h"
#include "gdcmTrace.h"
#include "gdcmTesting.h"
#include "gdcmImageHelper.h"
#include "gdcmImageReader.h"
#include "gdcmImage.h"
int TestStreamImageWrite(const char *subdir, const char* filename, bool verbose = false, bool lossydump = false)
{
(void)lossydump;
if( verbose )
std::cerr << "Reading and writing: " << filename << std::endl;
gdcm::ImageReader theImageReaderOriginal;
gdcm::ImageReader theImageReader;
gdcm::StreamImageWriter theStreamWriter;
theImageReaderOriginal.SetFileName( filename );
// Create directory first:
std::string tmpdir = gdcm::Testing::GetTempDirectory( subdir );
if( !gdcm::System::FileIsDirectory( tmpdir.c_str() ) )
{
gdcm::System::MakeDirectory( tmpdir.c_str() );
//return 1;
}
std::string outfilename = gdcm::Testing::GetTempFilename( filename, subdir );
if ( theImageReaderOriginal.Read() )
{
//int res = 0;
//to test the writer out, we have to read an image and then
//write it out one line at a time.
//a _real_ test would include both the streamimagereader and writer.
//so, this test is:
//1) read in the image via the stream reader
//2) write it out line by line
//3) read it in by a reader
//4) compare the image from step 1 with step 3
//5) go to step2, replace step 3 with a regular image reader.
//for now, we'll do 1-4
//pull image information prior to messing with the file
gdcm::Image theOriginalImage = theImageReaderOriginal.GetImage();
char* theOriginalBuffer = new char[theOriginalImage.GetBufferLength()];
if (!theOriginalImage.GetBuffer(theOriginalBuffer)){
std::cerr << "Unable to get original image buffer, stopping." << std::endl;
delete [] theOriginalBuffer;
return 1;
}
//first, check that the image information can be written
//theStreamReader.GetFile().GetDataSet().Print( std::cout );
theStreamWriter.SetFile(theImageReaderOriginal.GetFile());
#if 0
theStreamWriter.SetFileName(outfilename.c_str());
#else
std::ofstream of;
of.open( outfilename.c_str(), std::ios::out | std::ios::binary );
theStreamWriter.SetStream(of);
#endif
if (!theStreamWriter.CanWriteFile()){
delete [] theOriginalBuffer;
return 0;//this means that the file was unwritable, period.
//very similar to a ReadImageInformation failure
}
if (!theStreamWriter.WriteImageInformation()){
std::cerr << "unable to write image information" << std::endl;
delete [] theOriginalBuffer;
return 1; //the CanWrite function should prevent getting here, else,
//that's a test failure
}
std::vector extent =
gdcm::ImageHelper::GetDimensionsValue(theImageReaderOriginal.GetFile());
unsigned short xmax = (unsigned short)extent[0];
unsigned short ymax = (unsigned short)extent[1];
unsigned short theChunkSize = 4;
unsigned short ychunk = (unsigned short)(extent[1]/theChunkSize); //go in chunk sizes of theChunkSize
unsigned short zmax = (unsigned short)extent[2];
if (xmax == 0 || ymax == 0)
{
std::cerr << "Image has no size, unable to write zero-sized image." << std::endl;
return 0;
}
int z, y, nexty;
unsigned long prevLen = 0; //when going through the char buffer, make sure to grab
//the bytes sequentially. So, store how far you got in the buffer with each iteration.
for (z = 0; z < zmax; ++z){
for (y = 0; y < ymax; y += ychunk){
nexty = y + ychunk;
if (nexty > ymax) nexty = ymax;
theStreamWriter.DefinePixelExtent(0, (uint16_t)xmax, (uint16_t)y, (uint16_t)nexty, (uint16_t)z, (uint16_t)(z+1));
unsigned long len = theStreamWriter.DefineProperBufferLength();
char* finalBuffer = new char[len];
memcpy(finalBuffer, &(theOriginalBuffer[prevLen]), len);
if (!theStreamWriter.Write(finalBuffer, len)){
std::cerr << "writing failure:" << outfilename << " at y = " << y << " and z= " << z << std::endl;
delete [] theOriginalBuffer;
delete [] finalBuffer;
return 1;
}
delete [] finalBuffer;
prevLen += len;
}
}
delete [] theOriginalBuffer;
theImageReader.SetFileName(outfilename.c_str());
if (!theImageReader.Read()){
std::cerr << "unable to read in the written test file: " << outfilename << std::endl;
return 1;
} else {
int res = 0;
const gdcm::Image &img = theImageReader.GetImage();
//std::cerr << "Success to read image from file: " << filename << std::endl;
unsigned long len = img.GetBufferLength();
char* buffer = new char[len];
img.GetBuffer(buffer);
// On big Endian system we have byteswapped the buffer (duh!)
// Since the md5sum is byte based there is now way it would detect
// that the file is written in big endian word, so comparing against
// a md5sum computed on LittleEndian would fail. Thus we need to
// byteswap (again!) here:
const char *ref = gdcm::Testing::GetMD5FromFile(filename);
const char *correct_ref = gdcm::Testing::GetMD5FromBrokenFile(filename);
char digest[33];
gdcm::Testing::ComputeMD5(buffer, len, digest);
if( verbose )
{
std::cout << "ref=" << ref << std::endl;
std::cout << "md5=" << digest << std::endl;
}
if( !ref )
{
// new regression image needs a md5 sum
std::cout << "Missing md5 " << digest << " for: " << filename << std::endl;
//assert(0);
res = 1;
}
else if( strcmp(digest, ref) )
{
// let's be nice for now and only truly fails when file is proper DICOM
if( correct_ref && !strcmp(correct_ref, ref))
{
std::cerr << "Problem reading image from: " << filename << std::endl;
std::cerr << "Found " << digest << " instead of " << ref << std::endl;
res = 1;
}
}
delete[] buffer;
return res;
}
}
else
{
//std::cerr << "Unable to read test file: " << filename << std::endl;
//return 1;
return 0; //this is NOT a test of the reader, but a test of streaming writing
}
#if 0
const gdcm::FileMetaInformation &header = reader.GetFile().GetHeader();
gdcm::MediaStorage ms = header.GetMediaStorage();
bool isImage = gdcm::MediaStorage::IsImage( ms );
if( isImage )
{
if( reader.GetFile().GetDataSet().FindDataElement( gdcm::Tag(0x7fe0,0x0010) ) )
{
std::cerr << "Failed to read image from file: " << filename << std::endl;
return 1;
}
else
{
std::cerr << "no Pixel Data Element found in the file:" << filename << std::endl;
return 0;
}
}
// else
// well this is not an image, so thankfully we fail to read it
std::cerr << "Could not read image(" << filename << "), since file is a: " << ms << std::endl;
//assert( ms != gdcm::MediaStorage::MS_END );
#endif
return 0;
}
int TestStreamImageWriter(int argc, char *argv[])
{
if( argc == 2 )
{
const char *filename = argv[1];
return TestStreamImageWrite(argv[0], filename, true);
}
// else
// First of get rid of warning/debug message
gdcm::Trace::DebugOff();
gdcm::Trace::WarningOff();
int r = 0, i = 0;
const char *filename;
const char * const *filenames = gdcm::Testing::GetFileNames();
while( (filename = filenames[i]) )
{
r += TestStreamImageWrite( argv[0], filename);
++i;
}
return r;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestJSON1.cxx 000664 001766 001770 00000003236 14517730450 027656 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmJSON.h"
#include "gdcmFilename.h"
#include "gdcmTesting.h"
#include "gdcmDataSet.h"
#include "gdcmWriter.h"
#include "gdcmFile.h"
int TestJSON1(int, char *[])
{
//std::string sup166 = gdcm::Filename::Join(gdcm::Testing::GetSourceDirectory(), "/Testing/Source/Data/QIDO-RS_examplesup166.json" );
std::string sup166 = gdcm::Filename::Join(gdcm::Testing::GetSourceDirectory(), "/Testing/Source/Data/QIDO-RS_examplesup166_2.json" );
if( !gdcm::System::FileExists( sup166.c_str() ) )
{
std::cerr << sup166 << std::endl;
return 1;
}
std::ifstream is( sup166.c_str() );
gdcm::JSON json;
json.PrettyPrintOn();
#if 1
gdcm::DataSet ds;
json.Decode(is, ds );
//std::cout << ds << std::endl;
#else
gdcm::Writer w;
gdcm::File & ff = w.GetFile();
gdcm::DataSet &ds = ff.GetDataSet();
ff.GetHeader().SetDataSetTransferSyntax( gdcm::TransferSyntax::ExplicitVRLittleEndian );
json.Decode(is, ff.GetDataSet() );
w.SetFileName( "/tmp/debug2.dcm" );
if( !w.Write() ) return 1;
#endif
std::stringstream ss;
json.Code(ds, ss );
std::cout << ss.str() << std::endl;
return 0;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestCurve2.cxx 000664 001766 001770 00000013234 14517730450 030171 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmCurve.h"
#include "gdcmFileMetaInformation.h"
#include "gdcmSystem.h"
#include "gdcmImageReader.h"
#include "gdcmFilename.h"
#include "gdcmByteSwap.h"
#include "gdcmTrace.h"
#include "gdcmTesting.h"
struct curveinfo
{
unsigned short dimensions;
unsigned short numpts;
const char *typeofdata;
unsigned short datavaluerepresentation;
const char *datamd5;
};
static const curveinfo numptsarray1[] = { { 1, 1126, "PHYSIO", 0, "0fee912671ae158390efc7b49fe39f9b" } };
static const curveinfo numptsarray2[] = { { 1, 969, "PHYSIO", 0, "b46d2c6eed2944f1e16c46125022d2d4" } };
static const curveinfo numptsarray3[] = { { 2, 1864, "ECG ", 0, "22aadb1260fcb53a487a2e9e9ee445b3" } };
static const curveinfo numptsarray4[] = { { 2, 1590, "PRESSURE", 0, "6b4125d8a00c65feddb8c7c6f157e6ce" } , { 2, 1588, "ECG ", 0, "7a8e1cf198e74dd37738dbce5262c49d" } };
struct curveel
{
const char *name;
size_t numcurves;
const curveinfo *info;
};
static const curveel arraycurve[] = {
// gdcmData
{ "GE_DLX-8-MONO2-Multiframe-Jpeg_Lossless.dcm", 1, numptsarray1 },
{ "GE_DLX-8-MONO2-Multiframe.dcm", 1, numptsarray2 },
// gdcmDataExtra
{ "xa_integris.dcm", 1, numptsarray3 },
// random stuff:
{ "XA.1.2.826.0.1.3680043.3.29.1.3230389164.20272.1340974735.2.3.0.000001.dcm", 2, numptsarray4 },
};
static const curveel *getcurveelfromname(const char *filename)
{
static const size_t nel = sizeof( arraycurve ) / sizeof( *arraycurve );
for( size_t i = 0; i < nel; ++i )
{
const curveel &c = arraycurve[i];
if( strcmp( filename, c.name) == 0 )
{
return &c;
}
}
return nullptr;
}
static int TestCurve2Read(const char* filename, bool verbose = false)
{
if( verbose )
std::cerr << "Reading: " << filename << std::endl;
gdcm::ImageReader reader;
reader.SetFileName( filename );
if ( !reader.Read() )
{
}
int res = 0;
const gdcm::Image &img = reader.GetImage();
size_t numcurves = img.GetNumberOfCurves();
gdcm::Filename fn( filename );
if( numcurves )
{
const curveel *c = getcurveelfromname( fn.GetName() );
if( c == nullptr )
{
std::cerr << "Can't find: " << filename << std::endl;
return 1;
}
if( c->numcurves != numcurves )
{
std::cerr << "Should be: " << numcurves << " while " << c->numcurves << std::endl;
return 1;
}
const curveinfo *info = c->info;
for( size_t idx = 0; idx < numcurves; ++idx )
{
const gdcm::Curve &curve = img.GetCurve(idx);
//curve.Print( std::cout );
unsigned short dim = curve.GetDimensions();
if( info[idx].dimensions != dim )
{
std::cerr << "Should be: " << dim << " while " << info[idx].dimensions << " for idx: " << idx << std::endl;
return 1;
}
unsigned short npts = curve.GetNumberOfPoints();
if( info[idx].numpts != npts )
{
std::cerr << "Should be: " << npts << " while " << info[idx].numpts << " for idx: " << idx << std::endl;
return 1;
}
const char *tofdata = curve.GetTypeOfData();
if( strcmp(info[idx].typeofdata, tofdata ) != 0 )
{
std::cerr << "Should be: [" << tofdata << "] while [" << info[idx].typeofdata << "] for idx: " << idx << std::endl;
return 1;
}
unsigned short dvr = curve.GetDataValueRepresentation();
if( info[idx].datavaluerepresentation != dvr )
{
std::cerr << "Should be: " << dvr << " while " << info[idx].datavaluerepresentation << " for idx: " << idx << std::endl;
return 1;
}
std::vector points;
points.resize( 3 * npts );
curve.GetAsPoints( (float*)points.data() );
#if 0
for( size_t i = 0; i < npts; i += 3 )
{
std::cout << points[i + 0] << ","
<< points[i + 1] << ","
<< points[i + 2] << "\n";
}
#endif
char digest[33];
const char *buffer = (char*)points.data();
size_t len = sizeof(float) * 3 * npts;
const char *ref = info[idx].datamd5;
gdcm::Testing::ComputeMD5(buffer, len, digest);
if( verbose )
{
std::cout << "ref=" << ref << std::endl;
std::cout << "md5=" << digest << std::endl;
}
if( !ref )
{
// new regression image needs a md5 sum
std::cout << "Missing md5 " << digest << " for: " << filename << std::endl;
//assert(0);
res = 1;
}
else if( strcmp(digest, ref) != 0 )
{
std::cerr << "Problem reading image from: " << filename << std::endl;
std::cerr << "Found " << digest << " instead of " << ref << std::endl;
res = 1;
}
}
}
return res;
}
int TestCurve2(int argc, char *argv[])
{
if( argc == 2 )
{
const char *filename = argv[1];
return TestCurve2Read(filename, true);
}
// else
// First of get rid of warning/debug message
gdcm::Trace::DebugOff();
gdcm::Trace::WarningOff();
gdcm::Trace::ErrorOff();
int r = 0, i = 0;
const char *filename;
const char * const *filenames = gdcm::Testing::GetFileNames();
while( (filename = filenames[i]) )
{
r += TestCurve2Read(filename);
++i;
}
return r;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestFileAnonymizer3.cxx 000664 001766 001770 00000010336 14517730450 032041 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmFileAnonymizer.h"
#include "gdcmTesting.h"
#include "gdcmSystem.h"
#include "gdcmReader.h"
#include "gdcmFilename.h"
#include
static int TestFileAnonymize3(const char *filename, bool verbose = false)
{
using namespace gdcm;
if( verbose )
std::cout << "Processing: " << filename << std::endl;
// Create directory first:
const char subdir[] = "TestFileAnonymize3";
std::string tmpdir = Testing::GetTempDirectory( subdir );
if( !System::FileIsDirectory( tmpdir.c_str() ) )
{
System::MakeDirectory( tmpdir.c_str() );
//return 1;
}
std::string outfilename = Testing::GetTempFilename( filename, subdir );
if( verbose )
std::cout << "Generating: " << outfilename << std::endl;
const gdcm::Tag t1(0x0018,0x5100);
const gdcm::Tag t2(0x0018,0x1312);
const gdcm::Tag t3(0x0018,0x1313);
const gdcm::Tag t4(0x0018,0x1317);
//const gdcm::Tag t5(0x0008,0x2112); // SQ
//const gdcm::Tag t6(0x0008,0x9215); // SQ
const gdcm::Tag t7(0x0018,0x1020);
const gdcm::Tag t8(0x0004,0x1130); // Test DICOMDIR !
const gdcm::Tag t9(0x0008,0x0000); // Earliest possible Data Element
const gdcm::Tag t0(0xffff,0xffff); // Latest Possible Element
std::vector tags;
tags.push_back( t0 );
tags.push_back( t1 );
tags.push_back( t2 );
tags.push_back( t3 );
tags.push_back( t4 );
tags.push_back( t7 );
tags.push_back( t8 );
tags.push_back( t9 );
// precondition, remove the file if present:
System::RemoveFile(outfilename.c_str());
gdcm::FileAnonymizer fa;
fa.SetInputFileName( filename );
fa.SetOutputFileName( outfilename.c_str() );
for( std::vector::const_iterator it = tags.begin();
it != tags.end(); ++it )
{
fa.Replace( *it, "TOTO" );
}
if( !fa.Write() )
{
std::cerr << "Failed to write: " << outfilename << std::endl;
return 1;
}
// Read back and check:
gdcm::Reader r;
r.SetFileName( outfilename.c_str() );
if( !r.Read() )
{
gdcm::Filename fn( filename );
if( strcmp(fn.GetName(), "SIEMENS_MAGNETOM-12-MONO2-GDCM12-VRUN.dcm") == 0
|| strcmp(fn.GetName(), "DMCPACS_ExplicitImplicit_BogusIOP.dcm") == 0
|| strcmp(fn.GetName(), "ExplicitVRforPublicElementsImplicitVRforShadowElements.dcm") == 0 )
{
return 0;
}
std::cerr << "Failed to read: " << outfilename << std::endl;
return 1;
}
const File &f = r.GetFile();
gdcm::MediaStorage ms;
ms.SetFromFile( f );
const DataSet &ds = f.GetDataSet();
for( std::vector::const_iterator it = tags.begin();
it != tags.end(); ++it )
{
const gdcm::Tag & t = *it;
// Special handling of t8 (DICOMDIR only)
const bool iserror = (ms == gdcm::MediaStorage::MediaStorageDirectoryStorage && t == t8) && false; // de-activate for now
if( !ds.FindDataElement( t ) )
{
if( iserror )
{
std::cerr << "Not found element: " << t << " in " << outfilename << std::endl;
return 1;
}
}
const gdcm::DataElement & de = ds.GetDataElement( t );
if( de.GetVL() != 4 )
{
if( iserror )
{
std::cerr << "Wrong VL for: " << t << " in " << outfilename << std::endl;
return 1;
}
}
}
return 0;
}
int TestFileAnonymizer3(int argc, char *argv[])
{
if( argc == 2 )
{
const char *filename = argv[1];
return TestFileAnonymize3(filename, true);
}
// else
gdcm::Trace::DebugOff();
gdcm::Trace::WarningOff();
gdcm::Trace::ErrorOff();
int r = 0, i = 0;
const char *filename;
const char * const *filenames = gdcm::Testing::GetFileNames();
while( (filename = filenames[i]) )
{
r += TestFileAnonymize3( filename );
++i;
}
return r;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestEncapsulatedDocument.cxx 000664 001766 001770 00000001350 14517730450 033126 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmEncapsulatedDocument.h"
int TestEncapsulatedDocument(int argc, char *argv[])
{
(void)argc;
(void)argv;
gdcm::EncapsulatedDocument w;
(void)w;
return 0;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestFileStreamer6.cxx 000664 001766 001770 00000006504 14517730450 031475 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmFileStreamer.h"
#include "gdcmTesting.h"
#include "gdcmSystem.h"
#include "gdcmReader.h"
#include "gdcmDataSet.h"
#include "gdcmPrivateTag.h"
#include "gdcmFilename.h"
/*
* Make sure pseudo-private element also works:
*/
int TestFileStream6(const char *filename, bool verbose = false)
{
using namespace gdcm;
if( verbose )
std::cout << "Processing: " << filename << std::endl;
// Create directory first:
const char subdir[] = "TestFileStreamer6";
std::string tmpdir = Testing::GetTempDirectory( subdir );
if( !System::FileIsDirectory( tmpdir.c_str() ) )
{
System::MakeDirectory( tmpdir.c_str() );
//return 1;
}
std::string outfilename = Testing::GetTempFilename( filename, subdir );
if( verbose )
std::cout << "Generating: " << outfilename << std::endl;
gdcm::Filename fn( filename );
const char *name = fn.GetName();
// Special handling:
bool checktemplate = false;
if( strcmp(name, "DMCPACS_ExplicitImplicit_BogusIOP.dcm" ) == 0
|| strcmp(name, "ExplicitVRforPublicElementsImplicitVRforShadowElements.dcm") == 0
|| strcmp(name, "SIEMENS_MAGNETOM-12-MONO2-GDCM12-VRUN.dcm") == 0
)
{
checktemplate = true;
}
gdcm::FileStreamer fs;
fs.SetTemplateFileName( filename );
fs.CheckTemplateFileName( checktemplate );
fs.SetOutputFileName( outfilename.c_str() );
std::vector vbuffer;
vbuffer.resize( 8192 );
const char *buffer = vbuffer.data();
const size_t len = vbuffer.size();
Tag t( Tag(0x9,0x1010) );
fs.StartDataElement( t );
fs.AppendToDataElement( t, buffer, len );
fs.StopDataElement( t );
// Read back and check:
gdcm::Reader r;
r.SetFileName( outfilename.c_str() );
if( !r.Read() )
{
std::cerr << "Failed to read: " << outfilename << std::endl;
return 1;
}
gdcm::File & f = r.GetFile();
gdcm::DataSet & ds = f.GetDataSet();
if( !ds.FindDataElement( t ) )
{
return 1;
}
const gdcm::DataElement & de = ds.GetDataElement( t );
const gdcm::ByteValue * bv = de.GetByteValue();
if( !bv ) return 1;
if( bv->GetLength() != 8192 ) return 1;
const char *p = bv->GetPointer();
const char *end = p + bv->GetLength();
int res = 0;
for( ; p != end; ++p )
{
res += *p;
}
if( res )
{
std::cerr << "Mismatch: " << outfilename << std::endl;
}
return res;
}
int TestFileStreamer6(int argc, char *argv[])
{
if( argc == 2 )
{
const char *filename = argv[1];
return TestFileStream6(filename, true);
}
// else
gdcm::Trace::DebugOff();
gdcm::Trace::WarningOff();
gdcm::Trace::ErrorOff();
int r = 0, i = 0;
const char *filename;
const char * const *filenames = gdcm::Testing::GetFileNames();
while( (filename = filenames[i]) )
{
r += TestFileStream6( filename );
++i;
}
return r;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestStringFilter1.cxx 000664 001766 001770 00000004522 14517730450 031520 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmStringFilter.h"
#include "gdcmReader.h"
#include "gdcmSequenceOfItems.h"
#include "gdcmTesting.h"
#include "gdcmTrace.h"
static int TestStringFilt(const char *filename)
{
gdcm::StringFilter sf;
gdcm::Reader r;
r.SetFileName( filename );
if( !r.Read() )
{
return 1;
}
gdcm::DataSet const& ds = r.GetFile().GetDataSet();
sf.SetFile( r.GetFile() );
int ret = 0;
gdcm::DataSet::ConstIterator it = ds.Begin();
for( ; it != ds.End(); ++it)
{
const gdcm::DataElement &ref = *it;
std::pair s = sf.ToStringPair( ref.GetTag() );
if( !s.second.empty() || ref.GetVL() == 0 )
{
std::cout << s.first << " -> " << s.second << std::endl;
std::string s2 = sf.FromString( ref.GetTag(), s.second.c_str(), s.second.size() );
//std::cout << s.first << " -> " << s2 << std::endl;
}
else if( !ref.GetByteValue() ) // It means it's a SQ
{
std::cout << "SQ:" << ref.GetTag() << std::endl;
}
else if( ref.GetTag().IsPrivate() )
{
//std::cout << "Private:" << ref.GetTag() << std::endl;
std::string s2 = sf.FromString( ref.GetTag(), s.second.c_str(), s.second.size() );
}
else
{
std::cerr << "Not supported: " << ref << std::endl;
//ret += 1;
}
}
return ret;
}
int TestStringFilter1(int argc, char *argv[])
{
if( argc == 2 )
{
const char *filename = argv[1];
return TestStringFilt(filename);
}
// else
// First of get rid of warning/debug message
gdcm::Trace::DebugOff();
gdcm::Trace::WarningOff();
int r = 0, i = 0;
const char *filename;
const char * const *filenames = gdcm::Testing::GetFileNames();
while( (filename = filenames[i]) )
{
r += TestStringFilt( filename );
++i;
}
return r;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestRLECodec.cxx 000664 001766 001770 00000001406 14517730450 030401 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmTypes.h"
int TestRLECodec(int, char *[])
{
// Compress a black images: should give a good result
// Compress a checkboard (black/white alternate). Should give a mediocre result
return 0;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestStrictScanner2_1.cxx 000664 001766 001770 00000015632 14517730450 032113 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmStrictScanner2.h"
#include "gdcmDirectory.h"
#include "gdcmSystem.h"
#include "gdcmTesting.h"
#include "gdcmTrace.h"
// dcmdump /path/to/image/*.dcm 2>&/dev/null| grep 0020 | grep "000e\|000d" | sort | uniq
//
// $ find /images/ -type f -exec dcmdump -s +P 0010,0010 {} \;
static int TestScanner2Extra()
{
const char *extradataroot = gdcm::Testing::GetDataExtraRoot();
if( !extradataroot )
{
return 1;
}
if( !gdcm::System::FileIsDirectory(extradataroot) )
{
std::cerr << "No such directory: " << extradataroot << std::endl;
return 1;
}
gdcm::Directory d;
unsigned int nfiles = d.Load( extradataroot, true ); // no recursion
std::cout << "done retrieving file list. " << nfiles << " files found." << std::endl;
gdcm::StrictScanner2 s;
const gdcm::Tag t1(0x0020,0x000d); // Study Instance UID
const gdcm::Tag t2(0x0020,0x000e); // Series Instance UID
const gdcm::Tag t3(0x0010,0x0010); // Patient's Name
const gdcm::Tag t4(0x0004,0x5678); // DUMMY element
const gdcm::Tag t5(0x0028,0x0010); // Rows
const gdcm::Tag t6(0x0028,0x0011); // Columns
s.AddPublicTag( t1 );
s.AddPublicTag( t2 );
s.AddPublicTag( t3 );
s.AddPublicTag( t4 );
s.AddPublicTag( t5 );
s.AddPublicTag( t6 );
bool b = s.Scan( d.GetFilenames() );
if( !b )
{
std::cerr << "Scanner2 failed" << std::endl;
return 1;
}
//s.Print( std::cout );
return 0;
}
int TestStrictScanner2_1(int argc, char *argv[])
{
gdcm::Trace::WarningOff();
gdcm::Trace::ErrorOff();
const char *directory = gdcm::Testing::GetDataRoot();
std::string tmpdir = gdcm::Testing::GetTempDirectory( "TestWriter" );
directory = tmpdir.c_str();
if( argc == 2 )
{
directory = argv[1];
}
if( !gdcm::System::FileIsDirectory(directory) )
{
std::cerr << "No such directory: " << directory << std::endl;
return 1;
}
gdcm::Directory d;
unsigned int nfiles = d.Load( directory ); // no recursion
// d.Print( std::cout );
std::cout << "done retrieving file list. " << nfiles << " files found." << std::endl;
gdcm::StrictScanner2 s;
const gdcm::Tag t1(0x0020,0x000d); // Study Instance UID
const gdcm::Tag t2(0x0020,0x000e); // Series Instance UID
const gdcm::Tag t3(0x0010,0x0010); // Patient's Name
const gdcm::Tag t4(0x0004,0x5678); // DUMMY element
const gdcm::Tag t5(0x0028,0x0010); // Rows
const gdcm::Tag t6(0x0028,0x0011); // Columns
const gdcm::Tag t7(0x0008,0x0016); //
s.AddPublicTag( t1 );
s.AddPublicTag( t2 );
s.AddPublicTag( t3 );
s.AddPublicTag( t4 );
s.AddPublicTag( t5 );
s.AddPublicTag( t6 );
s.AddPublicTag( t7 );
bool b = s.Scan( d.GetFilenames() );
if( !b )
{
std::cerr << "Scanner2 failed" << std::endl;
return 1;
}
// s.Print( std::cout );
gdcm::Directory::FilenamesType const & files = s.GetFilenames();
if( files != d.GetFilenames() )
{
return 1;
}
int numerrors = 0;
for( gdcm::Directory::FilenamesType::const_iterator it = files.begin(); it != files.end(); ++it )
{
const char *filename = it->c_str();
const char* value = s.GetPublicValue(filename, t7);
const char *msstr = gdcm::Testing::GetMediaStorageFromFile(filename);
if( msstr && strcmp(msstr, "1.2.840.10008.1.3.10" ) == 0 )
{
// would need to check (0002,0002)...
}
if( value && msstr )
{
if( strcmp( value, msstr ) != 0 )
{
std::cerr << "Problem with file " << filename << std::endl;
std::cerr << value << "/" << msstr << std::endl;
++numerrors;
}
}
else
{
if ( !msstr )
{
std::cerr << "Problem with file " << filename << std::endl;
if( value ) std::cerr << "Value found: " << value << std::endl;
++numerrors;
}
}
}
if( numerrors )
return numerrors;
// Check dummy filename:
bool iskey = s.IsKey( "gdcm.rocks.invalid.name" );
if( iskey )
{
std::cout << "IsKey returned: " << iskey << std::endl;
return 1;
}
// Let's get the value for tag t1 in first file:
gdcm::StrictScanner2::PublicMappingType const &mt = s.GetPublicMappings();
std::string sfilename;
sfilename = gdcm::Testing::GetDataRoot();
sfilename = directory;
sfilename+= "/test.acr";
{
//const char *filename = d.GetFilenames()[0].c_str();
const char *filename = sfilename.c_str();
// The following breaks with Papyrus file: PET-cardio-Multiframe-Papyrus.dcm
unsigned int i = 0;
gdcm::StrictScanner2::PublicMappingType::const_iterator it = mt.find(filename);
assert( it != mt.end() );
while( it == mt.end() )
{
++i;
if( i == d.GetFilenames().size() )
{
return 1;
}
filename = d.GetFilenames()[i].c_str();
it = mt.find(filename);
}
std::cout << "Mapping for " << filename << " is :" << std::endl;
const gdcm::StrictScanner2::PublicTagToValue &tv = it->second;
//const std::string &filename = d.GetFilenames()[0];
gdcm::StrictScanner2::PublicTagToValue::const_iterator it2 = tv.find( t5 );
if( it2 == tv.end() || t5 != it2->first )
{
std::cerr << "Could not find tag:" << t5 << std::endl;
return 1;
}
const char * t1value = it2->second;
std::cout << filename << " -> " << t1 << " = " << (*t1value ? t1value : "none" ) << std::endl;
}
const gdcm::Directory::FilenamesType &filenames = d.GetFilenames();
{
gdcm::Directory::FilenamesType::const_iterator it = filenames.begin();
for(; it != filenames.end(); ++it)
{
const char *filename = it->c_str();
const gdcm::Tag &reftag = t6;
const char *value = s.GetPublicValue( filename, reftag );
if( value )
{
assert( value );
std::cout << filename << " has " << reftag << " = " << value << std::endl;
}
else
{
std::cout << filename << " has " << reftag << " = no value or not DICOM" << std::endl;
}
}
}
/*
{
std::vector keys = s.GetKeys();
for( std::vector::const_iterator it = keys.begin(); it != keys.end(); ++it)
{
const char *filename = *it;
const gdcm::Directory::FilenamesType::const_iterator it2
= std::find(filenames.begin(), filenames.end(), filename);
if( it2 == filenames.end() )
{
return 1;
}
if( !s.IsKey( filename ) )
{
return 1;
}
}
}
*/
// puposely discard gdcmDataExtra test, this is just an 'extra' test...
//int b2 = TestScanner2Extra(); (void)b2;
return 0;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestStrictScanner1.cxx 000664 001766 001770 00000015425 14517730450 031672 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmStrictScanner.h"
#include "gdcmDirectory.h"
#include "gdcmSystem.h"
#include "gdcmTesting.h"
#include "gdcmTrace.h"
// dcmdump /path/to/image/*.dcm 2>&/dev/null| grep 0020 | grep "000e\|000d" | sort | uniq
//
// $ find /images/ -type f -exec dcmdump -s +P 0010,0010 {} \;
static int TestScannerExtra()
{
const char *extradataroot = gdcm::Testing::GetDataExtraRoot();
if( !extradataroot )
{
return 1;
}
if( !gdcm::System::FileIsDirectory(extradataroot) )
{
std::cerr << "No such directory: " << extradataroot << std::endl;
return 1;
}
gdcm::Directory d;
unsigned int nfiles = d.Load( extradataroot, true ); // no recursion
std::cout << "done retrieving file list. " << nfiles << " files found." << std::endl;
gdcm::StrictScanner s;
const gdcm::Tag t1(0x0020,0x000d); // Study Instance UID
const gdcm::Tag t2(0x0020,0x000e); // Series Instance UID
const gdcm::Tag t3(0x0010,0x0010); // Patient's Name
const gdcm::Tag t4(0x0004,0x5678); // DUMMY element
const gdcm::Tag t5(0x0028,0x0010); // Rows
const gdcm::Tag t6(0x0028,0x0011); // Columns
s.AddTag( t1 );
s.AddTag( t2 );
s.AddTag( t3 );
s.AddTag( t4 );
s.AddTag( t5 );
s.AddTag( t6 );
bool b = s.Scan( d.GetFilenames() );
if( !b )
{
std::cerr << "Scanner failed" << std::endl;
return 1;
}
//s.Print( std::cout );
return 0;
}
int TestStrictScanner1(int argc, char *argv[])
{
gdcm::Trace::WarningOff();
gdcm::Trace::ErrorOff();
const char *directory = gdcm::Testing::GetDataRoot();
std::string tmpdir = gdcm::Testing::GetTempDirectory( "TestWriter" );
directory = tmpdir.c_str();
if( argc == 2 )
{
directory = argv[1];
}
if( !gdcm::System::FileIsDirectory(directory) )
{
std::cerr << "No such directory: " << directory << std::endl;
return 1;
}
gdcm::Directory d;
unsigned int nfiles = d.Load( directory ); // no recursion
// d.Print( std::cout );
std::cout << "done retrieving file list. " << nfiles << " files found." << std::endl;
gdcm::StrictScanner s;
const gdcm::Tag t1(0x0020,0x000d); // Study Instance UID
const gdcm::Tag t2(0x0020,0x000e); // Series Instance UID
const gdcm::Tag t3(0x0010,0x0010); // Patient's Name
const gdcm::Tag t4(0x0004,0x5678); // DUMMY element
const gdcm::Tag t5(0x0028,0x0010); // Rows
const gdcm::Tag t6(0x0028,0x0011); // Columns
const gdcm::Tag t7(0x0008,0x0016); //
s.AddTag( t1 );
s.AddTag( t2 );
s.AddTag( t3 );
s.AddTag( t4 );
s.AddTag( t5 );
s.AddTag( t6 );
s.AddTag( t7 );
bool b = s.Scan( d.GetFilenames() );
if( !b )
{
std::cerr << "Scanner failed" << std::endl;
return 1;
}
// s.Print( std::cout );
gdcm::Directory::FilenamesType const & files = s.GetFilenames();
if( files != d.GetFilenames() )
{
return 1;
}
int numerrors = 0;
for( gdcm::Directory::FilenamesType::const_iterator it = files.begin(); it != files.end(); ++it )
{
const char *filename = it->c_str();
const char* value = s.GetValue(filename, t7);
const char *msstr = gdcm::Testing::GetMediaStorageFromFile(filename);
if( msstr && strcmp(msstr, "1.2.840.10008.1.3.10" ) == 0 )
{
// would need to check (0002,0002)...
}
if( value && msstr )
{
if( strcmp( value, msstr ) != 0 )
{
std::cerr << "Problem with file " << filename << std::endl;
std::cerr << value << "/" << msstr << std::endl;
++numerrors;
}
}
else
{
if ( !msstr )
{
std::cerr << "Problem with file " << filename << std::endl;
if( value ) std::cerr << "Value found: " << value << std::endl;
++numerrors;
}
}
}
if( numerrors )
return numerrors;
// Check dummy filename:
bool iskey = s.IsKey( "gdcm.rocks.invalid.name" );
if( iskey )
{
std::cout << "IsKey returned: " << iskey << std::endl;
return 1;
}
// Let's get the value for tag t1 in first file:
gdcm::StrictScanner::MappingType const &mt = s.GetMappings();
std::string sfilename;
sfilename = gdcm::Testing::GetDataRoot();
sfilename = directory;
sfilename+= "/test.acr";
{
//const char *filename = d.GetFilenames()[0].c_str();
const char *filename = sfilename.c_str();
// The following breaks with Papyrus file: PET-cardio-Multiframe-Papyrus.dcm
unsigned int i = 0;
gdcm::StrictScanner::MappingType::const_iterator it = mt.find(filename);
assert( it != mt.end() );
while( it == mt.end() )
{
++i;
if( i == d.GetFilenames().size() )
{
return 1;
}
filename = d.GetFilenames()[i].c_str();
it = mt.find(filename);
}
std::cout << "Mapping for " << filename << " is :" << std::endl;
const gdcm::StrictScanner::TagToValue &tv = it->second;
//const std::string &filename = d.GetFilenames()[0];
gdcm::StrictScanner::TagToValue::const_iterator it2 = tv.find( t5 );
if( it2 == tv.end() || t5 != it2->first )
{
std::cerr << "Could not find tag:" << t5 << std::endl;
return 1;
}
const char * t1value = it2->second;
std::cout << filename << " -> " << t1 << " = " << (*t1value ? t1value : "none" ) << std::endl;
}
const gdcm::Directory::FilenamesType &filenames = d.GetFilenames();
{
gdcm::Directory::FilenamesType::const_iterator it = filenames.begin();
for(; it != filenames.end(); ++it)
{
const char *filename = it->c_str();
const gdcm::Tag &reftag = t6;
const char *value = s.GetValue( filename, reftag );
if( value )
{
assert( value );
std::cout << filename << " has " << reftag << " = " << value << std::endl;
}
else
{
std::cout << filename << " has " << reftag << " = no value or not DICOM" << std::endl;
}
}
}
/*
{
std::vector keys = s.GetKeys();
for( std::vector::const_iterator it = keys.begin(); it != keys.end(); ++it)
{
const char *filename = *it;
const gdcm::Directory::FilenamesType::const_iterator it2
= std::find(filenames.begin(), filenames.end(), filename);
if( it2 == filenames.end() )
{
return 1;
}
if( !s.IsKey( filename ) )
{
return 1;
}
}
}
*/
// puposely discard gdcmDataExtra test, this is just an 'extra' test...
//int b2 = TestScannerExtra(); (void)b2;
return 0;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestDICOMDIRGenerator2.cxx 000664 001766 001770 00000005306 14517730450 032147 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmDICOMDIRGenerator.h"
#include "gdcmDirectory.h"
#include "gdcmWriter.h"
#include "gdcmTesting.h"
#include "gdcmSystem.h"
#include "gdcmFilenameGenerator.h"
int TestDICOMDIRGenerator2(int argc, char *argv[])
{
(void)argc;
const char *directory = gdcm::Testing::GetDataRoot();
(void)argv;
gdcm::Directory::FilenamesType filenames;
gdcm::Directory::FilenamesType outfilenames;
gdcm::Directory dir;
int recursive = 0;
unsigned int nfiles = 1;
const char subdir[] = "TestImageChangeTransferSyntax4";
std::string tmpdir = gdcm::Testing::GetTempDirectory( subdir );
if( !gdcm::System::FileIsDirectory( tmpdir.c_str() ) )
{
std::cerr << "Need to run TestImageChangeTransferSyntax4 before" << std::endl;
return 1;
}
directory = tmpdir.c_str();
const char outsubdir[] = "TestDICOMDIRGenerator2";
std::string outtmpdir = gdcm::Testing::GetTempDirectory( outsubdir );
if( !gdcm::System::FileIsDirectory( outtmpdir.c_str() ) )
{
gdcm::System::MakeDirectory( outtmpdir.c_str() );
}
nfiles = dir.Load(directory, (recursive > 0 ? true : false));
gdcm::FilenameGenerator fg;
const char pattern[] = "FILE%03d";
fg.SetPattern( pattern );
fg.SetNumberOfFilenames( nfiles );
if( !fg.Generate() )
{
std::cerr << "Could not generate" << std::endl;
return 1;
}
filenames = dir.GetFilenames();
for( unsigned int i = 0; i < nfiles; ++i )
{
std::string copy = outtmpdir;
copy += "/";
copy += fg.GetFilename( i );
std::cerr << filenames[i] << " -> " << copy << std::endl;
std::ifstream f1(filenames[i].c_str(), std::fstream::binary);
std::ofstream f2(copy.c_str(), std::fstream::binary);
f2 << f1.rdbuf();
outfilenames.push_back( copy );
}
gdcm::DICOMDIRGenerator gen;
gen.SetFilenames( outfilenames );
gen.SetRootDirectory( outtmpdir );
gen.SetDescriptor( "MYDESCRIPTOR" );
if( !gen.Generate() )
{
return 1;
}
gdcm::Writer writer;
writer.SetFile( gen.GetFile() );
std::string outfilename = outtmpdir;
outfilename += "/DICOMDIR";
writer.SetFileName( outfilename.c_str() );
if( !writer.Write() )
{
return 1;
}
return 0;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestParseXPATH.cxx 000664 001766 001770 00000006216 14517730450 030704 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmReader.h"
#include "gdcmDataSet.h"
#include "gdcmDict.h"
#include "gdcmDicts.h"
#include "gdcmGlobal.h"
#include "gdcmStringFilter.h"
#include "gdcmTesting.h"
#include "gdcmFilename.h"
static bool CheckResult( std::string const & filename, std::string const & value )
{
if(
filename == "D_CLUNIE_MR3_JPLY.dcm"
|| filename == "D_CLUNIE_RG3_JPLY.dcm"
|| filename == "D_CLUNIE_NM1_JPLY.dcm"
|| filename == "D_CLUNIE_MR4_JPLY.dcm"
|| filename == "D_CLUNIE_CT1_J2KI.dcm"
|| filename == "D_CLUNIE_CT1_JLSN.dcm"
|| filename == "D_CLUNIE_MR1_JPLY.dcm"
|| filename == "D_CLUNIE_SC1_JPLY.dcm"
|| filename == "D_CLUNIE_MR2_JPLY.dcm"
|| filename == "D_CLUNIE_RG2_JPLY.dcm"
|| filename == "D_CLUNIE_XA1_JPLY.dcm" )
{
return value == "Lossy Compression ";
}
else if ( filename == "JPEG_LossyYBR.dcm"
|| filename == "MEDILABInvalidCP246_EVRLESQasUN.dcm" )
return value == "Full fidelity image, uncompressed or lossless compressed";
else if ( filename == "NM-PAL-16-PixRep1.dcm" )
return value == "Full fidelity image ";
else
return value.empty();
}
int TestParseXPATHFile(const char* filename, bool verbose = false )
{
(void)verbose;
//static gdcm::Global &g = gdcm::Global::GetInstance();
//static const gdcm::Dicts &dicts = g.GetDicts();
//static const gdcm::Dict &pubdict = dicts.GetPublicDict();
gdcm::Reader reader;
// reader.SetFileName( "/home/mathieu/Creatis/gdcmData/D_CLUNIE_CT1_J2KI.dcm" );
reader.SetFileName( filename );
if( !reader.Read() )
{
return 1;
}
gdcm::StringFilter sf;
sf.SetFile( reader.GetFile() );
const char query_const[] = "/DicomNativeModel/DicomAttribute[@keyword='DerivationCodeSequence']/Item[@number=1]//DicomAttribute[@keyword='CodeMeaning']/Value[@number=1]";
std::string value;
bool ret = sf.ExecuteQuery( query_const, value );
if( !ret )
{
return 1;
}
gdcm::Filename fn( filename );
bool b = CheckResult( fn.GetName(), value );
if( !b )
{
std::cerr << "Problem with: " << filename << " -> " << value << std::endl;
}
return !b;
}
int TestParseXPATH(int argc, char *argv[])
{
if( argc == 2 )
{
const char *filename = argv[1];
return TestParseXPATHFile(filename, true);
}
// else
// First of get rid of warning/debug message
gdcm::Trace::DebugOff();
gdcm::Trace::WarningOff();
int r = 0, i = 0;
const char *filename;
const char * const *filenames = gdcm::Testing::GetFileNames();
while( (filename = filenames[i]) )
{
r += TestParseXPATHFile(filename);
++i;
}
(void)r;
return EXIT_SUCCESS;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestJPEGCodec.cxx 000664 001766 001770 00000001201 14517730450 030475 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmJPEGCodec.h"
int TestJPEGCodec(int, char *[])
{
return 0;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageRegionReader2.cxx 000664 001766 001770 00000010713 14517730450 032415 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmImageRegionReader.h"
#include "gdcmImageHelper.h"
#include "gdcmFilename.h"
#include "gdcmBoxRegion.h"
#include "gdcmTesting.h"
static int TestImageRegionRead(const char* filename, bool verbose = false)
{
if( verbose )
std::cerr << "Reading: " << filename << std::endl;
gdcm::ImageRegionReader reader;
gdcm::Filename fn( filename );
// DMCPACS_ExplicitImplicit_BogusIOP.dcm is very difficult to handle since
// we need to read 3 attribute to detect the "well known" bug. However the third
// attribute is (b500,b700) which make ReadUpToTag(7fe0,0010) fails...
if( strcmp(fn.GetName(), "DMCPACS_ExplicitImplicit_BogusIOP.dcm" ) == 0
|| strcmp(fn.GetName(), "SC16BitsAllocated_8BitsStoredJ2K.dcm" ) == 0 // mismatch pixel format in JPEG 2000 vs DICOM
|| strcmp(fn.GetName(), "SC16BitsAllocated_8BitsStoredJPEG.dcm" ) == 0 // mismatch pixel format in JPEG vs DICOM
|| strcmp(fn.GetName(), "PHILIPS_Gyroscan-12-Jpeg_Extended_Process_2_4.dcm" ) == 0 // bogus JPEG cannot be streamed
|| strcmp(fn.GetName(), "US-YBR_FULL_422-EVRLE.dcm" ) == 0 // FIXME TODO
// FIXME: we should be able to handle those at some point:
|| strcmp(fn.GetName(), "JPEGNote_empty.dcm" ) == 0
|| strcmp(fn.GetName(), "JPEGNote_missing.dcm" ) == 0
|| strcmp(fn.GetName(), "JPEGNote_bogus.dcm" ) == 0
)
{
std::cerr << "Skipping impossible file: " << filename << std::endl;
return 0;
}
reader.SetFileName( filename );
bool canReadInformation = reader.ReadInformation();
if (!canReadInformation)
{
std::cerr << "Cannot ReadInformation: " << filename << std::endl;
return 0; //unable to read tags as expected.
}
int res = 0;
size_t len = 0;
std::vector vbuffer;
std::vector dims =
gdcm::ImageHelper::GetDimensionsValue(reader.GetFile());
gdcm::BoxRegion box;
for( unsigned int z = 0; z < dims[2]; ++z )
{
box.SetDomain(0, dims[0] - 1, 0, dims[1] - 1, z, z);
reader.SetRegion( box );
size_t zlen = reader.ComputeBufferLength();
if( !zlen )
{
std::cerr << "No length for: " << filename << std::endl;
return 1;
}
size_t oldlen = vbuffer.size();
len += zlen;
vbuffer.resize( oldlen + zlen );
char* buffer = vbuffer.data() + oldlen;
bool b = reader.ReadIntoBuffer(buffer, zlen);
if( !b )
{
std::cerr << "Could not ReadIntoBuffer" << std::endl;
return 1;
}
}
const char *ref = gdcm::Testing::GetMD5FromFile(filename);
// FIXME: PC=1
if( strcmp(fn.GetName(), "ACUSON-24-YBR_FULL-RLE-b.dcm" ) == 0) ref = "2d7a28cae6c3b3183284d1b4ae08307f";
if( strcmp(fn.GetName(), "ACUSON-24-YBR_FULL-RLE.dcm" ) == 0) ref = "429f31f0b70bd515b3feeda5dea5eac0";
char digest[33];
char* buffer = vbuffer.data();
#if 0
std::ofstream of( "/tmp/dd.raw", std::ios::binary );
of.write( buffer, len );
of.close();
#endif
gdcm::Testing::ComputeMD5(buffer, len, digest);
if( verbose )
{
std::cout << "ref=" << ref << std::endl;
std::cout << "md5=" << digest << std::endl;
}
if( !ref )
{
// new regression image needs a md5 sum
std::cout << "Missing md5 " << digest << " for: " << filename << std::endl;
res = 1;
}
else if( strcmp(digest, ref) != 0 )
{
std::cerr << "Problem reading image from: " << filename << std::endl;
std::cerr << "Found " << digest << " instead of " << ref << std::endl;
res = 1;
}
return res;
}
int TestImageRegionReader2(int argc, char *argv[])
{
if( argc == 2 )
{
const char *filename = argv[1];
return TestImageRegionRead(filename, true);
}
// else
// First of get rid of warning/debug message
gdcm::Trace::DebugOff();
gdcm::Trace::WarningOff();
int r = 0, i = 0;
const char *filename;
const char * const *filenames = gdcm::Testing::GetFileNames();
while( (filename = filenames[i]) )
{
r += TestImageRegionRead(filename);
++i;
}
return r;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageWriter.cxx 000664 001766 001770 00000012514 14517730450 031242 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmImageReader.h"
#include "gdcmImageWriter.h"
#include "gdcmFilename.h"
#include "gdcmSystem.h"
#include "gdcmFileMetaInformation.h"
#include "gdcmTesting.h"
#include "gdcmByteSwap.h"
namespace gdcm
{
int TestImageWrite(const char *subdir, const char* filename)
{
ImageReader reader;
reader.SetFileName( filename );
if ( !reader.Read() )
{
const FileMetaInformation &header = reader.GetFile().GetHeader();
MediaStorage ms = header.GetMediaStorage();
bool isImage = MediaStorage::IsImage( ms );
bool pixeldata = reader.GetFile().GetDataSet().FindDataElement( Tag(0x7fe0,0x0010) );
if( isImage && pixeldata )
{
std::cerr << "Failed to read: " << filename << std::endl;
return 1;
}
else
{
// not an image give up...
std::cerr << "Problem with: " << filename << " but that's ok" << std::endl;
return 0;
}
}
// Create directory first:
std::string tmpdir = Testing::GetTempDirectory( subdir );
if( !System::FileIsDirectory( tmpdir.c_str() ) )
{
System::MakeDirectory( tmpdir.c_str() );
//return 1;
}
std::string outfilename = Testing::GetTempFilename( filename, subdir );
ImageWriter writer;
writer.SetFileName( outfilename.c_str() );
writer.SetFile( reader.GetFile() ); // important
writer.SetImage( reader.GetImage() );
if( !writer.Write() )
{
std::cerr << "Failed to write: " << outfilename << std::endl;
return 1;
}
std::cout << "success: " << outfilename << std::endl;
// Let's read that file back in !
ImageReader reader2;
reader2.SetFileName( outfilename.c_str() );
if ( reader2.Read() )
{
int res = 0;
const Image &img = reader2.GetImage();
//std::cerr << "Success to read image from file: " << filename << std::endl;
unsigned long len = img.GetBufferLength();
char* buffer = new char[len];
img.GetBuffer(buffer);
// On big Endian system we have byteswapped the buffer (duh!)
// Since the md5sum is byte based there is now way it would detect
// that the file is written in big endian word, so comparing against
// a md5sum computed on LittleEndian would fail. Thus we need to
// byteswap (again!) here:
#ifdef GDCM_WORDS_BIGENDIAN
if( img.GetPixelFormat().GetBitsAllocated() == 16 )
{
assert( !(len % 2) );
assert( img.GetPhotometricInterpretation() == PhotometricInterpretation::MONOCHROME1
|| img.GetPhotometricInterpretation() == PhotometricInterpretation::MONOCHROME2 );
ByteSwap::SwapRangeFromSwapCodeIntoSystem(
(unsigned short*)buffer, SwapCode::LittleEndian, len/2);
}
#endif
// reuse the filename, since outfilename is simply the new representation of the old filename
const char *ref = Testing::GetMD5FromFile(filename);
char digest[33] = {};
Testing::ComputeMD5(buffer, len, digest);
if( !ref )
{
// new regression image needs a md5 sum
std::cout << "Missing md5 " << digest << " for: " << outfilename << std::endl;
//assert(0);
res = 1;
}
else if( strcmp(digest, ref) != 0 )
{
std::cerr << "Problem reading image from: " << outfilename << std::endl;
std::cerr << "Found " << digest << " instead of " << ref << std::endl;
res = 1;
#if 0
std::ofstream debug("/tmp/dump.gray", std::ios::binary);
debug.write(buffer, len);
debug.close();
//assert(0);
#endif
}
delete[] buffer;
return res;
}
#if 0
// Ok we have now two files let's compare their md5 sum:
char digest[33], outdigest[33];
System::ComputeFileMD5(filename, digest);
System::ComputeFileMD5(outfilename.c_str(), outdigest);
if( strcmp(digest, outdigest) )
{
// too bad the file is not identical, so let's be paranoid and
// try to reread-rewrite this just-writen file:
// TODO: Copy file System::CopyFile( );
if( TestImageWrite( outfilename.c_str() ) )
{
std::cerr << filename << " and "
<< outfilename << " are different\n";
return 1;
}
// In theory I need to compare the two documents to check they
// are identical... TODO
std::cerr << filename << " and "
<< outfilename << " should be compatible\n";
return 0;
}
else
{
std::cerr << filename << " and "
<< outfilename << " are identical\n";
return 0;
}
#endif
return 0;
}
}
int TestImageWriter(int argc, char *argv[])
{
if( argc == 2 )
{
const char *filename = argv[1];
return gdcm::TestImageWrite(argv[0],filename);
}
// else
gdcm::Trace::DebugOff();
gdcm::Trace::WarningOff();
int r = 0, i = 0;
const char *filename;
const char * const *filenames = gdcm::Testing::GetFileNames();
while( (filename = filenames[i]) )
{
r += gdcm::TestImageWrite(argv[0], filename );
++i;
}
return r;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestFileDecompressLookupTable.cxx 000664 001766 001770 00000012274 14517730450 034074 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmFileDecompressLookupTable.h"
#include "gdcmImageApplyLookupTable.h"
#include "gdcmTesting.h"
#include "gdcmSystem.h"
#include "gdcmImageReader.h"
#include "gdcmPixmapReader.h"
#include "gdcmPixmapWriter.h"
#include "gdcmImage.h"
#include "gdcmFilename.h"
// array copy/pasted from: TestImageApplyLookupTable
static const char * const lutarray[][2] = {
{ "d613050ca0f9c924fb5282d140281fcc", "LEADTOOLS_FLOWERS-8-PAL-RLE.dcm" },
{ "d613050ca0f9c924fb5282d140281fcc", "LEADTOOLS_FLOWERS-8-PAL-Uncompressed.dcm" },
{ "7b8d795eaf99f1fff176c43f9cf76bfb", "NM-PAL-16-PixRep1.dcm" },
{ "47715f0a5d5089268bbef6f83251a8ad", "OT-PAL-8-face.dcm" },
{ "c70309b66045140b8e08c11aa319c0ab", "US-PAL-8-10x-echo.dcm" },
{ "c370ca934dc910eb4b629a2fa8650b67", "gdcm-US-ALOKA-16.dcm" },
{ "49ca8ad45fa7f24b0406a5a03ba8aff6", "rle16loo.dcm" },
{ "964ea27345a7004325896d34b257f289", "rle16sti.dcm" },
// sentinel
{ nullptr, nullptr }
};
static int TestFileDecompressLookupTableFunc(const char *filename, bool verbose = false)
{
gdcm::PixmapReader reader;
reader.SetFileName( filename );
if ( !reader.Read() )
{
const gdcm::FileMetaInformation &header = reader.GetFile().GetHeader();
gdcm::MediaStorage ms = header.GetMediaStorage();
bool isImage = gdcm::MediaStorage::IsImage( ms );
bool pixeldata = reader.GetFile().GetDataSet().FindDataElement( gdcm::Tag(0x7fe0,0x0010) );
if( isImage && pixeldata )
{
std::cout << "Could not read: " << filename << std::endl;
return 1;
}
return 0;
}
const gdcm::Pixmap &image = reader.GetPixmap();
const gdcm::PhotometricInterpretation &pi = image.GetPhotometricInterpretation();
if( pi != gdcm::PhotometricInterpretation::PALETTE_COLOR )
{
// yeah well not much I can do here...
if( verbose )
{
std::cout << "PhotometricInterpretation is: " << pi << " cannot apply LUT then..." << std::endl;
}
return 0;
}
gdcm::FileDecompressLookupTable lutfilt;
lutfilt.SetPixmap( image );
lutfilt.SetFile( reader.GetFile() );
bool b = lutfilt.Change();
if( !b )
{
std::cerr << "Could not apply lut: " << filename << std::endl;
return 1;
}
// Create directory first:
const char subdir[] = "TestFileDecompressLookupTable";
std::string tmpdir = gdcm::Testing::GetTempDirectory( subdir );
if( !gdcm::System::FileIsDirectory( tmpdir.c_str() ) )
{
gdcm::System::MakeDirectory( tmpdir.c_str() );
//return 1;
}
std::string outfilename = gdcm::Testing::GetTempFilename( filename, subdir );
gdcm::PixmapWriter writer;
writer.SetFileName( outfilename.c_str() );
writer.SetFile( reader.GetFile() ); // comment out if you dare
writer.SetPixmap( lutfilt.GetPixmap() );
if( !writer.Write() )
{
std::cerr << "Failed to write: " << outfilename << std::endl;
return 1;
}
// Let's read that file back in !
gdcm::ImageReader reader2;
reader2.SetFileName( outfilename.c_str() );
if ( !reader2.Read() )
{
std::cerr << "Failed to read back: " << outfilename << std::endl;
return 1;
}
gdcm::ImageApplyLookupTable lutfilt2;
lutfilt2.SetInput( reader2.GetPixmap() );
b = lutfilt2.Apply();
if( !b )
{
std::cerr << "Could not apply lut: " << filename << std::endl;
return 1;
}
const gdcm::Image &img = lutfilt2.GetOutput();
unsigned long len = img.GetBufferLength();
char* buffer = new char[len];
img.GetBuffer(buffer);
gdcm::Filename fn( filename );
const char *name = fn.GetName();
unsigned int i = 0;
const char *p = lutarray[i][1];
while( p != nullptr )
{
if( strcmp( name, p ) == 0 )
{
break;
}
++i;
p = lutarray[i][1];
}
const char *ref = lutarray[i][0];
char digest[33] = {};
gdcm::Testing::ComputeMD5(buffer, len, digest);
int res = 0;
if( !ref )
{
std::cerr << "Missing LUT-applied MD5 for image from: " << filename << std::endl;
res = 1;
}
else if( strcmp(digest, ref) != 0 )
{
std::cerr << "Problem reading image from: " << filename << std::endl;
std::cerr << "Found " << digest << " instead of " << ref << std::endl;
res = 1;
}
delete[] buffer;
return res;
}
int TestFileDecompressLookupTable(int argc, char *argv[])
{
if( argc == 2 )
{
const char *filename = argv[1];
return TestFileDecompressLookupTableFunc(filename, true);
}
// else
gdcm::Trace::DebugOff();
gdcm::Trace::WarningOff();
int r = 0, i = 0;
const char *filename;
const char * const *filenames = gdcm::Testing::GetFileNames();
while( (filename = filenames[i]) )
{
r += TestFileDecompressLookupTableFunc( filename );
++i;
}
return r;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageRegionReader4.cxx 000664 001766 001770 00000010030 14517730450 032407 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmImageRegionReader.h"
#include "gdcmImageHelper.h"
#include "gdcmFilename.h"
#include "gdcmBoxRegion.h"
#include "gdcmTesting.h"
#include "gdcmSystem.h"
static int TestImageRegionRead(const char* filename, bool verbose = false)
{
using gdcm::System;
using gdcm::Testing;
if( verbose )
std::cerr << "Reading: " << filename << std::endl;
gdcm::ImageRegionReader reader;
reader.SetFileName( filename );
bool canReadInformation = reader.ReadInformation();
if (!canReadInformation)
{
std::cerr << "Cannot ReadInformation: " << filename << std::endl;
return 1;
}
// Create directory first:
const char subdir[] = "TestImageRegionReader4";
std::string tmpdir = Testing::GetTempDirectory( subdir );
if( !System::FileIsDirectory( tmpdir.c_str() ) )
{
System::MakeDirectory( tmpdir.c_str() );
//return 1;
}
std::string outfilename = Testing::GetTempFilename( filename, subdir );
outfilename += ".raw";
std::ofstream of( outfilename.c_str(), std::ios::binary );
int res = 0;
std::vector dims =
gdcm::ImageHelper::GetDimensionsValue(reader.GetFile());
std::vector vbuffer;
gdcm::BoxRegion box;
for( unsigned int z = 0; z < dims[2]; ++z )
{
box.SetDomain(0, dims[0] - 1, 0, dims[1] - 1, z, z);
reader.SetRegion( box );
size_t len = reader.ComputeBufferLength();
if( !len )
{
std::cerr << "No length for: " << filename << std::endl;
return 1;
}
vbuffer.resize( len );
char* buffer = &vbuffer[0];
bool b = reader.ReadIntoBuffer(buffer, len);
if( !b )
{
std::cerr << "Could not ReadIntoBuffer" << std::endl;
return 1;
}
of.write( buffer, len );
}
of.close();
char digest[33];
bool b = gdcm::Testing::ComputeFileMD5(outfilename.c_str(), digest);
if( !b )
{
std::cerr << "Could not ComputeFileMD5: " << outfilename << std::endl;
return 1;
}
const char *ref = gdcm::Testing::GetMD5FromFile(filename);
if( verbose )
{
std::cout << "ref=" << ref << std::endl;
std::cout << "md5=" << digest << std::endl;
}
if( !ref )
{
// new regression image needs a md5 sum
std::cout << "Missing md5 " << digest << " for: " << filename << std::endl;
res = 1;
}
else if( strcmp(digest, ref) )
{
std::cerr << "Problem reading image from: " << filename << std::endl;
std::cerr << "Into: " << outfilename << std::endl;
std::cerr << "Found " << digest << " instead of " << ref << std::endl;
res = 1;
}
return res;
}
int TestImageRegionReader4(int argc, char *argv[])
{
if( argc == 2 )
{
const char *filename = argv[1];
return TestImageRegionRead(filename, true);
}
// else
// First of get rid of warning/debug message
gdcm::Trace::DebugOff();
gdcm::Trace::WarningOff();
int r = 0, i = 0;
const char *extradataroot = gdcm::Testing::GetDataExtraRoot();
static const char *names[] = {
"/gdcmSampleData/images_of_interest/US_512x512x2496_JPEG_BaseLine_Process_1.dcm",
"/gdcmSampleData/images_of_interest/PHILIPS_Integris_V-10-MONO2-Multiframe.dcm",
"/gdcmSampleData/ForSeriesTesting/MultiFramesSingleSerieXR/1.3.46.670589.7.5.10.80002138018.20001204.181556.9.1.1.dcm",
"/gdcmSampleData/images_of_interest/i32.XADC.7.215MegaBytes.dcm",
nullptr
};
const char *filename;
while( (filename = names[i]) )
{
std::string fn = extradataroot;
fn += filename;
r += TestImageRegionRead(fn.c_str());
++i;
}
return r;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageReaderPixelSpacing.cxx 000664 001766 001770 00000003432 14517730450 033476 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmTesting.h"
#include "gdcmImageReader.h"
#include "gdcmImage.h"
int TestImageReaderPixelSpacing(int argc, char *argv[])
{
int ret = 0;
const char *filenames[] = { "CRIMAGE", "DXIMAGE", "MGIMAGE" };
const unsigned int nfiles = sizeof(filenames)/sizeof(*filenames);
const char *root = gdcm::Testing::GetPixelSpacingDataRoot();
if( !root || !*root )
{
std::cerr << "root is not defined" << std::endl;
return 1;
}
std::string sroot = root;
sroot += "/DISCIMG/IMAGES/";
const double spacing_ref[] = {0.5, 0.5};
for(unsigned int i = 0; i < nfiles; ++i)
{
std::string filename = sroot + filenames[i];
//std::cout << filename << std::endl;
gdcm::ImageReader r;
r.SetFileName( filename.c_str() );
if( !r.Read() )
{
ret++;
std::cerr << "could not read: " << filename << std::endl;
}
const gdcm::Image &image = r.GetImage();
const double *spacing = image.GetSpacing();
std::cout << spacing[0] << ","
<< spacing[1] << ","
<< spacing[2] << std::endl;
if( spacing[0] != spacing_ref[0]
|| spacing[1] != spacing_ref[1] )
{
std::cerr << "Wrong spacing for: " << filename << std::endl;
++ret;
}
}
return ret;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestSplitMosaicFilter3.cxx 000664 001766 001770 00000011050 14517730450 032475 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmSplitMosaicFilter.h"
#include "gdcmTesting.h"
#include "gdcmSystem.h"
#include "gdcmReader.h"
#include "gdcmAnonymizer.h"
#include "gdcmPrivateTag.h"
#include "gdcmCSAHeader.h"
#include "gdcmElement.h"
#include "gdcmDirectionCosines.h"
int TestSplitMosaicFilter3(int , char *[])
{
const char *directory = gdcm::Testing::GetDataRoot();
std::string filename = std::string(directory) + "/SIEMENS_MOSAIC_12BitsStored-16BitsJPEG.dcm";
gdcm::SplitMosaicFilter s;
if( !gdcm::System::FileExists(filename.c_str()) )
{
return 1;
}
gdcm::Reader reader;
reader.SetFileName( filename.c_str() );
if( !reader.Read() )
{
std::cerr << "could not read: " << filename << std::endl;
return 1;
}
gdcm::SplitMosaicFilter filter;
filter.SetFile( reader.GetFile() );
bool inverted;
double slicenormal[3];
bool b = filter.ComputeMOSAICSliceNormal( slicenormal, inverted );
if( !b )
{
std::cerr << "Could not ComputeMOSAICSliceNormal: " << filename << std::endl;
return 1;
}
const double refnor[3] = { -0.03737130908,-0.314588168,0.9484923141 };
const double eps = 1e-6;
gdcm::DirectionCosines dc;
const double dot = dc.Dot( slicenormal, refnor );
if( std::fabs( 1.0 - dot ) > eps )
{
std::cerr << "Invalid ComputeMOSAICSliceNormal: " << filename << std::endl;
return 1;
}
double slicepos[3];
b = filter.ComputeMOSAICSlicePosition( slicepos, inverted );
if( !b )
{
std::cerr << "Could not ComputeMOSAICSlicePosition: " << filename << std::endl;
return 1;
}
const double refpos[3] = { -10.48860023,-7.82515782,-28.87523447 };
for( int i = 0; i < 3; ++i )
{
if( std::fabs( refpos[i] - slicepos[i] ) > eps )
{
std::cerr << "Invalid ComputeMOSAICSlicePosition: " << filename << std::endl;
return 1;
}
}
gdcm::CSAHeader csa;
gdcm::DataSet & ds = reader.GetFile().GetDataSet();
gdcm::MrProtocol mrprot;
if( !csa.GetMrProtocol(ds, mrprot))
{
std::cerr << "No MrProtocol" << filename << std::endl;
return 1;
}
gdcm::MrProtocol::SliceArray sa;
b = mrprot.GetSliceArray(sa);
if( !b || sa.Slices.size() != 18 )
{
std::cerr << "Size" << filename << std::endl;
return 1;
}
gdcm::MrProtocol::Slice & slice0 = sa.Slices[0];
gdcm::MrProtocol::Vector3 & p0 = slice0.Position;
double pos0[3];
pos0[0] = p0.dSag;
pos0[1] = p0.dCor;
pos0[2] = p0.dTra;
for( int i = 0; i < 3; ++i )
{
if( std::fabs( refpos[i] - pos0[i] ) > eps )
{
std::cerr << "Invalid slice0: " << filename << std::endl;
return 1;
}
}
gdcm::MrProtocol::Slice & slice1 = sa.Slices[1];
gdcm::MrProtocol::Vector3 & p1 = slice1.Position;
double pos1[3];
pos1[0] = p1.dSag;
pos1[1] = p1.dCor;
pos1[2] = p1.dTra;
double altnor[3];
for( int i = 0; i < 3; ++i )
{
altnor[i] = pos1[i] - pos0[i];
}
dc.Normalize( altnor );
const double dot2 = dc.Dot( altnor, refnor );
if( std::fabs( 1.0 - dot2 ) > eps )
{
std::cerr << "Incompatible alt " << filename << std::endl;
return 1;
}
for( int k = 0; k < 18; ++k )
{
gdcm::MrProtocol::Slice & slice = sa.Slices[k];
gdcm::MrProtocol::Vector3 & nor = slice.Normal;
double normal[3];
normal[0] = nor.dSag;
normal[1] = nor.dCor;
normal[2] = nor.dTra;
for( int i = 0; i < 3; ++i )
{
if( std::fabs( refnor[i] - normal[i] ) > eps )
{
std::cerr << "Invalid normal: " << filename << std::endl;
return 1;
}
}
}
gdcm::Anonymizer ano;
ano.SetFile( reader.GetFile() );
const gdcm::PrivateTag &t1 = csa.GetCSAImageHeaderInfoTag();
ano.Remove( t1 );
unsigned int modims[3];
b = filter.ComputeMOSAICDimensions( modims );
if(! b )
{
std::cerr << "ComputeMOSAICDimensions: " << filename << std::endl;
return 1;
}
const unsigned int ref[3] = { 64u, 64u, 18u };
if( modims[0] != ref[0] || modims[1] != ref[1] || modims[2] != ref[2] )
{
std::cerr << "Invalid ComputeMOSAICDimensions " << filename << std::endl;
return 1;
}
return 0;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageRegionReader1.cxx 000664 001766 001770 00000010515 14517730450 032414 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmImageRegionReader.h"
#include "gdcmImageHelper.h"
#include "gdcmFilename.h"
#include "gdcmBoxRegion.h"
#include "gdcmTesting.h"
static int TestImageRegionRead(const char* filename, bool verbose = false)
{
if( verbose )
std::cerr << "Reading: " << filename << std::endl;
gdcm::ImageRegionReader reader;
gdcm::Filename fn( filename );
// DMCPACS_ExplicitImplicit_BogusIOP.dcm is very difficult to handle since
// we need to read 3 attribute to detect the "well known" bug. However the third
// attribute is (b500,b700) which make ReadUpToTag(7fe0,0010) fails...
if( strcmp(fn.GetName(), "DMCPACS_ExplicitImplicit_BogusIOP.dcm" ) == 0
|| strcmp(fn.GetName(), "SC16BitsAllocated_8BitsStoredJ2K.dcm" ) == 0 // mismatch pixel format in JPEG 2000 vs DICOM
|| strcmp(fn.GetName(), "SC16BitsAllocated_8BitsStoredJPEG.dcm" ) == 0 // mismatch pixel format in JPEG vs DICOM
|| strcmp(fn.GetName(), "PHILIPS_Gyroscan-12-Jpeg_Extended_Process_2_4.dcm" ) == 0 // bogus JPEG cannot be streamed
|| strcmp(fn.GetName(), "US-YBR_FULL_422-EVRLE.dcm" ) == 0 // FIXME TODO
// FIXME: we should be able to handle those at some point:
|| strcmp(fn.GetName(), "JPEGNote_empty.dcm" ) == 0
|| strcmp(fn.GetName(), "JPEGNote_missing.dcm" ) == 0
|| strcmp(fn.GetName(), "JPEGNote_bogus.dcm" ) == 0
)
{
std::cerr << "Skipping impossible file: " << filename << std::endl;
return 0;
}
reader.SetFileName( filename );
bool canReadInformation = reader.ReadInformation();
if (!canReadInformation)
{
//std::cerr << "Cannot ReadInformation: " << filename << std::endl;
return 0; //unable to read tags as expected.
}
int res = 0;
//std::cout << reader.GetFile().GetDataSet() << std::endl;
std::vector dims =
gdcm::ImageHelper::GetDimensionsValue(reader.GetFile());
gdcm::BoxRegion box;
box.SetDomain(0, dims[0] - 1, 0, dims[1] - 1, 0, dims[2] - 1);
reader.SetRegion( box );
size_t len = reader.ComputeBufferLength();
if( !len )
{
std::cerr << "No length for: " << filename << std::endl;
return 1;
}
std::vector vbuffer;
vbuffer.resize( len );
char* buffer = vbuffer.data();
bool b = reader.ReadIntoBuffer(buffer, len);
if( !b )
{
std::cerr << "Could not ReadIntoBuffer: " << filename << std::endl;
return 1;
}
#if 0
std::ofstream of( "/tmp/dd.raw", std::ios::binary );
of.write( buffer, len );
of.close();
#endif
const char *ref = gdcm::Testing::GetMD5FromFile(filename);
char digest[33];
gdcm::Testing::ComputeMD5(buffer, len, digest);
// FIXME: PC=1
if( strcmp(fn.GetName(), "ACUSON-24-YBR_FULL-RLE-b.dcm" ) == 0) ref = "2d7a28cae6c3b3183284d1b4ae08307f";
if( strcmp(fn.GetName(), "ACUSON-24-YBR_FULL-RLE.dcm" ) == 0) ref = "429f31f0b70bd515b3feeda5dea5eac0";
if( verbose )
{
if(ref) std::cout << "ref=" << ref << std::endl;
std::cout << "md5=" << digest << std::endl;
}
if( !ref )
{
// new regression image needs a md5 sum
std::cout << "Missing md5 " << digest << " for: " << filename << std::endl;
res = 1;
}
else if( strcmp(digest, ref) != 0 )
{
std::cerr << "Problem reading image from: " << filename << std::endl;
std::cerr << "Found " << digest << " instead of " << ref << std::endl;
res = 1;
}
return res;
}
int TestImageRegionReader1(int argc, char *argv[])
{
if( argc == 2 )
{
const char *filename = argv[1];
return TestImageRegionRead(filename, true);
}
// else
// First of get rid of warning/debug message
gdcm::Trace::DebugOff();
gdcm::Trace::WarningOff();
int r = 0, i = 0;
const char *filename;
const char * const *filenames = gdcm::Testing::GetFileNames();
while( (filename = filenames[i]) )
{
r += TestImageRegionRead(filename);
++i;
}
return r;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestAnonymizeEvent.cxx 000664 001766 001770 00000001246 14517730450 031776 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmAnonymizeEvent.h"
int TestAnonymizeEvent(int, char *[])
{
gdcm::AnonymizeEvent ae;
return 0;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestIPPSorter3.cxx 000664 001766 001770 00000006506 14517730450 030741 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmIPPSorter.h"
#include "gdcmDirectory.h"
#include "gdcmTesting.h"
#include "gdcmSystem.h"
#include "gdcmTrace.h"
#include "gdcmReader.h"
#include "gdcmWriter.h"
int TestIPPSorter3(int , char *[])
{
const char *directory = gdcm::Testing::GetDataRoot();
std::vector filenames;
// let's take 4 files that can be sorted:
std::string file0 = std::string(directory) + "/SIEMENS_MAGNETOM-12-MONO2-FileSeq0.dcm";
std::string file1 = std::string(directory) + "/SIEMENS_MAGNETOM-12-MONO2-FileSeq1.dcm";
std::string file2 = std::string(directory) + "/SIEMENS_MAGNETOM-12-MONO2-FileSeq2.dcm";
std::string file3 = std::string(directory) + "/SIEMENS_MAGNETOM-12-MONO2-FileSeq3.dcm";
// Make a fake copy:
const char * reference = file0.c_str();
gdcm::Reader reader;
reader.SetFileName( reference );
if( !reader.Read() ) return 1;
// Create directory first:
const char subdir[] = "TestIPPSorter3";
std::string tmpdir = gdcm::Testing::GetTempDirectory( subdir );
if( !gdcm::System::FileIsDirectory( tmpdir.c_str() ) )
{
gdcm::System::MakeDirectory( tmpdir.c_str() );
//return 1;
}
std::string outfilename = gdcm::Testing::GetTempFilename( reference, subdir );
// Tweak the orientation just a little:
// [001.000000E+00\-0.000000E+00\-0.000000E+00\00.000000E+00\01.000000E+00\-0.000000E+00]
gdcm::Writer writer;
writer.SetFileName( outfilename.c_str() );
//const char iop_orig[] = "1\\-0\\-0\\0\\1\\-0";
const char iop[] = R"(1\-0\-0\0\0.99999\0.00001)";
gdcm::DataElement de( gdcm::Tag(0x0020,0x0037) );
de.SetByteValue( iop, (uint32_t)strlen( iop ) );
reader.GetFile().GetDataSet().Replace( de );
writer.SetFile( reader.GetFile() );
if( !writer.Write() )
{
return 1;
}
// let's push them in random order (oh my god how are we going to succeed ??)
filenames.push_back( file1 );
filenames.push_back( file3 );
filenames.push_back( outfilename );
filenames.push_back( file2 );
//filenames.push_back( file0 );
gdcm::IPPSorter s;
s.SetComputeZSpacing( true );
s.SetZSpacingTolerance( 1e-10 );
s.SetDirectionCosinesTolerance( 1e-6 );
bool b = s.Sort( filenames );
if( b )
{
std::cerr << "Success to sort (we should have failed): " << directory << std::endl;
return 1;
}
// Lower the threshold:
s.SetDirectionCosinesTolerance( 1e-5 );
b = s.Sort( filenames );
if( !b )
{
std::cerr << "Failed to sort: " << directory << std::endl;
return 1;
}
// std::cout << "Sorting succeeded:" << std::endl;
// s.Print( std::cout );
double zspacing = s.GetZSpacing();
if(!zspacing)
{
std::cerr << "computation of ZSpacing failed." << std::endl;
return 1;
}
std::cout << "Found z-spacing:" << std::endl;
std::cout << s.GetZSpacing() << std::endl;
return 0;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestCurve.cxx 000664 001766 001770 00000001621 14517730450 030104 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmCurve.h"
int TestCurve(int, char *[])
{
gdcm::Curve c;
c.SetTypeOfData( "TAC" );
//c.SetTypeOfData( "PROF" );
//c.SetTypeOfData( "PRESSURE" );
//c.SetTypeOfData( "RESP" );
//c.SetTypeOfData( "dummy" );
std::cout << c.GetTypeOfData() << std::endl;
std::cout << c.GetTypeOfDataDescription() << std::endl;
return 0;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageChangeTransferSyntax6.cxx 000664 001766 001770 00000012300 14517730450 034146 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmImageChangeTransferSyntax.h"
#include "gdcmImageReader.h"
#include "gdcmImageWriter.h"
#include "gdcmFilename.h"
#include "gdcmSystem.h"
#include "gdcmFileMetaInformation.h"
#include "gdcmTesting.h"
#include "gdcmByteSwap.h"
namespace gdcm
{
int TestImageChangeTransferSyntaxRAWBE(const char *filename, bool verbose = false)
{
ImageReader reader;
reader.SetFileName( filename );
if ( !reader.Read() )
{
const FileMetaInformation &header = reader.GetFile().GetHeader();
MediaStorage ms = header.GetMediaStorage();
bool isImage = MediaStorage::IsImage( ms );
bool pixeldata = reader.GetFile().GetDataSet().FindDataElement( Tag(0x7fe0,0x0010) );
if( isImage && pixeldata )
{
std::cerr << "Failed to read: " << filename << std::endl;
return 1;
}
else
{
// not an image give up...
std::cerr << "Problem with: " << filename << " but that's ok" << std::endl;
return 0;
}
}
const gdcm::Image &image = reader.GetImage();
//const TransferSyntax &ts = reader.GetFile().GetHeader().GetDataSetTransferSyntax();
gdcm::ImageChangeTransferSyntax change;
change.SetTransferSyntax( gdcm::TransferSyntax::ExplicitVRBigEndian );
change.SetInput( image );
bool b = change.Change();
if( !b )
{
std::cerr << "Could not change the Transfer Syntax: " << filename << std::endl;
return 1;
}
// Create directory first:
const char subdir[] = "TestImageChangeTransferSyntax6";
std::string tmpdir = Testing::GetTempDirectory( subdir );
if( !System::FileIsDirectory( tmpdir.c_str() ) )
{
System::MakeDirectory( tmpdir.c_str() );
//return 1;
}
std::string outfilename = Testing::GetTempFilename( filename, subdir );
ImageWriter writer;
writer.SetFileName( outfilename.c_str() );
writer.SetFile( reader.GetFile() ); // increase test goal
writer.SetImage( change.GetOutput() );
if( !writer.Write() )
{
std::cerr << "Failed to write: " << outfilename << std::endl;
return 1;
}
// Let's read that file back in !
ImageReader reader2;
reader2.SetFileName( outfilename.c_str() );
if ( !reader2.Read() )
{
std::cerr << "Could not even reread our generated file : " << outfilename << std::endl;
return 1;
}
// Check that after decompression we still find the same thing:
int res = 0;
const gdcm::Image &img = reader2.GetImage();
//std::cerr << "Success to read image from file: " << filename << std::endl;
unsigned long len = img.GetBufferLength();
char* buffer = new char[len];
bool res2 = img.GetBuffer(buffer);
if( !res2 )
{
std::cerr << "could not get buffer: " << outfilename << std::endl;
return 1;
}
// On big Endian system we have byteswapped the buffer (duh!)
// Since the md5sum is byte based there is now way it would detect
// that the file is written in big endian word, so comparing against
// a md5sum computed on LittleEndian would fail. Thus we need to
// byteswap (again!) here:
#ifdef GDCM_WORDS_BIGENDIAN
if( img.GetPixelFormat().GetBitsAllocated() == 16 )
{
assert( !(len % 2) );
assert( img.GetPhotometricInterpretation() == gdcm::PhotometricInterpretation::MONOCHROME1
|| img.GetPhotometricInterpretation() == gdcm::PhotometricInterpretation::MONOCHROME2 );
gdcm::ByteSwap::SwapRangeFromSwapCodeIntoSystem(
(unsigned short*)buffer, gdcm::SwapCode::LittleEndian, len/2);
}
#endif
const char *ref = gdcm::Testing::GetMD5FromFile(filename);
char digest[33];
gdcm::Testing::ComputeMD5(buffer, len, digest);
if( !ref )
{
// new regression image needs a md5 sum
std::cerr << "Missing md5 " << digest << " for: " << filename << std::endl;
//assert(0);
res = 1;
}
else if( strcmp(digest, ref) != 0 )
{
std::cerr << "Problem reading image from: " << filename << std::endl;
std::cerr << "Found " << digest << " instead of " << ref << std::endl;
res = 1;
}
if(res)
{
std::cerr << "problem with: " << outfilename << std::endl;
}
if( verbose )
{
std::cout << "file was written in: " << outfilename << std::endl;
}
delete[] buffer;
return res;
}
} // end namespace gdcm
int TestImageChangeTransferSyntax6(int argc, char *argv[])
{
if( argc == 2 )
{
const char *filename = argv[1];
return gdcm::TestImageChangeTransferSyntaxRAWBE(filename, true);
}
// else
gdcm::Trace::DebugOff();
gdcm::Trace::WarningOff();
int r = 0, i = 0;
const char *filename;
const char * const *filenames = gdcm::Testing::GetFileNames();
while( (filename = filenames[i]) )
{
r += gdcm::TestImageChangeTransferSyntaxRAWBE( filename );
++i;
}
return r;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestIPPSorter.cxx 000664 001766 001770 00000005034 14517730450 030651 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmIPPSorter.h"
#include "gdcmDirectory.h"
#include "gdcmTesting.h"
#include "gdcmSystem.h"
#include "gdcmTrace.h"
int TestIPPSorter(int argc, char *argv[])
{
const char *directory = gdcm::Testing::GetDataRoot();
std::vector filenames;
if( argc == 2 )
{
gdcm::Trace::DebugOn();
directory = argv[1];
if( gdcm::System::FileIsDirectory( directory ) )
{
gdcm::Directory d;
unsigned int nfiles = d.Load( directory ); // no recursion
d.Print( std::cout );
std::cout << "done retrieving file list. " << nfiles << " files found." << std::endl;
filenames = d.GetFilenames();
}
else
{
std::cerr << "file:" << directory << " is not a directory" << std::endl;
return 1;
}
}
else
{
// default execution (nightly test)
// let's take 4 files that can be sorted:
std::string file0 = std::string(directory) + "/SIEMENS_MAGNETOM-12-MONO2-FileSeq0.dcm";
std::string file1 = std::string(directory) + "/SIEMENS_MAGNETOM-12-MONO2-FileSeq1.dcm";
std::string file2 = std::string(directory) + "/SIEMENS_MAGNETOM-12-MONO2-FileSeq2.dcm";
std::string file3 = std::string(directory) + "/SIEMENS_MAGNETOM-12-MONO2-FileSeq3.dcm";
// let's push them in random order (oh my god how are we going to succeed ??)
filenames.push_back( file1 );
filenames.push_back( file3 );
filenames.push_back( file2 );
filenames.push_back( file0 );
}
gdcm::IPPSorter s;
s.SetComputeZSpacing( true );
s.SetZSpacingTolerance( 1e-10 );
bool b = s.Sort( filenames );
if( !b )
{
std::cerr << "Failed to sort: " << directory << std::endl;
return 1;
}
std::cout << "Sorting succeeded:" << std::endl;
s.Print( std::cout );
double zspacing = s.GetZSpacing();
if(!zspacing)
{
std::cerr << "computation of ZSpacing failed." << std::endl;
return 1;
}
std::cout << "Found z-spacing:" << std::endl;
std::cout << s.GetZSpacing() << std::endl;
return 0;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestCoder.cxx 000664 001766 001770 00000001430 14517730450 030052 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmCoder.h"
namespace gdcm
{
class DummyCoder : public Coder
{
public:
bool CanCode(TransferSyntax const &) const override { return false; }
};
}
int TestCoder(int, char *[])
{
gdcm::DummyCoder c;
return 0;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageChangeTransferSyntax3.cxx 000664 001766 001770 00000013335 14517730450 034154 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmImageChangeTransferSyntax.h"
#include "gdcmImageReader.h"
#include "gdcmImageWriter.h"
#include "gdcmFilename.h"
#include "gdcmSystem.h"
#include "gdcmFileMetaInformation.h"
#include "gdcmTesting.h"
#include "gdcmByteSwap.h"
#include "gdcmImageChangePlanarConfiguration.h"
namespace gdcm
{
int TestImageChangeTransferSyntaxRLE(const char *filename, bool verbose = false)
{
ImageReader reader;
reader.SetFileName( filename );
if ( !reader.Read() )
{
const FileMetaInformation &header = reader.GetFile().GetHeader();
MediaStorage ms = header.GetMediaStorage();
bool isImage = MediaStorage::IsImage( ms );
bool pixeldata = reader.GetFile().GetDataSet().FindDataElement( Tag(0x7fe0,0x0010) );
if( isImage && pixeldata )
{
std::cerr << "Failed to read: " << filename << std::endl;
return 1;
}
else
{
// not an image give up...
std::cerr << "Problem with: " << filename << " but that's ok" << std::endl;
return 0;
}
}
const gdcm::Image &image = reader.GetImage();
unsigned int oldpc = image.GetPlanarConfiguration();
gdcm::ImageChangeTransferSyntax change;
change.SetTransferSyntax( gdcm::TransferSyntax::RLELossless );
change.SetInput( image );
bool b = change.Change();
if( !b )
{
unsigned short ba = reader.GetImage().GetPixelFormat().GetBitsAllocated();
if( ba == 12 )
{
std::cerr << "fail to change, but that's ok" << std::endl;
return 0;
}
std::cerr << "Could not change the Transfer Syntax: " << filename << std::endl;
return 1;
}
// Create directory first:
const char subdir[] = "TestImageChangeTransferSyntax3";
std::string tmpdir = Testing::GetTempDirectory( subdir );
if( !System::FileIsDirectory( tmpdir.c_str() ) )
{
System::MakeDirectory( tmpdir.c_str() );
//return 1;
}
std::string outfilename = Testing::GetTempFilename( filename, subdir );
ImageWriter writer;
writer.SetFileName( outfilename.c_str() );
writer.SetFile( reader.GetFile() ); // important for palette + mf
writer.SetImage( change.GetOutput() );
if( !writer.Write() )
{
std::cerr << "Failed to write: " << outfilename << std::endl;
return 1;
}
// Let's read that file back in !
ImageReader reader2;
reader2.SetFileName( outfilename.c_str() );
if ( !reader2.Read() )
{
std::cerr << "Could not even reread our generated file : " << outfilename << std::endl;
return 1;
}
// Check that after decompression we still find the same thing:
int res = 0;
const gdcm::Image &img = reader2.GetImage();
unsigned int newpc = img.GetPlanarConfiguration();
//std::cerr << "Success to read image from file: " << filename << std::endl;
unsigned long len = img.GetBufferLength();
char* buffer = new char[len];
bool res2;
if( oldpc != newpc )
{
gdcm::ImageChangePlanarConfiguration icpc;
icpc.SetPlanarConfiguration( oldpc );
icpc.SetInput( img );
if( !icpc.Change() )
{
return 1;
}
res2 = icpc.GetOutput().GetBuffer(buffer);
}
else
{
res2 = img.GetBuffer(buffer);
}
if( !res2 )
{
std::cerr << "could not get buffer: " << outfilename << std::endl;
return 1;
}
// On big Endian system we have byteswapped the buffer (duh!)
// Since the md5sum is byte based there is now way it would detect
// that the file is written in big endian word, so comparing against
// a md5sum computed on LittleEndian would fail. Thus we need to
// byteswap (again!) here:
#ifdef GDCM_WORDS_BIGENDIAN
if( img.GetPixelFormat().GetBitsAllocated() == 16 )
{
assert( !(len % 2) );
assert( img.GetPhotometricInterpretation() == gdcm::PhotometricInterpretation::MONOCHROME1
|| img.GetPhotometricInterpretation() == gdcm::PhotometricInterpretation::MONOCHROME2 );
gdcm::ByteSwap::SwapRangeFromSwapCodeIntoSystem(
(unsigned short*)buffer, gdcm::SwapCode::LittleEndian, len/2);
}
#endif
const char *ref = gdcm::Testing::GetMD5FromFile(filename);
char digest[33];
gdcm::Testing::ComputeMD5(buffer, len, digest);
if( !ref )
{
// new regression image needs a md5 sum
std::cerr << "Missing md5 " << digest << " for: " << filename << std::endl;
//assert(0);
res = 1;
}
else if( strcmp(digest, ref) != 0 )
{
std::cerr << "Problem reading image from: " << filename << std::endl;
std::cerr << "Found " << digest << " instead of " << ref << std::endl;
res = 1;
}
if(res)
{
std::cerr << "problem with: " << outfilename << std::endl;
}
if( verbose )
{
std::cout << "file was written in: " << outfilename << std::endl;
}
delete[] buffer;
return res;
}
} // end namespace gdcm
int TestImageChangeTransferSyntax3(int argc, char *argv[])
{
if( argc == 2 )
{
const char *filename = argv[1];
return gdcm::TestImageChangeTransferSyntaxRLE(filename, true);
}
// else
gdcm::Trace::DebugOff();
gdcm::Trace::WarningOff();
int r = 0, i = 0;
const char *filename;
const char * const *filenames = gdcm::Testing::GetFileNames();
while( (filename = filenames[i]) )
{
r += gdcm::TestImageChangeTransferSyntaxRLE( filename );
++i;
}
return r;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageReaderRandomEmpty.cxx 000664 001766 001770 00000006567 14517730450 033363 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmImageReader.h"
#include "gdcmFileMetaInformation.h"
#include "gdcmSystem.h"
#include "gdcmWriter.h"
#include "gdcmFilename.h"
#include "gdcmAnonymizer.h"
#include "gdcmByteSwap.h"
#include "gdcmTrace.h"
#include "gdcmTesting.h"
#include
int TestImageReaderRandomEmptyFunc(const char *subdir, const char* filename, bool verbose = false, bool lossydump = false)
{
(void)lossydump;
if( verbose )
std::cerr << "Reading: " << filename << std::endl;
gdcm::ImageReader reader;
reader.SetFileName( filename );
if( !reader.Read() )
{
return 0;//this is NOT a test of the ImageReader read function
//this is a test of the anonymizer. As such, if the reader can't read this file,
//that should be handled in the TestImageReader test, NOT here.
//There is a lot of logic involved in testing non-standard images that should not be
//duplicated here.
}
const gdcm::File &file = reader.GetFile();
const gdcm::DataSet &ds = file.GetDataSet();
const gdcm::FileMetaInformation &fmi = file.GetHeader();
gdcm::DataSet::ConstIterator it = ds.Begin();
// Create directory first:
std::string tmpdir = gdcm::Testing::GetTempDirectory( subdir );
if( !gdcm::System::FileIsDirectory( tmpdir.c_str() ) )
{
gdcm::System::MakeDirectory( tmpdir.c_str() );
//return 1;
}
std::string outfilename = gdcm::Testing::GetTempFilename( filename, subdir );
int ret = 0;
int i = 0;
for( ; it != ds.End(); ++it, ++i )
{
//std::cout << "Processing Tag: " << *it << std::endl;
gdcm::Writer writer;
gdcm::File &filecopy = writer.GetFile();
filecopy.SetDataSet( ds );
filecopy.SetHeader( fmi );
gdcm::Anonymizer ano;
ano.SetFile( filecopy );
ano.Empty( it->GetTag() );
//std::ostringstream os;
//os << "/tmp/ddd";
//os << i;
//os << ".dcm";
//std::string outfn = os.str();
std::string outfn = outfilename;
writer.SetFile( ano.GetFile() );
writer.CheckFileMetaInformationOff(); // FIXME ?
writer.SetFileName( outfn.c_str() );
if( !writer.Write() )
{
std::cerr << "Could not write: " << outfn << std::endl;
ret++;
}
gdcm::ImageReader readercopy;
readercopy.SetFileName( outfn.c_str() );
readercopy.Read();
}
return ret;
}
int TestImageReaderRandomEmpty(int argc, char *argv[])
{
if( argc == 2 )
{
const char *filename = argv[1];
return TestImageReaderRandomEmptyFunc(argv[0], filename, true);
}
// else
// First of get rid of warning/debug message
gdcm::Trace::DebugOff();
gdcm::Trace::WarningOff();
gdcm::Trace::ErrorOff();
int r = 0, i = 0;
const char *filename;
const char * const *filenames = gdcm::Testing::GetFileNames();
while( (filename = filenames[i]) )
{
r += TestImageReaderRandomEmptyFunc( argv[0], filename);
++i;
}
return r;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageChangeTransferSyntax7.cxx 000664 001766 001770 00000014527 14517730450 034164 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmImageChangeTransferSyntax.h"
#include "gdcmImageReader.h"
#include "gdcmImageWriter.h"
#include "gdcmFilename.h"
#include "gdcmSystem.h"
#include "gdcmFileMetaInformation.h"
#include "gdcmTesting.h"
#include "gdcmByteSwap.h"
namespace gdcm
{
int TestImageChangeTransferSyntaxIM2RAWBE(const char *filename, bool verbose = false)
{
ImageReader reader;
reader.SetFileName( filename );
if ( !reader.Read() )
{
const FileMetaInformation &header = reader.GetFile().GetHeader();
MediaStorage ms = header.GetMediaStorage();
bool isImage = MediaStorage::IsImage( ms );
bool pixeldata = reader.GetFile().GetDataSet().FindDataElement( Tag(0x7fe0,0x0010) );
if( isImage && pixeldata )
{
std::cerr << "Failed to read: " << filename << std::endl;
return 1;
}
else
{
// not an image give up...
std::cerr << "Problem with: " << filename << " but that's ok" << std::endl;
return 0;
}
}
const gdcm::Image &image = reader.GetImage();
gdcm::ImageChangeTransferSyntax change;
change.SetTransferSyntax( gdcm::TransferSyntax::ImplicitVRLittleEndian );
change.SetInput( image );
bool b = change.Change();
if( !b )
{
std::cerr << "Could not change the Transfer Syntax: " << filename << std::endl;
return 1;
}
// Create directory first:
const char subdir[] = "TestImageChangeTransferSyntax7";
std::string tmpdir = Testing::GetTempDirectory( subdir );
if( !System::FileIsDirectory( tmpdir.c_str() ) )
{
System::MakeDirectory( tmpdir.c_str() );
//return 1;
}
std::string outfilename = Testing::GetTempFilename( filename, subdir );
ImageWriter writer;
writer.SetFileName( outfilename.c_str() );
writer.SetFile( reader.GetFile() ); // increase test goal
writer.SetImage( change.GetOutput() );
if( !writer.Write() )
{
std::cerr << "Failed to write: " << outfilename << std::endl;
return 1;
}
// Let's read that file back in !
ImageReader reader2;
reader2.SetFileName( outfilename.c_str() );
if ( !reader2.Read() )
{
std::cerr << "Could not even reread our generated file : " << outfilename << std::endl;
return 1;
}
gdcm::ImageChangeTransferSyntax change2;
change2.SetTransferSyntax( gdcm::TransferSyntax::ExplicitVRBigEndian );
const gdcm::Image &image2 = reader2.GetImage();
change2.SetInput( image2 );
b = change2.Change();
if( !b )
{
std::cerr << "Could not change the Transfer Syntax: " << outfilename << std::endl;
return 1;
}
// Create directory first:
const char subdir2[] = "TestImageChangeTransferSyntax7_2";
std::string tmpdir2 = Testing::GetTempDirectory( subdir2 );
if( !System::FileIsDirectory( tmpdir2.c_str() ) )
{
System::MakeDirectory( tmpdir2.c_str() );
//return 1;
}
std::string outfilename2 = Testing::GetTempFilename( filename, subdir2 );
ImageWriter writer2;
writer2.SetFileName( outfilename2.c_str() );
writer2.SetFile( reader2.GetFile() ); // increase test goal
writer2.SetImage( change2.GetOutput() );
if( !writer2.Write() )
{
std::cerr << "Failed to write: " << outfilename2 << std::endl;
return 1;
}
// Let's read that file back in !
ImageReader reader3;
reader3.SetFileName( outfilename2.c_str() );
if ( !reader3.Read() )
{
std::cerr << "Could not even reread our generated file : " << outfilename2 << std::endl;
return 1;
}
// Check that after decompression we still find the same thing:
int res = 0;
const gdcm::Image &img = reader3.GetImage();
//std::cerr << "Success to read image from file: " << filename << std::endl;
unsigned long len = img.GetBufferLength();
char* buffer = new char[len];
bool res2 = img.GetBuffer(buffer);
if( !res2 )
{
std::cerr << "could not get buffer: " << outfilename << std::endl;
return 1;
}
// On big Endian system we have byteswapped the buffer (duh!)
// Since the md5sum is byte based there is now way it would detect
// that the file is written in big endian word, so comparing against
// a md5sum computed on LittleEndian would fail. Thus we need to
// byteswap (again!) here:
#ifdef GDCM_WORDS_BIGENDIAN
if( img.GetPixelFormat().GetBitsAllocated() == 16 )
{
assert( !(len % 2) );
assert( img.GetPhotometricInterpretation() == gdcm::PhotometricInterpretation::MONOCHROME1
|| img.GetPhotometricInterpretation() == gdcm::PhotometricInterpretation::MONOCHROME2 );
gdcm::ByteSwap::SwapRangeFromSwapCodeIntoSystem(
(unsigned short*)buffer, gdcm::SwapCode::LittleEndian, len/2);
}
#endif
const char *ref = gdcm::Testing::GetMD5FromFile(filename);
char digest[33];
gdcm::Testing::ComputeMD5(buffer, len, digest);
if( !ref )
{
// new regression image needs a md5 sum
std::cerr << "Missing md5 " << digest << " for: " << filename << std::endl;
//assert(0);
res = 1;
}
else if( strcmp(digest, ref) != 0 )
{
std::cerr << "Problem reading image from: " << filename << std::endl;
std::cerr << "Found " << digest << " instead of " << ref << std::endl;
res = 1;
}
if(res)
{
std::cerr << "problem with: " << outfilename2 << std::endl;
}
if( verbose )
{
std::cout << "file was written in: " << outfilename2 << std::endl;
}
delete[] buffer;
return res;
}
} // end namespace gdcm
int TestImageChangeTransferSyntax7(int argc, char *argv[])
{
if( argc == 2 )
{
const char *filename = argv[1];
return gdcm::TestImageChangeTransferSyntaxIM2RAWBE(filename, true);
}
// else
gdcm::Trace::DebugOff();
gdcm::Trace::WarningOff();
int r = 0, i = 0;
const char *filename;
const char * const *filenames = gdcm::Testing::GetFileNames();
while( (filename = filenames[i]) )
{
r += gdcm::TestImageChangeTransferSyntaxIM2RAWBE( filename );
++i;
}
return r;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestFloatingPointDouble.cxx 000664 001766 001770 00000002031 14517730450 032724 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include
#include
#include
#include
int TestFloatingPointDouble(int, char *[])
{
// Not applicable
const char strnan[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x7F};
const char strinf[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x7F};
double inf = std::numeric_limits::infinity();
double nan = std::numeric_limits::quiet_NaN();
std::cout << inf << std::endl;
std::cout << nan << std::endl;
return 0;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestIconImageGenerator2.cxx 000664 001766 001770 00000044205 14517730450 032611 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmImageReader.h"
#include "gdcmImageWriter.h"
#include "gdcmFilename.h"
#include "gdcmSystem.h"
#include "gdcmFileMetaInformation.h"
#include "gdcmTesting.h"
#include "gdcmByteSwap.h"
#include "gdcmIconImageGenerator.h"
static const char * const iconimagearray2[][2] = {
{"7e097b4a57af6a823bd692e37b131b1c" , "SIEMENS_SOMATOM-12-ACR_NEMA-ZeroLengthUs.acr" },
{"7f2638cea652bf3452ada158d2ea67c4" , "gdcm-MR-SIEMENS-16-2.acr" },
{"da0922a02f8e763ec878089617e0bc4c" , "test.acr" },
{"e75ee90f23db1952a593393cdfaaf99f" , "MR-MONO2-12-an2.acr" },
{"c9c46afd186531850af9576cf54c800b" , "CT-MONO2-12-lomb-an2.acr" },
{"feb10d9a28e5166a3baf9ec6ef4f460a" , "LIBIDO-8-ACR_NEMA-Lena_128_128.acr" },
{"f9d8a0796ebf5a6aabddb4e133d09770" , "gdcm-ACR-LibIDO.acr" },
{"a1bce65e11c5fd2e26f7b38ebfdd1c53" , "libido1.0-vol.acr" },
{"9edea7caea2b85aad952d35c64f1e092" , "SIEMENS_CSA2.dcm" },
{"011d1f2abd9e27a2dc5d013bd4848104" , "gdcm-JPEG-LossLessThoravision.dcm" },
{"ddb7e67d119eb2ce14731cd9007e36cc" , "XA-MONO2-8-12x-catheter.dcm" },
{"1041bae356da40d2113210ff2adef923" , "gdcm-MR-PHILIPS-16-Multi-Seq.dcm" },
{"a3a6b3bf75ccdc91f82effc60d005688" , "PHILIPS_GDCM12xBug.dcm" },
{"a247e2ca32279956079c9a87403bd157" , "MR_Philips_Intera_PrivateSequenceExplicitVR_in_SQ_2001_e05f_item_wrong_lgt_use_NOSHADOWSEQ.dcm" },
{"48b19e53bffc8feab8671fd23c869028" , "D_CLUNIE_CT1_J2KI.dcm" },
{"3f7cae9b920adb3ca4a96ace2c0c91d7" , "rle16sti.dcm" },
{"f706f740496e445ee59141b15f3baeb4" , "3E768EB7.dcm" },
{"b38c113fffa4925f6f06a928b357f6a1" , "D_CLUNIE_MR2_JPLY.dcm" },
{"c3d3a218fcec778476090bce4c8b3201" , "SIEMENS_MAGNETOM-12-MONO2-FileSeq1.dcm" },
{"882a7327bab05d88571dcf29f902adf3" , "SIEMENS_MAGNETOM-12-MONO2-FileSeq0.dcm" },
{"7944f0f8eb06466099fe6cd792ae8bfa" , "MR_Philips_Intera_SwitchIndianess_noLgtSQItem_in_trueLgtSeq.dcm" },
{"af193ff3143f299826d55e00696b3218" , "LEADTOOLS_FLOWERS-16-MONO2-Uncompressed.dcm" },
{"b9b499634bdaff3be7710722f75d9b5d" , "D_CLUNIE_MR3_JPLY.dcm" },
{"e8b529fbe615b4c540318695913d02e7" , "D_CLUNIE_VL2_RLE.dcm" },
{"8393213bd2c340a8cbd639f45a6b497e" , "OsirixFake16BitsStoredFakeSpacing.dcm" },
{"205a3ba253b61bf5ebb374523c366ccb" , "GE_RHAPSODE-16-MONO2-JPEG-Fragments.dcm" },
{"c265bf6c3bf4417987ff81b92ca4ca6c" , "MR_SIEMENS_forceLoad29-1010_29-1020.dcm" },
{"fa7da45d1a8eb16b092880ceff5a50e5" , "fffc0000UN.dcm" },
{"796594769ee3570292de36fdb4509df1" , "LIBIDO-24-ACR_NEMA-Rectangle.dcm" },
{"32b10fd4f13cfb4d74e1145f166e9dae" , "IM-0001-0066.CommandTag00.dcm" },
{"619f8c1650962cddf7695e39f43e8c49" , "D_CLUNIE_NM1_JPLY.dcm" },
{"205a3ba253b61bf5ebb374523c366ccb" , "D_CLUNIE_CT1_J2KR.dcm" },
{"30a530ea4df623cbec31f752637e234b" , "TheralysGDCM120Bug.dcm" },
{"3120b59e3635a912c6a60897f734b2ff" , "SIEMENS_MAGNETOM-12-MONO2-VRUN.dcm" },
{"5bdb2335ceb2dac83c2248d6ff8e0a49" , "THERALYS-12-MONO2-Uncompressed-Even_Length_Tag.dcm" },
{"30ff6655c5eb98ad34cd20836418a5a7" , "ALOKA_SSD-8-MONO2-RLE-SQ.dcm" },
{"992e4ef2b01f9d79514d7ab22c354be9" , "GE_GENESIS-16-MONO2-WrongLengthItem.dcm" },
{"d4669bd89971c1affd311c7d1d8b20c7" , "US-RGB-8-esopecho.dcm" },
{"85124dd05ab0567aecaf896373f780da" , "D_CLUNIE_MR4_RLE.dcm" },
{"07964ed19883cb96460d1407795f4306" , "D_CLUNIE_MR2_JPLL.dcm" },
{"096547f2834609ae4dbc115169806fc4" , "SIEMENS_Sonata-16-MONO2-Value_Multiplicity.dcm" },
{"af193ff3143f299826d55e00696b3218" , "LEADTOOLS_FLOWERS-16-MONO2-JpegLossless.dcm" },
{"da7002947725a950c3226cd23aa8d718" , "CT-MONO2-16-ankle.dcm" },
{"1a27a48d4efe2999b83bc89d3003d05c" , "LEADTOOLS_FLOWERS-8-PAL-RLE.dcm" },
{"feb10d9a28e5166a3baf9ec6ef4f460a" , "simpleImageWithIcon.dcm" },
{"aeb28d2cfb5376e2bb1ac4aac0b4807c" , "CR-MONO1-10-chest.dcm" },
{"205a3ba253b61bf5ebb374523c366ccb" , "D_CLUNIE_CT1_RLE.dcm" },
{"4d469f85f51b3b81bdf38ebba23a68e7" , "D_CLUNIE_NM1_JPLL.dcm" },
{"8ffdae8852e9388369935d65b8afa408" , "MR_GE_with_Private_Compressed_Icon_0009_1110.dcm" },
{"abe1950da247d18196fe5bea54cb26f1" , "NM-MONO2-16-13x-heart.dcm" },
{"6bd67bbd6e3e65808db8598fe0913f86" , "US-IRAD-NoPreambleStartWith0003.dcm" },
{"99672e03104c9176595bc0002cd8edf8" , "MR-MONO2-16-head.dcm" },
{"1a27a48d4efe2999b83bc89d3003d05c" , "LEADTOOLS_FLOWERS-8-PAL-Uncompressed.dcm" },
{"af8491953e762c12feb93a80a1575edf" , "MAROTECH_CT_JP2Lossy.dcm" },
{"932281859be22ffae33a2669b34cc2e6" , "05115014-mr-siemens-avanto-syngo-with-palette-icone.dcm" },
{"fb5402472ee00639ef8dc1b09692c299" , "US-PAL-8-10x-echo.dcm" },
{"038acb53133733a9f2c54528b8029511" , "MR-SIEMENS-DICOM-WithOverlays.dcm" },
{"890d0a5afdbf77398d857b523f86e83a" , "D_CLUNIE_MR1_JPLL.dcm" },
{"205a3ba253b61bf5ebb374523c366ccb" , "D_CLUNIE_CT1_JPLL.dcm" },
{"7e971371b523cc1db53f3fc7f2ac5441" , "AMIInvalidPrivateDefinedLengthSQasUN.dcm" },
{"7944f0f8eb06466099fe6cd792ae8bfa" , "ExplicitVRforPublicElementsImplicitVRforShadowElements.dcm" },
{"3443eba48f11dd9aadb4632c8c896b39" , "PHILIPS_Gyroscan-12-Jpeg_Extended_Process_2_4.dcm" },
{"b72e483ad977e18b8016c7cc916c4bbd" , "D_CLUNIE_SC1_JPLY.dcm" },
{"582df1a47c5992cc4f37496dab8c5130" , "gdcm-MR-PHILIPS-16-NonSquarePixels.dcm" },
{"8a5d13f6c85b2eebc1c02432d729cd45" , "SIEMENS-MR-RGB-16Bits.dcm" },
{"aacd6f6257e068cf53cdec5c7e172513" , "US-IRAD-NoPreambleStartWith0005.dcm" },
{"6a9ecd676ce47b0fda111a804b58b054" , "PICKER-16-MONO2-Nested_icon.dcm" },
{"9b720fd0aa079bc2f3f9545bd0e207c6" , "gdcm-JPEG-Extended.dcm" },
{"c790d0a462907135c1991f10a4846f98" , "D_CLUNIE_US1_RLE.dcm" },
{"4689c053642dcee7a2a9d0475c1b6528" , "D_CLUNIE_RG2_JPLY.dcm" },
{"b3b8a60e7b7b20c029eec1d5006e2b9c" , "PHILIPS_Brilliance_ExtraBytesInOverlay.dcm" },
{"91533007e5e07353012dea33149d920f" , "MR_ELSCINT1_00e1_1042_SQ_feff_00e0_Item.dcm" },
{"c8902cc14f285f2687866f60e45c7d86" , "TG18-CH-2k-01.dcm" },
{"af193ff3143f299826d55e00696b3218" , "LEADTOOLS_FLOWERS-16-MONO2-RLE.dcm" },
{"27daf49ec13f58db1d800fc58378852e" , "OT-PAL-8-face.dcm" },
{"07fef244d4e14358d453c144770b2a55" , "LEADTOOLS_FLOWERS-24-RGB-JpegLossy.dcm" },
{"ad96e04c3c50d463cccdfca68b49b071" , "SIEMENS_MAGNETOM-12-MONO2-Uncompressed.dcm" },
{"620f0b67a91f7f74151bc5be745b7110" , "GDCMJ2K_TextGBR.dcm" },
{"d1f5dfac9c3213f548df6a1f9e86acd0" , "MR16BitsAllocated_8BitsStored.dcm" },
{"dab7df42898362213062eb0d493eb38e" , "GE_GENESIS-16-MONO2-Uncompressed-UnusualVR.dcm" },
{"205a3ba253b61bf5ebb374523c366ccb" , "D_CLUNIE_CT1_JLSL.dcm" },
{"719505e71eafd643fa2e114acc83496f" , "ELSCINT1_JP2vsJ2K.dcm" },
{"7132fec8839d9c8b26cba4a4f17000da" , "D_CLUNIE_XA1_JPLL.dcm" },
{"cdf5908902fb63e321b224fae86a4128" , "SIEMENS_Sonata-12-MONO2-SQ.dcm" },
{"bc1774acbf5c025aa3b57184213cc98c" , "JPEGDefinedLengthSequenceOfFragments.dcm" },
{"e9faa2ce59db8563d7abe50432f91351" , "PHILIPS_GDCM12xBug2.dcm" },
{"620f0b67a91f7f74151bc5be745b7110" , "ITK_GDCM124_MultiframeSecondaryCaptureInvalid.dcm" },
{"52d0b90aa78a20cbff6b0beb3bd2c2b3" , "D_CLUNIE_RG2_JPLL.dcm" },
{"50dd1ae0bf918a9144b50229fa04f8e0" , "FUJI-10-MONO1-ACR_NEMA_2.dcm" },
{"d7e55bf3c6eb7a627823b532bcac7e16" , "D_CLUNIE_MR1_JPLY.dcm" },
{"7132fec8839d9c8b26cba4a4f17000da" , "D_CLUNIE_XA1_RLE.dcm" },
{"ddb5ac3f32badb154ce9a8a18c09c2c0" , "BugGDCM2_UndefItemWrongVL.dcm" },
{"7f2638cea652bf3452ada158d2ea67c4" , "SIEMENS_MAGNETOM-12-ACR_NEMA_2-Modern.dcm" },
{"477d801b27ef3cb21a8685cedbc9b12e" , "JDDICOM_Sample2.dcm" },
{"cae77b420f407118f288c14eeb81e11f" , "TOSHIBA_MRT150-16-MONO2-ACR_NEMA_2.dcm" },
{"524014ef866b31e3fd2e33a6148d31bb" , "DCMTK_JPEGExt_12Bits.dcm" },
{"84ea2f46ad98332a06875da922709007" , "US-MONO2-8-8x-execho.dcm" },
{"19d6f17c8a0b2cd04049828dcb304046" , "UnexpectedSequenceDelimiterInFixedLengthSequence.dcm" },
{"bee28068ae9edef69fef792583b3e20f" , "ACUSON-24-YBR_FULL-RLE-b.dcm" },
{"b171f7581c9cf15b2d32cfd62e9b6038" , "gdcm-US-ALOKA-16.dcm" },
{"80be78c9365f6a1604191dd703c84ac5" , "DX_J2K_0Padding.dcm" },
{"a9a72d44b888fb4f1f727af88109cfb3" , "D_CLUNIE_CT2_RLE.dcm" },
{"151376fcac2fbd55c3b5c5a155e16d26" , "D_CLUNIE_RG1_JPLL.dcm" },
{"e0a3fd5917c5a13a16981e1d0346af4d" , "D_CLUNIE_VL3_RLE.dcm" },
{"28ea47a62e1f2ca9d7dcd10ef868701d" , "NM_Kakadu44_SOTmarkerincons.dcm" },
{"e95cec3c8078cea91b287e45d751cf78" , "CT-SIEMENS-Icone-With-PaletteColor.dcm" },
{"eacd1cabeaf78554804ca627344cba91" , "GE_DLX-8-MONO2-PrivateSyntax.dcm" },
{"8f40712ff8e4a7691be144d884546a17" , "CT_16b_signed-UsedBits13.dcm" },
{"da9fb19d564fa01e4633df5c105f5a58" , "D_CLUNIE_RG3_JPLY.dcm" },
{"6510f44ff1dd8daf9b49100fd2c81d85" , "DX_GE_FALCON_SNOWY-VOI.dcm" },
{"5a15bd50c589c9611636dc7813493c03" , "PrivateGEImplicitVRBigEndianTransferSyntax16Bits.dcm" },
{"4948235091edc01603344f79a29835e1" , "CT-MONO2-16-brain.dcm" },
{"c2de60330cda14759a117b937a7e5a95" , "D_CLUNIE_VL4_RLE.dcm" },
{"db07030ff68debba674a6ca5c3e6eeb3" , "D_CLUNIE_MR3_RLE.dcm" },
{"72f55d5cf022e983783185195b77d0e6" , "undefined_length_un_vr.dcm" },
{"a8e2e35044384f31afc1dcf9163154ff" , "CT-MONO2-16-ort.dcm" },
{"0fefcf91a55062f1cb20945b3f726eda" , "05148044-mr-siemens-avanto-syngo.dcm" },
{"5d6aaab5766479ec6e27de4eaa4a6438" , "GE_LOGIQBook-8-RGB-HugePreview.dcm" },
{"acad4e43da617035315bcddc4bbb96bd" , "RadBWLossLess.dcm" },
{"b69e23b6479de4d9c3b4ed51aa748f73" , "KODAK-12-MONO1-Odd_Terminated_Sequence.dcm" },
{"e8458a5483e72cced4d46f93eed1699e" , "CT-MONO2-16-chest.dcm" },
{"728a698e308f7863ba3d103b80dffc45" , "PhilipsInteraSeqTermInvLen.dcm" },
{"35144f65c704edf2d69abc40405c3ea7" , "D_CLUNIE_MR4_JPLY.dcm" },
{"904b38f362b86f626ea7d89eed455709" , "D_CLUNIE_RG3_JPLL.dcm" },
{"707e26b0fa27f670c35ca5cc2bf3eda2" , "MR_Philips-Intera_BreaksNOSHADOW.dcm" },
{"04b97df84da7a126be30993cf9cff942" , "GE_CT_With_Private_compressed-icon.dcm" },
{"04cb0299587f38ba369e1fdcbf07dc25" , "D_CLUNIE_CT1_JLSN.dcm" },
{"3120b59e3635a912c6a60897f734b2ff" , "SIEMENS_MAGNETOM-12-MONO2-GDCM12-VRUN.dcm" },
{"cee47e57f6b1aaace74bb813e33a74eb" , "00191113.dcm" },
{"99ba02caa6813cafd254f97fb8377f60" , "MARCONI_MxTWin-12-MONO2-JpegLossless-ZeroLengthSQ.dcm" },
{"0a9449186ab107120640910a58a38ec4" , "SignedShortLosslessBug.dcm" },
{"2b306840879792f3509e1c1ccedee81d" , "GE_DLX-8-MONO2-Multiframe.dcm" },
{"fde7dc022ec854a98ffdc2190ceef424" , "PHILIPS_Gyroscan-12-MONO2-Jpeg_Lossless.dcm" },
{"f4b5fc5cc1440b865f1a99b85b170ecd" , "LJPEG_BuginGDCM12.dcm" },
{"ba2717c0d839213e788a74cccf37f1d4" , "SIEMENS_MAGNETOM-12-MONO2-FileSeq3.dcm" },
{"904b38f362b86f626ea7d89eed455709" , "D_CLUNIE_RG3_RLE.dcm" },
{"5e51e64ee21c2f643c13257e054c2990" , "CT-SIEMENS-MissingPixelDataInIconSQ.dcm" },
{"07964ed19883cb96460d1407795f4306" , "MR-MONO2-12-shoulder.dcm" },
{"0b818ac3983d76cfdc535a46058a1a53" , "LEADTOOLS_FLOWERS-24-RGB-Uncompressed.dcm" },
{"7f7aaee92f20ffcd64bebf8ce105bf5d" , "PICKER-16-MONO2-No_DicomV3_Preamble.dcm" },
{"fde3b9c4853c597383fab1050b491202" , "SIEMENS_MOSAIC_12BitsStored-16BitsJPEG.dcm" },
{"ba0654f3e7aae75bca8fc24705ddb78a" , "CT-MONO2-8-abdo.dcm" },
{"db07030ff68debba674a6ca5c3e6eeb3" , "D_CLUNIE_MR3_JPLL.dcm" },
{"03f25fb3e6e8ae53b9565553e2026a66" , "D_CLUNIE_VL6_RLE.dcm" },
{"af193ff3143f299826d55e00696b3218" , "LEADTOOLS_FLOWERS-8-MONO2-RLE.dcm" },
{"d46afca30969faa05583e87b0f6e5211" , "PHILIPS_Gyroscan-8-MONO2-Odd_Sequence.dcm" },
{"5885ade0feaaf967f5a1c22724c10d02" , "SIEMENS-12-Jpeg_Process_2_4-Lossy-a.dcm" },
{"13758e32fe34c17b897efcbd26e7e03b" , "gdcm-JPEG-LossLess3a.dcm" },
{"1e61c6d50ae3ef3ac0550277f166bd1c" , "D_CLUNIE_XA1_JPLY.dcm" },
{"151376fcac2fbd55c3b5c5a155e16d26" , "D_CLUNIE_RG1_RLE.dcm" },
{"e77b93eb953f2a21fa75d257da0514fb" , "US-RGB-8-epicard.dcm" },
{"a101ddd933114bcc0145d047d74f41c9" , "GE_MR_0025xx1bProtocolDataBlock.dcm" },
{"b9f48f54e75b7f1994cfe1a7152d9ab5" , "rle16loo.dcm" },
{"cc61470afd2b80014749abbb5bd9109d" , "DMCPACS_ExplicitImplicit_BogusIOP.dcm" },
{"a9a72d44b888fb4f1f727af88109cfb3" , "D_CLUNIE_CT2_JPLL.dcm" },
{"477d801b27ef3cb21a8685cedbc9b12e" , "JDDICOM_Sample2-dcmdjpeg.dcm" },
{"7944f0f8eb06466099fe6cd792ae8bfa" , "MR_Philips_Intera_No_PrivateSequenceImplicitVR.dcm" },
{"323c2919ea590363dd6eb4105a2566a7" , "KODAK_CompressedIcon.dcm" },
{"486199008daf27f167efee9469fffd52" , "ACUSON-24-YBR_FULL-RLE.dcm" },
{"07964ed19883cb96460d1407795f4306" , "D_CLUNIE_MR2_RLE.dcm" },
{"b53c440c32a7bd20d24cc1997bd7c9e6" , "JPEG_LossyYBR.dcm" },
{"23bf148e163ea7d3f1dbadfc590618fe" , "012345.002.050.dcm" },
{"52d0b90aa78a20cbff6b0beb3bd2c2b3" , "D_CLUNIE_RG2_RLE.dcm" },
{"e44869a1044b611e08a9f1396432a44b" , "MR_Philips_Intera_PrivateSequenceImplicitVR.dcm" },
{"f92d6349e1d80bbdba34a9e1b84eb737" , "SIEMENS_ImageLocationUN.dcm" },
{"7944f0f8eb06466099fe6cd792ae8bfa" , "PHILIPS_Intera-16-MONO2-Uncompress.dcm" },
{"0e82ac528c72a2dd69fa1b52e5370d82" , "MR-SIEMENS-DICOM-WithOverlays-extracted-overlays.dcm" },
{"0b818ac3983d76cfdc535a46058a1a53" , "LEADTOOLS_FLOWERS-24-RGB-JpegLossless.dcm" },
{"91b4da2ca9fd378ca404580c84c62984" , "US-GE-4AICL142.dcm" },
{"2ff486489d600e0ab5f8c829960c516f" , "D_CLUNIE_SC1_RLE.dcm" },
{"85124dd05ab0567aecaf896373f780da" , "D_CLUNIE_MR4_JPLL.dcm" },
{"ece67fa0c8a99f8147b26081252cd0a5" , "MR-Brucker-CineTagging-NonSquarePixels.dcm" },
{"bdf48b10871ac0b3c14587eaba9ca998" , "MR-MONO2-8-16x-heart.dcm" },
{"0c65a403a0a24957e523bb29e84c31ef" , "LEADTOOLS_FLOWERS-8-MONO2-JpegLossy.dcm" },
{"f92a60ad3cbc2783db57cac5f800a9c0" , "GE_DLX-8-MONO2-Multiframe-Jpeg_Lossless.dcm" },
{"4d469f85f51b3b81bdf38ebba23a68e7" , "D_CLUNIE_NM1_RLE.dcm" },
{"20e2f6cc2b60ae26adfdd3b3ee0e1915" , "D_CLUNIE_VL1_RLE.dcm" },
{"84462b24809f4e9d151c7c27004f7922" , "SIEMENS_MAGNETOM-12-MONO2-FileSeq2.dcm" },
{"620f0b67a91f7f74151bc5be745b7110" , "DermaColorLossLess.dcm" },
{"72e203ca5756f4491d84d8240c82a59b" , "OT-MONO2-8-a7.dcm" },
{"890d0a5afdbf77398d857b523f86e83a" , "D_CLUNIE_MR1_RLE.dcm" },
{"af193ff3143f299826d55e00696b3218" , "LEADTOOLS_FLOWERS-8-MONO2-Uncompressed.dcm" },
{"cee47e57f6b1aaace74bb813e33a74eb" , "00191113.dcm" },
{"07b6f4e2fba920d28e2f29dbb037b640" , "TOSHIBA_J2K_SIZ1_PixRep0.dcm" },
{"93f60acbb450c62992a1db09a6c19c05" , "TOSHIBA_J2K_OpenJPEGv2Regression.dcm" },
{"fa02ad71bdf3e6970e18fc9a9df03a2d" , "TOSHIBA_J2K_SIZ0_PixRep1.dcm" },
{"3475cb96e0308cb84502be1c1531b588" , "NM-PAL-16-PixRep1.dcm" },
{"2ec6d7c60d6786665cff2b7a31aaeedf" , "MEDILABInvalidCP246_EVRLESQasUN.dcm" },
{"54b1cec013420f771142ca6ec6c274a4" , "JPEGInvalidSecondFrag.dcm" },
// sentinel
{ 0, 0 }
};
namespace gdcm
{
int TestIconImageGenerate2(const char *subdir, const char* filename, bool verbose = false)
{
ImageReader reader;
reader.SetFileName( filename );
if ( !reader.Read() )
{
const FileMetaInformation &header = reader.GetFile().GetHeader();
MediaStorage ms = header.GetMediaStorage();
bool isImage = MediaStorage::IsImage( ms );
bool pixeldata = reader.GetFile().GetDataSet().FindDataElement( Tag(0x7fe0,0x0010) );
if( isImage && pixeldata )
{
std::cerr << "Failed to read: " << filename << std::endl;
return 1;
}
else
{
// not an image give up...
std::cerr << "Problem with: " << filename << " but that's ok" << std::endl;
return 0;
}
}
// Create directory first:
std::string tmpdir = Testing::GetTempDirectory( subdir );
if( !System::FileIsDirectory( tmpdir.c_str() ) )
{
System::MakeDirectory( tmpdir.c_str() );
//return 1;
}
std::string outfilename = Testing::GetTempFilename( filename, subdir );
IconImageGenerator iig;
iig.SetPixmap( reader.GetImage() );
iig.AutoPixelMinMax(true);
const unsigned int idims[2] = { 64, 64 };
//const unsigned int idims[2] = { 600,430 };
iig.SetOutputDimensions( idims );
bool b = iig.Generate();
gdcm::Filename fn( filename );
const char *name = fn.GetName();
unsigned int i = 0;
const char *p = iconimagearray2[i][1];
while( p != 0 )
{
if( strcmp( name, p ) == 0 )
{
break;
}
++i;
p = iconimagearray2[i][1];
}
const char *refmd5 = iconimagearray2[i][0];
if( b )
{
const gdcm::IconImage &icon = iig.GetIconImage();
if( verbose ) icon.Print( std::cout );
unsigned long len = icon.GetBufferLength();
std::vector< char > vbuffer;
vbuffer.resize( len );
char *buffer = &vbuffer[0];
bool res2 = icon.GetBuffer(buffer);
if( !res2 )
{
std::cerr << "res2 failure:" << filename << std::endl;
return 1;
}
char digest[33];
gdcm::Testing::ComputeMD5(buffer, len, digest);
Image & img = reader.GetImage();
img.SetIconImage( iig.GetIconImage() );
ImageWriter writer;
writer.SetFileName( outfilename.c_str() );
#if 1
writer.SetImage( img );
#else
Image &ii = writer.GetImage();
(Bitmap&)ii = iig.GetIconImage();
#endif
if( !writer.Write() )
{
std::cerr << "Failed to write: " << outfilename << std::endl;
return 1;
}
if( verbose )
{
std::cout << "success: " << outfilename << std::endl;
std::cout << "ref=" << refmd5 << std::endl;
std::cout << "md5=" << digest << std::endl;
}
if( !refmd5 )
{
std::cerr << " missing md5= {\"" << digest << "\" , \"" << name << "\" }," << std::endl;
return 1;
}
if( strcmp( refmd5, digest) )
{
std::cerr << "Problem with : " << name << " " << refmd5 << " vs " << digest << std::endl;
return 1;
}
}
else
{
assert( refmd5 == 0 );
std::cerr << "Could not generate Icon for: " << filename << std::endl;
return 1;
}
return 0;
}
}
int TestIconImageGenerator2(int argc, char *argv[])
{
if( argc == 2 )
{
const char *filename = argv[1];
return gdcm::TestIconImageGenerate2(argv[0],filename, true);
}
// else
gdcm::Trace::DebugOff();
gdcm::Trace::WarningOff();
gdcm::Trace::ErrorOff();
int r = 0, i = 0;
const char *filename;
const char * const *filenames = gdcm::Testing::GetFileNames();
while( (filename = filenames[i]) )
{
r += gdcm::TestIconImageGenerate2(argv[0], filename );
++i;
}
return r;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageRegionReader3.cxx 000664 001766 001770 00000011761 14517730450 032422 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmImageRegionReader.h"
#include "gdcmImageHelper.h"
#include "gdcmFilename.h"
#include "gdcmBoxRegion.h"
#include "gdcmTesting.h"
static int TestImageRegionRead(const char* filename, bool verbose = false)
{
using gdcm::System;
using gdcm::Testing;
if( verbose )
std::cerr << "Reading: " << filename << std::endl;
gdcm::Filename fn( filename );
// DMCPACS_ExplicitImplicit_BogusIOP.dcm is very difficult to handle since
// we need to read 3 attribute to detect the "well known" bug. However the third
// attribute is (b500,b700) which make ReadUpToTag(7fe0,0010) fails...
if( strcmp(fn.GetName(), "DMCPACS_ExplicitImplicit_BogusIOP.dcm" ) == 0
|| strcmp(fn.GetName(), "SC16BitsAllocated_8BitsStoredJ2K.dcm" ) == 0 // mismatch pixel format in JPEG 2000 vs DICOM
|| strcmp(fn.GetName(), "SC16BitsAllocated_8BitsStoredJPEG.dcm" ) == 0 // mismatch pixel format in JPEG vs DICOM
|| strcmp(fn.GetName(), "PHILIPS_Gyroscan-12-Jpeg_Extended_Process_2_4.dcm" ) == 0 // bogus JPEG cannot be streamed
|| strcmp(fn.GetName(), "US-YBR_FULL_422-EVRLE.dcm" ) == 0 // FIXME TODO
// FIXME: we should be able to handle those at some point:
|| strcmp(fn.GetName(), "JPEGNote_empty.dcm" ) == 0
|| strcmp(fn.GetName(), "JPEGNote_missing.dcm" ) == 0
|| strcmp(fn.GetName(), "JPEGNote_bogus.dcm" ) == 0
)
{
std::cerr << "Skipping impossible file: " << filename << std::endl;
return 0;
}
gdcm::ImageRegionReader reader;
reader.SetFileName( filename );
bool canReadInformation = reader.ReadInformation();
if (!canReadInformation)
{
std::cerr << "Cannot ReadInformation: " << filename << std::endl;
return 0; //unable to read tags as expected.
}
// Create directory first:
const char subdir[] = "TestImageRegionReader3";
std::string tmpdir = Testing::GetTempDirectory( subdir );
if( !System::FileIsDirectory( tmpdir.c_str() ) )
{
System::MakeDirectory( tmpdir.c_str() );
//return 1;
}
std::string outfilename = Testing::GetTempFilename( filename, subdir );
outfilename += ".raw";
std::ofstream of( outfilename.c_str(), std::ios::binary );
int res = 0;
std::vector dims =
gdcm::ImageHelper::GetDimensionsValue(reader.GetFile());
std::vector vbuffer;
gdcm::BoxRegion box;
for( unsigned int z = 0; z < dims[2]; ++z )
{
const unsigned int xdelta = dims[0] / 1;
const unsigned int ydelta = dims[1] / 4;
size_t zlen;
bool b;
for( unsigned int y = 0; y < 4; ++y )
{
unsigned int maxy = ydelta + y * ydelta;
if( y == 3 ) maxy = dims[1];
box.SetDomain(0, xdelta - 1, 0 + y * ydelta, (unsigned int)(maxy - 1), z, z);
reader.SetRegion(box);
zlen = reader.ComputeBufferLength();
assert( zlen );
vbuffer.resize( zlen );
char* buffer = vbuffer.data();
b = reader.ReadIntoBuffer(buffer, zlen);
if( !b ) return 1;
assert( zlen );
of.write( buffer, zlen );
}
}
of.close();
char digest[33];
bool b = gdcm::Testing::ComputeFileMD5(outfilename.c_str(), digest);
if( !b )
{
std::cerr << "Could not ComputeFileMD5: " << outfilename << std::endl;
return 1;
}
const char *ref = gdcm::Testing::GetMD5FromFile(filename);
// FIXME: PC=1
if( strcmp(fn.GetName(), "ACUSON-24-YBR_FULL-RLE-b.dcm" ) == 0) ref = "2d7a28cae6c3b3183284d1b4ae08307f";
if( strcmp(fn.GetName(), "ACUSON-24-YBR_FULL-RLE.dcm" ) == 0) ref = "429f31f0b70bd515b3feeda5dea5eac0";
if( verbose )
{
std::cout << "ref=" << ref << std::endl;
std::cout << "md5=" << digest << std::endl;
}
if( !ref )
{
// new regression image needs a md5 sum
std::cout << "Missing md5 " << digest << " for: " << filename << std::endl;
res = 1;
}
else if( strcmp(digest, ref) != 0 )
{
std::cerr << "Problem reading image from: " << filename << std::endl;
std::cerr << "Found " << digest << " instead of " << ref << std::endl;
res = 1;
}
return res;
}
int TestImageRegionReader3(int argc, char *argv[])
{
if( argc == 2 )
{
const char *filename = argv[1];
return TestImageRegionRead(filename, true);
}
// else
// First of get rid of warning/debug message
gdcm::Trace::DebugOff();
gdcm::Trace::WarningOff();
int r = 0, i = 0;
const char *filename;
const char * const *filenames = gdcm::Testing::GetFileNames();
while( (filename = filenames[i]) )
{
r += TestImageRegionRead(filename);
++i;
}
return r;
}
Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageChangePhotometricInterpretation.cxx 000664 001766 001770 00000007007 14517730450 036243 0 ustar 00mmalaterre mmalaterre 000000 000000 gdcm-3.0.22 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmImageChangePhotometricInterpretation.h"
#include "gdcmImageReader.h"
#include "gdcmImageWriter.h"
#include "gdcmTesting.h"
#include "gdcmSystem.h"
namespace gdcm
{
PhotometricInterpretation InvertPI(PhotometricInterpretation pi)
{
assert( pi == PhotometricInterpretation::MONOCHROME1 || pi == PhotometricInterpretation::MONOCHROME2 );
if( pi == PhotometricInterpretation::MONOCHROME1 )
{
return PhotometricInterpretation::MONOCHROME2;
}
return PhotometricInterpretation::MONOCHROME1;
}
}
int TestImageChangePhotometricInterpretationFunc(const char *filename, bool verbose = false)
{
gdcm::ImageReader reader;
reader.SetFileName( filename );
if ( !reader.Read() )
{
const gdcm::FileMetaInformation &header = reader.GetFile().GetHeader();
gdcm::MediaStorage ms = header.GetMediaStorage();
bool isImage = gdcm::MediaStorage::IsImage( ms );
bool pixeldata = reader.GetFile().GetDataSet().FindDataElement( gdcm::Tag(0x7fe0,0x0010) );
if( isImage && pixeldata )
{
std::cout << "Could not read: " << filename << std::endl;
return 1;
}
return 0;
}
const gdcm::Image &image = reader.GetImage();
//unsigned int pc = image.GetPlanarConfiguration();
gdcm::PhotometricInterpretation pi = image.GetPhotometricInterpretation();
if( pi != gdcm::PhotometricInterpretation::MONOCHROME1 && pi != gdcm::PhotometricInterpretation::MONOCHROME2 )
{
// nothing to do:
return 0;
}
gdcm::PhotometricInterpretation invert_pi = gdcm::InvertPI(pi);
gdcm::ImageChangePhotometricInterpretation pcfilt;
pcfilt.SetInput( image );
pcfilt.SetPhotometricInterpretation( invert_pi );
bool b = pcfilt.Change();
if( !b )
{
std::cerr << "Could not apply pcfilt: " << filename << std::endl;
return 1;
}
// Create directory first:
const char subdir[] = "TestImageChangePhotometricInterpretation";
std::string tmpdir = gdcm::Testing::GetTempDirectory( subdir );
if( !gdcm::System::FileIsDirectory( tmpdir.c_str() ) )
{
gdcm::System::MakeDirectory( tmpdir.c_str() );
//return 1;
}
std::string outfilename = gdcm::Testing::GetTempFilename( filename, subdir );
gdcm::ImageWriter writer;
writer.SetFileName( outfilename.c_str() );
//writer.SetFile( reader.GetFile() ); // increase test goal
writer.SetImage( pcfilt.GetOutput() );
if( !writer.Write() )
{
std::cerr << "Failed to write: " << outfilename << std::endl;
return 1;
}
return 0;
}
int TestImageChangePhotometricInterpretation(int argc, char *argv[])
{
if( argc == 2 )
{
const char *filename = argv[1];
return TestImageChangePhotometricInterpretationFunc(filename, true);
}
// else
gdcm::Trace::DebugOff();
gdcm::Trace::WarningOff();
int r = 0, i = 0;
const char *filename;
const char * const *filenames = gdcm::Testing::GetFileNames();
while( (filename = filenames[i]) )
{
r += TestImageChangePhotometricInterpretationFunc( filename );
++i;
}
return r;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageChangePlanarConfiguration.cxx 000664 001766 001770 00000013350 14517730450 035040 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmImageChangePlanarConfiguration.h"
#include "gdcmImageReader.h"
#include "gdcmImageWriter.h"
#include "gdcmTesting.h"
#include "gdcmFilename.h"
#include "gdcmByteSwap.h"
#include "gdcmSystem.h"
int TestImageChangePlanarConfigurationFunc(const char *filename, bool verbose = false)
{
(void)verbose;
gdcm::ImageReader reader;
reader.SetFileName( filename );
if ( !reader.Read() )
{
const gdcm::FileMetaInformation &header = reader.GetFile().GetHeader();
gdcm::MediaStorage ms = header.GetMediaStorage();
bool isImage = gdcm::MediaStorage::IsImage( ms );
bool pixeldata = reader.GetFile().GetDataSet().FindDataElement( gdcm::Tag(0x7fe0,0x0010) );
if( isImage && pixeldata )
{
std::cout << "Could not read: " << filename << std::endl;
return 1;
}
return 0;
}
const gdcm::Image &image = reader.GetImage();
unsigned int oldpc = image.GetPlanarConfiguration();
assert( oldpc == 1 || oldpc == 0 );
gdcm::ImageChangePlanarConfiguration pcfilt;
pcfilt.SetPlanarConfiguration( !oldpc );
pcfilt.SetInput( image );
bool b = pcfilt.Change();
if( !b )
{
unsigned short ba = reader.GetImage().GetPixelFormat().GetBitsAllocated();
if( ba == 12 )
{
std::cerr << "fail to change, but that's ok" << std::endl;
return 0;
}
std::cerr << "Could not apply pcfilt: " << filename << std::endl;
return 1;
}
// Create directory first:
const char subdir[] = "TestImageChangePlanarConfiguration";
std::string tmpdir = gdcm::Testing::GetTempDirectory( subdir );
if( !gdcm::System::FileIsDirectory( tmpdir.c_str() ) )
{
gdcm::System::MakeDirectory( tmpdir.c_str() );
//return 1;
}
std::string outfilename = gdcm::Testing::GetTempFilename( filename, subdir );
gdcm::ImageWriter writer;
writer.SetFileName( outfilename.c_str() );
writer.SetFile( reader.GetFile() ); // important
writer.SetImage( pcfilt.GetOutput() );
if( !writer.Write() )
{
std::cerr << "Failed to write: " << outfilename << std::endl;
return 1;
}
// Let's read that file back in !
gdcm::ImageReader reader2;
reader2.SetFileName( outfilename.c_str() );
if ( !reader2.Read() )
{
std::cerr << "Could not even reread our generated file : " << outfilename << std::endl;
return 1;
}
// Check that after decompression we still find the same thing:
int res = 0;
const gdcm::Image &img = reader2.GetImage();
//unsigned int newpc = img.GetPlanarConfiguration();
//std::cerr << "Success to read image from file: " << filename << std::endl;
unsigned long len = img.GetBufferLength();
char* buffer = new char[len];
bool res2;
{
gdcm::ImageChangePlanarConfiguration icpc;
icpc.SetPlanarConfiguration( oldpc );
icpc.SetInput( img );
if( !icpc.Change() )
{
return 1;
}
res2 = icpc.GetOutput().GetBuffer(buffer);
}
if( !res2 )
{
std::cerr << "could not get buffer: " << outfilename << std::endl;
return 1;
}
// On big Endian system we have byteswapped the buffer (duh!)
// Since the md5sum is byte based there is now way it would detect
// that the file is written in big endian word, so comparing against
// a md5sum computed on LittleEndian would fail. Thus we need to
// byteswap (again!) here:
#ifdef GDCM_WORDS_BIGENDIAN
if( img.GetPixelFormat().GetBitsAllocated() == 16 )
{
assert( !(len % 2) );
assert( img.GetPhotometricInterpretation() == gdcm::PhotometricInterpretation::MONOCHROME1
|| img.GetPhotometricInterpretation() == gdcm::PhotometricInterpretation::MONOCHROME2 );
gdcm::ByteSwap::SwapRangeFromSwapCodeIntoSystem(
(unsigned short*)buffer, gdcm::SwapCode::LittleEndian, len/2);
}
#endif
const char *ref = gdcm::Testing::GetMD5FromFile(filename);
// FIXME: PC=1
gdcm::Filename fn( filename );
if( strcmp(fn.GetName(), "ACUSON-24-YBR_FULL-RLE-b.dcm" ) == 0) ref = "2d7a28cae6c3b3183284d1b4ae08307f";
if( strcmp(fn.GetName(), "ACUSON-24-YBR_FULL-RLE.dcm" ) == 0) ref = "429f31f0b70bd515b3feeda5dea5eac0";
char digest[33];
gdcm::Testing::ComputeMD5(buffer, len, digest);
if( !ref )
{
// new regression image needs a md5 sum
std::cerr << "Missing md5 " << digest << " for: " << filename << std::endl;
//assert(0);
res = 1;
}
else if( strcmp(digest, ref) != 0 )
{
std::cerr << "Problem reading image from: " << filename << std::endl;
std::cerr << "Found " << digest << " instead of " << ref << std::endl;
res = 1;
}
if(res)
{
std::cerr << "problem with: " << outfilename << std::endl;
}
if( verbose )
{
std::cout << "file was written in: " << outfilename << std::endl;
}
delete[] buffer;
return 0;
}
int TestImageChangePlanarConfiguration(int argc, char *argv[])
{
if( argc == 2 )
{
const char *filename = argv[1];
return TestImageChangePlanarConfigurationFunc(filename, true);
}
// else
gdcm::Trace::DebugOff();
gdcm::Trace::WarningOff();
int r = 0, i = 0;
const char *filename;
const char * const *filenames = gdcm::Testing::GetFileNames();
while( (filename = filenames[i]) )
{
r += TestImageChangePlanarConfigurationFunc( filename );
++i;
}
return r;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestCleaner2.cxx 000664 001766 001770 00000012363 14517730450 030460 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmCleaner.h"
#include "gdcmFilename.h"
#include "gdcmReader.h"
#include "gdcmSmartPointer.h"
#include "gdcmSystem.h"
#include "gdcmTesting.h"
#include "gdcmWriter.h"
namespace gdcm {
static const DataSet &GetNestedDataSet(const DataSet &ds,
const PrivateTag &path) {
const DataElement &de = ds.GetDataElement(path);
SmartPointer sqi = de.GetValueAsSQ();
assert(sqi && sqi->GetNumberOfItems() == 1);
const Item &item = sqi->GetItem(1);
const DataSet &subds = item.GetNestedDataSet();
return subds;
}
static bool IsTagIn(const DataSet &ds, const PrivateTag &path,
const PrivateTag &pt) {
const DataSet &subds = GetNestedDataSet(ds, path);
return subds.FindDataElement(pt);
}
static bool IsTagEmpty(const DataSet &ds, const PrivateTag &path,
const PrivateTag &pt) {
const DataSet &subds = GetNestedDataSet(ds, path);
if (!subds.FindDataElement(pt)) return false;
const DataElement &de = subds.GetDataElement(pt);
return de.IsEmpty();
}
} // namespace gdcm
int TestCleaner2Impl(std::string const &filename,
std::string const &outfilename, bool useDPath) {
using namespace gdcm;
// Setup DPath
DPath dpath1, dpath2;
PrivateTag pt1, pt2;
// This attribute is a SQ. make sure we can Empty a SQ:
static const char ref1[] = "0029,e0,SPI-P-Private_ICS Release 1;4";
static const char ref2[] = "0029,00,SPI-P-Private_ICS Release 1;1";
if (useDPath) {
if (!dpath1.ConstructFromString(ref1)) {
return 1;
}
if (!dpath2.ConstructFromString(ref2)) {
return 1;
}
}
if (!pt1.ReadFromCommaSeparatedString(ref1)) {
return 1;
}
if (!pt2.ReadFromCommaSeparatedString(ref2)) {
return 1;
}
PrivateTag path1(0x0029, 0xf, "SPI-P-Private_ICS Release 1");
PrivateTag path2(0x0029, 0xcd, "SPI-P-Private_ICS Release 1;1");
PrivateTag path3(0x0029, 0x1b, "SPI-P-Private_ICS Release 1");
PrivateTag path4(0x0029, 0x4c, "SPI-P-Private_ICS Release 1");
// first pass
{
Reader reader;
reader.SetFileName(filename.c_str());
if (!reader.Read()) {
std::cerr << "Could not read: " << filename << std::endl;
return 1;
}
File &file = reader.GetFile();
DataSet &ds = file.GetDataSet();
const bool b0 = IsTagIn(ds, path4, pt1);
const bool b1 = IsTagIn(ds, path1, pt2);
const DataSet &ds1 = GetNestedDataSet(ds, path1);
const bool b2 = IsTagIn(ds1, path2, pt2);
const bool b3 = IsTagIn(ds, path3, pt2);
const bool b4 = IsTagIn(ds, path4, pt2);
if (!b0 || !b1 || !b2 || !b3 || !b4) {
std::cerr << "Test not setup correctly" << std::endl;
return 1;
}
Cleaner cleaner;
cleaner.SetFile(file);
cleaner.RemoveAllGroupLength(false);
if (useDPath) {
if (!cleaner.Empty(dpath1)) {
return 1;
}
if (!cleaner.Empty(dpath2)) {
return 1;
}
} else {
if (!cleaner.Empty(pt1)) {
return 1;
}
if (!cleaner.Empty(pt2)) {
return 1;
}
}
if (!cleaner.Clean()) {
return 1;
}
Writer writer;
writer.SetFileName(outfilename.c_str());
writer.SetFile(cleaner.GetFile());
if (!writer.Write()) {
std::cerr << "Failed to write: " << outfilename << std::endl;
return 1;
}
}
// re-read, written out:
{
Reader reader;
reader.SetFileName(outfilename.c_str());
if (!reader.Read()) {
std::cerr << "Could not read: " << outfilename << std::endl;
return 1;
}
File &file = reader.GetFile();
DataSet &ds = file.GetDataSet();
const bool b0 = IsTagEmpty(ds, path4, pt1);
const bool b1 = IsTagEmpty(ds, path1, pt2);
const DataSet &ds1 = GetNestedDataSet(ds, path1);
const bool b2 = IsTagEmpty(ds1, path2, pt2);
const bool b3 = IsTagEmpty(ds, path3, pt2);
const bool b4 = IsTagEmpty(ds, path4, pt2);
if (!b0 || !b1 || !b2 || !b3 || !b4) {
std::cerr << "At least one tag was not empty" << std::endl;
return 1;
}
}
return 0;
}
int TestCleaner2(int, char *[]) {
using namespace gdcm;
const char *directory = gdcm::Testing::GetDataRoot();
std::string sfilename =
std::string(directory) + "/PhilipsInteraSeqTermInvLen.dcm";
const char *filename = sfilename.c_str();
// Create directory first:
const char subdir[] = "TestCleaner2";
std::string tmpdir = Testing::GetTempDirectory(subdir);
if (!System::FileIsDirectory(tmpdir.c_str())) {
System::MakeDirectory(tmpdir.c_str());
}
std::string outfilename = Testing::GetTempFilename(filename, subdir);
int res1 = 0; // TestCleaner2Impl(filename, outfilename, true);
int res2 = TestCleaner2Impl(filename, outfilename, false);
return res1 + res2;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestWaveform.cxx 000664 001766 001770 00000001304 14517730450 030604 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmWaveform.h"
int TestWaveform(int argc, char *argv[])
{
(void)argc;
(void)argv;
gdcm::Waveform w;
(void)w;
return 0;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestScanner2_2.cxx 000664 001766 001770 00000003714 14517730450 030721 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmScanner2.h"
#include "gdcmDirectory.h"
#include "gdcmSystem.h"
#include "gdcmTesting.h"
#include "gdcmTrace.h"
int TestScanner2_2(int argc, char *argv[])
{
gdcm::Trace::WarningOff();
gdcm::Trace::ErrorOff();
const char *directory = gdcm::Testing::GetDataRoot();
if( argc == 2 )
{
directory = argv[1];
}
if( !gdcm::System::FileIsDirectory(directory) )
{
std::cerr << "No such directory: " << directory << std::endl;
return 1;
}
gdcm::Directory d;
unsigned int nfiles = d.Load( directory ); // no recursion
std::cout << "done retrieving file list. " << nfiles << " files found." << std::endl;
gdcm::Scanner2 s;
const gdcm::Tag t2(0x0020,0x000e); // Series Instance UID
s.AddPublicTag( t2 );
bool b = s.Scan( d.GetFilenames() );
if( !b )
{
std::cerr << "Scanner2 failed" << std::endl;
return 1;
}
gdcm::Directory::FilenamesType const & files = s.GetFilenames();
if( files != d.GetFilenames() )
{
return 1;
}
const char str1[] = "1.3.12.2.1107.5.2.4.7630.20010301125744000008";
gdcm::Directory::FilenamesType fns = s.GetAllFilenamesFromPublicTagToValue(t2, str1);
// all SIEMENS_MAGNETOM-12-MONO2-FileSeq*.dcm:
if( fns.size() != 4 ) return 1;
const char str2[] = "1.3.12.2.1107.5.2.4.7630.2001030112574400000";
fns = s.GetAllFilenamesFromPublicTagToValue(t2, str2);
if( !fns.empty() ) return 1;
return 0;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestDICOMDIR.cxx 000664 001766 001770 00000001515 14517730450 030214 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmDICOMDIR.h"
#include "gdcmFileSet.h"
int TestDICOMDIR(int argc, char *argv[])
{
(void)argc;
(void)argv;
gdcm::DICOMDIR dd;
gdcm::FileSet fs;
gdcm::File f1;
gdcm::File f2;
fs.AddFile( f1 );
fs.AddFile( f2 );
gdcm::DICOMDIR dd2(fs);
return 0;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestFileDerivation.cxx 000664 001766 001770 00000007455 14517730450 031737 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmFileDerivation.h"
#include "gdcmReader.h"
#include "gdcmWriter.h"
#include "gdcmTesting.h"
#include "gdcmSystem.h"
#include "gdcmUIDGenerator.h"
int TestFileDerive(const char *subdir, const char* filename)
{
using namespace gdcm;
Reader reader;
reader.SetFileName( filename );
if ( !reader.Read() )
{
std::cerr << "Failed to read: " << filename << std::endl;
return 1;
}
FileDerivation fd;
fd.SetFile( reader.GetFile() );
// Setup some actions:
// TODO we should reference the original image
File &file = reader.GetFile();
DataSet &ds = file.GetDataSet();
if( !ds.FindDataElement( Tag(0x0008,0x0016) )
|| ds.GetDataElement( Tag(0x0008,0x0016) ).IsEmpty() )
{
std::cerr << "Missing sop class giving up: " << filename << std::endl;
return 0;
}
if( !ds.FindDataElement( Tag(0x0008,0x0018) )
|| ds.GetDataElement( Tag(0x0008,0x0018) ).IsEmpty() )
{
std::cerr << "Missing sop instance giving up: " << filename << std::endl;
return 0;
}
const DataElement &sopclassuid = ds.GetDataElement( Tag(0x0008,0x0016) );
const DataElement &sopinstanceuid = ds.GetDataElement( Tag(0x0008,0x0018) );
// Make sure that const char* pointer will be properly padded with \0 char:
std::string sopclassuid_str( sopclassuid.GetByteValue()->GetPointer(), sopclassuid.GetByteValue()->GetLength() );
std::string sopinstanceuid_str( sopinstanceuid.GetByteValue()->GetPointer(), sopinstanceuid.GetByteValue()->GetLength() );
fd.AddReference( sopclassuid_str.c_str(), sopinstanceuid_str.c_str() );
// CID 7202 Source Image Purposes of Reference
// {"DCM",121320,"Uncompressed predecessor"},
fd.SetPurposeOfReferenceCodeSequenceCodeValue( 121320 );
// CID 7203 Image Derivation
// { "DCM",113040,"Lossy Compression" },
fd.SetDerivationCodeSequenceCodeValue( 113040 );
fd.SetDerivationDescription( "lossy conversion" );
if( !fd.Derive() )
{
std::cerr << "Failed to derive: " << filename << std::endl;
if( ds.FindDataElement( Tag(0x8,0x2112) ) )
{
return 0;
}
return 1;
}
// Create directory first:
std::string tmpdir = Testing::GetTempDirectory( subdir );
if( !System::FileIsDirectory( tmpdir.c_str() ) )
{
System::MakeDirectory( tmpdir.c_str() );
//return 1;
}
std::string outfilename = Testing::GetTempFilename( filename, subdir );
Writer writer;
writer.SetFileName( outfilename.c_str() );
writer.SetFile( reader.GetFile() );
if( !writer.Write() )
{
std::cerr << "Failed to write: " << outfilename << std::endl;
return 1;
}
// now let's try to read it back in:
Reader reader2;
reader2.SetFileName( outfilename.c_str() );
if ( !reader2.Read() )
{
std::cerr << "Could not reread written file: " << outfilename << std::endl;
return 1;
}
return 0;
}
int TestFileDerivation( int argc, char *argv[])
{
if( argc == 2 )
{
const char *filename = argv[1];
return TestFileDerive( argv[0], filename);
}
// else
gdcm::Trace::DebugOff();
gdcm::Trace::WarningOff();
int r = 0, i = 0;
const char *filename;
const char * const *filenames = gdcm::Testing::GetFileNames();
while( (filename = filenames[i]) )
{
r += TestFileDerive( argv[0], filename );
++i;
}
return r;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageWriter2.cxx 000664 001766 001770 00000014430 14517730450 031323 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmImageWriter.h"
#include "gdcmImageReader.h"
#include "gdcmImage.h"
#include "gdcmTesting.h"
#include "gdcmSystem.h"
#include "gdcmTrace.h"
#include "gdcmAttribute.h"
/*
Let's test the relation in between lossless transfer syntax and lossless compressed stream.
D_CLUNIE_CT1_J2KR.dcm
D_CLUNIE_CT1_J2KI.dcm
D_CLUNIE_MR1_JPLL.dcm
D_CLUNIE_MR1_JPLY.dcm
D_CLUNIE_CT1_JLSL.dcm
D_CLUNIE_CT1_JLSN.dcm
*/
struct LossLessTest
{
const char *lossyfile;
const char *losslessfile;
gdcm::TransferSyntax::TSType lossyts;
gdcm::TransferSyntax::TSType losslessts;
};
static const LossLessTest LossLessTestArray[] = {
{ "/D_CLUNIE_CT1_J2KI.dcm", "/D_CLUNIE_CT1_J2KR.dcm", gdcm::TransferSyntax::JPEG2000, gdcm::TransferSyntax::JPEG2000Lossless },
{ "/D_CLUNIE_MR1_JPLY.dcm", "/D_CLUNIE_MR1_JPLL.dcm", gdcm::TransferSyntax::JPEGExtendedProcess2_4, gdcm::TransferSyntax::JPEGLosslessProcess14_1 },
{ "/D_CLUNIE_CT1_JLSN.dcm", "/D_CLUNIE_CT1_JLSL.dcm", gdcm::TransferSyntax::JPEGLSNearLossless, gdcm::TransferSyntax::JPEGLSLossless }
};
int TestImageWriter2(int , char *[])
{
const char *directory = gdcm::Testing::GetDataRoot();
gdcm::Trace::WarningOff();
static const unsigned int ntests = sizeof( LossLessTestArray ) / sizeof( *LossLessTestArray );
for( unsigned int test = 0; test < ntests; ++test )
{
const LossLessTest <est = LossLessTestArray[test];
const char *j2k_filename1 = ltest.lossyfile;
const char *j2k_filename2 = ltest.losslessfile;
//const char j2k_filename1[] = "/D_CLUNIE_CT1_J2KI.dcm";
//const char j2k_filename2[] = "/D_CLUNIE_CT1_J2KR.dcm";
std::string filename_lossy = directory;
filename_lossy += j2k_filename1;
std::string filename_lossless = directory;
filename_lossless += j2k_filename2;
// Create directory first:
const char subdir[] = "TestImageWriter2";
std::string tmpdir = gdcm::Testing::GetTempDirectory( subdir );
if( !gdcm::System::FileIsDirectory( tmpdir.c_str() ) )
{
gdcm::System::MakeDirectory( tmpdir.c_str() );
//return 1;
}
std::string outfilename_lossy = gdcm::Testing::GetTempFilename( filename_lossy.c_str(), subdir );
std::string outfilename_lossless = gdcm::Testing::GetTempFilename( filename_lossless.c_str(), subdir );
{
gdcm::ImageReader reader;
reader.SetFileName( filename_lossy.c_str() );
if( !reader.Read() )
{
return 1;
}
gdcm::Image &ir = reader.GetImage();
if( !ir.IsLossy() )
{
std::cerr << "Image is not lossy" << std::endl;
std::cerr << filename_lossy << std::endl;
return 1;
}
//if( ir.GetTransferSyntax() != gdcm::TransferSyntax::JPEG2000 )
if( ir.GetTransferSyntax() != ltest.lossyts )
{
std::cerr << filename_lossy << " " << filename_lossless << std::endl;
std::cerr << ir.GetTransferSyntax() << " vs " << gdcm::TransferSyntax::GetTSString( ltest.lossyts ) << std::endl;
return 1;
}
//ir.SetTransferSyntax( gdcm::TransferSyntax::JPEG2000Lossless );
ir.SetTransferSyntax( ltest.losslessts );
gdcm::ImageWriter writer;
writer.SetImage( ir );
writer.SetFileName( outfilename_lossy.c_str() );
// We should never authorized writing of image that was lossy compress and declare as lossless
if( writer.Write() )
{
gdcm::Attribute<0x0028,0x2110> at;
at.Set( writer.GetFile().GetDataSet() );
if( at.GetValue() != "01" )
{
std::cerr << "We should never authorize writing of image that was lossy "
"compress and declare as lossless" << std::endl;
std::cerr << filename_lossy << " " << filename_lossless << std::endl;
return 1;
}
}
}
// But the contrary is ok:
{
gdcm::ImageReader reader;
reader.SetFileName( filename_lossless.c_str() );
if( !reader.Read() )
{
return 1;
}
gdcm::Image &ir = reader.GetImage();
//if( ir.GetTransferSyntax() != gdcm::TransferSyntax::JPEG2000Lossless )
if( ir.GetTransferSyntax() != ltest.losslessts )
{
return 1;
}
//ir.SetTransferSyntax( gdcm::TransferSyntax::JPEG2000 );
ir.SetTransferSyntax( ltest.lossyts );
gdcm::ImageWriter writer;
writer.SetImage( ir );
writer.SetFileName( outfilename_lossless.c_str() );
// It is ok to save a lossless file and declare transfer syntax to JPEG2000
if( !writer.Write() )
{
return 1;
}
}
}
#if 0
const gdcm::Image &ir = reader.GetImage();
gdcm::Image image;
image.SetNumberOfDimensions( ir.GetNumberOfDimensions() );
const unsigned int *dims = ir.GetDimensions();
image.SetDimension(0, dims[0] );
image.SetDimension(1, dims[1] );
const gdcm::PixelFormat &pixeltype = ir.GetPixelFormat();
image.SetPixelFormat( pixeltype );
const gdcm::PhotometricInterpretation &pi = ir.GetPhotometricInterpretation();
image.SetPhotometricInterpretation( pi );
unsigned long len = image.GetBufferLength();
assert( len = ir.GetBufferLength() );
std::vector buffer;
buffer.resize(len); // black image
gdcm::ByteValue *bv = new gdcm::ByteValue(buffer);
gdcm::DataElement pixeldata( gdcm::Tag(0x7fe0,0x0010) );
pixeldata.SetValue( *bv );
image.SetDataElement( pixeldata );
const char filename[] = "toto.dcm";
gdcm::ImageWriter writer;
writer.SetImage( image );
writer.SetFileName( filename );
gdcm::File& file = writer.GetFile();
gdcm::DataSet& ds = file.GetDataSet();
gdcm::DataElement de( gdcm::Tag(0x0010,0x0010) );
const char s[] = "GDCM^Rocks";
de.SetByteValue( s, strlen( s ) );
ds.Insert( de );
if( !writer.Write() )
{
return 1;
}
return 0;
#endif
return 0;
}
Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageChangePhotometricInterpretation2.cxx 000664 001766 001770 00000006053 14517730450 036325 0 ustar 00mmalaterre mmalaterre 000000 000000 gdcm-3.0.22 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmImageChangePhotometricInterpretation.h"
#include
#include
template
double diff(T rgb1[3], T rgb2[2])
{
double sum = 0;
for(int i = 0; i < 3; ++i)
sum += fabs((double)(rgb1[i] - rgb2[i]));
return sum < 1e-3 ? 0 : sum;
//return sum;
}
int TestImageChangePhotometricInterpretation2(int argc, char *argv[])
{
//typedef float Type;
//typedef double Type;
//typedef int Type;
typedef unsigned char Type;
double sdiff = 0;
double max = 0;
int nerrors = 0;
int res = 0;
Type error[3] = {};
Type error2[3] = {};
Type yerror[3] = {};
for(int r = 0; r < 256; ++r)
for(int g = 0; g < 256; ++g)
for(int b = 0; b < 256; ++b)
{
Type rgb[3];
Type ybr[3] = {};
Type rgb2[3] = {};
rgb[0] = r;
rgb[1] = g;
rgb[1] = 128;
rgb[2] = b;
rgb[2] = 128;
// convert rgb 2 ybr:
//gdcm::ImageChangePhotometricInterpretation::RGB2YBR(ybr,rgb);
gdcm::ImageChangePhotometricInterpretation::YBR2RGB(ybr,rgb);
// convert back:
//gdcm::ImageChangePhotometricInterpretation::YBR2RGB(rgb2,ybr);
gdcm::ImageChangePhotometricInterpretation::RGB2YBR(rgb2,ybr);
if( memcmp(rgb,rgb2,3*sizeof(Type)) != 0 )
{
//std::cerr << "Problem with R,G,B=" << r << "," << g << "," << b <<
//" instead of " << (int)rgb2[0] << "," << (int)rgb2[1] << "," << (int)rgb2[2] << std::endl;
//std::cerr << "diff:" << diff(rgb,rgb2) << std::endl;
double d = diff(rgb,rgb2);
sdiff += d;
if( d > max )
{
error2[0] = rgb2[0];
error2[1] = rgb2[1];
error2[2] = rgb2[2];
error[0] = rgb[0];
error[1] = rgb[1];
error[2] = rgb[2];
yerror[0] = ybr[0];
yerror[1] = ybr[1];
yerror[2] = ybr[2];
}
max = std::max(d,max);
res = 1;
++nerrors;
}
}
std::cerr << "nerrors=" << nerrors << std::endl;
std::cerr << "sdiff=" << sdiff<< std::endl;
std::cerr << "max=" << max << std::endl;
std::cerr << "max error=" << (double)error[0] << "," << (double)error[1] << "," << (double)error[2] << std::endl;
std::cerr << "max error2=" << (double)error2[0] << "," << (double)error2[1] << "," << (double)error2[2] << std::endl;
std::cerr << "max yerror=" << (double)yerror[0] << "," << (double)yerror[1] << "," << (double)yerror[2] << std::endl;
return res;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestCleaner1.cxx 000664 001766 001770 00000012403 14517730450 030452 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmCSAHeader.h"
#include "gdcmCleaner.h"
#include "gdcmFilename.h"
#include "gdcmReader.h"
#include "gdcmSmartPointer.h"
#include "gdcmSystem.h"
#include "gdcmTesting.h"
#include "gdcmWriter.h"
namespace gdcm {
static std::pair ComputeMD5CSADecoded(
const DataSet &ds, const PrivateTag &pt) {
std::pair ret;
CSAHeader csa;
char digest1[33];
char digest2[33];
if (ds.FindDataElement(pt)) {
const DataElement &de = ds.GetDataElement(pt);
const ByteValue *bv = de.GetByteValue();
if (!Testing::ComputeMD5(bv->GetPointer(), bv->GetLength(), digest1))
return ret;
if (!csa.LoadFromDataElement(de)) return ret;
if (csa.GetFormat() != CSAHeader::SV10) return ret;
std::ostringstream os;
csa.Print(os);
std::string str = os.str();
if (!Testing::ComputeMD5(str.c_str(), str.size(), digest2)) return ret;
ret.first = digest1;
ret.second = digest2;
}
return ret;
}
} // namespace gdcm
int TestCleaner1Impl(std::string const &filename,
std::string const &outfilename, bool useDPath) {
using namespace gdcm;
// reference digest of decoded csa:
const std::string ref1 = "ff225133ae107e4e8ee0ba1972016e0c";
const std::string ref2 = "860bf885643a9a40e6d4bd468f8fd6c4";
// first pass
{
Reader reader;
reader.SetFileName(filename.c_str());
if (!reader.Read()) {
std::cerr << "Could not read: " << filename << std::endl;
return 1;
}
File &file = reader.GetFile();
DataSet &ds = file.GetDataSet();
const std::string raw1 = "42efe9d2b2611d88039ce76a0d5eeb42";
const std::string raw2 = "938bbc5c001fb24e37b97dbffbd83ff7";
CSAHeader csa;
const PrivateTag &t1 = csa.GetCSAImageHeaderInfoTag();
const PrivateTag &t2 = csa.GetCSASeriesHeaderInfoTag();
const std::pair digests1 =
ComputeMD5CSADecoded(ds, t1);
const std::pair digests2 =
ComputeMD5CSADecoded(ds, t2);
if (digests1.first != raw1 || digests2.first != raw2) {
std::cerr << "bogus digest" << std::endl;
return 1;
}
if (digests1.second != ref1 || digests2.second != ref2) {
std::cerr << "bogus digest" << std::endl;
return 1;
}
// Setup DPath
DPath dpath1, dpath2;
if (!dpath1.ConstructFromString("/0029,10,SIEMENS CSA HEADER") ||
!dpath2.ConstructFromString("/0029,20,SIEMENS CSA HEADER")) {
return 1;
}
Cleaner cleaner;
cleaner.SetFile(file);
if (useDPath) {
if (!cleaner.Scrub(dpath1)) {
return 1;
}
if (!cleaner.Scrub(dpath2)) {
return 1;
}
} else {
if (!cleaner.Scrub(t1)) {
return 1;
}
if (!cleaner.Scrub(t2)) {
return 1;
}
}
if (!cleaner.Clean()) {
return 1;
}
Writer writer;
writer.SetFileName(outfilename.c_str());
writer.SetFile(cleaner.GetFile());
if (!writer.Write()) {
std::cerr << "Failed to write: " << outfilename << std::endl;
return 1;
}
}
// re-read, written out:
{
Reader reader;
reader.SetFileName(outfilename.c_str());
if (!reader.Read()) {
std::cerr << "Could not read: " << outfilename << std::endl;
return 1;
}
File &file = reader.GetFile();
DataSet &ds = file.GetDataSet();
const std::string raw1 = "c712f47d79928578a724f36420342fc1";
const std::string raw2 = "3a33733b8dc87cb5f80eccf0aeb784f5";
CSAHeader csa;
const PrivateTag &t1 = csa.GetCSAImageHeaderInfoTag();
const PrivateTag &t2 = csa.GetCSASeriesHeaderInfoTag();
const std::pair digests1 =
ComputeMD5CSADecoded(ds, t1);
const std::pair digests2 =
ComputeMD5CSADecoded(ds, t2);
if (digests1.first != raw1 || digests2.first != raw2) {
std::cerr << "bogus digest" << std::endl;
return 1;
}
if (digests1.second != ref1 || digests2.second != ref2) {
std::cerr << "bogus digest" << std::endl;
return 1;
}
}
return 0;
}
int TestCleaner1(int, char *[]) {
using namespace gdcm;
const char *directory = gdcm::Testing::GetDataRoot();
std::string sfilename = std::string(directory) + "/SIEMENS_CSA2.dcm";
const char *filename = sfilename.c_str();
// Create directory first:
const char subdir[] = "TestCleaner1";
std::string tmpdir = Testing::GetTempDirectory(subdir);
if (!System::FileIsDirectory(tmpdir.c_str())) {
System::MakeDirectory(tmpdir.c_str());
}
std::string outfilename = Testing::GetTempFilename(filename, subdir);
int res1 = TestCleaner1Impl(filename, outfilename, true);
int res2 = TestCleaner1Impl(filename, outfilename, false);
return res1 + res2;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImage.cxx 000664 001766 001770 00000003440 14517730450 030043 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmImage.h"
#include "gdcmImageReader.h"
int TestImage(int, char *[])
{
gdcm::Image img;
gdcm::ImageReader reader;
const gdcm::Image &img2 = reader.GetImage();
img2.Print(std::cout);//just to avoid the warning of img2 being unused
#if 0
{
gdcm::Image img3 = reader.GetImage();
}
gdcm::SmartPointer img4 = const_cast(&img2);
gdcm::ImageReader r;
//r.SetFileName( "/home/mathieu/Creatis/gdcmData/test.acr" );
r.SetFileName( "/home/mathieu/Creatis/gdcmData/DermaColorLossLess.dcm" );
r.Read();
//std::vector< gdcm::SmartPointer > images;
std::vector< gdcm::Image > images;
{
const gdcm::Image &ref = r.GetImage();
images.push_back( ref );
ref.Print(std::cout);
gdcm::Image copy1 = ref;
copy1.Print(std::cout);
gdcm::SmartPointer copy2;
copy2 = r.GetImage();
copy2->Print(std::cout);
gdcm::ImageReader r2;
r2.SetFileName( "/home/mathieu/Creatis/gdcmData/012345.002.050.dcm" );
r2.Read();
std::cout << " ------------------ " << std::endl;
images.push_back( r2.GetImage() );
ref.Print(std::cout);
copy1.Print(std::cout);
copy2->Print(std::cout);
}
images[0].Print( std::cout );
images[1].Print( std::cout );
#endif
return 0;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestPNMCodec.cxx 000664 001766 001770 00000001366 14517730450 030416 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmPNMCodec.h"
#include "gdcmTransferSyntax.h"
int TestPNMCodec(int, char *[])
{
gdcm::PNMCodec pnm;
pnm.CanDecode( gdcm::TransferSyntax::ImplicitVRLittleEndian );
return 0;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestFileStreamer2.cxx 000664 001766 001770 00000007364 14517730450 031476 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmFileStreamer.h"
#include "gdcmTesting.h"
#include "gdcmSystem.h"
#include "gdcmReader.h"
#include "gdcmFilename.h"
int TestFileStream2(const char *filename, bool verbose = false)
{
using namespace gdcm;
if( verbose )
std::cout << "Processing: " << filename << std::endl;
// Create directory first:
const char subdir[] = "TestFileStreamer2";
std::string tmpdir = Testing::GetTempDirectory( subdir );
if( !System::FileIsDirectory( tmpdir.c_str() ) )
{
System::MakeDirectory( tmpdir.c_str() );
//return 1;
}
std::string outfilename = Testing::GetTempFilename( filename, subdir );
if( verbose )
std::cout << "Generating: " << outfilename << std::endl;
const gdcm::Tag t1(0x0042,0x0011);
gdcm::Filename fn( filename );
const char *name = fn.GetName();
// Special handling:
bool checktemplate = false;
if( strcmp(name, "DMCPACS_ExplicitImplicit_BogusIOP.dcm" ) == 0
|| strcmp(name, "ExplicitVRforPublicElementsImplicitVRforShadowElements.dcm") == 0
|| strcmp(name, "SIEMENS_MAGNETOM-12-MONO2-GDCM12-VRUN.dcm") == 0
)
{
checktemplate = true;
}
gdcm::FileStreamer fs;
fs.SetTemplateFileName( filename );
fs.CheckTemplateFileName( checktemplate );
fs.SetOutputFileName( outfilename.c_str() );
const char buffer[10] = { 0, 1, 2 , 3, 4, 5, 6, 7, 8, 9 };
const size_t len = sizeof( buffer );
//fs.ReserveDataElement( 36 );
fs.StartDataElement( t1 );
fs.AppendToDataElement( t1, buffer, len );
fs.AppendToDataElement( t1, buffer, len );
fs.AppendToDataElement( t1, buffer, len );
fs.AppendToDataElement( t1, buffer, len / 2 + 0 );
fs.StopDataElement( t1 );
// Read back and check:
gdcm::Reader r;
r.SetFileName( outfilename.c_str() );
if( !r.Read() )
{
std::cerr << "Failed to read: " << outfilename << std::endl;
return 1;
}
gdcm::File & f = r.GetFile();
gdcm::DataSet & ds = f.GetDataSet();
if( !ds.FindDataElement( t1 ) )
{
std::cerr << "Could not find tag: " << t1 << std::endl;
return 1;
}
const DataElement & de = ds.GetDataElement( t1 );
const int vl = de.GetVL();
if( vl != 36 ) // 35 + padding
{
return 1;
}
const ByteValue *bv = de.GetByteValue();
const char *ptr = bv->GetPointer();
const int b1 = memcmp( ptr + 0 * len, buffer, len );
const int b2 = memcmp( ptr + 1 * len, buffer, len );
const int b3 = memcmp( ptr + 2 * len, buffer, len );
const int b4 = memcmp( ptr + 3 * len, buffer, len / 2 );
if( b1 || b2 || b3 || b4 )
{
std::cerr << "Problem:" << b1 << " "
<< b2 << " "
<< b3 << " "
<< b4 << std::endl;
return 1;
}
// NULL padding
if( ptr[35] != 0x0 )
{
std::cerr << "Error in padding" << std::endl;
return 1;
}
return 0;
}
int TestFileStreamer2(int argc, char *argv[])
{
if( argc == 2 )
{
const char *filename = argv[1];
return TestFileStream2(filename, true);
}
// else
gdcm::Trace::DebugOff();
gdcm::Trace::WarningOff();
gdcm::Trace::ErrorOff();
int r = 0, i = 0;
const char *filename;
const char * const *filenames = gdcm::Testing::GetFileNames();
while( (filename = filenames[i]) )
{
r += TestFileStream2( filename );
++i;
}
return r;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestAnonymizer.cxx 000664 001766 001770 00000006355 14517730450 031164 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmAnonymizer.h"
#include "gdcmReader.h"
#include "gdcmWriter.h"
#include "gdcmTesting.h"
#include "gdcmSystem.h"
#include "gdcmUIDGenerator.h"
namespace gdcm
{
static int TestAnonymize(const char *subdir, const char* filename)
{
Reader reader;
reader.SetFileName( filename );
if ( !reader.Read() )
{
return 1;
}
Anonymizer anonymizer;
anonymizer.SetFile( reader.GetFile() );
// Setup some actions:
const char patname[] = "test^anonymize";
const Tag pattag = Tag(0x0010,0x0010);
anonymizer.Replace( pattag , patname );
anonymizer.Remove( Tag(0x0008,0x2112) );
anonymizer.Empty( Tag(0x0008,0x0070) );
anonymizer.Clear( Tag(0x0010,0x0020) );
UIDGenerator uid;
// Those two are very special, since (0008,0016) needs to be propagated to (0002,0002) and
// (0008,0018) needs to be propagated to (0002,0003)
std::string newuid = uid.Generate();
anonymizer.Replace( Tag(0x0008,0x0018), newuid.c_str() );
anonymizer.Replace( Tag(0x0008,0x0016), "1.2.840.10008.5.1.4.1.1.1" ); // Make it a CT
if( !anonymizer.RemovePrivateTags() )
{
return 1;
}
// Create directory first:
std::string tmpdir = Testing::GetTempDirectory( subdir );
if( !System::FileIsDirectory( tmpdir.c_str() ) )
{
System::MakeDirectory( tmpdir.c_str() );
//return 1;
}
std::string outfilename = Testing::GetTempFilename( filename, subdir );
Writer writer;
writer.SetFileName( outfilename.c_str() );
writer.SetFile( reader.GetFile() );
writer.SetCheckFileMetaInformation( false );
if( !writer.Write() )
{
std::cerr << "Failed to write: " << outfilename << std::endl;
return 1;
}
std::cout << "Success to write: " << outfilename << std::endl;
// now let's try to read it back in:
Reader reader2;
reader2.SetFileName( outfilename.c_str() );
if ( !reader2.Read() )
{
std::cerr << "Could not reread written file: " << outfilename << std::endl;
return 1;
}
const DataSet & ds = reader.GetFile().GetDataSet();
//std::cout << ds << std::endl;
const ByteValue *bv = ds.GetDataElement( pattag ).GetByteValue();
if( !bv )
{
return 1;
}
if (strncmp( bv->GetPointer(), patname, strlen(patname) ) != 0 )
{
return 1;
}
if( bv->GetLength() != strlen(patname) )
{
return 1;
}
return 0;
}
}
int TestAnonymizer(int argc, char *argv[])
{
if( argc == 2 )
{
const char *filename = argv[1];
return gdcm::TestAnonymize(argv[0], filename);
}
// else
int r = 0, i = 0;
const char *filename;
const char * const *filenames = gdcm::Testing::GetFileNames();
while( (filename = filenames[i]) )
{
r += gdcm::TestAnonymize( argv[0], filename );
++i;
}
return r;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestOrientation.cxx 000664 001766 001770 00000003066 14517730450 031320 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmOrientation.h"
#include
int TestOrientation(int, char *[])
{
gdcm::Orientation o;
{
double dircos[] = { 1, 0, 0, 0, 1, 0 };
gdcm::Orientation::OrientationType type = gdcm::Orientation::GetType(dircos);
if( type != gdcm::Orientation::AXIAL )
{
std::cerr << "Should be AXIAL: " << gdcm::Orientation::GetLabel( type ) << std::endl;
return 1;
}
}
{
double dircos[] = { 1, 0, 0, 0, 0, 1 };
gdcm::Orientation::OrientationType type = gdcm::Orientation::GetType(dircos);
if( type != gdcm::Orientation::CORONAL )
{
return 1;
}
}
{
double dircos[] = { 0, 1, 0, 0, 0, -1 };
gdcm::Orientation::OrientationType type = gdcm::Orientation::GetType(dircos);
if( type != gdcm::Orientation::SAGITTAL )
{
return 1;
}
}
if( o.GetObliquityThresholdCosineValue() != 0.8 )
{
return 1;
}
gdcm::Orientation::SetObliquityThresholdCosineValue( 0.75 );
if( o.GetObliquityThresholdCosineValue() != 0.75 )
{
return 1;
}
return 0;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestDataSetHelper.cxx 000664 001766 001770 00000020004 14517730450 031501 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmDataSetHelper.h"
#include "gdcmPrinter.h"
#include "gdcmReader.h"
#include "gdcmGlobal.h"
#include "gdcmTesting.h"
namespace gdcm
{
class Printer2 : public Printer
{
public:
VR PrintDataElement(std::ostringstream & os, const Dicts &dicts, const DataSet & ds, const DataElement &de, std::ostream &out, std::string const & indent ) {
const VR vr = Printer::PrintDataElement(os, dicts, ds, de, out, indent );
const VR vr2 = DataSetHelper::ComputeVR(*F, ds, de.GetTag());
if( vr != vr2 )
{
std::string privcrea = ds.GetPrivateCreator(de.GetTag());
// Special case for AMIInvalidPrivateDefinedLengthSQasUN.dcm
const PrivateTag pt1(0x0027,0x33,"GEMS_IMAG_01");
// DX_GE_FALCON_SNOWY-VOI.dcm
const PrivateTag pt2(0x0045,0x72,"GEMS_FALCON_03");
const PrivateTag pt3(0x0045,0x73,"GEMS_FALCON_03");
// MEDILABValidCP246_EVRLESQasOB.dcm
const PrivateTag pt4(0x0029,0x1140,"SIEMENS MEDCOM HEADER");
if( PrivateTag(de.GetTag(),"GEMS_IMAG_01") == pt1 )
{
assert( vr == VR::UL );
assert( vr2 == VR::SL );
return vr;
}
if( PrivateTag(de.GetTag(),"GEMS_IMAG_01") == pt2
|| PrivateTag(de.GetTag(),"GEMS_IMAG_01") == pt3 )
{
assert( vr == VR::IS );
assert( vr2 == VR::DS );
return vr;
}
if( PrivateTag(de.GetTag(),"SIEMENS MEDCOM HEADER") == pt4 )
{
assert( vr == VR::OB );
assert( vr2 == VR::SQ );
return vr;
}
// ELSCINT1_PMSCT_RLE1.dcm
if( de.GetTag() == Tag(0x0020,0x0070) )
{
assert( vr == VR::CS );
assert( vr2 == VR::LO );
return vr;
}
// EmptyIcon_Bug417.dcm
if( de.GetTag() == Tag(0x0040,0x1008) )
{
assert( vr == VR::ST );
assert( vr2 == VR::LO );
return vr;
}
// GE_CT_With_Private_compressed-icon.dcm
if( de.GetTag() == Tag(0x0040,0x0253) )
{
assert( vr == VR::CS );
assert( vr2 == VR::SH );
return vr;
}
// JPEGInvalidSecondFrag.dcm
if( de.GetTag() == Tag(0x0018,0x9305)
|| de.GetTag() == Tag(0x0018,0x9306)
|| de.GetTag() == Tag(0x0018,0x9307)
|| de.GetTag() == Tag(0x0023,0x1070) )
{
assert( vr == VR::OB );
assert( vr2 == VR::FD );
return vr;
}
// NM-PAL-16-PixRep1.dcm...FIXME: dcmconv +te
if( de.GetTag() == Tag(0x0028,0x1101)
|| de.GetTag() == Tag(0x0028,0x1102)
|| de.GetTag() == Tag(0x0028,0x1103)
|| de.GetTag() == Tag(0x0028,0x1201)
|| de.GetTag() == Tag(0x0028,0x1202)
|| de.GetTag() == Tag(0x0028,0x1203) )
{
assert( vr == VR::US );
assert( vr2 == VR::SS || vr2 == VR::OW );
return vr;
}
// PHILIPS_Gyroscan-12-MONO2-Jpeg_Lossless.dcm
if( de.GetTag() == Tag(0x0008,0x0010)
|| de.GetTag() == Tag(0x0018,0x4000)
|| de.GetTag() == Tag(0x0020,0x3402) )
{
assert( vr == VR::LO );
assert( vr2 == VR::CS || vr2 == VR::LT || vr2 == VR::SH );
return vr;
}
// PHILIPS_Gyroscan-12-MONO2-Jpeg_Lossless.dcm
if( de.GetTag() == Tag(0x0020,0x1001)
|| de.GetTag() == Tag(0x0028,0x0005)
|| de.GetTag() == Tag(0x0028,0x0040)
|| de.GetTag() == Tag(0x0028,0x0200) )
{
assert( vr == VR::DS || vr == VR::SS || vr == VR::SH );
assert( vr2 == VR::IS || vr2 == VR::US || vr2 == VR::CS );
return vr;
}
// PHILIPS_Gyroscan-12-Jpeg_Extended_Process_2_4.dcm
if( de.GetTag() == Tag(0x0008,0x0040) )
{
assert( vr == VR::SS );
assert( vr2 == VR::US );
return vr;
}
if( vr == VR::SQ || vr2 == VR::SQ )
assert( vr == vr2 );
if( !de.GetTag().IsPrivate() )
assert( vr == vr2 );
//assert( vr.Compatible(vr2) );
}
return vr;
}
void PrintSQ(const SequenceOfItems *sqi, std::ostream & os, std::string const & indent)
{
if( !sqi ) return;
SequenceOfItems::ItemVector::const_iterator it = sqi->Items.begin();
for(; it != sqi->Items.end(); ++it)
{
const Item &item = *it;
const DataSet &ds = item.GetNestedDataSet();
const DataElement &deitem = item;
std::string nextindent = indent + " ";
os << nextindent << deitem.GetTag();
os << " ";
os << "na"; //deitem.GetVR();
os << " ";
if( deitem.GetVL().IsUndefined() )
{
os << "(Item with undefined length)";
}
else
{
os << "(Item with defined length)";
}
os << "\n";
PrintDataSet(ds, os, nextindent + " ");
if( deitem.GetVL().IsUndefined() )
{
const Tag itemDelItem(0xfffe,0xe00d);
os << nextindent << itemDelItem << "\n";
}
}
if( sqi->GetLength().IsUndefined() )
{
const Tag seqDelItem(0xfffe,0xe0dd);
os << indent << seqDelItem << "\n";
}
}
void PrintDataSet(const DataSet &ds, std::ostream &out, std::string const & indent = "" )
{
const Global& g = GlobalInstance;
const Dicts &dicts = g.GetDicts();
DataSet::ConstIterator it = ds.Begin();
for( ; it != ds.End(); ++it )
{
const DataElement &de = *it;
const SequenceOfFragments *sqf = de.GetSequenceOfFragments();
std::ostringstream os;
VR refvr = PrintDataElement(os, dicts, ds, de, out, indent);
if( refvr == VR::SQ /*|| sqi*/ )
{
SmartPointer sqi2 = de.GetValueAsSQ(); // may throw
PrintSQ(sqi2, os, indent);
}
else if ( sqf )
{
std::string nextindent = indent + " ";
const BasicOffsetTable & table = sqf->GetTable();
PrintDataElement(os,dicts,ds,table,out,nextindent);
size_t numfrag = sqf->GetNumberOfFragments();
for(size_t i = 0; i < numfrag; ++i)
{
const Fragment& frag = sqf->GetFragment(i);
PrintDataElement(os,dicts,ds,frag,out,nextindent);
}
const Tag seqDelItem(0xfffe,0xe0dd);
VL zero = 0;
os << /*nextindent <<*/ seqDelItem;
os << " " << zero << "\n";
}
else
{
// This is a byte value, so it should have been already treated
}
out << os.str();
}
}
void Print(std::ostream& os)
{
os << "# Dicom-File-Format\n";
os << "\n";
os << "# Dicom-Meta-Information-Header\n";
os << "# Used TransferSyntax: \n";
const FileMetaInformation &meta = F->GetHeader();
PrintDataSet(meta, os);
os << "\n# Dicom-Data-Set\n";
os << "# Used TransferSyntax: ";
const TransferSyntax &metats = meta.GetDataSetTransferSyntax();
os << metats;
os << std::endl;
const DataSet &ds = F->GetDataSet();
PrintDataSet(ds, os);
}
};
} // namespace gdcm
static int TestDataSetHelperFunc(const char *filename, bool verbose= false)
{
gdcm::Reader r;
r.SetFileName( filename );
if( !r.Read() )
{
std::cerr << "Could not read: " << filename << std::endl;
return 1;
}
const gdcm::File & file = r.GetFile();
gdcm::Printer2 print;
print.SetFile( file );
std::ostringstream out;
if( verbose )
print.Print( std::cout );
print.Print( out );
return 0;
}
int TestDataSetHelper(int argc, char *argv[])
{
if( argc == 2 )
{
const char *filename = argv[1];
return TestDataSetHelperFunc(filename, true);
}
// else
int r = 0, i = 0;
gdcm::Trace::DebugOff();
gdcm::Trace::WarningOff();
gdcm::Trace::ErrorOff();
const char *filename;
const char * const *filenames = gdcm::Testing::GetFileNames();
while( (filename = filenames[i]) )
{
r += TestDataSetHelperFunc( filename );
++i;
}
return r;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestUUIDGenerator.cxx 000664 001766 001770 00000002423 14517730450 031436 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmUUIDGenerator.h"
#include
int TestUUIDGenerator(int , char *[])
{
gdcm::UUIDGenerator uid;
const char *suid = uid.Generate();
if( !gdcm::UUIDGenerator::IsValid( suid ) )
{
std::cerr << "Invalid: " << suid << std::endl;
return 1;
}
const char *valids[] = {
"00000000-0000-0000-0000-000000000000",
"ba209999-0c6c-11d2-97cf-00c04f8eea45",
"67C8770B-44F1-410A-AB9A-F9B5446F13EE"
};
const size_t nv = sizeof( valids ) / sizeof( *valids );
for( size_t i = 0; i < nv; ++i )
{
const char *valid = valids[i];
if( !gdcm::UUIDGenerator::IsValid( valid ) )
{
std::cerr << "Invalid: " << valid << std::endl;
return 1;
}
}
return 0;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestScanner2_1.cxx 000664 001766 001770 00000015351 14517730450 030720 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmScanner2.h"
#include "gdcmDirectory.h"
#include "gdcmSystem.h"
#include "gdcmTesting.h"
#include "gdcmTrace.h"
// dcmdump /path/to/image/*.dcm 2>&/dev/null| grep 0020 | grep "000e\|000d" | sort | uniq
//
// $ find /images/ -type f -exec dcmdump -s +P 0010,0010 {} \;
static int TestScanner2Extra()
{
const char *extradataroot = gdcm::Testing::GetDataExtraRoot();
if( !extradataroot )
{
return 1;
}
if( !gdcm::System::FileIsDirectory(extradataroot) )
{
std::cerr << "No such directory: " << extradataroot << std::endl;
return 1;
}
gdcm::Directory d;
unsigned int nfiles = d.Load( extradataroot, true ); // no recursion
std::cout << "done retrieving file list. " << nfiles << " files found." << std::endl;
gdcm::Scanner2 s;
const gdcm::Tag t1(0x0020,0x000d); // Study Instance UID
const gdcm::Tag t2(0x0020,0x000e); // Series Instance UID
const gdcm::Tag t3(0x0010,0x0010); // Patient's Name
const gdcm::Tag t4(0x0004,0x5678); // DUMMY element
const gdcm::Tag t5(0x0028,0x0010); // Rows
const gdcm::Tag t6(0x0028,0x0011); // Columns
s.AddPublicTag( t1 );
s.AddPublicTag( t2 );
s.AddPublicTag( t3 );
s.AddPublicTag( t4 );
s.AddPublicTag( t5 );
s.AddPublicTag( t6 );
bool b = s.Scan( d.GetFilenames() );
if( !b )
{
std::cerr << "Scanner2 failed" << std::endl;
return 1;
}
//s.Print( std::cout );
return 0;
}
int TestScanner2_1(int argc, char *argv[])
{
gdcm::Trace::WarningOff();
gdcm::Trace::ErrorOff();
const char *directory = gdcm::Testing::GetDataRoot();
if( argc == 2 )
{
directory = argv[1];
}
if( !gdcm::System::FileIsDirectory(directory) )
{
std::cerr << "No such directory: " << directory << std::endl;
return 1;
}
gdcm::Directory d;
unsigned int nfiles = d.Load( directory ); // no recursion
// d.Print( std::cout );
std::cout << "done retrieving file list. " << nfiles << " files found." << std::endl;
gdcm::Scanner2 s;
const gdcm::Tag t1(0x0020,0x000d); // Study Instance UID
const gdcm::Tag t2(0x0020,0x000e); // Series Instance UID
const gdcm::Tag t3(0x0010,0x0010); // Patient's Name
const gdcm::Tag t4(0x0004,0x5678); // DUMMY element
const gdcm::Tag t5(0x0028,0x0010); // Rows
const gdcm::Tag t6(0x0028,0x0011); // Columns
const gdcm::Tag t7(0x0008,0x0016); //
s.AddPublicTag( t1 );
s.AddPublicTag( t2 );
s.AddPublicTag( t3 );
s.AddPublicTag( t4 );
s.AddPublicTag( t5 );
s.AddPublicTag( t6 );
s.AddPublicTag( t7 );
bool b = s.Scan( d.GetFilenames() );
if( !b )
{
std::cerr << "Scanner2 failed" << std::endl;
return 1;
}
// s.Print( std::cout );
gdcm::Directory::FilenamesType const & files = s.GetFilenames();
if( files != d.GetFilenames() )
{
return 1;
}
int numerrors = 0;
for( gdcm::Directory::FilenamesType::const_iterator it = files.begin(); it != files.end(); ++it )
{
const char *filename = it->c_str();
const char* value = s.GetPublicValue(filename, t7);
const char *msstr = gdcm::Testing::GetMediaStorageFromFile(filename);
if( msstr && strcmp(msstr, "1.2.840.10008.1.3.10" ) == 0 )
{
// would need to check (0002,0002)...
}
if( value && msstr )
{
if( strcmp( value, msstr ) != 0 )
{
std::cerr << "Problem with file " << filename << std::endl;
std::cerr << value << "/" << msstr << std::endl;
++numerrors;
}
}
else
{
if ( !msstr )
{
std::cerr << "Problem with file " << filename << std::endl;
if( value ) std::cerr << "Value found: " << value << std::endl;
++numerrors;
}
}
}
if( numerrors )
return numerrors;
// Check dummy filename:
bool iskey = s.IsKey( "gdcm.rocks.invalid.name" );
if( iskey )
{
std::cout << "IsKey returned: " << iskey << std::endl;
return 1;
}
// Let's get the value for tag t1 in first file:
gdcm::Scanner2::PublicMappingType const &mt = s.GetPublicMappings();
std::string sfilename;
sfilename = gdcm::Testing::GetDataRoot();
sfilename+= "/test.acr";
{
//const char *filename = d.GetFilenames()[0].c_str();
const char *filename = sfilename.c_str();
// The following breaks with Papyrus file: PET-cardio-Multiframe-Papyrus.dcm
unsigned int i = 0;
gdcm::Scanner2::PublicMappingType::const_iterator it = mt.find(filename);
assert( it != mt.end() );
while( it == mt.end() )
{
++i;
if( i == d.GetFilenames().size() )
{
return 1;
}
filename = d.GetFilenames()[i].c_str();
it = mt.find(filename);
}
std::cout << "Mapping for " << filename << " is :" << std::endl;
const gdcm::Scanner2::PublicTagToValue &tv = it->second;
//const std::string &filename = d.GetFilenames()[0];
gdcm::Scanner2::PublicTagToValue::const_iterator it2 = tv.find( t5 );
if( it2 == tv.end() || t5 != it2->first )
{
std::cerr << "Could not find tag:" << t5 << std::endl;
return 1;
}
const char * t1value = it2->second;
std::cout << filename << " -> " << t1 << " = " << (*t1value ? t1value : "none" ) << std::endl;
}
const gdcm::Directory::FilenamesType &filenames = d.GetFilenames();
{
gdcm::Directory::FilenamesType::const_iterator it = filenames.begin();
for(; it != filenames.end(); ++it)
{
const char *filename = it->c_str();
const gdcm::Tag &reftag = t6;
const char *value = s.GetPublicValue( filename, reftag );
if( value )
{
assert( value );
std::cout << filename << " has " << reftag << " = " << value << std::endl;
}
else
{
std::cout << filename << " has " << reftag << " = no value or not DICOM" << std::endl;
}
}
}
/*
{
std::vector keys = s.GetKeys();
for( std::vector::const_iterator it = keys.begin(); it != keys.end(); ++it)
{
const char *filename = *it;
const gdcm::Directory::FilenamesType::const_iterator it2
= std::find(filenames.begin(), filenames.end(), filename);
if( it2 == filenames.end() )
{
return 1;
}
if( !s.IsKey( filename ) )
{
return 1;
}
}
}
*/
// puposely discard gdcmDataExtra test, this is just an 'extra' test...
int b2 = TestScanner2Extra(); (void)b2;
return 0;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestFileChangeTransferSyntax2.cxx 000664 001766 001770 00000016145 14517730450 034012 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmFileChangeTransferSyntax.h"
#include "gdcmTesting.h"
#include "gdcmSystem.h"
#include "gdcmReader.h"
#include "gdcmImageReader.h"
#include "gdcmFilename.h"
#include "gdcmImageChangePlanarConfiguration.h"
#include "gdcmByteSwap.h"
static int TestFileChangeTransferSyntax2Func(const char *filename, bool verbose = false)
{
using namespace gdcm;
if( verbose )
std::cout << "Processing: " << filename << std::endl;
// Create directory first:
const char subdir[] = "TestFileChangeTransferSyntax2";
std::string tmpdir = Testing::GetTempDirectory( subdir );
if( !System::FileIsDirectory( tmpdir.c_str() ) )
{
System::MakeDirectory( tmpdir.c_str() );
//return 1;
}
std::string outfilename = Testing::GetTempFilename( filename, subdir );
if( verbose )
std::cout << "Generating: " << outfilename << std::endl;
const gdcm::TransferSyntax ts( TransferSyntax::JPEGLSLossless );
gdcm::FileChangeTransferSyntax fcts;
fcts.SetTransferSyntax( ts );
fcts.SetInputFileName( filename );
fcts.SetOutputFileName( outfilename.c_str() );
ImageCodec *ic = fcts.GetCodec();
if( !ic )
{
return 1;
}
if( !fcts.Change() )
{
gdcm::Reader reader;
reader.SetFileName( filename );
if( !reader.Read() )
{
std::cerr << "not dicom" << std::endl;
return 1;
}
const gdcm::File & file = reader.GetFile();
const gdcm::FileMetaInformation & fmi = file.GetHeader();
const TransferSyntax &tsref = fmi.GetDataSetTransferSyntax();
if( tsref.IsEncapsulated() )
{
if( verbose )
std::cout << "Will not generate (encaps): " << outfilename << std::endl;
return 0;
}
gdcm::Filename fn( filename );
const char *name = fn.GetName();
// Special handling:
if( strcmp(name, "CT-MONO2-12-lomb-an2.acr" ) == 0
|| strcmp(name, "LIBIDO-8-ACR_NEMA-Lena_128_128.acr") == 0
|| strcmp(name, "gdcm-ACR-LibIDO.acr") == 0
|| strcmp(name, "gdcm-MR-SIEMENS-16-2.acr") == 0
|| strcmp(name, "libido1.0-vol.acr") == 0
|| strcmp(name, "test.acr") == 0
|| strcmp(name, "LIBIDO-24-ACR_NEMA-Rectangle.dcm") == 0
|| strcmp(name, "MR_Spectroscopy_SIEMENS_OF.dcm") == 0 // not an image
|| strcmp(name, "ELSCINT1_PMSCT_RLE1.dcm") == 0
|| strcmp(name, "ELSCINT1_PMSCT_RLE1_priv.dcm") == 0
|| strcmp(name, "gdcm-CR-DCMTK-16-NonSamplePerPix.dcm") == 0
|| strcmp(name, "SIEMENS_MAGNETOM-12-ACR_NEMA_2-Modern.dcm") == 0
|| strcmp(name, "PrivateGEImplicitVRBigEndianTransferSyntax16Bits.dcm") == 0 // Implicit VR Big Endian DLX (G.E Private)
|| strcmp(name, "MR_GE_with_Private_Compressed_Icon_0009_1110.dcm") == 0 // Explicit VR Big Endian
|| strcmp(name, "US-RGB-8-epicard.dcm") == 0 // Explicit VR Big Endian
|| strcmp(name, "GE_DLX-8-MONO2-PrivateSyntax.dcm") == 0 // Implicit VR Big Endian DLX (G.E Private)
|| strcmp(name, "GE_CT_With_Private_compressed-icon.dcm") == 0 // Explicit VR Big Endian
|| strcmp(name, "JDDICOM_Sample2-dcmdjpeg.dcm") == 0 // cannot recreate FMI
|| strcmp(name, "DMCPACS_ExplicitImplicit_BogusIOP.dcm") == 0 // ImageRegionReader does not handle it
|| strcmp(name, "unreadable.dcm") == 0 // No Pixel Data (old ACR-NEMA)
|| strcmp(name, "US-YBR_FULL_422-EVRLE.dcm") == 0 // packed ybr422
|| strncmp(name, "DICOMDIR", 8) == 0 // DICOMDIR*
|| strncmp(name, "dicomdir", 8) == 0 // dicomdir*
)
{
if( verbose )
std::cout << "Will not generate: " << outfilename << std::endl;
return 0;
}
std::cerr << "Could not change: " << filename << std::endl;
return 1;
}
// Let's read that file back in !
gdcm::ImageReader reader2;
reader2.SetFileName( outfilename.c_str() );
if ( !reader2.Read() )
{
std::cerr << "Could not even reread our generated file : " << outfilename << std::endl;
return 1;
}
// Check that after decompression we still find the same thing:
int res = 0;
gdcm::Image img = reader2.GetImage();
int pc = 0;
// When recompressing: US-RGB-8-epicard.dcm, make sure to compute the md5 using the
// same original Planar Configuration...
if( (int)img.GetPlanarConfiguration() != pc )
{
gdcm::ImageChangePlanarConfiguration icpc;
icpc.SetInput( reader2.GetImage() );
icpc.SetPlanarConfiguration( pc );
icpc.Change();
img = icpc.GetOutput();
}
//std::cerr << "Success to read image from file: " << filename << std::endl;
unsigned long len = img.GetBufferLength();
char* buffer = new char[len];
bool res2 = img.GetBuffer(buffer);
if( !res2 )
{
std::cerr << "could not get buffer: " << outfilename << std::endl;
return 1;
}
// On big Endian system we have byteswapped the buffer (duh!)
// Since the md5sum is byte based there is now way it would detect
// that the file is written in big endian word, so comparing against
// a md5sum computed on LittleEndian would fail. Thus we need to
// byteswap (again!) here:
#ifdef GDCM_WORDS_BIGENDIAN
if( img.GetPixelFormat().GetBitsAllocated() == 16 )
{
assert( !(len % 2) );
assert( img.GetPhotometricInterpretation() == gdcm::PhotometricInterpretation::MONOCHROME1
|| img.GetPhotometricInterpretation() == gdcm::PhotometricInterpretation::MONOCHROME2 );
gdcm::ByteSwap::SwapRangeFromSwapCodeIntoSystem(
(unsigned short*)buffer, gdcm::SwapCode::LittleEndian, len/2);
}
#endif
const char *ref = gdcm::Testing::GetMD5FromFile(filename);
char digest[33];
gdcm::Testing::ComputeMD5(buffer, len, digest);
if( !ref )
{
// new regression image needs a md5 sum
std::cerr << "Missing md5 " << digest << " for: " << filename << std::endl;
//assert(0);
res = 1;
}
else if( strcmp(digest, ref) != 0 )
{
std::cerr << "Problem reading image from: " << filename << std::endl;
std::cerr << "Found " << digest << " instead of " << ref << std::endl;
res = 1;
}
if(res)
{
std::cerr << "problem with: " << outfilename << std::endl;
}
if( verbose )
{
std::cout << "file was written in: " << outfilename << std::endl;
}
delete[] buffer;
return res;
}
int TestFileChangeTransferSyntax2(int argc, char *argv[])
{
if( argc == 2 )
{
const char *filename = argv[1];
return TestFileChangeTransferSyntax2Func(filename, true);
}
// else
gdcm::Trace::DebugOff();
gdcm::Trace::WarningOff();
gdcm::Trace::ErrorOff();
int r = 0, i = 0;
const char *filename;
const char * const *filenames = gdcm::Testing::GetFileNames();
while( (filename = filenames[i]) )
{
r += TestFileChangeTransferSyntax2Func( filename );
++i;
}
return r;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestDictPrinter.cxx 000664 001766 001770 00000001235 14517730450 031250 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmDictPrinter.h"
int TestDictPrinter(int, char *[])
{
gdcm::DictPrinter dp;
return 0;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestIconImageGenerator4.cxx 000664 001766 001770 00000046262 14517730450 032620 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmImageReader.h"
#include "gdcmImageWriter.h"
#include "gdcmFilename.h"
#include "gdcmSystem.h"
#include "gdcmFileMetaInformation.h"
#include "gdcmTesting.h"
#include "gdcmByteSwap.h"
#include "gdcmIconImageGenerator.h"
#include "gdcmAttribute.h"
#include "gdcmStringFilter.h"
static const char * const iconimagearray4[][2] = {
{"7e097b4a57af6a823bd692e37b131b1c" , "SIEMENS_SOMATOM-12-ACR_NEMA-ZeroLengthUs.acr" },
{"7f2638cea652bf3452ada158d2ea67c4" , "gdcm-MR-SIEMENS-16-2.acr" },
{"da0922a02f8e763ec878089617e0bc4c" , "test.acr" },
{"e75ee90f23db1952a593393cdfaaf99f" , "MR-MONO2-12-an2.acr" },
{"c9c46afd186531850af9576cf54c800b" , "CT-MONO2-12-lomb-an2.acr" },
{"feb10d9a28e5166a3baf9ec6ef4f460a" , "LIBIDO-8-ACR_NEMA-Lena_128_128.acr" },
{"f9d8a0796ebf5a6aabddb4e133d09770" , "gdcm-ACR-LibIDO.acr" },
{"a1bce65e11c5fd2e26f7b38ebfdd1c53" , "libido1.0-vol.acr" },
{"9edea7caea2b85aad952d35c64f1e092" , "SIEMENS_CSA2.dcm" },
{"011d1f2abd9e27a2dc5d013bd4848104" , "gdcm-JPEG-LossLessThoravision.dcm" },
{"ddb7e67d119eb2ce14731cd9007e36cc" , "XA-MONO2-8-12x-catheter.dcm" },
{"1041bae356da40d2113210ff2adef923" , "gdcm-MR-PHILIPS-16-Multi-Seq.dcm" },
{"a3a6b3bf75ccdc91f82effc60d005688" , "PHILIPS_GDCM12xBug.dcm" },
{"a247e2ca32279956079c9a87403bd157" , "MR_Philips_Intera_PrivateSequenceExplicitVR_in_SQ_2001_e05f_item_wrong_lgt_use_NOSHADOWSEQ.dcm" },
{"b29a7fe847f942e3afdda5ddf23c03c3" , "D_CLUNIE_CT1_J2KI.dcm" },
{"3f7cae9b920adb3ca4a96ace2c0c91d7" , "rle16sti.dcm" },
{"f706f740496e445ee59141b15f3baeb4" , "3E768EB7.dcm" },
{"b38c113fffa4925f6f06a928b357f6a1" , "D_CLUNIE_MR2_JPLY.dcm" },
{"c3d3a218fcec778476090bce4c8b3201" , "SIEMENS_MAGNETOM-12-MONO2-FileSeq1.dcm" },
{"882a7327bab05d88571dcf29f902adf3" , "SIEMENS_MAGNETOM-12-MONO2-FileSeq0.dcm" },
{"1f4ae64fab8745e6affb72721ffdfaec" , "MR_Philips_Intera_SwitchIndianess_noLgtSQItem_in_trueLgtSeq.dcm" },
{"af193ff3143f299826d55e00696b3218" , "LEADTOOLS_FLOWERS-16-MONO2-Uncompressed.dcm" },
{"f6a020bb9aab2e59a289064b2add00ec" , "D_CLUNIE_MR3_JPLY.dcm" },
{"e8b529fbe615b4c540318695913d02e7" , "D_CLUNIE_VL2_RLE.dcm" },
{"8393213bd2c340a8cbd639f45a6b497e" , "OsirixFake16BitsStoredFakeSpacing.dcm" },
{"c50f0f97e1e36a4387620634e7a9b152" , "GE_RHAPSODE-16-MONO2-JPEG-Fragments.dcm" },
{"c265bf6c3bf4417987ff81b92ca4ca6c" , "MR_SIEMENS_forceLoad29-1010_29-1020.dcm" },
{"fa7da45d1a8eb16b092880ceff5a50e5" , "fffc0000UN.dcm" },
{"796594769ee3570292de36fdb4509df1" , "LIBIDO-24-ACR_NEMA-Rectangle.dcm" },
{"32b10fd4f13cfb4d74e1145f166e9dae" , "IM-0001-0066.CommandTag00.dcm" },
{"619f8c1650962cddf7695e39f43e8c49" , "D_CLUNIE_NM1_JPLY.dcm" },
{"c50f0f97e1e36a4387620634e7a9b152" , "D_CLUNIE_CT1_J2KR.dcm" },
{"30a530ea4df623cbec31f752637e234b" , "TheralysGDCM120Bug.dcm" },
{"3120b59e3635a912c6a60897f734b2ff" , "SIEMENS_MAGNETOM-12-MONO2-VRUN.dcm" },
{"5bdb2335ceb2dac83c2248d6ff8e0a49" , "THERALYS-12-MONO2-Uncompressed-Even_Length_Tag.dcm" },
{"30ff6655c5eb98ad34cd20836418a5a7" , "ALOKA_SSD-8-MONO2-RLE-SQ.dcm" },
{"992e4ef2b01f9d79514d7ab22c354be9" , "GE_GENESIS-16-MONO2-WrongLengthItem.dcm" },
{"d4669bd89971c1affd311c7d1d8b20c7" , "US-RGB-8-esopecho.dcm" },
{"85124dd05ab0567aecaf896373f780da" , "D_CLUNIE_MR4_RLE.dcm" },
{"07964ed19883cb96460d1407795f4306" , "D_CLUNIE_MR2_JPLL.dcm" },
{"096547f2834609ae4dbc115169806fc4" , "SIEMENS_Sonata-16-MONO2-Value_Multiplicity.dcm" },
{"af193ff3143f299826d55e00696b3218" , "LEADTOOLS_FLOWERS-16-MONO2-JpegLossless.dcm" },
{"da7002947725a950c3226cd23aa8d718" , "CT-MONO2-16-ankle.dcm" },
{"1a27a48d4efe2999b83bc89d3003d05c" , "LEADTOOLS_FLOWERS-8-PAL-RLE.dcm" },
{"feb10d9a28e5166a3baf9ec6ef4f460a" , "simpleImageWithIcon.dcm" },
{"aeb28d2cfb5376e2bb1ac4aac0b4807c" , "CR-MONO1-10-chest.dcm" },
{"c50f0f97e1e36a4387620634e7a9b152" , "D_CLUNIE_CT1_RLE.dcm" },
{"4d469f85f51b3b81bdf38ebba23a68e7" , "D_CLUNIE_NM1_JPLL.dcm" },
{"f7f066f0597791fcc147603ab5af6387" , "MR_GE_with_Private_Compressed_Icon_0009_1110.dcm" },
{"abe1950da247d18196fe5bea54cb26f1" , "NM-MONO2-16-13x-heart.dcm" },
{"6bd67bbd6e3e65808db8598fe0913f86" , "US-IRAD-NoPreambleStartWith0003.dcm" },
{"99672e03104c9176595bc0002cd8edf8" , "MR-MONO2-16-head.dcm" },
{"1a27a48d4efe2999b83bc89d3003d05c" , "LEADTOOLS_FLOWERS-8-PAL-Uncompressed.dcm" },
{"af8491953e762c12feb93a80a1575edf" , "MAROTECH_CT_JP2Lossy.dcm" },
{"932281859be22ffae33a2669b34cc2e6" , "05115014-mr-siemens-avanto-syngo-with-palette-icone.dcm" },
{"fb5402472ee00639ef8dc1b09692c299" , "US-PAL-8-10x-echo.dcm" },
{"038acb53133733a9f2c54528b8029511" , "MR-SIEMENS-DICOM-WithOverlays.dcm" },
{"890d0a5afdbf77398d857b523f86e83a" , "D_CLUNIE_MR1_JPLL.dcm" },
{"c50f0f97e1e36a4387620634e7a9b152" , "D_CLUNIE_CT1_JPLL.dcm" },
{"7897424399822301bdbedbcaf34c7c84" , "AMIInvalidPrivateDefinedLengthSQasUN.dcm" },
{"1f4ae64fab8745e6affb72721ffdfaec" , "ExplicitVRforPublicElementsImplicitVRforShadowElements.dcm" },
{"3443eba48f11dd9aadb4632c8c896b39" , "PHILIPS_Gyroscan-12-Jpeg_Extended_Process_2_4.dcm" },
{"b72e483ad977e18b8016c7cc916c4bbd" , "D_CLUNIE_SC1_JPLY.dcm" },
{"582df1a47c5992cc4f37496dab8c5130" , "gdcm-MR-PHILIPS-16-NonSquarePixels.dcm" },
{"8a5d13f6c85b2eebc1c02432d729cd45" , "SIEMENS-MR-RGB-16Bits.dcm" },
{"aacd6f6257e068cf53cdec5c7e172513" , "US-IRAD-NoPreambleStartWith0005.dcm" },
{"6a9ecd676ce47b0fda111a804b58b054" , "PICKER-16-MONO2-Nested_icon.dcm" },
{"9b720fd0aa079bc2f3f9545bd0e207c6" , "gdcm-JPEG-Extended.dcm" },
{"c790d0a462907135c1991f10a4846f98" , "D_CLUNIE_US1_RLE.dcm" },
{"4689c053642dcee7a2a9d0475c1b6528" , "D_CLUNIE_RG2_JPLY.dcm" },
{"b3b8a60e7b7b20c029eec1d5006e2b9c" , "PHILIPS_Brilliance_ExtraBytesInOverlay.dcm" },
{"91533007e5e07353012dea33149d920f" , "MR_ELSCINT1_00e1_1042_SQ_feff_00e0_Item.dcm" },
{"c8902cc14f285f2687866f60e45c7d86" , "TG18-CH-2k-01.dcm" },
{"af193ff3143f299826d55e00696b3218" , "LEADTOOLS_FLOWERS-16-MONO2-RLE.dcm" },
{"27daf49ec13f58db1d800fc58378852e" , "OT-PAL-8-face.dcm" },
{"07fef244d4e14358d453c144770b2a55" , "LEADTOOLS_FLOWERS-24-RGB-JpegLossy.dcm" },
{"ad96e04c3c50d463cccdfca68b49b071" , "SIEMENS_MAGNETOM-12-MONO2-Uncompressed.dcm" },
{"620f0b67a91f7f74151bc5be745b7110" , "GDCMJ2K_TextGBR.dcm" },
{"d1f5dfac9c3213f548df6a1f9e86acd0" , "MR16BitsAllocated_8BitsStored.dcm" },
{"cc2aaa869f08908e1f37ccdd314841ab" , "GE_GENESIS-16-MONO2-Uncompressed-UnusualVR.dcm" },
{"c50f0f97e1e36a4387620634e7a9b152" , "D_CLUNIE_CT1_JLSL.dcm" },
{"719505e71eafd643fa2e114acc83496f" , "ELSCINT1_JP2vsJ2K.dcm" },
{"7132fec8839d9c8b26cba4a4f17000da" , "D_CLUNIE_XA1_JPLL.dcm" },
{"cdf5908902fb63e321b224fae86a4128" , "SIEMENS_Sonata-12-MONO2-SQ.dcm" },
{"bc1774acbf5c025aa3b57184213cc98c" , "JPEGDefinedLengthSequenceOfFragments.dcm" },
{"e9faa2ce59db8563d7abe50432f91351" , "PHILIPS_GDCM12xBug2.dcm" },
{"620f0b67a91f7f74151bc5be745b7110" , "ITK_GDCM124_MultiframeSecondaryCaptureInvalid.dcm" },
{"52d0b90aa78a20cbff6b0beb3bd2c2b3" , "D_CLUNIE_RG2_JPLL.dcm" },
{"50dd1ae0bf918a9144b50229fa04f8e0" , "FUJI-10-MONO1-ACR_NEMA_2.dcm" },
{"d7e55bf3c6eb7a627823b532bcac7e16" , "D_CLUNIE_MR1_JPLY.dcm" },
{"7132fec8839d9c8b26cba4a4f17000da" , "D_CLUNIE_XA1_RLE.dcm" },
{"f48ea76ff11ca6ca4958df9c186422f4" , "BugGDCM2_UndefItemWrongVL.dcm" },
{"7f2638cea652bf3452ada158d2ea67c4" , "SIEMENS_MAGNETOM-12-ACR_NEMA_2-Modern.dcm" },
{"477d801b27ef3cb21a8685cedbc9b12e" , "JDDICOM_Sample2.dcm" },
{"cae77b420f407118f288c14eeb81e11f" , "TOSHIBA_MRT150-16-MONO2-ACR_NEMA_2.dcm" },
{"524014ef866b31e3fd2e33a6148d31bb" , "DCMTK_JPEGExt_12Bits.dcm" },
{"84ea2f46ad98332a06875da922709007" , "US-MONO2-8-8x-execho.dcm" },
{"19d6f17c8a0b2cd04049828dcb304046" , "UnexpectedSequenceDelimiterInFixedLengthSequence.dcm" },
{"bee28068ae9edef69fef792583b3e20f" , "ACUSON-24-YBR_FULL-RLE-b.dcm" },
{"b171f7581c9cf15b2d32cfd62e9b6038" , "gdcm-US-ALOKA-16.dcm" },
{"80be78c9365f6a1604191dd703c84ac5" , "DX_J2K_0Padding.dcm" },
{"a9a72d44b888fb4f1f727af88109cfb3" , "D_CLUNIE_CT2_RLE.dcm" },
{"151376fcac2fbd55c3b5c5a155e16d26" , "D_CLUNIE_RG1_JPLL.dcm" },
{"e0a3fd5917c5a13a16981e1d0346af4d" , "D_CLUNIE_VL3_RLE.dcm" },
{"28ea47a62e1f2ca9d7dcd10ef868701d" , "NM_Kakadu44_SOTmarkerincons.dcm" },
{"e95cec3c8078cea91b287e45d751cf78" , "CT-SIEMENS-Icone-With-PaletteColor.dcm" },
{"eacd1cabeaf78554804ca627344cba91" , "GE_DLX-8-MONO2-PrivateSyntax.dcm" },
{"8f40712ff8e4a7691be144d884546a17" , "CT_16b_signed-UsedBits13.dcm" },
{"da9fb19d564fa01e4633df5c105f5a58" , "D_CLUNIE_RG3_JPLY.dcm" },
{"6510f44ff1dd8daf9b49100fd2c81d85" , "DX_GE_FALCON_SNOWY-VOI.dcm" },
{"5a15bd50c589c9611636dc7813493c03" , "PrivateGEImplicitVRBigEndianTransferSyntax16Bits.dcm" },
{"4948235091edc01603344f79a29835e1" , "CT-MONO2-16-brain.dcm" },
{"c2de60330cda14759a117b937a7e5a95" , "D_CLUNIE_VL4_RLE.dcm" },
{"599ac7bd3a573451f3cd53494ace8cdf" , "D_CLUNIE_MR3_RLE.dcm" },
{"72f55d5cf022e983783185195b77d0e6" , "undefined_length_un_vr.dcm" },
{"a8e2e35044384f31afc1dcf9163154ff" , "CT-MONO2-16-ort.dcm" },
{"0fefcf91a55062f1cb20945b3f726eda" , "05148044-mr-siemens-avanto-syngo.dcm" },
{"5d6aaab5766479ec6e27de4eaa4a6438" , "GE_LOGIQBook-8-RGB-HugePreview.dcm" },
{"acad4e43da617035315bcddc4bbb96bd" , "RadBWLossLess.dcm" },
{"b69e23b6479de4d9c3b4ed51aa748f73" , "KODAK-12-MONO1-Odd_Terminated_Sequence.dcm" },
{"e8458a5483e72cced4d46f93eed1699e" , "CT-MONO2-16-chest.dcm" },
{"728a698e308f7863ba3d103b80dffc45" , "PhilipsInteraSeqTermInvLen.dcm" },
{"35144f65c704edf2d69abc40405c3ea7" , "D_CLUNIE_MR4_JPLY.dcm" },
{"904b38f362b86f626ea7d89eed455709" , "D_CLUNIE_RG3_JPLL.dcm" },
{"707e26b0fa27f670c35ca5cc2bf3eda2" , "MR_Philips-Intera_BreaksNOSHADOW.dcm" },
{"04b97df84da7a126be30993cf9cff942" , "GE_CT_With_Private_compressed-icon.dcm" },
{"04cb0299587f38ba369e1fdcbf07dc25" , "D_CLUNIE_CT1_JLSN.dcm" },
{"3120b59e3635a912c6a60897f734b2ff" , "SIEMENS_MAGNETOM-12-MONO2-GDCM12-VRUN.dcm" },
{"cee47e57f6b1aaace74bb813e33a74eb" , "00191113.dcm" },
{"99ba02caa6813cafd254f97fb8377f60" , "MARCONI_MxTWin-12-MONO2-JpegLossless-ZeroLengthSQ.dcm" },
{"46c2e032f2858831691a184aa6cdb0da" , "SignedShortLosslessBug.dcm" },
{"2b306840879792f3509e1c1ccedee81d" , "GE_DLX-8-MONO2-Multiframe.dcm" },
{"fde7dc022ec854a98ffdc2190ceef424" , "PHILIPS_Gyroscan-12-MONO2-Jpeg_Lossless.dcm" },
{"f4b5fc5cc1440b865f1a99b85b170ecd" , "LJPEG_BuginGDCM12.dcm" },
{"ba2717c0d839213e788a74cccf37f1d4" , "SIEMENS_MAGNETOM-12-MONO2-FileSeq3.dcm" },
{"904b38f362b86f626ea7d89eed455709" , "D_CLUNIE_RG3_RLE.dcm" },
{"5e51e64ee21c2f643c13257e054c2990" , "CT-SIEMENS-MissingPixelDataInIconSQ.dcm" },
{"07964ed19883cb96460d1407795f4306" , "MR-MONO2-12-shoulder.dcm" },
{"0b818ac3983d76cfdc535a46058a1a53" , "LEADTOOLS_FLOWERS-24-RGB-Uncompressed.dcm" },
{"7f7aaee92f20ffcd64bebf8ce105bf5d" , "PICKER-16-MONO2-No_DicomV3_Preamble.dcm" },
{"fde3b9c4853c597383fab1050b491202" , "SIEMENS_MOSAIC_12BitsStored-16BitsJPEG.dcm" },
{"ba0654f3e7aae75bca8fc24705ddb78a" , "CT-MONO2-8-abdo.dcm" },
{"599ac7bd3a573451f3cd53494ace8cdf" , "D_CLUNIE_MR3_JPLL.dcm" },
{"03f25fb3e6e8ae53b9565553e2026a66" , "D_CLUNIE_VL6_RLE.dcm" },
{"af193ff3143f299826d55e00696b3218" , "LEADTOOLS_FLOWERS-8-MONO2-RLE.dcm" },
{"d46afca30969faa05583e87b0f6e5211" , "PHILIPS_Gyroscan-8-MONO2-Odd_Sequence.dcm" },
{"5885ade0feaaf967f5a1c22724c10d02" , "SIEMENS-12-Jpeg_Process_2_4-Lossy-a.dcm" },
{"13758e32fe34c17b897efcbd26e7e03b" , "gdcm-JPEG-LossLess3a.dcm" },
{"1e61c6d50ae3ef3ac0550277f166bd1c" , "D_CLUNIE_XA1_JPLY.dcm" },
{"151376fcac2fbd55c3b5c5a155e16d26" , "D_CLUNIE_RG1_RLE.dcm" },
{"e77b93eb953f2a21fa75d257da0514fb" , "US-RGB-8-epicard.dcm" },
{"a101ddd933114bcc0145d047d74f41c9" , "GE_MR_0025xx1bProtocolDataBlock.dcm" },
{"b9f48f54e75b7f1994cfe1a7152d9ab5" , "rle16loo.dcm" },
{"cc61470afd2b80014749abbb5bd9109d" , "DMCPACS_ExplicitImplicit_BogusIOP.dcm" },
{"a9a72d44b888fb4f1f727af88109cfb3" , "D_CLUNIE_CT2_JPLL.dcm" },
{"477d801b27ef3cb21a8685cedbc9b12e" , "JDDICOM_Sample2-dcmdjpeg.dcm" },
{"1f4ae64fab8745e6affb72721ffdfaec" , "MR_Philips_Intera_No_PrivateSequenceImplicitVR.dcm" },
{"323c2919ea590363dd6eb4105a2566a7" , "KODAK_CompressedIcon.dcm" },
{"486199008daf27f167efee9469fffd52" , "ACUSON-24-YBR_FULL-RLE.dcm" },
{"07964ed19883cb96460d1407795f4306" , "D_CLUNIE_MR2_RLE.dcm" },
{"b53c440c32a7bd20d24cc1997bd7c9e6" , "JPEG_LossyYBR.dcm" },
{"2b098d933de8c90b317619658f698cc5" , "012345.002.050.dcm" },
{"52d0b90aa78a20cbff6b0beb3bd2c2b3" , "D_CLUNIE_RG2_RLE.dcm" },
{"e44869a1044b611e08a9f1396432a44b" , "MR_Philips_Intera_PrivateSequenceImplicitVR.dcm" },
{"f92d6349e1d80bbdba34a9e1b84eb737" , "SIEMENS_ImageLocationUN.dcm" },
{"1f4ae64fab8745e6affb72721ffdfaec" , "PHILIPS_Intera-16-MONO2-Uncompress.dcm" },
{"0e82ac528c72a2dd69fa1b52e5370d82" , "MR-SIEMENS-DICOM-WithOverlays-extracted-overlays.dcm" },
{"0b818ac3983d76cfdc535a46058a1a53" , "LEADTOOLS_FLOWERS-24-RGB-JpegLossless.dcm" },
{"91b4da2ca9fd378ca404580c84c62984" , "US-GE-4AICL142.dcm" },
{"2ff486489d600e0ab5f8c829960c516f" , "D_CLUNIE_SC1_RLE.dcm" },
{"85124dd05ab0567aecaf896373f780da" , "D_CLUNIE_MR4_JPLL.dcm" },
{"ece67fa0c8a99f8147b26081252cd0a5" , "MR-Brucker-CineTagging-NonSquarePixels.dcm" },
{"bdf48b10871ac0b3c14587eaba9ca998" , "MR-MONO2-8-16x-heart.dcm" },
{"0c65a403a0a24957e523bb29e84c31ef" , "LEADTOOLS_FLOWERS-8-MONO2-JpegLossy.dcm" },
{"f92a60ad3cbc2783db57cac5f800a9c0" , "GE_DLX-8-MONO2-Multiframe-Jpeg_Lossless.dcm" },
{"4d469f85f51b3b81bdf38ebba23a68e7" , "D_CLUNIE_NM1_RLE.dcm" },
{"20e2f6cc2b60ae26adfdd3b3ee0e1915" , "D_CLUNIE_VL1_RLE.dcm" },
{"84462b24809f4e9d151c7c27004f7922" , "SIEMENS_MAGNETOM-12-MONO2-FileSeq2.dcm" },
{"620f0b67a91f7f74151bc5be745b7110" , "DermaColorLossLess.dcm" },
{"72e203ca5756f4491d84d8240c82a59b" , "OT-MONO2-8-a7.dcm" },
{"890d0a5afdbf77398d857b523f86e83a" , "D_CLUNIE_MR1_RLE.dcm" },
{"af193ff3143f299826d55e00696b3218" , "LEADTOOLS_FLOWERS-8-MONO2-Uncompressed.dcm" },
{"cee47e57f6b1aaace74bb813e33a74eb" , "00191113.dcm" },
{"07b6f4e2fba920d28e2f29dbb037b640" , "TOSHIBA_J2K_SIZ1_PixRep0.dcm" },
{"93f60acbb450c62992a1db09a6c19c05" , "TOSHIBA_J2K_OpenJPEGv2Regression.dcm" },
{"fa02ad71bdf3e6970e18fc9a9df03a2d" , "TOSHIBA_J2K_SIZ0_PixRep1.dcm" },
{"3475cb96e0308cb84502be1c1531b588" , "NM-PAL-16-PixRep1.dcm" },
{"2ec6d7c60d6786665cff2b7a31aaeedf" , "MEDILABInvalidCP246_EVRLESQasUN.dcm" },
{"560881eca73809ac358aa14733ee64af" , "JPEGInvalidSecondFrag.dcm" },
{"7c70c2aaacf9a4206cbe2191fa4d2041" , "SC16BitsAllocated_8BitsStoredJ2K.dcm" },
{"da0922a02f8e763ec878089617e0bc4c" , "SC16BitsAllocated_8BitsStoredJPEG.dcm" },
{"da0922a02f8e763ec878089617e0bc4c" , "Osirix10vs8BitsStored.dcm" },
{"da0922a02f8e763ec878089617e0bc4c" , "Bug_Siemens_PrivateIconNoItem.dcm" },
{"da0922a02f8e763ec878089617e0bc4c" , "HardcopyColor_YBR_RCT_J2K_PC1.dcm" },
{"da0922a02f8e763ec878089617e0bc4c" , "PET-GE-dicomwrite-PixelDataSQUNv2.dcm" },
// sentinel
{ 0, 0 }
};
namespace gdcm
{
int TestIconImageGenerate4(const char *subdir, const char* filename, bool verbose = false)
{
ImageReader reader;
reader.SetFileName( filename );
if ( !reader.Read() )
{
const FileMetaInformation &header = reader.GetFile().GetHeader();
MediaStorage ms = header.GetMediaStorage();
bool isImage = MediaStorage::IsImage( ms );
bool pixeldata = reader.GetFile().GetDataSet().FindDataElement( Tag(0x7fe0,0x0010) );
if( isImage && pixeldata )
{
std::cerr << "Failed to read: " << filename << std::endl;
return 1;
}
else
{
// not an image give up...
std::cerr << "Problem with: " << filename << " but that's ok" << std::endl;
return 0;
}
}
// Create directory first:
std::string tmpdir = Testing::GetTempDirectory( subdir );
if( !System::FileIsDirectory( tmpdir.c_str() ) )
{
System::MakeDirectory( tmpdir.c_str() );
//return 1;
}
std::string outfilename = Testing::GetTempFilename( filename, subdir );
IconImageGenerator iig;
iig.SetPixmap( reader.GetImage() );
iig.AutoPixelMinMax(true);
gdcm::StringFilter sf;
sf.SetFile( reader.GetFile() );
/*
const DataSet & ds = reader.GetFile().GetDataSet();
if( ds.FindDataElement( gdcm::Tag(0x0028,0x0120) ) && !ds.GetDataElement(gdcm::Tag(0x0028,0x0120)).IsEmpty() )
{
// gdcm::Attribute<0x28,0x120> at;
iig.SetOutsideValuePixel( -2000 );
}
*/
std::string strval = sf.ToString(gdcm::Tag(0x0028,0x0120));
double val;
std::istringstream is;
is.str( strval );
if( is >> val )
{
iig.SetOutsideValuePixel( val );
assert( !strval.empty() );
}
const unsigned int idims[2] = { 64, 64 };
//const unsigned int idims[2] = { 600,430 };
iig.SetOutputDimensions( idims );
bool b = iig.Generate();
gdcm::Filename fn( filename );
const char *name = fn.GetName();
unsigned int i = 0;
const char *p = iconimagearray4[i][1];
while( p != 0 )
{
if( strcmp( name, p ) == 0 )
{
break;
}
++i;
p = iconimagearray4[i][1];
}
const char *refmd5 = iconimagearray4[i][0];
if( b )
{
const gdcm::IconImage &icon = iig.GetIconImage();
if( verbose ) icon.Print( std::cout );
unsigned long len = icon.GetBufferLength();
std::vector< char > vbuffer;
vbuffer.resize( len );
char *buffer = &vbuffer[0];
bool res2 = icon.GetBuffer(buffer);
if( !res2 )
{
std::cerr << "res2 failure:" << filename << std::endl;
return 1;
}
char digest[33];
gdcm::Testing::ComputeMD5(buffer, len, digest);
Image & img = reader.GetImage();
img.SetIconImage( iig.GetIconImage() );
ImageWriter writer;
writer.SetFileName( outfilename.c_str() );
#if 1
writer.SetImage( img );
#else
Image &ii = writer.GetImage();
(Bitmap&)ii = iig.GetIconImage();
#endif
if( !writer.Write() )
{
std::cerr << "Failed to write: " << outfilename << std::endl;
return 1;
}
if( verbose )
{
std::cout << "success: " << outfilename << std::endl;
std::cout << "ref=" << refmd5 << std::endl;
std::cout << "md5=" << digest << std::endl;
}
if( !refmd5 )
{
std::cerr << " missing md5= {\"" << digest << "\" , \"" << name << "\" }," << std::endl;
return 1;
}
if( strcmp( refmd5, digest) )
{
std::cerr << "Problem with : " << name << " " << refmd5 << " vs " << digest << std::endl;
return 1;
}
}
else
{
assert( refmd5 == 0 );
std::cerr << "Could not generate Icon for: " << filename << std::endl;
return 1;
}
return 0;
}
}
int TestIconImageGenerator4(int argc, char *argv[])
{
if( argc == 2 )
{
const char *filename = argv[1];
return gdcm::TestIconImageGenerate4(argv[0],filename, true);
}
// else
gdcm::Trace::DebugOff();
gdcm::Trace::WarningOff();
gdcm::Trace::ErrorOff();
int r = 0, i = 0;
const char *filename;
const char * const *filenames = gdcm::Testing::GetFileNames();
while( (filename = filenames[i]) )
{
r += gdcm::TestIconImageGenerate4(argv[0], filename );
++i;
}
return r;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestTagPath.cxx 000664 001766 001770 00000002675 14517730450 030362 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmTagPath.h"
#include "gdcmTag.h"
int TestTagPath(int argc, char *argv[])
{
(void)argc;
(void)argv;
gdcm::TagPath tp;
const char path[] = "/0010,0010";
if( !gdcm::TagPath::IsValid( path ) )
{
return 1;
}
if( !tp.ConstructFromString( path ) )
{
return 1;
}
tp.Print( std::cout );
const char path2[] = "/0010,0011/*/1234,5678";
if( !gdcm::TagPath::IsValid( path2 ) )
{
return 1;
}
if( !tp.ConstructFromString( path2 ) )
{
return 1;
}
std::cout << "FromString:" << std::endl;
tp.Print( std::cout );
const unsigned int n = 10;
gdcm::Tag list[n];
for(unsigned i = 0; i < n; ++i)
{
list[i].SetGroup( 0x1234 );
list[i].SetElement( (uint16_t)i );
}
if( !tp.ConstructFromTagList( list, n ) )
{
return 1;
}
std::cout << "TagList:" << std::endl;
tp.Print( std::cout );
return 0;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestDPath.cxx 000664 001766 001770 00000005602 14517730450 030023 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmDPath.h"
int TestDPath(int, char *[]) {
gdcm::DPath tp;
#if 0
{
const char path[] = "10,10";
if (!gdcm::DPath::IsValid(path)) {
return 1;
}
if (!tp.ConstructFromString(path)) {
return 1;
}
tp.Print(std::cout);
std::cout << std::endl;
}
#endif
{
const char path[] = "/0010,0010";
if (!gdcm::DPath::IsValid(path)) {
return 1;
}
if (!tp.ConstructFromString(path)) {
return 1;
}
tp.Print(std::cout);
std::cout << std::endl;
}
{
const char path[] = "/0008,1120/*/0008,1155";
if (!gdcm::DPath::IsValid(path)) {
return 1;
}
if (!tp.ConstructFromString(path)) {
return 1;
}
tp.Print(std::cout);
std::cout << std::endl;
}
// contains a '/' in creator
{
const char path[] = "\\19,0,Siemens: Thorax/Multix FD Lab Settings";
if (!gdcm::DPath::IsValid(path)) {
return 1;
}
if (!tp.ConstructFromString(path)) {
return 1;
}
tp.Print(std::cout);
std::cout << std::endl;
}
{
const char path[] = "\\019,0,PHILIPS MR R5.6/PART";
if (!gdcm::DPath::IsValid(path)) {
return 1;
}
if (!tp.ConstructFromString(path)) {
return 1;
}
tp.Print(std::cout);
std::cout << std::endl;
}
{
const char path[] = "\\4109,2,Applicare/Centricity Radiology Web/Version 1.0";
if (!gdcm::DPath::IsValid(path)) {
return 1;
}
if (!tp.ConstructFromString(path)) {
return 1;
}
tp.Print(std::cout);
std::cout << std::endl;
}
// contains a ',' in creator
{
const char path[] = "/4453,1000,DR Systems, Inc.";
if (!gdcm::DPath::IsValid(path)) {
return 1;
}
if (!tp.ConstructFromString(path)) {
return 1;
}
tp.Print(std::cout);
std::cout << std::endl;
}
// wildcard '*' in item
{
const char path[] = "/29,2,SIEMENS SYNGO ADVANCED PRESENTATION/*/70,84";
if (!gdcm::DPath::IsValid(path)) {
return 1;
}
if (!tp.ConstructFromString(path)) {
return 1;
}
tp.Print(std::cout);
std::cout << std::endl;
}
// indexed:
{
const char path[] = "/40,100/1/40,6";
if (!gdcm::DPath::IsValid(path)) {
return 1;
}
if (!tp.ConstructFromString(path)) {
return 1;
}
tp.Print(std::cout);
std::cout << std::endl;
}
return 0;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageFragmentSplitter.cxx 000664 001766 001770 00000010077 14517730450 033262 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmImageFragmentSplitter.h"
#include "gdcmTesting.h"
#include "gdcmSystem.h"
#include "gdcmImageReader.h"
#include "gdcmImageWriter.h"
#include "gdcmTransferSyntax.h"
#include "gdcmImage.h"
#include "gdcmFilename.h"
int TestImageFragmentSplitterFunc(const char *filename, bool verbose = false)
{
gdcm::ImageReader reader;
reader.SetFileName( filename );
if ( !reader.Read() )
{
const gdcm::FileMetaInformation &header = reader.GetFile().GetHeader();
gdcm::MediaStorage ms = header.GetMediaStorage();
bool isImage = gdcm::MediaStorage::IsImage( ms );
if( isImage )
{
if( reader.GetFile().GetDataSet().FindDataElement( gdcm::Tag(0x7fe0,0x0010) ) )
{
std::cerr << "Could not read: " << filename << std::endl;
return 1;
}
}
return 0;
}
const gdcm::Image &image = reader.GetImage();
const unsigned int *dims = image.GetDimensions();
if( dims[2] != 1 )
{
return 0; // nothing to do
}
const gdcm::File &file = reader.GetFile();
const gdcm::FileMetaInformation &header = file.GetHeader();
//gdcm::MediaStorage ms = header.GetMediaStorage();
if( header.GetDataSetTransferSyntax() == gdcm::TransferSyntax::ImplicitVRLittleEndian
|| header.GetDataSetTransferSyntax() == gdcm::TransferSyntax::ImplicitVRBigEndianPrivateGE
|| header.GetDataSetTransferSyntax() == gdcm::TransferSyntax::ExplicitVRLittleEndian
|| header.GetDataSetTransferSyntax() == gdcm::TransferSyntax::DeflatedExplicitVRLittleEndian
|| header.GetDataSetTransferSyntax() == gdcm::TransferSyntax::ExplicitVRBigEndian
)
{
return 0; // nothing to do
}
gdcm::ImageFragmentSplitter splitter;
splitter.SetInput( image );
splitter.SetFragmentSizeMax( 65536 );
bool b = splitter.Split();
if( !b )
{
const gdcm::DataElement &pixeldata = file.GetDataSet().GetDataElement( gdcm::Tag(0x7fe0,0x0010) );
const gdcm::SequenceOfFragments* sqf = pixeldata.GetSequenceOfFragments();
if( sqf && dims[2] == 1 )
{
return 0;
}
gdcm::Filename fn( filename );
if( fn.GetName() == std::string("JPEGDefinedLengthSequenceOfFragments.dcm" ) )
{
// JPEG Fragments are packed in a VR:OB Attribute
return 0;
}
std::cerr << "Could not apply splitter: " << filename << std::endl;
return 1;
}
// Create directory first:
const char subdir[] = "TestImageFragmentSplitter";
std::string tmpdir = gdcm::Testing::GetTempDirectory( subdir );
if( !gdcm::System::FileIsDirectory( tmpdir.c_str() ) )
{
gdcm::System::MakeDirectory( tmpdir.c_str() );
//return 1;
}
std::string outfilename = gdcm::Testing::GetTempFilename( filename, subdir );
gdcm::ImageWriter writer;
writer.SetFileName( outfilename.c_str() );
//writer.SetFile( reader.GetFile() ); // increase test goal
writer.SetImage( splitter.GetOutput() );
if( !writer.Write() )
{
std::cerr << "Failed to write: " << outfilename << std::endl;
return 1;
}
if( verbose )
std::cout << "Success to write: " << outfilename << std::endl;
return 0;
}
int TestImageFragmentSplitter(int argc, char *argv[])
{
if( argc == 2 )
{
const char *filename = argv[1];
return TestImageFragmentSplitterFunc(filename, true);
}
// else
gdcm::Trace::DebugOff();
gdcm::Trace::WarningOff();
int r = 0, i = 0;
const char *filename;
const char * const *filenames = gdcm::Testing::GetFileNames();
while( (filename = filenames[i]) )
{
r += TestImageFragmentSplitterFunc( filename );
++i;
}
return r;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestSegmentedPaletteColorLookupTable.cxx 000664 001766 001770 00000001333 14517730450 035413 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmSegmentedPaletteColorLookupTable.h"
int TestSegmentedPaletteColorLookupTable(int, char *[])
{
gdcm::SegmentedPaletteColorLookupTable o;
return 0;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestDICOMDIRGenerator1.cxx 000664 001766 001770 00000005460 14517730450 032147 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmDICOMDIRGenerator.h"
#include "gdcmDirectory.h"
#include "gdcmWriter.h"
#include "gdcmTesting.h"
#include "gdcmSystem.h"
#include "gdcmFilenameGenerator.h"
int TestDICOMDIRGenerator1(int argc, char *argv[])
{
(void)argc;
(void)argv;
gdcm::Directory::FilenamesType filenames;
gdcm::Directory::FilenamesType outfilenames;
const char outsubdir[] = "TestDICOMDIRGenerator1";
std::string outtmpdir = gdcm::Testing::GetTempDirectory( outsubdir );
if( !gdcm::System::FileIsDirectory( outtmpdir.c_str() ) )
{
gdcm::System::MakeDirectory( outtmpdir.c_str() );
}
const char subdir[] = "TestImageChangeTransferSyntax4";
std::string directory = gdcm::Testing::GetTempDirectory( subdir );
std::string file0 = std::string(directory) + "/SIEMENS_MAGNETOM-12-MONO2-FileSeq0.dcm";
std::string file1 = std::string(directory) + "/SIEMENS_MAGNETOM-12-MONO2-FileSeq1.dcm";
std::string file2 = std::string(directory) + "/SIEMENS_MAGNETOM-12-MONO2-FileSeq2.dcm";
std::string file3 = std::string(directory) + "/SIEMENS_MAGNETOM-12-MONO2-FileSeq3.dcm";
filenames.push_back( file1 );
filenames.push_back( file3 );
filenames.push_back( file2 );
filenames.push_back( file0 );
size_t nfiles = filenames.size();
gdcm::FilenameGenerator fg;
const char pattern[] = "FILE%03d";
fg.SetPattern( pattern );
fg.SetNumberOfFilenames( nfiles );
if( !fg.Generate() )
{
std::cerr << "Could not generate" << std::endl;
return 1;
}
for( unsigned int i = 0; i < nfiles; ++i )
{
std::string copy = outtmpdir;
copy += "/";
copy += fg.GetFilename( i );
std::cerr << filenames[i] << " -> " << copy << std::endl;
std::ifstream f1(filenames[i].c_str(), std::fstream::binary);
std::ofstream f2(copy.c_str(), std::fstream::binary);
f2 << f1.rdbuf();
outfilenames.push_back( copy );
}
gdcm::DICOMDIRGenerator gen;
gen.SetFilenames( outfilenames );
gen.SetRootDirectory( outtmpdir );
gen.SetDescriptor( "MYDESCRIPTOR" );
if( !gen.Generate() )
{
return 1;
}
gdcm::Writer writer;
writer.SetFile( gen.GetFile() );
std::string outfilename = outtmpdir;
outfilename += "/DICOMDIR";
writer.SetFileName( outfilename.c_str() );
if( !writer.Write() )
{
return 1;
}
return 0;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestPhotometricInterpretation.cxx 000664 001766 001770 00000006372 14517730450 034255 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmPhotometricInterpretation.h"
#include // strlen
int TestPhotometricInterpretation(int, char *[])
{
gdcm::PhotometricInterpretation pi;
int end = gdcm::PhotometricInterpretation::PI_END;
for( int i = 1; i < end; ++i)
{
const char *pistr = gdcm::PhotometricInterpretation::GetPIString( (gdcm::PhotometricInterpretation::PIType)i );
if( strlen( pistr ) % 2 )
{
std::cerr << pistr << std::endl;
return 1;
}
}
pi = gdcm::PhotometricInterpretation::RGB;
pi = gdcm::PhotometricInterpretation::GetPIType( "MONOCHROME2" );
if( pi != gdcm::PhotometricInterpretation::MONOCHROME2 )
{
std::cerr << "PhotometricInterpretation: " << pi << std::endl;
return 1;
}
pi = gdcm::PhotometricInterpretation::GetPIType( "MONOCHROME2 " );
if( pi != gdcm::PhotometricInterpretation::MONOCHROME2 )
{
std::cerr << "PhotometricInterpretation: " << pi << std::endl;
return 1;
}
pi = gdcm::PhotometricInterpretation::GetPIType( " MONOCHROME2 " );
if( pi != gdcm::PhotometricInterpretation::MONOCHROME2 )
{
std::cerr << "PhotometricInterpretation: " << pi << std::endl;
return 1;
}
pi = gdcm::PhotometricInterpretation::GetPIType( " MONOCHROME2 " );
if( pi != gdcm::PhotometricInterpretation::MONOCHROME2 )
{
std::cerr << "PhotometricInterpretation: " << pi << std::endl;
return 1;
}
pi = gdcm::PhotometricInterpretation::GetPIType( " MONOCHROME2 " );
if( pi != gdcm::PhotometricInterpretation::MONOCHROME2 )
{
std::cerr << "PhotometricInterpretation: " << pi << std::endl;
return 1;
}
pi = gdcm::PhotometricInterpretation::GetPIType( "MONOCHROME" );
if( pi != gdcm::PhotometricInterpretation::MONOCHROME1 )
{
std::cerr << "PhotometricInterpretation: " << pi << std::endl;
return 1;
}
pi = gdcm::PhotometricInterpretation::GetPIType( "YBR_PARTIAL_42 " );
if( pi != gdcm::PhotometricInterpretation::YBR_PARTIAL_422)
{
std::cerr << "PhotometricInterpretation: " << pi << std::endl;
return 1;
}
pi = gdcm::PhotometricInterpretation::GetPIType( "PALETTE" );
if( pi != gdcm::PhotometricInterpretation::PALETTE_COLOR )
{
std::cerr << "PhotometricInterpretation: " << pi << std::endl;
return 1;
}
pi = gdcm::PhotometricInterpretation::GetPIType( "YBR_FULL_4" );
if( pi != gdcm::PhotometricInterpretation::YBR_FULL_422)
{
std::cerr << "PhotometricInterpretation: " << pi << std::endl;
return 1;
}
// FIXME ?
pi = gdcm::PhotometricInterpretation::GetPIType( "YBR_FUL" );
if( pi != gdcm::PhotometricInterpretation::YBR_FULL )
{
std::cerr << "PhotometricInterpretation: " << pi << std::endl;
return 1;
}
return 0;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestOverlay.cxx 000664 001766 001770 00000001250 14517730450 030437 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmOverlay.h"
int TestOverlay(int, char *[])
{
gdcm::Overlay o;
o.Print( std::cout );
return 0;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestWriter2.cxx 000664 001766 001770 00000002035 14517730450 030356 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
int TestWriter2(int argc, char *argv[])
{
const char *filename = argv[1];
const char *outfilename = argv[2];
Reader reader;
reader.SetFileName( filename );
if ( !reader.Read() )
{
std::cerr << "Failed to read: " << filename << std::endl;
return 1;
}
Writer writer;
writer.SetFileName( outfilename );
writer.SetFile( reader.GetFile() );
if( !writer.Write() )
{
std::cerr << "Failed to write: " << outfilename << std::endl;
return 1;
}
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestFileChangeTransferSyntax4.cxx 000664 001766 001770 00000016142 14517730450 034011 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmFileChangeTransferSyntax.h"
#include "gdcmTesting.h"
#include "gdcmSystem.h"
#include "gdcmReader.h"
#include "gdcmImageReader.h"
#include "gdcmFilename.h"
#include "gdcmImageChangePlanarConfiguration.h"
#include "gdcmByteSwap.h"
static int TestFileChangeTransferSyntax4Func(const char *filename, bool verbose = false)
{
using namespace gdcm;
if( verbose )
std::cout << "Processing: " << filename << std::endl;
// Create directory first:
const char subdir[] = "TestFileChangeTransferSyntax4";
std::string tmpdir = Testing::GetTempDirectory( subdir );
if( !System::FileIsDirectory( tmpdir.c_str() ) )
{
System::MakeDirectory( tmpdir.c_str() );
//return 1;
}
std::string outfilename = Testing::GetTempFilename( filename, subdir );
if( verbose )
std::cout << "Generating: " << outfilename << std::endl;
const gdcm::TransferSyntax ts( TransferSyntax::RLELossless );
gdcm::FileChangeTransferSyntax fcts;
fcts.SetTransferSyntax( ts );
fcts.SetInputFileName( filename );
fcts.SetOutputFileName( outfilename.c_str() );
ImageCodec *ic = fcts.GetCodec();
if( !ic )
{
return 1;
}
if( !fcts.Change() )
{
gdcm::Reader reader;
reader.SetFileName( filename );
if( !reader.Read() )
{
std::cerr << "not dicom" << std::endl;
return 1;
}
const gdcm::File & file = reader.GetFile();
const gdcm::FileMetaInformation & fmi = file.GetHeader();
const TransferSyntax &tsref = fmi.GetDataSetTransferSyntax();
if( tsref.IsEncapsulated() )
{
if( verbose )
std::cout << "Will not generate (encaps): " << outfilename << std::endl;
return 0;
}
gdcm::Filename fn( filename );
const char *name = fn.GetName();
// Special handling:
if( strcmp(name, "CT-MONO2-12-lomb-an2.acr" ) == 0
|| strcmp(name, "LIBIDO-8-ACR_NEMA-Lena_128_128.acr") == 0
|| strcmp(name, "gdcm-ACR-LibIDO.acr") == 0
|| strcmp(name, "gdcm-MR-SIEMENS-16-2.acr") == 0
|| strcmp(name, "libido1.0-vol.acr") == 0
|| strcmp(name, "test.acr") == 0
|| strcmp(name, "LIBIDO-24-ACR_NEMA-Rectangle.dcm") == 0
|| strcmp(name, "MR_Spectroscopy_SIEMENS_OF.dcm") == 0 // not an image
|| strcmp(name, "ELSCINT1_PMSCT_RLE1.dcm") == 0
|| strcmp(name, "ELSCINT1_PMSCT_RLE1_priv.dcm") == 0
|| strcmp(name, "gdcm-CR-DCMTK-16-NonSamplePerPix.dcm") == 0
|| strcmp(name, "SIEMENS_MAGNETOM-12-ACR_NEMA_2-Modern.dcm") == 0
|| strcmp(name, "PrivateGEImplicitVRBigEndianTransferSyntax16Bits.dcm") == 0 // Implicit VR Big Endian DLX (G.E Private)
|| strcmp(name, "MR_GE_with_Private_Compressed_Icon_0009_1110.dcm") == 0 // Explicit VR Big Endian
|| strcmp(name, "US-RGB-8-epicard.dcm") == 0 // Explicit VR Big Endian
|| strcmp(name, "GE_DLX-8-MONO2-PrivateSyntax.dcm") == 0 // Implicit VR Big Endian DLX (G.E Private)
|| strcmp(name, "GE_CT_With_Private_compressed-icon.dcm") == 0 // Explicit VR Big Endian
|| strcmp(name, "JDDICOM_Sample2-dcmdjpeg.dcm") == 0 // cannot recreate FMI
|| strcmp(name, "DMCPACS_ExplicitImplicit_BogusIOP.dcm") == 0 // ImageRegionReader does not handle it
|| strcmp(name, "unreadable.dcm") == 0 // No Pixel Data (old ACR-NEMA)
|| strcmp(name, "US-YBR_FULL_422-EVRLE.dcm") == 0 // packed ybr422
|| strncmp(name, "DICOMDIR", 8) == 0 // DICOMDIR*
|| strncmp(name, "dicomdir", 8) == 0 // dicomdir*
)
{
if( verbose )
std::cout << "Will not generate: " << outfilename << std::endl;
return 0;
}
std::cerr << "Could not change: " << filename << std::endl;
return 1;
}
// Let's read that file back in !
gdcm::ImageReader reader2;
reader2.SetFileName( outfilename.c_str() );
if ( !reader2.Read() )
{
std::cerr << "Could not even reread our generated file : " << outfilename << std::endl;
return 1;
}
// Check that after decompression we still find the same thing:
int res = 0;
gdcm::Image img = reader2.GetImage();
int pc = 0;
// When recompressing: US-RGB-8-epicard.dcm, make sure to compute the md5 using the
// same original Planar Configuration...
if( (int)img.GetPlanarConfiguration() != pc )
{
gdcm::ImageChangePlanarConfiguration icpc;
icpc.SetInput( reader2.GetImage() );
icpc.SetPlanarConfiguration( pc );
icpc.Change();
img = icpc.GetOutput();
}
//std::cerr << "Success to read image from file: " << filename << std::endl;
unsigned long len = img.GetBufferLength();
char* buffer = new char[len];
bool res2 = img.GetBuffer(buffer);
if( !res2 )
{
std::cerr << "could not get buffer: " << outfilename << std::endl;
return 1;
}
// On big Endian system we have byteswapped the buffer (duh!)
// Since the md5sum is byte based there is now way it would detect
// that the file is written in big endian word, so comparing against
// a md5sum computed on LittleEndian would fail. Thus we need to
// byteswap (again!) here:
#ifdef GDCM_WORDS_BIGENDIAN
if( img.GetPixelFormat().GetBitsAllocated() == 16 )
{
assert( !(len % 2) );
assert( img.GetPhotometricInterpretation() == gdcm::PhotometricInterpretation::MONOCHROME1
|| img.GetPhotometricInterpretation() == gdcm::PhotometricInterpretation::MONOCHROME2 );
gdcm::ByteSwap::SwapRangeFromSwapCodeIntoSystem(
(unsigned short*)buffer, gdcm::SwapCode::LittleEndian, len/2);
}
#endif
const char *ref = gdcm::Testing::GetMD5FromFile(filename);
char digest[33];
gdcm::Testing::ComputeMD5(buffer, len, digest);
if( !ref )
{
// new regression image needs a md5 sum
std::cerr << "Missing md5 " << digest << " for: " << filename << std::endl;
//assert(0);
res = 1;
}
else if( strcmp(digest, ref) != 0 )
{
std::cerr << "Problem reading image from: " << filename << std::endl;
std::cerr << "Found " << digest << " instead of " << ref << std::endl;
res = 1;
}
if(res)
{
std::cerr << "problem with: " << outfilename << std::endl;
}
if( verbose )
{
std::cout << "file was written in: " << outfilename << std::endl;
}
delete[] buffer;
return res;
}
int TestFileChangeTransferSyntax4(int argc, char *argv[])
{
if( argc == 2 )
{
const char *filename = argv[1];
return TestFileChangeTransferSyntax4Func(filename, true);
}
// else
gdcm::Trace::DebugOff();
gdcm::Trace::WarningOff();
gdcm::Trace::ErrorOff();
int r = 0, i = 0;
const char *filename;
const char * const *filenames = gdcm::Testing::GetFileNames();
while( (filename = filenames[i]) )
{
r += TestFileChangeTransferSyntax4Func( filename );
++i;
}
return r;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestIconImageFilter.cxx 000664 001766 001770 00000011403 14517730450 032020 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmIconImageFilter.h"
#include "gdcmTesting.h"
#include "gdcmFilename.h"
#include "gdcmSystem.h"
#include "gdcmImageReader.h"
#include "gdcmImageWriter.h"
#include "gdcmImage.h"
static const char * const iconimagearray[][2] = {
{ "b818c90fc4135423dfc118c3305d23ef" , "MR_GE_with_Private_Compressed_Icon_0009_1110.dcm" },
{ "57e43cf467d9bc4c4a43e0a97329075d" , "SIEMENS_CSA2.dcm" },
{ "fc5db4e2e7fca8445342b83799ff16d8" , "simpleImageWithIcon.dcm" },
{ "93c1b9e4c97cf5ff3501f3d8114c3b89" , "05115014-mr-siemens-avanto-syngo-with-palette-icone.dcm" },
{ "07950df5d3662740874e93d2c41dec18" , "MR-SIEMENS-DICOM-WithOverlays.dcm" },
{ "e1305d5341e8ced04caff40c706c23b0" , "AMIInvalidPrivateDefinedLengthSQasUN.dcm" },
{ "5f76af83e7b99cab45a70248824c2145" , "PICKER-16-MONO2-Nested_icon.dcm" },
{ "59d8479e0025d8bbb3244551d6535890" , "MR_ELSCINT1_00e1_1042_SQ_feff_00e0_Item.dcm" },
{ "9ad43e72601a228c4a3d021f08a09b69" , "CT-SIEMENS-Icone-With-PaletteColor.dcm" },
{ "a9c3c78082a46e2226a4b1ff499ccd74" , "PrivateGEImplicitVRBigEndianTransferSyntax16Bits.dcm" },
{ "50387cdd945b22ccbb5d1824e955deeb" , "05148044-mr-siemens-avanto-syngo.dcm" },
{ "e42ea2852be5d20f95083991728d8623" , "GE_LOGIQBook-8-RGB-HugePreview.dcm" },
{ "c38df20a8514714f5d5af1699a841c60" , "GE_CT_With_Private_compressed-icon.dcm" },
{ "61b2bf04c18a0f67b7e720e07804dcdd" , "KODAK_CompressedIcon.dcm" },
{ "620f0b67a91f7f74151bc5be745b7110" , "MR-SIEMENS-DICOM-WithOverlays-extracted-overlays.dcm" },
{ "938f6ea0bea13ff5c45c7934e603caac" , "US-GE-4AICL142.dcm" },
{ "9c145bbfd00e867d5f9f6efe9651a71e" , "SIEMENS_SYNGO-12-MONO2-LUTWrongLength512.dcm" },
{ "48bf71ea2e18b0632ec318d55fb455ab" , "Bug_Siemens_PrivateIconNoItem.dcm" },
{ "a29e9def9a1478c9f8b957c68b33885b" , "PET-GE-dicomwrite-PixelDataSQUNv2.dcm" },
// VEPRO VIF
{ "ea4673b2aa72f477188bac340e115f4c" , "PHILIPS_Gyroscan-12-MONO2-Jpeg_Lossless.dcm" },
{ "660417e04b9af62832a43bf82369e4fa" , "GE_DLX-8-MONO2-Multiframe-Jpeg_Lossless.dcm" },
// gdcmDataExtra
{ "a144b851c9262c97dde567d4d3781733" , "2929J888_8b_YBR_RLE_PlanConf0_breaker.dcm" },
// sentinel
{ nullptr, nullptr }
};
int TestIconImageFilterFunc(const char *filename, bool verbose = false)
{
gdcm::ImageReader reader;
reader.SetFileName( filename );
if ( !reader.Read() )
{
return 0;
}
gdcm::IconImageFilter iif;
iif.SetFile( reader.GetFile() );
bool b = iif.Extract();
gdcm::Filename fn( filename );
const char *name = fn.GetName();
unsigned int i = 0;
const char *p = iconimagearray[i][1];
while( p != nullptr )
{
if( strcmp( name, p ) == 0 )
{
break;
}
++i;
p = iconimagearray[i][1];
}
const char *refmd5 = iconimagearray[i][0];
if( b )
{
if( iif.GetNumberOfIconImages() != 1 ) return 1;
const gdcm::IconImage &icon = iif.GetIconImage(0);
if( verbose ) icon.Print( std::cout );
unsigned long len = icon.GetBufferLength();
std::vector< char > vbuffer;
vbuffer.resize( len );
char *buffer = vbuffer.data();
bool res2 = icon.GetBuffer(buffer);
if( !res2 )
{
std::cerr << "res2 failure:" << filename << std::endl;
return 1;
}
char digest[33];
gdcm::Testing::ComputeMD5(buffer, len, digest);
if( verbose )
{
std::cout << "ref=" << refmd5 << std::endl;
std::cout << "md5=" << digest << std::endl;
}
if( !refmd5 )
{
std::cerr << "Problem with : " << name << " missing md5= " << digest << std::endl;
return 1;
}
if( strcmp( refmd5, digest) != 0 )
{
std::cerr << "Problem with : " << name << " " << refmd5 << " vs " << digest << std::endl;
return 1;
}
}
else
{
assert( refmd5 == nullptr );
}
return 0;
}
int TestIconImageFilter(int argc, char *argv[])
{
if( argc == 2 )
{
const char *filename = argv[1];
return TestIconImageFilterFunc(filename, true);
}
// else
gdcm::Trace::DebugOff();
gdcm::Trace::WarningOff();
gdcm::Trace::ErrorOff();
int r = 0, i = 0;
const char *filename;
const char * const *filenames = gdcm::Testing::GetFileNames();
while( (filename = filenames[i]) )
{
r += TestIconImageFilterFunc( filename );
++i;
}
return r;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestPrinter1.cxx 000664 001766 001770 00000050307 14517730450 030531 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmReader.h"
#include "gdcmPrinter.h"
#include "gdcmFilename.h"
#include "gdcmTesting.h"
// How to update this file:
// $ while IFS=\; read -r col1 col2 col3; do echo "-e 's/$col2/$col3/g'"; done < /tmp/full > /tmp/s
// the following list has been generated using gdcm, git: df760b9d8b3c9b280ad423153c649190f6e21204
// This correspond to the commit just before:
// BUG: an explicit length VR=SQ dataelement would not have been loaded as
// expected and a call to GetSequenceOfItems would fails. Thus downstream filter
// would fail load the SQ as expected. Introducing the more robust interface:
// GetValueAsSQ to solve that issue.
static const char * const printmd5[][2] = {
{ "a19bffac370df32acbf6b4991d1cbafe" , "00191113.dcm" } ,
{ "94816f96c7db33e8449cc4f2e0843ff8" , "012345.002.050.dcm" } ,
{ "94f8c6ab090bdc11e61625bfc2dd39b7" , "05115014-mr-siemens-avanto-syngo-with-palette-icone.dcm" } ,
{ "20c11831c616eb121a405cd73de5cba2" , "05148044-mr-siemens-avanto-syngo.dcm" } ,
{ "ec10dcbf1b13ace8a6c0cc5b24c6c870" , "3E768EB7.dcm" } ,
{ "fde1da68a1707dcc687ddffd57e6b3c3" , "ACUSON-24-YBR_FULL-RLE-b.dcm" } ,
{ "a27c6628d6379783a3be223481d5cba4" , "ACUSON-24-YBR_FULL-RLE.dcm" } ,
{ "9f3aa114b955a812942f815b6b456eaf" , "ALOKA_SSD-8-MONO2-RLE-SQ.dcm" } ,
{ "0f44d8305020f5fb854563eb4335e207" , "AMIInvalidPrivateDefinedLengthSQasUN.dcm" } ,
{ "56aea0ecd59a5b9427dbd60523eeb2c1" , "BugGDCM2_UndefItemWrongVL.dcm" } ,
{ "6d2af85d2af299c223b684538d42d9e5" , "CR-MONO1-10-chest.dcm" } ,
{ "820d45cefd528e011921ea129bec9084" , "CT_16b_signed-UsedBits13.dcm" } ,
{ "fcf2ca019aa3138188edb18552983733" , "CT-MONO2-12-lomb-an2.acr" } ,
{ "0e4137f63819c706dfa370405d662c79" , "CT-MONO2-16-ankle.dcm" } ,
{ "f00a663066627e7ecdd1a7379137d396" , "CT-MONO2-16-brain.dcm" } ,
{ "87eadd3a3460c13593c9468bc533aa58" , "CT-MONO2-16-chest.dcm" } ,
{ "8b0efbe7cfd72a7d14cef44683fbacab" , "CT-MONO2-16-ort.dcm" } ,
{ "32c8e40e0726bbcc374f20771d37a312" , "CT-MONO2-8-abdo.dcm" } ,
{ "c5ffd15172c43b200e3654d5e3e45f3e" , "CT-SIEMENS-Icone-With-PaletteColor.dcm" } ,
{ "ca0e93a8995fccad9d031e0125ea1a29" , "CT-SIEMENS-MissingPixelDataInIconSQ.dcm" } ,
{ "a46ca467a0df5e1c71c8017b6b6768e7" , "D_CLUNIE_CT1_J2KI.dcm" } ,
{ "d2698545b07ad721faa71fdc1cf4a35d" , "D_CLUNIE_CT1_J2KR.dcm" } ,
{ "78f619a764a94a2c2bdc084d53ad2577" , "D_CLUNIE_CT1_JPLL.dcm" } ,
{ "4aaa4a602d7a1fd80c023acba36d6a84" , "D_CLUNIE_CT1_RLE.dcm" } ,
{ "9ee24f3a3291cd86f0bc78fddc3417e7" , "D_CLUNIE_CT2_JPLL.dcm" } ,
{ "b01b2b28aa3caa945b05865a9c440349" , "D_CLUNIE_CT2_RLE.dcm" } ,
{ "7d6531dc92c53ad25835b75fa5505b66" , "D_CLUNIE_MR1_JPLL.dcm" } ,
{ "e8a970a1c861192331a98162146ee0f9" , "D_CLUNIE_MR1_JPLY.dcm" } ,
{ "6f8b7b128c86c5a670a284e7eac38391" , "D_CLUNIE_MR1_RLE.dcm" } ,
{ "b770b1ca257d7c1c885f69a5a1b58808" , "D_CLUNIE_MR2_JPLL.dcm" } ,
{ "da74aefef4e8ac49dbe1a4dd3b1dcb26" , "D_CLUNIE_MR2_JPLY.dcm" } ,
{ "023eb2a9ecbfd3c04bb148ec339865f0" , "D_CLUNIE_MR2_RLE.dcm" } ,
{ "fbeaa26ab8c0ce7abcae5c24532cab0c" , "D_CLUNIE_MR3_JPLL.dcm" } ,
{ "d2b228b64ef53df5b8fb07c227e4250a" , "D_CLUNIE_MR3_JPLY.dcm" } ,
{ "ef7b70b4f87f540f7c2fe954c5988d82" , "D_CLUNIE_MR3_RLE.dcm" } ,
{ "1646ec013060ef3f261849db705f80f3" , "D_CLUNIE_MR4_JPLL.dcm" } ,
{ "fbbfe4caab2179641bd0de5d8ccf79ae" , "D_CLUNIE_MR4_JPLY.dcm" } ,
{ "fafdb8499580e59c2f6d9047894272ea" , "D_CLUNIE_MR4_RLE.dcm" } ,
{ "bc35454da5d8c0825236ccae83adcb82" , "D_CLUNIE_NM1_JPLL.dcm" } ,
{ "03527dbfa9b0b82fee7d6eb601abf470" , "D_CLUNIE_NM1_JPLY.dcm" } ,
{ "9488a473e2cd1fc981f36643e7dc1b82" , "D_CLUNIE_NM1_RLE.dcm" } ,
{ "d9da8798488b1c825dbd4ef940e386b9" , "D_CLUNIE_RG1_JPLL.dcm" } ,
{ "68a498853d26cce827eefb0f8be3581d" , "D_CLUNIE_RG1_RLE.dcm" } ,
{ "9f652b621320650c6be743b6bafcf539" , "D_CLUNIE_RG2_JPLL.dcm" } ,
{ "1f0e2edba097f4491b7d45fed604729d" , "D_CLUNIE_RG2_JPLY.dcm" } ,
{ "403e0e40507608cdcd61ee461de91226" , "D_CLUNIE_RG2_RLE.dcm" } ,
{ "73ecf348f874e7fb69f5dbfb4637979e" , "D_CLUNIE_RG3_JPLL.dcm" } ,
{ "f454ce36a97e4d4164a628e686a9977b" , "D_CLUNIE_RG3_JPLY.dcm" } ,
{ "ec7dcf6857238547f0fb43f51317b05f" , "D_CLUNIE_RG3_RLE.dcm" } ,
{ "af35b9ad269b8a37df3d25389655272e" , "D_CLUNIE_SC1_JPLY.dcm" } ,
{ "50f92b02a370e2858632dfde330a2881" , "D_CLUNIE_SC1_RLE.dcm" } ,
{ "ad377bc5cc50cb1b6312e9035417b2f1" , "D_CLUNIE_US1_RLE.dcm" } ,
{ "e6ea16c1ba4a8e8f97383811fd91288a" , "D_CLUNIE_VL1_RLE.dcm" } ,
{ "291ac2ee3c48a76ae0ab9a095199997c" , "D_CLUNIE_VL2_RLE.dcm" } ,
{ "91c92c4d1330c283012d2bdd3a91dc2f" , "D_CLUNIE_VL3_RLE.dcm" } ,
{ "fcc44b14754a56879e0f3afc8161c1c0" , "D_CLUNIE_VL4_RLE.dcm" } ,
{ "d7ded36c6827f41d61790bed41b963e3" , "D_CLUNIE_VL6_RLE.dcm" } ,
{ "75801e9732698ea89740f935052f28d6" , "D_CLUNIE_XA1_JPLL.dcm" } ,
{ "79d8daf6837a4b5aefaa963b1fb88df1" , "D_CLUNIE_XA1_JPLY.dcm" } ,
{ "e2bda8297745ab7a77ca84242ad4c980" , "D_CLUNIE_XA1_RLE.dcm" } ,
{ "bb52d9f7a9116c87103066dd18a60e68" , "D_CLUNIE_CT1_JLSN.dcm" } ,
{ "8984d6319cd913d0f88fdb61989412f2" , "D_CLUNIE_CT1_JLSL.dcm" } ,
{ "4ef94d44a83066b80b39d254fb2a1c28" , "DCMTK_JPEGExt_12Bits.dcm" } ,
{ "d982dca9cc6c9db94a6233ca76e52f26" , "DermaColorLossLess.dcm" } ,
{ "ee354d9b221360982f15b630e1fdb046" , "DICOMDIR" } ,
{ "aa0556f64fb938935447f3e3b6b67b68" , "dicomdir_Acusson_WithPrivate_WithSR" } ,
{ "9934ab3c8adca82cad0fe8997b6c5cd3" , "DICOMDIR_MR_B_VA12A" } ,
{ "6a4cfd1ddd6eea5538dd7f8cf1ba1e1f" , "DICOMDIR-Philips-EasyVision-4200-Entries" } ,
{ "4254e4123245565e43a86e191acff01b" , "dicomdir_Pms_With_heavy_embedded_sequence" } ,
{ "6b4a338aff7a2e0b75e39bc7b2393ec2" , "dicomdir_Pms_WithVisit_WithPrivate_WithStudyComponents" } ,
{ "356f30be965bbe4e335a56c6c5fe1928" , "dicomdir_With_embedded_icons" } ,
{ "cfa838dc4a9f62199b10909744dee484" , "DMCPACS_ExplicitImplicit_BogusIOP.dcm" } ,
{ "c28bfc62319b6059b4e7a30dd31599de" , "DX_GE_FALCON_SNOWY-VOI.dcm" } ,
{ "1cbeb77ea2d6e0171dd38e0d6d5cb0b9" , "DX_J2K_0Padding.dcm" } ,
{ "3493bf0e698798529fde6ef488289879" , "ELSCINT1_JP2vsJ2K.dcm" } ,
{ "8f5581be656bd6f1ab6c9ec94f302284" , "ELSCINT1_LOSSLESS_RICE.dcm" } ,
{ "54f138a1aa6819ec1560a7ed344cde1a" , "ELSCINT1_PMSCT_RLE1.dcm" } ,
{ "1f3720cdf4c65748d512fe7e6f5dcab8" , "EnhancedWithIPPPerFrameIOPShared.dcm"} ,
{ "d576bf8e8b2ca71fd543d29698807e85" , "ExplicitVRforPublicElementsImplicitVRforShadowElements.dcm" } ,
{ "3199cd21166043d619209d7a2073fb56" , "fffc0000UN.dcm" } ,
{ "9b426b02521cbc2f3ee25ab383ca835e" , "FUJI-10-MONO1-ACR_NEMA_2.dcm" } ,
{ "f705cfe771a299023c8dcc94b2184960" , "FUJI-ffff-MONO1-J2K.dcm"} ,
{ "2aba3dacd00a0bc14a06e2d7142b916a" , "gdcm-ACR-LibIDO.acr" } ,
{ "b808c747b59f9d1a91a01491103abea5" , "gdcm-CR-DCMTK-16-NonSamplePerPix.dcm" } ,
{ "e7b5089a2a007221993ee5a7e6d44959" , "gdcm-JPEG-Extended.dcm" } ,
{ "20894653d750b4edf6034258a8dc3cf7" , "gdcm-JPEG-LossLess3a.dcm" } ,
{ "5011206e2a744c8a6f2cedb1ff7e5e11" , "gdcm-JPEG-LossLessThoravision.dcm" } ,
{ "49f3c524267607c09b6a78448f804eb8" , "gdcm-MR-PHILIPS-16-Multi-Seq.dcm" } ,
{ "3ada4145885084c465fc0d2969299428" , "gdcm-MR-PHILIPS-16-NonSquarePixels.dcm" } ,
{ "ac5f5bea451fd81aa2416fbab1a4e8c4" , "gdcm-MR-SIEMENS-16-2.acr" } ,
{ "48c49a7a41a7efea9ea0eadcd89ac9fa" , "gdcm-US-ALOKA-16.dcm" } ,
{ "7d42ad3c14c4fc9953ed8da6df4ae6c6" , "GE_CT_With_Private_compressed-icon.dcm" } ,
{ "9e126a24f81534e1cd653f16739a6192" , "GE_DLX-8-MONO2-Multiframe.dcm" } ,
{ "aa39aa421b9d1e9c51e261ed632250a3" , "GE_DLX-8-MONO2-Multiframe-Jpeg_Lossless.dcm" } ,
{ "61ca6c5115e6f74565f6f2ca06647444" , "GE_DLX-8-MONO2-PrivateSyntax.dcm" } ,
{ "84b29e188d5067565469c7c31676ff58" , "GE_GENESIS-16-MONO2-Uncompressed-UnusualVR.dcm" } ,
{ "8d398fce426d3a248d8c3f7582e3751d" , "GE_GENESIS-16-MONO2-WrongLengthItem.dcm" } ,
{ "d9111c251fd785c328897e8eadc19dbc" , "GE_LOGIQBook-8-RGB-HugePreview.dcm" } ,
{ "511da6acdb4f3189c93928e99b73ba39" , "GE_MR_0025xx1bProtocolDataBlock.dcm" } ,
{ "d5efa34d8091e1ad04683eefb41f33c7" , "GE_RHAPSODE-16-MONO2-JPEG-Fragments.dcm" } ,
{ "d41d8cd98f00b204e9800998ecf8427e" , "IM-0001-0066.dcm" } ,
{ "cd085d783924d8a7fa2270ff40c6dc3e" , "ITK_GDCM124_MultiframeSecondaryCaptureInvalid.dcm" } ,
{ "40b0edf4b7c8a6f3756cbc1cd2d00359" , "JDDICOM_Sample2.dcm" } ,
{ "e08545c49082b527a6446c9077227471" , "JDDICOM_Sample2-dcmdjpeg.dcm" } ,
{ "9fc7096fd5d3ffdcbfe535f517689e62" , "JPEGDefinedLengthSequenceOfFragments.dcm" } ,
{ "9c0548b6cc474c309686cfc3bdff7723" , "JPEG_LossyYBR.dcm" } ,
{ "7c666b7c8fe0d52d906150d80d805cb7" , "KODAK-12-MONO1-Odd_Terminated_Sequence.dcm" } ,
{ "492ba4d8a4b904a15a4f14fe35b31a16" , "KODAK_CompressedIcon.dcm" } ,
{ "3b2388a839775bb10d45ff19465a63ce" , "LEADTOOLS_FLOWERS-16-MONO2-JpegLossless.dcm" } ,
{ "3789010ccb4520b923e2bdc260377a2f" , "LEADTOOLS_FLOWERS-16-MONO2-RLE.dcm" } ,
{ "27626466079fd8b8f8965947a0bba342" , "LEADTOOLS_FLOWERS-16-MONO2-Uncompressed.dcm" } ,
{ "ee4b520d66c63601d228168c84a95150" , "LEADTOOLS_FLOWERS-24-RGB-JpegLossless.dcm" } ,
{ "dbd4d69de9e9579fa9938bbfba0bf770" , "LEADTOOLS_FLOWERS-24-RGB-JpegLossy.dcm" } ,
{ "43a20a3308793dabbc8ea4b7e0a0e04f" , "LEADTOOLS_FLOWERS-24-RGB-Uncompressed.dcm" } ,
{ "8af486710c7ff58fdedc6543aec353fe" , "LEADTOOLS_FLOWERS-8-MONO2-JpegLossy.dcm" } ,
{ "b708f5dd17424f0d2fe9355a345b5954" , "LEADTOOLS_FLOWERS-8-MONO2-RLE.dcm" } ,
{ "e3ca577b17fbc3bb8c0b0da85cc9cd6c" , "LEADTOOLS_FLOWERS-8-MONO2-Uncompressed.dcm" } ,
{ "0082bdcd44ae5d2681d645b49ec49a80" , "LEADTOOLS_FLOWERS-8-PAL-RLE.dcm" } ,
{ "6ac99a8ae372d278c96627f9cf76b6bb" , "LEADTOOLS_FLOWERS-8-PAL-Uncompressed.dcm" } ,
{ "8fb0042d71596bb45e7387b0f0ed0d6b" , "libido1.0-vol.acr" } ,
{ "05fe8714421e16371d62ae2c280b7107" , "LIBIDO-16-ACR_NEMA-Volume.dcm" } ,
{ "251033db6d79bcfde7a8e17a814713a9" , "LIBIDO-24-ACR_NEMA-Rectangle.dcm" } ,
{ "d71a08e78c1d33c858836f6c1a0f2231" , "LIBIDO-8-ACR_NEMA-Lena_128_128.acr" } ,
{ "e39e4923be2d8bb2fb19c6c8deae216f" , "LJPEG_BuginGDCM12.dcm" } ,
{ "e6bc657d132abebb01a675ade04129f1" , "MARCONI_MxTWin-12-MONO2-JpegLossless-ZeroLengthSQ.dcm" } ,
{ "4d808eca0d736b876cad3c566722d077" , "MAROTECH_CT_JP2Lossy.dcm" } ,
{ "497d6ea45b8f3f7f6a3bf8125dcc43b1" , "MR16BitsAllocated_8BitsStored.dcm" } ,
{ "cff201fb9749bd85a43d9bfb3675a25e" , "MR-Brucker-CineTagging-NonSquarePixels.dcm" } ,
{ "31246836410a24124acf6bea5a36a942" , "MR_ELSCINT1_00e1_1042_SQ_feff_00e0_Item.dcm" } ,
{ "84d300c76b8e8bee108d7a1e2da81319" , "MR_GE_with_Private_Compressed_Icon_0009_1110.dcm" } ,
{ "8419613dfb8d4b190ef8a988f8927bce" , "MR-MONO2-12-an2.acr" } ,
{ "b4058b67ec1eb3d3d3acde27d51eb24a" , "MR-MONO2-12-angio-an1.acr" } ,
{ "f782f6ea25928310bd69c3ca5c6a97d2" , "MR-MONO2-12-shoulder.dcm" } ,
{ "7f6bccb00b34a7d277eacaffd2bb0362" , "MR-MONO2-16-head.dcm" } ,
{ "294324abb8e0e5df7907fba58d60ab99" , "MR-MONO2-8-16x-heart.dcm" } ,
{ "cd623ac04602182dc66adb505c516341" , "MR_Philips-Intera_BreaksNOSHADOW.dcm" } ,
{ "ced145431248f1e00e9bdc23b0c61674" , "MR_Philips_Intera_No_PrivateSequenceImplicitVR.dcm" } ,
{ "8eab7fcf9c53d06968dde33f6b3a8918" , "MR_Philips_Intera_PrivateSequenceExplicitVR_in_SQ_2001_e05f_item_wrong_lgt_use_NOSHADOWSEQ.dcm" } ,
{ "3d24233b19788d349f64b7b267723186" , "MR_Philips_Intera_PrivateSequenceImplicitVR.dcm" } ,
{ "1693399bc1edb7cdc494095a27201eab" , "MR_Philips_Intera_SwitchIndianess_noLgtSQItem_in_trueLgtSeq.dcm" } ,
{ "5797c9dfe94e4a4bccfbf81ab0aaa957" , "MR-SIEMENS-DICOM-WithOverlays.dcm" } ,
{ "cc2f9bcd27cf7880482fcf72b9afd303" , "MR-SIEMENS-DICOM-WithOverlays-extracted-overlays.dcm" } ,
{ "bf324a1c91d3a09d9136f54f5910e570" , "MR_SIEMENS_forceLoad29-1010_29-1020.dcm" } ,
{ "67d2eb3dba82f5d3ac5620b3fb7932d6" , "MR_Spectroscopy_SIEMENS_OF.dcm" } ,
{ "1a5646a7b05840813c067d8c8dfa507e" , "NM-MONO2-16-13x-heart.dcm" } ,
{ "1bc606b879ab7bd244782685f5f6149d" , "OsirixFake16BitsStoredFakeSpacing.dcm" } ,
{ "bf793beb0e96f2399e467409e3cf5311" , "OT-MONO2-8-a7.dcm" } ,
{ "7f4cddc9a88f8c5147b89f769eb1cae7" , "OT-PAL-8-face.dcm" } ,
{ "5fce2728bd9457d4fc1224a374829e2f" , "PET-cardio-Multiframe-Papyrus.dcm" } ,
{ "aa865ae5cf7c0c0320b58e7714155f13" , "PHILIPS_Brilliance_ExtraBytesInOverlay.dcm" } ,
{ "020332d94a89fd2be159f9b82637db5d" , "PHILIPS_GDCM12xBug2.dcm" } ,
{ "9f97969789e9ae279c87189a62ab12d4" , "PHILIPS_GDCM12xBug.dcm" } ,
{ "c38ad661c6a14f8bd88b304755e7ba7b" , "PHILIPS_Gyroscan-12-Jpeg_Extended_Process_2_4.dcm" } ,
{ "73d6489008482473f2839c3984d987c6" , "PHILIPS_Gyroscan-12-MONO2-Jpeg_Lossless.dcm" } ,
{ "03d88060c3bd820b96840599c0099470" , "PHILIPS_Gyroscan-8-MONO2-Odd_Sequence.dcm" } ,
{ "1f198bdb09f5e52dc3f9ad1dfced8a4d" , "PHILIPS_Intera-16-MONO2-Uncompress.dcm" } ,
{ "4f34474ed72e6a5960fc4691e588f8e0" , "PICKER-16-MONO2-Nested_icon.dcm" } ,
{ "629da04611e097e2cc532d6fe5e6454d" , "PICKER-16-MONO2-No_DicomV3_Preamble.dcm" } ,
{ "3aaca1826b4a4deb9e41ebf2af4fa6b2" , "PrivateGEImplicitVRBigEndianTransferSyntax16Bits.dcm" } ,
{ "62837f966bfd15ca8f9853cc905e20a4" , "RadBWLossLess.dcm" } ,
{ "c2f13224f3f0bc3aa8bbfa6f4a0a23ec" , "rle16loo.dcm" } ,
{ "bd5d9b2f994cfc0c6a95cca8c586533a" , "rle16sti.dcm" } ,
{ "631c5bb2e2f046215999072d13316363" , "SIEMENS-12-Jpeg_Process_2_4-Lossy-a.dcm" } ,
{ "e71384013e91e3a6e6acdb84b9c83a4d" , "SIEMENS_CSA2.dcm" } ,
{ "fa919f3ee7cef3af1f362dd166d53103" , "SIEMENS_GBS_III-16-ACR_NEMA_1.acr" } ,
{ "825580733e8cfaf5d8679348889db40d" , "SIEMENS_GBS_III-16-ACR_NEMA_1-ULis2Bytes.dcm" } ,
{ "ff6bf3c70ef86ca08244317afd7fb98a" , "SIEMENS_ImageLocationUN.dcm" } ,
{ "ac5f5bea451fd81aa2416fbab1a4e8c4" , "SIEMENS_MAGNETOM-12-ACR_NEMA_2-Modern.dcm" } ,
{ "5202b5e2521b1a5b480317864081beae" , "SIEMENS_MAGNETOM-12-MONO2-FileSeq0.dcm" } ,
{ "8969371a42ecebc02f316a344a887c81" , "SIEMENS_MAGNETOM-12-MONO2-FileSeq1.dcm" } ,
{ "c32e8171b87f3825bf6a37c4ed4b627a" , "SIEMENS_MAGNETOM-12-MONO2-FileSeq2.dcm" } ,
{ "ea85da9fae20a585af6a71467916fa4a" , "SIEMENS_MAGNETOM-12-MONO2-FileSeq3.dcm" } ,
{ "1e22b1b3ef16b82cac4299279018282a" , "SIEMENS_MAGNETOM-12-MONO2-GDCM12-VRUN.dcm" } ,
{ "16f02a1ee88f8753978a3dad9a5968ac" , "SIEMENS_MAGNETOM-12-MONO2-Uncompressed.dcm" } ,
{ "bec3be5aaf61c96757095120bc5db29e" , "SIEMENS_MAGNETOM-12-MONO2-VRUN.dcm" } ,
{ "3fb1221855970e4837dccab0d0441ccc" , "SIEMENS_MOSAIC_12BitsStored-16BitsJPEG.dcm" } ,
{ "be0b7098b442990aebf3364d747af482" , "SIEMENS-MR-RGB-16Bits.dcm" } ,
{ "433387bd667a1737628f05547d982758" , "SIEMENS_SOMATOM-12-ACR_NEMA-ZeroLengthUs.acr" } ,
{ "5fc4be2074b6186d3993818cd1baeb89" , "SIEMENS_Sonata-12-MONO2-SQ.dcm" } ,
{ "c56ae357244ed3d4203c2b28fe3ab447" , "SIEMENS_Sonata-16-MONO2-Value_Multiplicity.dcm" } ,
{ "7176eb4ec64dab63578eb6826318c87d" , "SignedShortLosslessBug.dcm" } ,
{ "3b7f193595e3954796ed5c15ba65f9e4" , "simpleImageWithIcon.dcm" } ,
{ "cbd59e416dd82dc14df251ea6fccb55b" , "test.acr" } ,
{ "0c2c475f6d21ae0aeadbf16565dcdbc4" , "TG18-CH-2k-01.dcm" } ,
{ "e8cc7ed19eedf9bed9ab60683f3dbfa1" , "THERALYS-12-MONO2-Uncompressed-Even_Length_Tag.dcm" } ,
{ "aa708d3b15e451c8367e7909257d9346" , "TheralysGDCM120Bug.dcm" } ,
{ "e8819809884c214fe78ee2b227417e5c" , "TOSHIBA_MRT150-16-MONO2-ACR_NEMA_2.dcm" } ,
{ "203e3207fb53e4141341cd112fc2e867" , "undefined_length_un_vr.dcm" } ,
{ "787ca80c8dd1aa619d5f85610862380b" , "US-GE-4AICL142.dcm" } ,
{ "f1e9c893391e1d458cffa2a1e0904160" , "US-IRAD-NoPreambleStartWith0003.dcm" } ,
{ "d1d9be67c9d066fabc8e1c4ae124f9a0" , "US-IRAD-NoPreambleStartWith0005.dcm" } ,
{ "a917b69aed7c81f4e2fb5983ca340ebf" , "US-MONO2-8-8x-execho.dcm" } ,
{ "d58a4930f5b436939d297730b883d5b9" , "US-PAL-8-10x-echo.dcm" } ,
{ "b42152fc38f88b3a52f93003ab83a148" , "US-RGB-8-epicard.dcm" } ,
{ "87fa2e4c03b664afa7f5b70cdaa5ac59" , "US-RGB-8-esopecho.dcm" } ,
{ "7a3535f869f4a450b8de3d73a268e713" , "XA-MONO2-8-12x-catheter.dcm" } ,
{ "167af475c7e2f4605544fa1602c34d50" , "IM-0001-0066.CommandTag00.dcm" },
{ "d2cb6962750eb8f92c480e6cc2f4d104" , "GDCMJ2K_TextGBR.dcm" },
{ "2e039bbc7520f809963e051ff5144ccf" , "UnexpectedSequenceDelimiterInFixedLengthSequence.dcm" },
{ "5046074a1377d76f109df7ce331c8144" , "NM_Kakadu44_SOTmarkerincons.dcm" },
{ "fdd8a53915712a924ac74c26ec4d1051" , "PhilipsInteraSeqTermInvLen.dcm" },
{ "2940bd46f097f79012d24f47504c3c8c" , "TOSHIBA_J2K_OpenJPEGv2Regression.dcm" },
{ "696917fea41e83b9980bad82b609162c" , "TOSHIBA_J2K_SIZ0_PixRep1.dcm" },
{ "7ef3da46c43e51cfe2eb82e4d23dd623" , "TOSHIBA_J2K_SIZ1_PixRep0.dcm" },
{ "47d8f59fe43aae50263fef27145cca11" , "NM-PAL-16-PixRep1.dcm" },
{ "27ccfa08495b406c9c5e1b686a8b35f9" , "MEDILABInvalidCP246_EVRLESQasUN.dcm" },
{ "43620b01e21fdcecb2ff4cbd71f921cc" , "JPEGInvalidSecondFrag.dcm" },
{ "2a8649f99c4ada4109b6aa7c52cf1a6a" , "SC16BitsAllocated_8BitsStoredJPEG.dcm" },
{ "25cca40808c9ecdaac6316667c77daac" , "SC16BitsAllocated_8BitsStoredJ2K.dcm" },
{ "a841fb52502c740d57d187219a906173" , "SIEMENS_SYNGO-12-MONO2-LUTWrongLength512.dcm" },
{ "41d1baead629d878d09d6c1037faf47a" , "JPEGNote_empty.dcm" },
{ "3cb9917c468226c265ef637aac5f4b61" , "JPEGLS_CharLS_10742.dcm" },
{ "8381875d83ce321955a064e40d047dde" , "JPEGLosslessYBR_FULL_422.dcm" },
{ "67f7b36ad6e54889b4a2581baa41afdf" , "JPEGNote_missing.dcm" },
{ "807bf2aef3bc1885217c8a12d2d2bc19" , "JPEGNote_bogus.dcm" },
{ "669cc0e807673ebe57124739a1874f35" , "RLEDebianBug816607Orig.dcm" },
{ "1daa9bb53a8ce090041472f528248686" , "IllegalGroup2ImplicitTS.dcm" },
{ "d08fd49e8bd15a5e66b5578c49441514" , "GE_MR_0025xx1bProtocolDataBlockXML.dcm" },
{ "df3327313dadcc29e88779c7bc884abb" , "EmptyIcon_Bug417.dcm" },
{ "7d0db54d48964c813d513b472f29155c" , "JPEGLosslessSeNonZero.dcm" },
{ "44e6c3eef66b555ec3ae3e6dec6e8157" , "US-YBR_FULL_422-EVRLE.dcm" },
{ "6b8a1f866c39aaccef4185a0923552cd" , "Osirix10vs8BitsStored.dcm" },
{ "a638f2bc00e67f35257f36e5d5caa6b0" , "Bug_Siemens_PrivateIconNoItem.dcm" },
{ "f64bcbdf9396df3eb3cedd28457042da" , "HardcopyColor_YBR_RCT_J2K_PC1.dcm" },
{ "4f9b4e5530f1d60472d85a641105c009" , "PET-GE-dicomwrite-PixelDataSQUNv2.dcm" },
{ "a7f54f67b6a978813b8ab1a0e2900f30" , "MEDILABValidCP246_EVRLESQasOB.dcm" },
{ nullptr ,nullptr }
};
int TestPrint(const char *filename, bool verbose= false)
{
gdcm::Reader r;
r.SetFileName( filename );
if( !r.Read() )
{
std::cerr << "Could not read: " << filename << std::endl;
return 1;
}
gdcm::Printer print;
print.SetFile( r.GetFile() );
std::ostringstream out;
if( verbose )
print.Print( std::cout );
#if defined(_MSC_VER) && (_MSC_VER <= 1800) // Visual Studio 2013
auto old_exponent_format = _set_output_format(_TWO_DIGIT_EXPONENT);
#endif
print.Print( out );
#if defined(_MSC_VER) && (_MSC_VER <= 1800) // Visual Studio 2013
_set_output_format(old_exponent_format);
#endif
gdcm::Filename fn( filename );
const char *name = fn.GetName();
std::string buf = out.str();
if( buf.find( "GDCM:UNKNOWN" ) != std::string::npos )
{
if( strcmp(name, "test.acr" ) != 0
&& strcmp(name, "LIBIDO-8-ACR_NEMA-Lena_128_128.acr" ) != 0
&& strcmp(name, "gdcm-ACR-LibIDO.acr" ) != 0
&& strcmp(name, "SIEMENS_GBS_III-16-ACR_NEMA_1.acr" ) != 0
&& strcmp(name, "LIBIDO-24-ACR_NEMA-Rectangle.dcm" ) != 0
&& strcmp(name, "NM_Kakadu44_SOTmarkerincons.dcm" ) != 0
&& strcmp(name, "GE_MR_0025xx1bProtocolDataBlockXML.dcm" ) != 0
)
{
std::cerr << "UNKNOWN Attribute with : " << name << std::endl;
return 1;
}
}
char digest[33];
gdcm::Testing::ComputeMD5(buf.data(), buf.size(), digest);
unsigned int i = 0;
const char *p = printmd5[i][1];
while( p != nullptr )
{
if( strcmp( name, p ) == 0 )
{
break;
}
++i;
p = printmd5[i][1];
}
const char *refmd5 = printmd5[i][0];
if( !refmd5 )
{
std::cerr << "Problem with : " << name << " missing md5= " << digest << std::endl;
return 1;
}
if( strcmp( refmd5, digest) != 0 )
{
std::cerr << "Problem with : " << name << " " << refmd5 << " vs " << digest << std::endl;
return 1;
}
return 0;
}
int TestPrinter1(int argc, char *argv[])
{
if( argc == 2 )
{
const char *filename = argv[1];
return TestPrint(filename, true);
}
// else
int r = 0, i = 0;
gdcm::Trace::DebugOff();
gdcm::Trace::WarningOff();
gdcm::Trace::ErrorOff();
const char *filename;
const char * const *filenames = gdcm::Testing::GetFileNames();
while( (filename = filenames[i]) )
{
r += TestPrint( filename );
++i;
}
return r;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestFileChangeTransferSyntax1.cxx 000664 001766 001770 00000016156 14517730450 034013 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmFileChangeTransferSyntax.h"
#include "gdcmTesting.h"
#include "gdcmSystem.h"
#include "gdcmReader.h"
#include "gdcmImageReader.h"
#include "gdcmFilename.h"
#include "gdcmImageChangePlanarConfiguration.h"
#include "gdcmByteSwap.h"
static int TestFileChangeTransferSyntax1Func(const char *filename, bool verbose = false)
{
using namespace gdcm;
if( verbose )
std::cout << "Processing: " << filename << std::endl;
// Create directory first:
const char subdir[] = "TestFileChangeTransferSyntax1";
std::string tmpdir = Testing::GetTempDirectory( subdir );
if( !System::FileIsDirectory( tmpdir.c_str() ) )
{
System::MakeDirectory( tmpdir.c_str() );
//return 1;
}
std::string outfilename = Testing::GetTempFilename( filename, subdir );
if( verbose )
std::cout << "Generating: " << outfilename << std::endl;
const gdcm::TransferSyntax ts( TransferSyntax::JPEGLosslessProcess14_1 );
gdcm::FileChangeTransferSyntax fcts;
fcts.SetTransferSyntax( ts );
fcts.SetInputFileName( filename );
fcts.SetOutputFileName( outfilename.c_str() );
ImageCodec *ic = fcts.GetCodec();
if( !ic )
{
return 1;
}
if( !fcts.Change() )
{
gdcm::Reader reader;
reader.SetFileName( filename );
if( !reader.Read() )
{
std::cerr << "not dicom" << std::endl;
return 1;
}
const gdcm::File & file = reader.GetFile();
const gdcm::FileMetaInformation & fmi = file.GetHeader();
const TransferSyntax &tsref = fmi.GetDataSetTransferSyntax();
if( tsref.IsEncapsulated() )
{
if( verbose )
std::cout << "Will not generate (encaps): " << outfilename << std::endl;
return 0;
}
gdcm::Filename fn( filename );
const char *name = fn.GetName();
// Special handling:
if( strcmp(name, "CT-MONO2-12-lomb-an2.acr" ) == 0
|| strcmp(name, "LIBIDO-8-ACR_NEMA-Lena_128_128.acr") == 0
|| strcmp(name, "gdcm-ACR-LibIDO.acr") == 0
|| strcmp(name, "gdcm-MR-SIEMENS-16-2.acr") == 0
|| strcmp(name, "libido1.0-vol.acr") == 0
|| strcmp(name, "test.acr") == 0
|| strcmp(name, "LIBIDO-24-ACR_NEMA-Rectangle.dcm") == 0
|| strcmp(name, "MR_Spectroscopy_SIEMENS_OF.dcm") == 0 // not an image
|| strcmp(name, "ELSCINT1_PMSCT_RLE1.dcm") == 0
|| strcmp(name, "ELSCINT1_PMSCT_RLE1_priv.dcm") == 0
|| strcmp(name, "gdcm-CR-DCMTK-16-NonSamplePerPix.dcm") == 0
|| strcmp(name, "SIEMENS_MAGNETOM-12-ACR_NEMA_2-Modern.dcm") == 0
|| strcmp(name, "PrivateGEImplicitVRBigEndianTransferSyntax16Bits.dcm") == 0 // Implicit VR Big Endian DLX (G.E Private)
|| strcmp(name, "MR_GE_with_Private_Compressed_Icon_0009_1110.dcm") == 0 // Explicit VR Big Endian
|| strcmp(name, "US-RGB-8-epicard.dcm") == 0 // Explicit VR Big Endian
|| strcmp(name, "GE_DLX-8-MONO2-PrivateSyntax.dcm") == 0 // Implicit VR Big Endian DLX (G.E Private)
|| strcmp(name, "GE_CT_With_Private_compressed-icon.dcm") == 0 // Explicit VR Big Endian
|| strcmp(name, "JDDICOM_Sample2-dcmdjpeg.dcm") == 0 // cannot recreate FMI
|| strcmp(name, "DMCPACS_ExplicitImplicit_BogusIOP.dcm") == 0 // ImageRegionReader does not handle it
|| strcmp(name, "unreadable.dcm") == 0 // No Pixel Data (old ACR-NEMA)
|| strcmp(name, "US-YBR_FULL_422-EVRLE.dcm") == 0 // packed ybr422
|| strncmp(name, "DICOMDIR", 8) == 0 // DICOMDIR*
|| strncmp(name, "dicomdir", 8) == 0 // dicomdir*
)
{
if( verbose )
std::cout << "Will not generate: " << outfilename << std::endl;
return 0;
}
std::cerr << "Could not change: " << filename << std::endl;
return 1;
}
// Let's read that file back in !
gdcm::ImageReader reader2;
reader2.SetFileName( outfilename.c_str() );
if ( !reader2.Read() )
{
std::cerr << "Could not even reread our generated file : " << outfilename << std::endl;
return 1;
}
// Check that after decompression we still find the same thing:
int res = 0;
gdcm::Image img = reader2.GetImage();
int pc = 0;
// When recompressing: US-RGB-8-epicard.dcm, make sure to compute the md5 using the
// same original Planar Configuration...
if( (int)img.GetPlanarConfiguration() != pc )
{
gdcm::ImageChangePlanarConfiguration icpc;
icpc.SetInput( reader2.GetImage() );
icpc.SetPlanarConfiguration( pc );
icpc.Change();
img = icpc.GetOutput();
}
//std::cerr << "Success to read image from file: " << filename << std::endl;
unsigned long len = img.GetBufferLength();
char* buffer = new char[len];
bool res2 = img.GetBuffer(buffer);
if( !res2 )
{
std::cerr << "could not get buffer: " << outfilename << std::endl;
return 1;
}
// On big Endian system we have byteswapped the buffer (duh!)
// Since the md5sum is byte based there is now way it would detect
// that the file is written in big endian word, so comparing against
// a md5sum computed on LittleEndian would fail. Thus we need to
// byteswap (again!) here:
#ifdef GDCM_WORDS_BIGENDIAN
if( img.GetPixelFormat().GetBitsAllocated() == 16 )
{
assert( !(len % 2) );
assert( img.GetPhotometricInterpretation() == gdcm::PhotometricInterpretation::MONOCHROME1
|| img.GetPhotometricInterpretation() == gdcm::PhotometricInterpretation::MONOCHROME2 );
gdcm::ByteSwap::SwapRangeFromSwapCodeIntoSystem(
(unsigned short*)buffer, gdcm::SwapCode::LittleEndian, len/2);
}
#endif
const char *ref = gdcm::Testing::GetMD5FromFile(filename);
char digest[33];
gdcm::Testing::ComputeMD5(buffer, len, digest);
if( !ref )
{
// new regression image needs a md5 sum
std::cerr << "Missing md5 " << digest << " for: " << filename << std::endl;
//assert(0);
res = 1;
}
else if( strcmp(digest, ref) != 0 )
{
std::cerr << "Problem reading image from: " << filename << std::endl;
std::cerr << "Found " << digest << " instead of " << ref << std::endl;
res = 1;
}
if(res)
{
std::cerr << "problem with: " << outfilename << std::endl;
}
if( verbose )
{
std::cout << "file was written in: " << outfilename << std::endl;
}
delete[] buffer;
return res;
}
int TestFileChangeTransferSyntax1(int argc, char *argv[])
{
if( argc == 2 )
{
const char *filename = argv[1];
return TestFileChangeTransferSyntax1Func(filename, true);
}
// else
gdcm::Trace::DebugOff();
gdcm::Trace::WarningOff();
gdcm::Trace::ErrorOff();
int r = 0, i = 0;
const char *filename;
const char * const *filenames = gdcm::Testing::GetFileNames();
while( (filename = filenames[i]) )
{
r += TestFileChangeTransferSyntax1Func( filename );
++i;
}
return r;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestUIDGenerator3.cxx 000664 001766 001770 00000003722 14517730450 031377 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmUIDGenerator.h"
#include "gdcmSystem.h"
#include
#include
int TestUIDGenerator3(int argc, char *argv[])
{
char randbytesbuf[200];
gdcm::UIDGenerator uid;
unsigned char data[16];
for(unsigned int i = 0; i < 100; ++i)
{
uid.GenerateUUID( data );
size_t len = gdcm::System::EncodeBytes(randbytesbuf, data, sizeof(data));
//std::cout << randbytesbuf << std::endl;
std::bitset<8> x;
//x.reset();
//std::cout << x << std::endl;
//x.flip();
//std::cout << x << std::endl;
//std::cout << sizeof(x) << std::endl;
//std::cout << sizeof(data) << std::endl;
x = data[0];
//std::cout << x << std::endl;
//std::cout << (int)data[0] << std::endl;
//x = data[5];
//std::cout << x << std::endl;
x[2+0] = 0;
x[2+1] = 0;
x[2+2] = 0;
x[2+3] = 0;
x[2+4] = 0;
x[2+5] = 0;
data[0] = x.to_ulong();
//std::cout << x << std::endl;
//std::cout << (int)data[0] << std::endl;
len = gdcm::System::EncodeBytes(randbytesbuf, data, sizeof(data));
std::cout << randbytesbuf << std::endl;
if( len > 37 )
{
return 1;
}
// Can't use the following, this would declare x2 as a function
//std::bitset<128> x2( std::string(randbytesbuf) );
// instead split it out :
//std::string s(randbytesbuf);
//std::bitset<128> x2( s );
//std::cout << x2 << std::endl;
}
return 0;
}
gdcm-3.0.22/Testing/Source/MediaStorageAndFileFormat/Cxx/TestOverlay3.cxx 000664 001766 001770 00000013305 14517730450 030526 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmOverlay.h"
#include "gdcmImageReader.h"
#include "gdcmTesting.h"
#include "gdcmSystem.h"
#include "gdcmFilename.h"
using namespace gdcm;
struct ovel
{
const char *md5;
const char *fn;
unsigned int idx;
Overlay::OverlayType type;
};
static const ovel overlay3array[] = {
// gdcmData
{"d42bff3545ed8c5fccb39d9a61828992", "MR-SIEMENS-DICOM-WithOverlays-extracted-overlays.dcm", 0, Overlay::Graphics },
{"2cf60257b75a034fbdc98e560881184e", "PHILIPS_Brilliance_ExtraBytesInOverlay.dcm", 0, Overlay::Graphics },
{"b2dd1007e018b3b9691761cf93f77552", "05115014-mr-siemens-avanto-syngo-with-palette-icone.dcm", 0, Overlay::Graphics },
{"d42bff3545ed8c5fccb39d9a61828992", "MR-SIEMENS-DICOM-WithOverlays.dcm", 0, Overlay::Graphics },
// gdcmDataExtra
{"4b0240033afba211eeac42a44417d4c9", "05119848_IS_Black_hasOverlayData.dcm", 0, Overlay::Graphics },
{"349d1f9510f64467ecf73eeea46c9c6e", "45909476", 0, Overlay::Graphics },
{"6a5f8038cc8cf753bf74422164adc24c", "45909517", 0, Overlay::Graphics },
{"1a3bf73e42b0f6dc282a9be59c054027", "OverlayDICOMDataSet.dcm", 0, Overlay::Graphics },
// gdcmConformanceTests
{"040560796c1a53ffce0d2f7e90c9dc26", "CT_OSIRIX_OddOverlay.dcm", 0, Overlay::Graphics },
// random
// {"f7e43de189a1bc08044c13aefac73fed", "1.dcm", 0 },
// {"e7859c818f26202fb63a2b205ff16297", "1.dcm", 1 },
// {"aa4c726bc52e13b750ac8c94c7b06e07", "0.dcm", 0 },
// {"31d58476326722793379fbcda55a4856", "0.dcm", 1 },
// sentinel
{ nullptr, nullptr, 0, Overlay::Invalid }
};
static int TestReadOverlay(const char* filename, bool verbose = false)
{
if( verbose )
std::cerr << "Reading: " << filename << std::endl;
gdcm::ImageReader reader;
reader.SetFileName( filename );
int ret = 0;
if ( reader.Read() )
{
gdcm::Filename fn( filename );
const char *name = fn.GetName();
std::vector overlay;
const gdcm::Image &img = reader.GetImage();
size_t numoverlays = img.GetNumberOfOverlays();
for( size_t ovidx = 0; ovidx < numoverlays; ++ovidx )
{
const gdcm::Overlay& ov = img.GetOverlay(ovidx);
size_t len = ov.GetUnpackBufferLength();
overlay.resize( len );
if( !ov.GetUnpackBuffer(overlay.data(), len) )
{
std::cerr << "GetUnpackBuffer: Problem with Overlay: #" << ovidx << std::endl;
++ret;
}
char digest1[33];
if( !gdcm::Testing::ComputeMD5(overlay.data(), len, digest1) )
{
std::cerr << "ComputeMD5: Problem with Overlay: #" << ovidx << std::endl;
++ret;
}
std::stringstream overlay2;
ov.Decompress(overlay2);
Overlay::OverlayType type = ov.GetTypeAsEnum();
const std::string soverlay2 = overlay2.str();
if( soverlay2.size() != len )
{
std::cerr << "Decompress: Problem with Overlay: #" << ovidx << std::endl;
std::cerr << "Size is: " << soverlay2.size() << " vs " << len << std::endl;
++ret;
}
char digest2[33];
if( !gdcm::Testing::ComputeMD5(soverlay2.c_str(), soverlay2.size(), digest2) )
{
std::cerr << "ComputeMD5: Problem with Overlay: #" << ovidx << std::endl;
++ret;
}
Overlay::OverlayType reftype = Overlay::Invalid;
const char *refmd5 = nullptr;
{
unsigned int i = 0;
const char *p = overlay3array[i].fn;
unsigned int idx = overlay3array[i].idx;
while( p != nullptr )
{
if( strcmp( name, p ) == 0 && ovidx == idx )
{
break;
}
++i;
p = overlay3array[i].fn;
idx = overlay3array[i].idx;
}
refmd5 = overlay3array[i].md5;
reftype = overlay3array[i].type;
}
if( !refmd5 )
{
std::cerr << "refmd5: Problem with Overlay: #" << ovidx << std::endl;
std::cerr << name << std::endl;
++ret;
}
if( refmd5 && strcmp(digest1, refmd5) != 0 )
{
std::cerr << "strcmp/ref: Problem with Overlay: #" << ovidx << std::endl;
std::cerr << "ref: " << refmd5 << " vs " << digest1 << std::endl;
++ret;
}
if( strcmp(digest1, digest2) != 0 )
{
std::cerr << "strcmp/1/2: Problem with Overlay: #" << ovidx << std::endl;
std::cerr << "digest1: " << digest1 << " vs " << digest2 << std::endl;
++ret;
}
if( reftype != type )
{
std::cerr << "OverlayType: Problem with Overlay: #" << ovidx << std::endl;
std::cerr << "reftype: " << (int)reftype << " vs " << (int)type << std::endl;
std::cerr << name << std::endl;
++ret;
}
}
}
return ret;
}
int TestOverlay3(int argc, char *argv[])
{
if( argc == 2 )
{
const char *filename = argv[1];
return TestReadOverlay(filename, true);
}
// else
// First of get rid of warning/debug message
gdcm::Trace::DebugOff();
gdcm::Trace::WarningOff();
gdcm::Trace::ErrorOff();
int r = 0, i = 0;
const char *filename;
const char * const *filenames = gdcm::Testing::GetFileNames();
while( (filename = filenames[i]) )
{
r += TestReadOverlay( filename);
++i;
}
return r;
}
gdcm-3.0.22/Testing/Source/Attribute/ 000775 001766 001770 00000000000 14517731550 021677 5 ustar 00mmalaterre mmalaterre 000000 000000 gdcm-3.0.22/Testing/Source/Attribute/CMakeLists.txt 000664 001766 001770 00000000000 14517730450 024423 0 ustar 00mmalaterre mmalaterre 000000 000000 gdcm-3.0.22/Testing/Source/CMakeLists.txt 000664 001766 001770 00000001565 14517730450 022501 0 ustar 00mmalaterre mmalaterre 000000 000000 # All the tests
# ADD_SUBDIRECTORY is required here to properly get the definition variables later on:
add_subdirectory(Data)
# Get the variables defined in Data add_subdirectory:
get_directory_property(gdcm_data_dicomdir_filenames_glob DIRECTORY Data DEFINITION GDCM_DATA_DICOMDIR_FILENAMES_GLOB)
get_directory_property(gdcm_data_image_filenames_glob DIRECTORY Data DEFINITION GDCM_DATA_IMAGE_FILENAMES_GLOB)
get_directory_property(gdcm_data_filenames_glob DIRECTORY Data DEFINITION GDCM_DATA_FILENAMES_GLOB)
get_directory_property(black_list_reader DIRECTORY Data DEFINITION BLACK_LIST_READER)
add_subdirectory( Attribute )
add_subdirectory( Common )
add_subdirectory( DataDictionary )
add_subdirectory( DataStructureAndEncodingDefinition )
add_subdirectory( InformationObjectDefinition )
add_subdirectory( MediaStorageAndFileFormat )
add_subdirectory( MessageExchangeDefinition )
gdcm-3.0.22/Testing/Source/DataDictionary/ 000775 001766 001770 00000000000 14517731550 022633 5 ustar 00mmalaterre mmalaterre 000000 000000 gdcm-3.0.22/Testing/Source/DataDictionary/CMakeLists.txt 000664 001766 001770 00000000117 14517730450 025370 0 ustar 00mmalaterre mmalaterre 000000 000000 add_subdirectory(Cxx)
if(GDCM_WRAP_PYTHON)
add_subdirectory(Python)
endif()
gdcm-3.0.22/Testing/Source/DataDictionary/Python/ 000775 001766 001770 00000000000 14517731550 024114 5 ustar 00mmalaterre mmalaterre 000000 000000 gdcm-3.0.22/Testing/Source/DataDictionary/Python/CMakeLists.txt 000664 001766 001770 00000000361 14517730450 026652 0 ustar 00mmalaterre mmalaterre 000000 000000 # Define the tests for gdcm-python
# gdcm-python
set(GDCM_PYTHON_TEST_SRCS
TestGlobal
TestDict
)
# Loop over files and create executables
foreach(name ${GDCM_PYTHON_TEST_SRCS})
ADD_PYTHON_TEST(${name}Python ${name}.py)
endforeach()
gdcm-3.0.22/Testing/Source/DataDictionary/Python/TestDict.py 000664 001766 001770 00000002170 14517730450 026207 0 ustar 00mmalaterre mmalaterre 000000 000000 ############################################################################
#
# Program: GDCM (Grassroots DICOM). A DICOM library
#
# Copyright (c) 2006-2011 Mathieu Malaterre
# All rights reserved.
# See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even
# the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the above copyright notice for more information.
#
############################################################################
import gdcm
import os,sys
if __name__ == "__main__":
singleton = gdcm.Global.GetInstance()
dicts = singleton.GetDicts()
d = dicts.GetPublicDict()
t = gdcm.Tag(0x0010,0x0010)
keyword = d.GetKeywordFromTag( t )
if keyword != 'PatientName':
sys.exit(1)
print(keyword)
p = d.GetDictEntryByKeyword( keyword )
if p[0].GetKeyword() != keyword:
sys.exit(1)
print(p[0].GetKeyword())
p = d.GetDictEntryByKeyword( 'foobar' )
undef = gdcm.Tag(0xffff,0xffff)
if p[1] != undef:
sys.exit(1)
print(p[1])
# Test succeed ?
sys.exit(0)
gdcm-3.0.22/Testing/Source/DataDictionary/Python/TestGlobal.py 000664 001766 001770 00000001666 14517730450 026535 0 ustar 00mmalaterre mmalaterre 000000 000000 ############################################################################
#
# Program: GDCM (Grassroots DICOM). A DICOM library
#
# Copyright (c) 2006-2011 Mathieu Malaterre
# All rights reserved.
# See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even
# the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the above copyright notice for more information.
#
############################################################################
import gdcm
import os,sys
if __name__ == "__main__":
#gi = gdcm.GlobalInstance
#print gi
singleton = gdcm.Global.GetInstance()
print(singleton)
d = singleton.GetDicts()
print(d)
t = gdcm.Tag(0x0010,0x0010)
entry = d.GetDictEntry( t )
print(entry)
print(entry.GetName())
#print entry.GetVM()
print(entry.GetVR())
# Test succeed ?
sys.exit(0)
gdcm-3.0.22/Testing/Source/DataDictionary/Cxx/ 000775 001766 001770 00000000000 14517731550 023375 5 ustar 00mmalaterre mmalaterre 000000 000000 gdcm-3.0.22/Testing/Source/DataDictionary/Cxx/CMakeLists.txt 000664 001766 001770 00000001653 14517730450 026140 0 ustar 00mmalaterre mmalaterre 000000 000000 # Define the tests for Data Dictionary
# DICT
set(DICT_TEST_SRCS
TestDictEntry.cxx
TestDict.cxx
TestGlobal.cxx
TestUIDs.cxx
TestDicts.cxx
TestGroupDict.cxx
TestTagToType.cxx
TestSOPClassUIDToIOD.cxx
TestTagKeywords.cxx
)
# Add the include paths
include_directories(
"${GDCM_BINARY_DIR}/Source/Common"
"${GDCM_SOURCE_DIR}/Source/Common"
"${GDCM_SOURCE_DIR}/Source/DataStructureAndEncodingDefinition"
"${GDCM_SOURCE_DIR}/Source/DataDictionary"
"${GDCM_SOURCE_DIR}/Source/InformationObjectDefinition"
)
create_test_sourcelist(DICTTests gdcmDICTTests.cxx ${DICT_TEST_SRCS}
EXTRA_INCLUDE gdcmTestDriver.h
)
add_executable(gdcmDICTTests ${DICTTests})
target_link_libraries(gdcmDICTTests gdcmDICT gdcmMSFF)
# Loop over files and create executables
foreach(name ${DICT_TEST_SRCS})
get_filename_component(testname ${name} NAME_WE)
add_test(NAME ${testname} COMMAND gdcmDICTTests ${testname})
endforeach()
gdcm-3.0.22/Testing/Source/DataDictionary/Cxx/TestSOPClassUIDToIOD.cxx 000664 001766 001770 00000003141 14517730450 027606 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmSOPClassUIDToIOD.h"
#include
int TestSOPClassUIDToIOD(int, char *[])
{
gdcm::SOPClassUIDToIOD::SOPClassUIDToIODType& s = gdcm::SOPClassUIDToIOD::GetSOPClassUIDToIOD(0);
std::cout << s[0] << std::endl;
if( std::string(s[0] ) != "1.2.840.10008.1.3.10" ) return 1;
std::cout << s[1] << std::endl;
if( std::string(s[1] ) != "Basic Directory IOD Modules" ) return 1;
// points to { nullptr, nullptr }, hardcoded
gdcm::SOPClassUIDToIOD::SOPClassUIDToIODType& s2 = gdcm::SOPClassUIDToIOD::GetSOPClassUIDToIOD(107);
std::cout << ( s2[0] == nullptr ) << std::endl;
if( !(s2[0] == nullptr) ) {
std::cerr << s2[1] << std::endl;
return 1;
}
if( !(s2[1] == nullptr) ) return 1;
const char *sopclassuid = gdcm::SOPClassUIDToIOD::GetSOPClassUIDFromIOD( s[1] );
const char *iod = gdcm::SOPClassUIDToIOD::GetIODFromSOPClassUID( s[0] );
std::cout << sopclassuid << std::endl;
std::cout << iod << std::endl;
if( std::string(sopclassuid) != s[0] ) return 1;
if( std::string(iod) != s[1] ) return 1;
return 0;
}
gdcm-3.0.22/Testing/Source/DataDictionary/Cxx/TestUIDs.cxx 000664 001766 001770 00000064102 14517730450 025566 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmUIDs.h"
#include "gdcmTesting.h"
#include
#include // strcmp
#include // strcmp
// This list was retrieved from:
// http://cardiacatlas.wiki.sourceforge.net/DICOM+Service+Class+Definitions
// Hum...there is not a single difference, exact same number of white space...
// apparently last modifier is 'solidether'
// http://cardiacatlas.wiki.sourceforge.net/page/diff/DICOM+Service+Class+Definitions?v1=209104&v2=209124
// could this be that they copy/paste stuff from gdcm itself ?
// how else could you explain the:
// { "1.2.840.113543.6.6.1.3.10002","Unregistered (?) Philips3D" },
static const char * const sopclassuids[][2] = {
{ "1.2.840.10008.1.1","Verification SOP Class" },
{ "1.2.840.10008.1.2","Implicit VR Little Endian: Default Transfer Syntax for DICOM" },
{ "1.2.840.10008.1.2.1","Explicit VR Little Endian" },
{ "1.2.840.10008.1.2.1.99","Deflated Explicit VR Little Endian" },
{ "1.2.840.10008.1.2.2","Explicit VR Big Endian" },
{ "1.2.840.10008.1.2.4.50","JPEG Baseline (Process 1): Default Transfer Syntax for Lossy JPEG 8 Bit Image Compression" },
{ "1.2.840.10008.1.2.4.51","JPEG Extended (Process 2 & 4): Default Transfer Syntax for Lossy JPEG 12 Bit Image Compression (Process 4 only)" },
{ "1.2.840.10008.1.2.4.52","JPEG Extended (Process 3 & 5)" },
{ "1.2.840.10008.1.2.4.53","JPEG Spectral Selection, Non-Hierarchical (Process 6 & 8)" },
{ "1.2.840.10008.1.2.4.54","JPEG Spectral Selection, Non-Hierarchical (Process 7 & 9)" },
{ "1.2.840.10008.1.2.4.55","JPEG Full Progression, Non-Hierarchical (Process 10 & 12)" },
{ "1.2.840.10008.1.2.4.56","JPEG Full Progression, Non-Hierarchical (Process 11 & 13)" },
{ "1.2.840.10008.1.2.4.57","JPEG Lossless, Non-Hierarchical (Process 14)" },
{ "1.2.840.10008.1.2.4.58","JPEG Lossless, Non-Hierarchical (Process 15)" },
{ "1.2.840.10008.1.2.4.59","JPEG Extended, Hierarchical (Process 16 & 18)" },
{ "1.2.840.10008.1.2.4.60","JPEG Extended, Hierarchical (Process 17 & 19)" },
{ "1.2.840.10008.1.2.4.61","JPEG Spectral Selection, Hierarchical (Process 20 & 22)" },
{ "1.2.840.10008.1.2.4.62","JPEG Spectral Selection, Hierarchical (Process 21 & 23)" },
{ "1.2.840.10008.1.2.4.63","JPEG Full Progression, Hierarchical (Process 24 & 26)" },
{ "1.2.840.10008.1.2.4.64","JPEG Full Progression, Hierarchical (Process 25 & 27)" },
{ "1.2.840.10008.1.2.4.65","JPEG Lossless, Hierarchical (Process 28)" },
{ "1.2.840.10008.1.2.4.66","JPEG Lossless, Hierarchical (Process 29)" },
{ "1.2.840.10008.1.2.4.70","JPEG Lossless, Non-Hierarchical, First-Order Prediction (Process 14 [Selection Value 1]): Default Transfer Syntax for Lossless JPEG Image Compression" },
{ "1.2.840.10008.1.2.4.80","JPEG-LS Lossless Image Compression" },
{ "1.2.840.10008.1.2.4.81","JPEG-LS Lossy (Near-Lossless) Image Compression" },
{ "1.2.840.10008.1.2.4.90","JPEG 2000 Image Compression (Lossless Only)" },
{ "1.2.840.10008.1.2.4.91","JPEG 2000 Image Compression" },
{ "1.2.840.10008.1.2.4.92","JPEG 2000 Part 2 Multi-component Image Compression (Lossless Only)" },
{ "1.2.840.10008.1.2.4.93","JPEG 2000 Part 2 Multi-component Image Compression" },
{ "1.2.840.10008.1.2.4.94","JPIP Referenced" },
{ "1.2.840.10008.1.2.4.95","JPIP Referenced Deflate" },
{ "1.2.840.10008.1.2.4.100","MPEG2 Main Profile @ Main Level" },
{ "1.2.840.10008.1.2.5","RLE Lossless" },
{ "1.2.840.10008.1.2.6.1","RFC 2557 MIME encapsulation" },
{ "1.2.840.10008.1.2.6.2","XML Encoding" },
{ "1.2.840.10008.1.3.10","Media Storage Directory Storage" },
{ "1.2.840.10008.1.4.1.1","Talairach Brain Atlas Frame of Reference" },
{ "1.2.840.10008.1.4.1.2","SPM2 T1 Frame of Reference" },
{ "1.2.840.10008.1.4.1.3","SPM2 T2 Frame of Reference" },
{ "1.2.840.10008.1.4.1.4","SPM2 PD Frame of Reference" },
{ "1.2.840.10008.1.4.1.5","SPM2 EPI Frame of Reference" },
{ "1.2.840.10008.1.4.1.6","SPM2 FIL T1 Frame of Reference" },
{ "1.2.840.10008.1.4.1.7","SPM2 PET Frame of Reference" },
{ "1.2.840.10008.1.4.1.8","SPM2 TRANSM Frame of Reference" },
{ "1.2.840.10008.1.4.1.9","SPM2 SPECT Frame of Reference" },
{ "1.2.840.10008.1.4.1.10","SPM2 GRAY Frame of Reference" },
{ "1.2.840.10008.1.4.1.11","SPM2 WHITE Frame of Reference" },
{ "1.2.840.10008.1.4.1.12","SPM2 CSF Frame of Reference" },
{ "1.2.840.10008.1.4.1.13","SPM2 BRAINMASK Frame of Reference" },
{ "1.2.840.10008.1.4.1.14","SPM2 AVG305T1 Frame of Reference" },
{ "1.2.840.10008.1.4.1.15","SPM2 AVG152T1 Frame of Reference" },
{ "1.2.840.10008.1.4.1.16","SPM2 AVG152T2 Frame of Reference" },
{ "1.2.840.10008.1.4.1.17","SPM2 AVG152PD Frame of Reference" },
{ "1.2.840.10008.1.4.1.18","SPM2 SINGLESUBJT1 Frame of Reference" },
{ "1.2.840.10008.1.4.2.1","ICBM 452 T1 Frame of Reference" },
{ "1.2.840.10008.1.4.2.2","ICBM Single Subject MRI Frame of Reference" },
{ "1.2.840.10008.1.9","Basic Study Content Notification SOP Class" },
{ "1.2.840.10008.1.20.1","Storage Commitment Push Model SOP Class" },
{ "1.2.840.10008.1.20.1.1","Storage Commitment Push Model SOP Instance" },
{ "1.2.840.10008.1.20.2","Storage Commitment Pull Model SOP Class" },
{ "1.2.840.10008.1.20.2.1","Storage Commitment Pull Model SOP Instance" },
{ "1.2.840.10008.1.40","Procedural Event Logging SOP Class" },
{ "1.2.840.10008.1.40.1","Procedural Event Logging SOP Instance" },
{ "1.2.840.10008.1.42","Substance Administration Logging SOP Class" },
{ "1.2.840.10008.1.42.1","Substance Administration Logging SOP Instance" },
{ "1.2.840.10008.2.6.1","DICOM UID Registry" },
{ "1.2.840.10008.2.16.4","DICOM Controlled Terminology" },
{ "1.2.840.10008.3.1.1.1","DICOM Application Context Name" },
{ "1.2.840.10008.3.1.2.1.1","Detached Patient Management SOP Class" },
{ "1.2.840.10008.3.1.2.1.4","Detached Patient Management Meta SOP Class" },
{ "1.2.840.10008.3.1.2.2.1","Detached Visit Management SOP Class" },
{ "1.2.840.10008.3.1.2.3.1","Detached Study Management SOP Class" },
{ "1.2.840.10008.3.1.2.3.2","Study Component Management SOP Class" },
{ "1.2.840.10008.3.1.2.3.3","Modality Performed Procedure Step SOP Class" },
{ "1.2.840.10008.3.1.2.3.4","Modality Performed Procedure Step Retrieve SOP Class" },
{ "1.2.840.10008.3.1.2.3.5","Modality Performed Procedure Step Notification SOP Class" },
{ "1.2.840.10008.3.1.2.5.1","Detached Results Management SOP Class" },
{ "1.2.840.10008.3.1.2.5.4","Detached Results Management Meta SOP Class" },
{ "1.2.840.10008.3.1.2.5.5","Detached Study Management Meta SOP Class" },
{ "1.2.840.10008.3.1.2.6.1","Detached Interpretation Management SOP Class" },
{ "1.2.840.10008.4.2","Storage Service Class" },
{ "1.2.840.10008.5.1.1.1","Basic Film Session SOP Class" },
{ "1.2.840.10008.5.1.1.2","Basic Film Box SOP Class" },
{ "1.2.840.10008.5.1.1.4","Basic Grayscale Image Box SOP Class" },
{ "1.2.840.10008.5.1.1.4.1","Basic Color Image Box SOP Class" },
{ "1.2.840.10008.5.1.1.4.2","Referenced Image Box SOP Class" },
{ "1.2.840.10008.5.1.1.9","Basic Grayscale Print Management Meta SOP Class" },
{ "1.2.840.10008.5.1.1.9.1","Referenced Grayscale Print Management Meta SOP Class" },
{ "1.2.840.10008.5.1.1.14","Print Job SOP Class" },
{ "1.2.840.10008.5.1.1.15","Basic Annotation Box SOP Class" },
{ "1.2.840.10008.5.1.1.16","Printer SOP Class" },
{ "1.2.840.10008.5.1.1.16.376","Printer Configuration Retrieval SOP Class" },
{ "1.2.840.10008.5.1.1.17","Printer SOP Instance" },
{ "1.2.840.10008.5.1.1.17.376","Printer Configuration Retrieval SOP Instance" },
{ "1.2.840.10008.5.1.1.18","Basic Color Print Management Meta SOP Class" },
{ "1.2.840.10008.5.1.1.18.1","Referenced Color Print Management Meta SOP Class" },
{ "1.2.840.10008.5.1.1.22","VOI LUT Box SOP Class" },
{ "1.2.840.10008.5.1.1.23","Presentation LUT SOP Class" },
{ "1.2.840.10008.5.1.1.24","Image Overlay Box SOP Class" },
{ "1.2.840.10008.5.1.1.24.1","Basic Print Image Overlay Box SOP Class" },
{ "1.2.840.10008.5.1.1.25","Print Queue SOP Instance" },
{ "1.2.840.10008.5.1.1.26","Print Queue Management SOP Class" },
{ "1.2.840.10008.5.1.1.27","Stored Print Storage SOP Class" },
{ "1.2.840.10008.5.1.1.29","Hardcopy Grayscale Image Storage SOP Class" },
{ "1.2.840.10008.5.1.1.30","Hardcopy Color Image Storage SOP Class" },
{ "1.2.840.10008.5.1.1.31","Pull Print Request SOP Class" },
{ "1.2.840.10008.5.1.1.32","Pull Stored Print Management Meta SOP Class" },
{ "1.2.840.10008.5.1.1.33","Media Creation Management SOP Class UID" },
{ "1.2.840.10008.5.1.4.1.1.1","Computed Radiography Image Storage" },
{ "1.2.840.10008.5.1.4.1.1.1.1","Digital X-Ray Image Storage - For Presentation" },
{ "1.2.840.10008.5.1.4.1.1.1.1.1","Digital X-Ray Image Storage - For Processing" },
{ "1.2.840.10008.5.1.4.1.1.1.2","Digital Mammography X-Ray Image Storage - For Presentation" },
{ "1.2.840.10008.5.1.4.1.1.1.2.1","Digital Mammography X-Ray Image Storage - For Processing" },
{ "1.2.840.10008.5.1.4.1.1.1.3","Digital Intra-oral X-Ray Image Storage - For Presentation" },
{ "1.2.840.10008.5.1.4.1.1.1.3.1","Digital Intra-oral X-Ray Image Storage - For Processing" },
{ "1.2.840.10008.5.1.4.1.1.2","CT Image Storage" },
{ "1.2.840.10008.5.1.4.1.1.2.1","Enhanced CT Image Storage" },
{ "1.2.840.10008.5.1.4.1.1.3","Ultrasound Multi-frame Image Storage" },
{ "1.2.840.10008.5.1.4.1.1.3.1","Ultrasound Multi-frame Image Storage" },
{ "1.2.840.10008.5.1.4.1.1.4","MR Image Storage" },
{ "1.2.840.10008.5.1.4.1.1.4.1","Enhanced MR Image Storage" },
{ "1.2.840.10008.5.1.4.1.1.4.2","MR Spectroscopy Storage" },
{ "1.2.840.10008.5.1.4.1.1.5","Nuclear Medicine Image Storage" },
{ "1.2.840.10008.5.1.4.1.1.6","Ultrasound Image Storage" },
{ "1.2.840.10008.5.1.4.1.1.6.1","Ultrasound Image Storage" },
{ "1.2.840.10008.5.1.4.1.1.7","Secondary Capture Image Storage" },
{ "1.2.840.10008.5.1.4.1.1.7.1","Multi-frame Single Bit Secondary Capture Image Storage" },
{ "1.2.840.10008.5.1.4.1.1.7.2","Multi-frame Grayscale Byte Secondary Capture Image Storage" },
{ "1.2.840.10008.5.1.4.1.1.7.3","Multi-frame Grayscale Word Secondary Capture Image Storage" },
{ "1.2.840.10008.5.1.4.1.1.7.4","Multi-frame True Color Secondary Capture Image Storage" },
{ "1.2.840.10008.5.1.4.1.1.8","Standalone Overlay Storage" },
{ "1.2.840.10008.5.1.4.1.1.9","Standalone Curve Storage" },
{ "1.2.840.10008.5.1.4.1.1.9.1","Waveform Storage - Trial" },
{ "1.2.840.10008.5.1.4.1.1.9.1.1","12-lead ECG Waveform Storage" },
{ "1.2.840.10008.5.1.4.1.1.9.1.2","General ECG Waveform Storage" },
{ "1.2.840.10008.5.1.4.1.1.9.1.3","Ambulatory ECG Waveform Storage" },
{ "1.2.840.10008.5.1.4.1.1.9.2.1","Hemodynamic Waveform Storage" },
{ "1.2.840.10008.5.1.4.1.1.9.3.1","Cardiac Electrophysiology Waveform Storage" },
{ "1.2.840.10008.5.1.4.1.1.9.4.1","Basic Voice Audio Waveform Storage" },
{ "1.2.840.10008.5.1.4.1.1.10","Standalone Modality LUT Storage" },
{ "1.2.840.10008.5.1.4.1.1.11","Standalone VOI LUT Storage" },
{ "1.2.840.10008.5.1.4.1.1.11.1","Grayscale Softcopy Presentation State Storage SOP Class" },
{ "1.2.840.10008.5.1.4.1.1.11.2","Color Softcopy Presentation State Storage SOP Class" },
{ "1.2.840.10008.5.1.4.1.1.11.3","Pseudo-Color Softcopy Presentation State Storage SOP Class" },
{ "1.2.840.10008.5.1.4.1.1.11.4","Blending Softcopy Presentation State Storage SOP Class" },
{ "1.2.840.10008.5.1.4.1.1.12.1","X-Ray Angiographic Image Storage" },
{ "1.2.840.10008.5.1.4.1.1.12.1.1","Enhanced XA Image Storage" },
{ "1.2.840.10008.5.1.4.1.1.12.2","X-Ray Radiofluoroscopic Image Storage" },
{ "1.2.840.10008.5.1.4.1.1.12.2.1","Enhanced XRF Image Storage" },
{ "1.2.840.10008.5.1.4.1.1.13.1.1","X-Ray 3D Angiographic Image Storage" },
{ "1.2.840.10008.5.1.4.1.1.13.1.2","X-Ray 3D Craniofacial Image Storage" },
{ "1.2.840.10008.5.1.4.1.1.12.3","X-Ray Angiographic Bi-Plane Image Storage" },
{ "1.2.840.10008.5.1.4.1.1.20","Nuclear Medicine Image Storage" },
{ "1.2.840.10008.5.1.4.1.1.66","Raw Data Storage" },
{ "1.2.840.10008.5.1.4.1.1.66.1","Spatial Registration Storage" },
{ "1.2.840.10008.5.1.4.1.1.66.2","Spatial Fiducials Storage" },
{ "1.2.840.10008.5.1.4.1.1.66.3","Deformable Spatial Registration Storage" },
{ "1.2.840.10008.5.1.4.1.1.66.4","Segmentation Storage" },
{ "1.2.840.10008.5.1.4.1.1.67","Real World Value Mapping Storage" },
{ "1.2.840.10008.5.1.4.1.1.77.1","VL Image Storage - Trial" },
{ "1.2.840.10008.5.1.4.1.1.77.2","VL Multi-frame Image Storage - Trial" },
{ "1.2.840.10008.5.1.4.1.1.77.1.1","VL Endoscopic Image Storage" },
{ "1.2.840.10008.5.1.4.1.1.77.1.1.1","Video Endoscopic Image Storage" },
{ "1.2.840.10008.5.1.4.1.1.77.1.2","VL Microscopic Image Storage" },
{ "1.2.840.10008.5.1.4.1.1.77.1.2.1","Video Microscopic Image Storage" },
{ "1.2.840.10008.5.1.4.1.1.77.1.3","VL Slide-Coordinates Microscopic Image Storage" },
{ "1.2.840.10008.5.1.4.1.1.77.1.4","VL Photographic Image Storage" },
{ "1.2.840.10008.5.1.4.1.1.77.1.4.1","Video Photographic Image Storage" },
{ "1.2.840.10008.5.1.4.1.1.77.1.5.1","Ophthalmic Photography 8 Bit Image Storage" },
{ "1.2.840.10008.5.1.4.1.1.77.1.5.2","Ophthalmic Photography 16 Bit Image Storage" },
{ "1.2.840.10008.5.1.4.1.1.77.1.5.3","Stereometric Relationship Storage" },
{ "1.2.840.10008.5.1.4.1.1.77.1.5.4","Ophthalmic Tomography Image Storage" },
{ "1.2.840.10008.5.1.4.1.1.88.1","Text SR Storage - Trial" },
{ "1.2.840.10008.5.1.4.1.1.88.2","Audio SR Storage - Trial" },
{ "1.2.840.10008.5.1.4.1.1.88.3","Detail SR Storage - Trial" },
{ "1.2.840.10008.5.1.4.1.1.88.4","Comprehensive SR Storage - Trial" },
{ "1.2.840.10008.5.1.4.1.1.88.11","Basic Text SR Storage" },
{ "1.2.840.10008.5.1.4.1.1.88.22","Enhanced SR Storage" },
{ "1.2.840.10008.5.1.4.1.1.88.33","Comprehensive SR Storage" },
{ "1.2.840.10008.5.1.4.1.1.88.40","Procedure Log Storage" },
{ "1.2.840.10008.5.1.4.1.1.88.50","Mammography CAD SR Storage" },
{ "1.2.840.10008.5.1.4.1.1.88.59","Key Object Selection Document Storage" },
{ "1.2.840.10008.5.1.4.1.1.88.65","Chest CAD SR Storage" },
{ "1.2.840.10008.5.1.4.1.1.88.67","X-Ray Radiation Dose SR Storage" },
{ "1.2.840.10008.5.1.4.1.1.104.1","Encapsulated PDF Storage" },
{ "1.2.840.10008.5.1.4.1.1.104.2","Encapsulated CDA Storage" },
{ "1.2.840.10008.5.1.4.1.1.128","Positron Emission Tomography Image Storage" },
{ "1.2.840.10008.5.1.4.1.1.129","Standalone PET Curve Storage" },
{ "1.2.840.10008.5.1.4.1.1.481.1","RT Image Storage" },
{ "1.2.840.10008.5.1.4.1.1.481.2","RT Dose Storage" },
{ "1.2.840.10008.5.1.4.1.1.481.3","RT Structure Set Storage" },
{ "1.2.840.10008.5.1.4.1.1.481.4","RT Beams Treatment Record Storage" },
{ "1.2.840.10008.5.1.4.1.1.481.5","RT Plan Storage" },
{ "1.2.840.10008.5.1.4.1.1.481.6","RT Brachy Treatment Record Storage" },
{ "1.2.840.10008.5.1.4.1.1.481.7","RT Treatment Summary Record Storage" },
{ "1.2.840.10008.5.1.4.1.1.481.8","RT Ion Plan Storage" },
{ "1.2.840.10008.5.1.4.1.1.481.9","RT Ion Beams Treatment Record Storage" },
{ "1.2.840.10008.5.1.4.1.2.1.1","Patient Root Query/Retrieve Information Model - FIND" },
{ "1.2.840.10008.5.1.4.1.2.1.2","Patient Root Query/Retrieve Information Model - MOVE" },
{ "1.2.840.10008.5.1.4.1.2.1.3","Patient Root Query/Retrieve Information Model - GET" },
{ "1.2.840.10008.5.1.4.1.2.2.1","Study Root Query/Retrieve Information Model - FIND" },
{ "1.2.840.10008.5.1.4.1.2.2.2","Study Root Query/Retrieve Information Model - MOVE" },
{ "1.2.840.10008.5.1.4.1.2.2.3","Study Root Query/Retrieve Information Model - GET" },
{ "1.2.840.10008.5.1.4.1.2.3.1","Patient/Study Only Query/Retrieve Information Model - FIND" },
{ "1.2.840.10008.5.1.4.1.2.3.2","Patient/Study Only Query/Retrieve Information Model - MOVE" },
{ "1.2.840.10008.5.1.4.1.2.3.3","Patient/Study Only Query/Retrieve Information Model - GET" },
{ "1.2.840.10008.5.1.4.31","Modality Worklist Information Model - FIND" },
{ "1.2.840.10008.5.1.4.32.1","General Purpose Worklist Information Model - FIND" },
{ "1.2.840.10008.5.1.4.32.2","General Purpose Scheduled Procedure Step SOP Class" },
{ "1.2.840.10008.5.1.4.32.3","General Purpose Performed Procedure Step SOP Class" },
{ "1.2.840.10008.5.1.4.32","General Purpose Worklist Management Meta SOP Class" },
{ "1.2.840.10008.5.1.4.33","Instance Availability Notification SOP Class" },
{ "1.2.840.10008.5.1.4.34.1","RT Beams Delivery Instruction Storage (Supplement 74 Frozen Draft)" },
{ "1.2.840.10008.5.1.4.34.2","RT Conventional Machine Verification (Supplement 74 Frozen Draft)" },
{ "1.2.840.10008.5.1.4.34.3","RT Ion Machine Verification (Supplement 74 Frozen Draft)" },
{ "1.2.840.10008.5.1.4.34.4","Unified Worklist and Procedure Step Service Class" },
{ "1.2.840.10008.5.1.4.34.4.1","Unified Procedure Step - Push SOP Class" },
{ "1.2.840.10008.5.1.4.34.4.2","Unified Procedure Step - Watch SOP Class" },
{ "1.2.840.10008.5.1.4.34.4.3","Unified Procedure Step - Pull SOP Class" },
{ "1.2.840.10008.5.1.4.34.4.4","Unified Procedure Step - Event SOP Class" },
{ "1.2.840.10008.5.1.4.34.5","Unified Worklist and Procedure Step SOP Instance" },
{ "1.2.840.10008.5.1.4.37.1","General Relevant Patient Information Query" },
{ "1.2.840.10008.5.1.4.37.2","Breast Imaging Relevant Patient Information Query" },
{ "1.2.840.10008.5.1.4.37.3","Cardiac Relevant Patient Information Query" },
{ "1.2.840.10008.5.1.4.38.1","Hanging Protocol Storage" },
{ "1.2.840.10008.5.1.4.38.2","Hanging Protocol Information Model - FIND" },
{ "1.2.840.10008.5.1.4.38.3","Hanging Protocol Information Model - MOVE" },
{ "1.2.840.10008.5.1.4.41","Product Characteristics Query SOP Class" },
{ "1.2.840.10008.5.1.4.42","Substance Approval Query SOP Class" },
{ "1.2.840.10008.15.0.3.1","dicomDeviceName" },
{ "1.2.840.10008.15.0.3.2","dicomDescription" },
{ "1.2.840.10008.15.0.3.3","dicomManufacturer" },
{ "1.2.840.10008.15.0.3.4","dicomManufacturerModelName" },
{ "1.2.840.10008.15.0.3.5","dicomSoftwareVersion" },
{ "1.2.840.10008.15.0.3.6","dicomVendorData" },
{ "1.2.840.10008.15.0.3.7","dicomAETitle" },
{ "1.2.840.10008.15.0.3.8","dicomNetworkConnectionReference" },
{ "1.2.840.10008.15.0.3.9","dicomApplicationCluster" },
{ "1.2.840.10008.15.0.3.10","dicomAssociationInitiator" },
{ "1.2.840.10008.15.0.3.11","dicomAssociationAcceptor" },
{ "1.2.840.10008.15.0.3.12","dicomHostname" },
{ "1.2.840.10008.15.0.3.13","dicomPort" },
{ "1.2.840.10008.15.0.3.14","dicomSOPClass" },
{ "1.2.840.10008.15.0.3.15","dicomTransferRole" },
{ "1.2.840.10008.15.0.3.16","dicomTransferSyntax" },
{ "1.2.840.10008.15.0.3.17","dicomPrimaryDeviceType" },
{ "1.2.840.10008.15.0.3.18","dicomRelatedDeviceReference" },
{ "1.2.840.10008.15.0.3.19","dicomPreferredCalledAETitle" },
{ "1.2.840.10008.15.0.3.20","dicomTLSCyphersuite" },
{ "1.2.840.10008.15.0.3.21","dicomAuthorizedNodeCertificateReference" },
{ "1.2.840.10008.15.0.3.22","dicomThisNodeCertificateReference" },
{ "1.2.840.10008.15.0.3.23","dicomInstalled" },
{ "1.2.840.10008.15.0.3.24","dicomStationName" },
{ "1.2.840.10008.15.0.3.25","dicomDeviceSerialNumber" },
{ "1.2.840.10008.15.0.3.26","dicomInstitutionName" },
{ "1.2.840.10008.15.0.3.27","dicomInstitutionAddress" },
{ "1.2.840.10008.15.0.3.28","dicomInstitutionDepartmentName" },
{ "1.2.840.10008.15.0.3.29","dicomIssuerOfPatientID" },
{ "1.2.840.10008.15.0.3.30","dicomPreferredCallingAETitle" },
{ "1.2.840.10008.15.0.3.31","dicomSupportedCharacterSet" },
{ "1.2.840.10008.15.0.4.1","dicomConfigurationRoot" },
{ "1.2.840.10008.15.0.4.2","dicomDevicesRoot" },
{ "1.2.840.10008.15.0.4.3","dicomUniqueAETitlesRegistryRoot" },
{ "1.2.840.10008.15.0.4.4","dicomDevice" },
{ "1.2.840.10008.15.0.4.5","dicomNetworkAE" },
{ "1.2.840.10008.15.0.4.6","dicomNetworkConnection" },
{ "1.2.840.10008.15.0.4.7","dicomUniqueAETitle" },
{ "1.2.840.10008.15.0.4.8","dicomTransferCapability" },
{ "1.2.840.113619.4.2","General Electric Magnetic Resonance Image Storage" },
{ "1.2.840.113619.4.3","General Electric Computed Tomography Image Storage" },
{ "1.3.12.2.1107.5.9.1","CSA Non-Image Storage" },
{ "1.2.840.113619.4.26","GE Private 3D Model Storage" },
{ "1.2.840.113619.4.30","GE Advance (PET) Raw Data Storage" },
{ "2.16.840.1.113709.1.5.1","GEPACS_PRIVATE_IMS_INFO Storage" },
{ "1.2.840.113543.6.6.1.3.10002","Unregistered (?) Philips3D" },
{ "1.2.392.200036.9116.7.8.1.1.1","Toshiba Private Data Storage" },
{ "1.2.840.113619.4.27","GE Nuclear Medicine private SOP Class" },
//{ "1.3.46.670589.11.0.0.12.1","Philips Private Gyroscan MR Spectrum" },
{ "1.3.46.670589.11.0.0.12.1","Philips Private MR Spectrum Storage" },
//{ "1.3.46.670589.11.0.0.12.2","Philips Private Gyroscan MR Series Data" },
{ "1.3.46.670589.11.0.0.12.2","Philips Private MR Series Data Storage" },
{ "1.3.46.670589.2.3.1.1","Philips Private Specialized XA Image" },
{ "1.3.46.670589.2.4.1.1","Philips Private CX Image Storage" },
{ "1.3.46.670589.2.5.1.1","Philips iE33 private 3D Object Storage" },
{ "1.3.46.670589.5.0.1","Philips Private Volume Storage" },
{ "1.3.46.670589.5.0.1.1","Philips Private Volume Image Reference" },
{ "1.3.46.670589.5.0.10","Philips Private MR Synthetic Image Storage" },
{ "1.3.46.670589.5.0.11","Philips Private MR Cardio Analysis Storage" },
{ "1.3.46.670589.5.0.11.1","Philips Private MR Cardio Analysis Data" },
{ "1.3.46.670589.5.0.12","Philips Private CX Synthetic Image Storage" },
{ "1.3.46.670589.5.0.13","Philips Private Perfusion Image Reference" },
{ "1.3.46.670589.5.0.14","Philips Private Perfusion Analysis Data" },
{ "1.3.46.670589.5.0.2","Philips Private 3D Object Storage" },
{ "1.3.46.670589.5.0.2.1","Philips Private 3D Object 2 Storage" },
{ "1.3.46.670589.5.0.3","Philips Private Surface Storage" },
{ "1.3.46.670589.5.0.3.1","Philips Private Surface 2 Storage" },
{ "1.3.46.670589.5.0.4","Philips Private Composite Object Storage" },
{ "1.3.46.670589.5.0.7","Philips Private MR Cardio Profile" },
{ "1.3.46.670589.5.0.8","Philips Private MR Cardio" },
{ "1.3.46.670589.5.0.9","Philips Private CT Synthetic Image Storage" },
{ "1.2.752.24.3.7.6","Sectra Compression (Private Syntax)" },
{ "1.2.752.24.3.7.7","Sectra Compression LS (Private Syntax)" },
{ "1.2.840.113619.5.2","Implicit VR Big Endian DLX (G.E Private)" },
{ nullptr, nullptr}
};
// Custom list:
static const char * const sopclassuids2[] = {
"1.2.840.10008.1.3.10",
"1.2.840.10008.5.1.4.1.1.1",
"1.2.840.10008.5.1.4.1.1.1.1",
"1.2.840.10008.5.1.4.1.1.11.1",
"1.2.840.10008.5.1.4.1.1.1.2",
"1.2.840.10008.5.1.4.1.1.12.1",
"1.2.840.10008.5.1.4.1.1.12.2",
"1.2.840.10008.5.1.4.1.1.128",
"1.2.840.10008.5.1.4.1.1.2",
"1.2.840.10008.5.1.4.1.1.20",
"1.2.840.10008.5.1.4.1.1.3.1",
"1.2.840.10008.5.1.4.1.1.4",
"1.2.840.10008.5.1.4.1.1.4.1",
"1.2.840.10008.5.1.4.1.1.481.3",
"1.2.840.10008.5.1.4.1.1.5",
"1.2.840.10008.5.1.4.1.1.6",
"1.2.840.10008.5.1.4.1.1.6.1",
"1.2.840.10008.5.1.4.1.1.66",
"1.2.840.10008.5.1.4.1.1.7",
"1.2.840.10008.5.1.4.1.1.88.11",
"1.2.840.10008.5.1.4.1.1.88.22",
"1.2.840.10008.5.1.4.1.1.88.3",
"1.2.840.10008.5.1.4.1.1.88.59",
"1.2.840.10008.5.1.4.1.1.9",
"1.2.840.10008.5.1.4.1.1.9.4.1",
"1.2.840.10008.5.1.4.38.1",
"1.2.840.113619.4.26",
"1.3.12.2.1107.5.9.1",
"1.3.46.670589.11.0.0.12.2",
"1.3.46.670589.5.0.1",
"1.3.46.670589.5.0.10",
"1.3.46.670589.5.0.1.1",
"1.3.46.670589.5.0.11",
"1.3.46.670589.5.0.13",
"1.3.46.670589.5.0.14",
"1.3.46.670589.5.0.2",
"1.3.46.670589.5.0.2.1",
"1.3.46.670589.5.0.3",
"1.3.46.670589.5.0.8",
//"1.3.6.1.4.1.20468.1.10", // invalid
nullptr
};
int TestUIDs(int, char *[])
{
const char* s0 = gdcm::UIDs::GetUIDString( 0 );
if(s0) return 1;
// {"1.2.840.10008.5.1.4.1.1.2.1","Enhanced CT Image Storage"},
// uid_1_2_840_10008_5_1_4_1_1_2_1 = 117, // Enhanced CT Image Storage
const char* s = gdcm::UIDs::GetUIDString( gdcm::UIDs::uid_1_2_840_10008_5_1_4_1_1_2_1 );
if(!s) return 1;
std::cout << s << std::endl;
const char* n = gdcm::UIDs::GetUIDName( gdcm::UIDs::uid_1_2_840_10008_5_1_4_1_1_2_1 );
if(!n) return 1;
std::cout << n << std::endl;
const char* s1 = gdcm::UIDs::GetUIDString( gdcm::UIDs::EnhancedCTImageStorage );
if(!s1) return 1;
std::cout << s1 << std::endl;
const char* n1 = gdcm::UIDs::GetUIDName( gdcm::UIDs::EnhancedCTImageStorage );
if(!n1) return 1;
std::cout << n1 << std::endl;
gdcm::UIDs uid;
// valid:
if( !uid.SetFromUID( "1.2.840.10008.5.1.4.1.1.2.1" ) )
{
return 1;
}
std::cout << "This is : " << uid.GetName() << std::endl;
std::cout << "This is : " << uid.GetString() << std::endl;
std::cout << uid << std::endl;
// invalid
if( uid.SetFromUID( "prosper youpla boum c'est le roi du pain d'epices" ) )
{
return 1;
}
if( uid.GetName() ) return 1;
if( uid.SetFromUID( "1.2" ) )
{
return 1;
}
if( uid.GetName() ) return 1;
if( uid.SetFromUID( "" ) )
{
return 1;
}
if( uid.GetName() ) return 1;
// black box:
if( uid.SetFromUID( nullptr ) )
{
return 1;
}
if( uid.GetName() ) return 1;
using mytype = const char *const (*)[2];
mytype sopclassuid = sopclassuids;
while( *sopclassuid[0] )
{
const char *uid_str = (*sopclassuid)[0];
const char *name_str = (*sopclassuid)[1];
//std::cout << uid_str << std::endl;
if( !uid.SetFromUID( uid_str ) )
{
std::cerr << "Invalid UID:" << uid_str << std::endl;
return 1;
}
const char *name = uid.GetName();
if( !name )
{
std::cerr << "problem with: " << uid_str << std::endl;
return 1;
}
if( strcmp( name, name_str) != 0 )
{
std::cerr << "Error: " << name << " vs " << name_str << std::endl;
return 1;
}
++sopclassuid;
}
std::cout << "Custom List:" << std::endl;
const char * const *s2 = sopclassuids2;
while( *s2 )
{
const char *uid_str = *s2;
if( !uid.SetFromUID( uid_str ) )
{
std::cerr << "Invalid UID:" << uid_str << std::endl;
return 1;
}
const char *name = uid.GetName();
if( !name )
{
return 1;
}
//std::cout << uid_str << "," << name << std::endl;
s2++;
}
// Print all
std::cout << "All:" << std::endl;
for(unsigned int i = 0; i < gdcm::UIDs::GetNumberOfTransferSyntaxStrings(); ++i)
{
//const char * const * str_pair = gdcm::UIDs::GetTransferSyntaxString(i);
uid.SetFromUID( gdcm::UIDs::GetUIDString( i+1 ) );
//std::cout << uid << std::endl;
if( !uid.GetName() || !uid.GetString() ) return 1;
}
return 0;
}
gdcm-3.0.22/Testing/Source/DataDictionary/Cxx/TestDictEntry.cxx 000664 001766 001770 00000002757 14517730450 026677 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmDictEntry.h"
#include "gdcmDict.h"
int TestDictEntry(int, char *[])
{
//gdcm::DictEntry de(0,0,0,0);
//std::cout << sizeof(de) << std::endl;
//gdcm::PrivateDictEntry pde(0,0,0);
//std::cout << sizeof(pde) << std::endl;
gdcm::PrivateTag pt1(0,0,"bla");
gdcm::PrivateTag pt2(0,0,"foo");
gdcm::PrivateTag pt3(0,1,"bla");
gdcm::PrivateTag pt4(0,1,"foo");
if( ! (pt1 < pt2) )
{
return 1;
}
if( ! (pt2 < pt3) )
{
return 1;
}
if( ! (pt3 < pt4) )
{
return 1;
}
if( ! (pt1 < pt3) )
{
return 1;
}
if( ! (pt1 < pt4) )
{
return 1;
}
if( ! (pt2 < pt4) )
{
return 1;
}
if( pt4 < pt3 )
{
return 1;
}
if( pt4 < pt2 )
{
return 1;
}
if( pt4 < pt1 )
{
return 1;
}
if( pt3 < pt2 )
{
return 1;
}
if( pt3 < pt1 )
{
return 1;
}
if( pt2 < pt1 )
{
return 1;
}
return 0;
}
gdcm-3.0.22/Testing/Source/DataDictionary/Cxx/TestDict.cxx 000664 001766 001770 00000001257 14517730450 025647 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmDict.h"
int TestDict(int, char *[])
{
gdcm::Dict d;
std::cerr << sizeof(d) << std::endl;
return 0;
}
gdcm-3.0.22/Testing/Source/DataDictionary/Cxx/TestTagToType.xsl 000664 001766 001770 00000004513 14517730450 026646 0 ustar 00mmalaterre mmalaterre 000000 000000
// GENERATED FILE DO NOT EDIT
// $ xsltproc TestTagToType.xsl DICOMV3.xml > TestTagToType.cxx
/*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmTagToType.h"
int TestTagToType(int, char *[])
{
gdcm::TagToType<0x
,0x
>
; (void)
;
return 0;
}
gdcm-3.0.22/Testing/Source/DataDictionary/Cxx/TestTagKeywords.cxx 000664 001766 001770 00000001374 14517730450 027227 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmTagKeywords.h"
int TestTagKeywords(int, char *[])
{
gdcm::Keywords::FileMetaInformationVersion at1;
(void)at1;
if( at1.GetTag() != gdcm::Tag( 0x2, 0x1 ) ) return 1;
return 0;
}
gdcm-3.0.22/Testing/Source/DataDictionary/Cxx/TestGlobal.cxx 000664 001766 001770 00000006317 14517730450 026166 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmGlobal.h"
#include "gdcmDicts.h"
#include "gdcmDict.h"
#include "gdcmDefs.h"
int TestGlobal(int, char *[])
{
// case 1
// Get the global singleton:
gdcm::Trace::DebugOn();
gdcm::Global& g = gdcm::Global::GetInstance();
if( !g.LoadResourcesFiles() )
{
std::cerr << "Could not LoadResourcesFiles" << std::endl;
return 1;
}
gdcm::Trace::DebugOff();
// get the Part 6 dicts from it:
const gdcm::Dicts &ds = g.GetDicts();
const gdcm::Dict &pub = ds.GetPublicDict();
const gdcm::PrivateDict &priv = ds.GetPrivateDict();
// case 2
gdcm::Dicts dicts;
const gdcm::Dict &d1 = dicts.GetPublicDict();
// case 3
gdcm::Dict d2;
// This one will be empty:
std::cout << "Empty dict:" << std::endl;
std::cout << d1 << std::endl;
if( !d1.IsEmpty() )
{
return 1;
}
// This one will be empty:
std::cout << "Empty dict:" << std::endl;
std::cout << d2 << std::endl;
if( !d2.IsEmpty() )
{
return 1;
}
// This should should be filled in:
std::cout << "Global pub dict:" << std::endl;
//std::cout << pub << std::endl;
if( pub.IsEmpty() )
{
return 1;
}
// This should should be filled in:
std::cout << "Global priv dict:" << std::endl;
//std::cout << priv << std::endl;
if( priv.IsEmpty() )
{
return 1;
}
#if 0
// FIXME I do not understand what was wrong before...
// I had to change the PrivateTag to use lower case to support this:
const gdcm::DictEntry& de1 = priv.GetDictEntry( gdcm::PrivateTag(0x2001,0x0001,"Philips Imaging DD 001") );
std::cout << de1 << std::endl;
const gdcm::DictEntry& de2 = priv.GetDictEntry( gdcm::PrivateTag(0x2001,0x0001,"PHILIPS IMAGING DD 001") );
std::cout << de2 << std::endl;
if( &de1 != &de2 )
{
return 1;
}
const gdcm::DictEntry& de3 = priv.GetDictEntry( gdcm::PrivateTag(0x2001,0x0003,"Philips Imaging DD 001") );
std::cout << de3 << std::endl;
const gdcm::DictEntry& de4 = priv.GetDictEntry( gdcm::PrivateTag(0x2001,0x0003,"PHILIPS IMAGING DD 001") );
std::cout << de4 << std::endl;
if( &de4 != &de3 )
{
return 1;
}
#endif
#if 0
const char *empty = "";
std::string s = empty;
std::cout << s.empty() << std::endl;
const gdcm::DictEntry& de = pub.GetDictEntry( gdcm::Tag(0x0028,0x0015) );
const char *v = de.GetName();
//assert( v );
std::cout << "TOTO:" << de << std::endl;
#endif
const gdcm::Defs &defs = g.GetDefs();
const gdcm::Modules &modules = defs.GetModules();
std::cout << modules << std::endl;
const gdcm::Macros ¯os = defs.GetMacros();
std::cout << macros << std::endl;
const gdcm::IODs &iods = defs.GetIODs();
std::cout << iods << std::endl;
return 0;
}
gdcm-3.0.22/Testing/Source/DataDictionary/Cxx/TestGroupDict.cxx 000664 001766 001770 00000001316 14517730450 026660 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmGroupDict.h"
#include
int TestGroupDict(int , char *[])
{
gdcm::GroupDict gd;
std::cout << gd << std::endl;
return 0;
}
gdcm-3.0.22/Testing/Source/DataDictionary/Cxx/TestTagToType.cxx 000664 001766 001770 00000474252 14517730450 026655 0 ustar 00mmalaterre mmalaterre 000000 000000
// GENERATED FILE DO NOT EDIT
// $ xsltproc TestTagToType.xsl DICOMV3.xml > TestTagToType.cxx
/*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmTagToType.h"
int TestTagToType(int, char *[])
{
gdcm::TagToType<0x0000,0x0000> x00000000; (void)x00000000;
gdcm::TagToType<0x0000,0x0001> x00000001; (void)x00000001;
gdcm::TagToType<0x0000,0x0002> x00000002; (void)x00000002;
gdcm::TagToType<0x0000,0x0003> x00000003; (void)x00000003;
gdcm::TagToType<0x0000,0x0010> x00000010; (void)x00000010;
gdcm::TagToType<0x0000,0x0100> x00000100; (void)x00000100;
gdcm::TagToType<0x0000,0x0110> x00000110; (void)x00000110;
gdcm::TagToType<0x0000,0x0120> x00000120; (void)x00000120;
gdcm::TagToType<0x0000,0x0200> x00000200; (void)x00000200;
gdcm::TagToType<0x0000,0x0300> x00000300; (void)x00000300;
gdcm::TagToType<0x0000,0x0400> x00000400; (void)x00000400;
gdcm::TagToType<0x0000,0x0600> x00000600; (void)x00000600;
gdcm::TagToType<0x0000,0x0700> x00000700; (void)x00000700;
gdcm::TagToType<0x0000,0x0800> x00000800; (void)x00000800;
gdcm::TagToType<0x0000,0x0850> x00000850; (void)x00000850;
gdcm::TagToType<0x0000,0x0860> x00000860; (void)x00000860;
gdcm::TagToType<0x0000,0x0900> x00000900; (void)x00000900;
gdcm::TagToType<0x0000,0x0901> x00000901; (void)x00000901;
gdcm::TagToType<0x0000,0x0902> x00000902; (void)x00000902;
gdcm::TagToType<0x0000,0x0903> x00000903; (void)x00000903;
gdcm::TagToType<0x0000,0x1000> x00001000; (void)x00001000;
gdcm::TagToType<0x0000,0x1001> x00001001; (void)x00001001;
gdcm::TagToType<0x0000,0x1002> x00001002; (void)x00001002;
gdcm::TagToType<0x0000,0x1005> x00001005; (void)x00001005;
gdcm::TagToType<0x0000,0x1008> x00001008; (void)x00001008;
gdcm::TagToType<0x0000,0x1020> x00001020; (void)x00001020;
gdcm::TagToType<0x0000,0x1021> x00001021; (void)x00001021;
gdcm::TagToType<0x0000,0x1022> x00001022; (void)x00001022;
gdcm::TagToType<0x0000,0x1023> x00001023; (void)x00001023;
gdcm::TagToType<0x0000,0x1030> x00001030; (void)x00001030;
gdcm::TagToType<0x0000,0x1031> x00001031; (void)x00001031;
gdcm::TagToType<0x0000,0x4000> x00004000; (void)x00004000;
gdcm::TagToType<0x0000,0x4010> x00004010; (void)x00004010;
gdcm::TagToType<0x0000,0x5010> x00005010; (void)x00005010;
gdcm::TagToType<0x0000,0x5020> x00005020; (void)x00005020;
gdcm::TagToType<0x0000,0x5110> x00005110; (void)x00005110;
gdcm::TagToType<0x0000,0x5120> x00005120; (void)x00005120;
gdcm::TagToType<0x0000,0x5130> x00005130; (void)x00005130;
gdcm::TagToType<0x0000,0x5140> x00005140; (void)x00005140;
gdcm::TagToType<0x0000,0x5150> x00005150; (void)x00005150;
gdcm::TagToType<0x0000,0x5160> x00005160; (void)x00005160;
gdcm::TagToType<0x0000,0x5170> x00005170; (void)x00005170;
gdcm::TagToType<0x0000,0x5180> x00005180; (void)x00005180;
gdcm::TagToType<0x0000,0x5190> x00005190; (void)x00005190;
gdcm::TagToType<0x0000,0x51a0> x000051a0; (void)x000051a0;
gdcm::TagToType<0x0000,0x51b0> x000051b0; (void)x000051b0;
gdcm::TagToType<0x0002,0x0000> x00020000; (void)x00020000;
gdcm::TagToType<0x0002,0x0001> x00020001; (void)x00020001;
gdcm::TagToType<0x0002,0x0002> x00020002; (void)x00020002;
gdcm::TagToType<0x0002,0x0003> x00020003; (void)x00020003;
gdcm::TagToType<0x0002,0x0010> x00020010; (void)x00020010;
gdcm::TagToType<0x0002,0x0012> x00020012; (void)x00020012;
gdcm::TagToType<0x0002,0x0013> x00020013; (void)x00020013;
gdcm::TagToType<0x0002,0x0016> x00020016; (void)x00020016;
gdcm::TagToType<0x0002,0x0100> x00020100; (void)x00020100;
gdcm::TagToType<0x0002,0x0102> x00020102; (void)x00020102;
gdcm::TagToType<0x0004,0x1130> x00041130; (void)x00041130;
gdcm::TagToType<0x0004,0x1141> x00041141; (void)x00041141;
gdcm::TagToType<0x0004,0x1142> x00041142; (void)x00041142;
gdcm::TagToType<0x0004,0x1200> x00041200; (void)x00041200;
gdcm::TagToType<0x0004,0x1202> x00041202; (void)x00041202;
gdcm::TagToType<0x0004,0x1212> x00041212; (void)x00041212;
gdcm::TagToType<0x0004,0x1220> x00041220; (void)x00041220;
gdcm::TagToType<0x0004,0x1400> x00041400; (void)x00041400;
gdcm::TagToType<0x0004,0x1410> x00041410; (void)x00041410;
gdcm::TagToType<0x0004,0x1420> x00041420; (void)x00041420;
gdcm::TagToType<0x0004,0x1430> x00041430; (void)x00041430;
gdcm::TagToType<0x0004,0x1432> x00041432; (void)x00041432;
gdcm::TagToType<0x0004,0x1500> x00041500; (void)x00041500;
gdcm::TagToType<0x0004,0x1504> x00041504; (void)x00041504;
gdcm::TagToType<0x0004,0x1510> x00041510; (void)x00041510;
gdcm::TagToType<0x0004,0x1511> x00041511; (void)x00041511;
gdcm::TagToType<0x0004,0x1512> x00041512; (void)x00041512;
gdcm::TagToType<0x0004,0x151a> x0004151a; (void)x0004151a;
gdcm::TagToType<0x0004,0x1600> x00041600; (void)x00041600;
gdcm::TagToType<0x0008,0x0001> x00080001; (void)x00080001;
gdcm::TagToType<0x0008,0x0005> x00080005; (void)x00080005;
gdcm::TagToType<0x0008,0x0008> x00080008; (void)x00080008;
gdcm::TagToType<0x0008,0x0010> x00080010; (void)x00080010;
gdcm::TagToType<0x0008,0x0012> x00080012; (void)x00080012;
gdcm::TagToType<0x0008,0x0013> x00080013; (void)x00080013;
gdcm::TagToType<0x0008,0x0014> x00080014; (void)x00080014;
gdcm::TagToType<0x0008,0x0016> x00080016; (void)x00080016;
gdcm::TagToType<0x0008,0x0018> x00080018; (void)x00080018;
gdcm::TagToType<0x0008,0x001a> x0008001a; (void)x0008001a;
gdcm::TagToType<0x0008,0x001b> x0008001b; (void)x0008001b;
gdcm::TagToType<0x0008,0x0020> x00080020; (void)x00080020;
gdcm::TagToType<0x0008,0x0021> x00080021; (void)x00080021;
gdcm::TagToType<0x0008,0x0022> x00080022; (void)x00080022;
gdcm::TagToType<0x0008,0x0023> x00080023; (void)x00080023;
gdcm::TagToType<0x0008,0x0024> x00080024; (void)x00080024;
gdcm::TagToType<0x0008,0x0025> x00080025; (void)x00080025;
gdcm::TagToType<0x0008,0x002a> x0008002a; (void)x0008002a;
gdcm::TagToType<0x0008,0x0030> x00080030; (void)x00080030;
gdcm::TagToType<0x0008,0x0031> x00080031; (void)x00080031;
gdcm::TagToType<0x0008,0x0032> x00080032; (void)x00080032;
gdcm::TagToType<0x0008,0x0033> x00080033; (void)x00080033;
gdcm::TagToType<0x0008,0x0034> x00080034; (void)x00080034;
gdcm::TagToType<0x0008,0x0035> x00080035; (void)x00080035;
gdcm::TagToType<0x0008,0x0040> x00080040; (void)x00080040;
gdcm::TagToType<0x0008,0x0041> x00080041; (void)x00080041;
gdcm::TagToType<0x0008,0x0042> x00080042; (void)x00080042;
gdcm::TagToType<0x0008,0x0050> x00080050; (void)x00080050;
gdcm::TagToType<0x0008,0x0052> x00080052; (void)x00080052;
gdcm::TagToType<0x0008,0x0054> x00080054; (void)x00080054;
gdcm::TagToType<0x0008,0x0056> x00080056; (void)x00080056;
gdcm::TagToType<0x0008,0x0058> x00080058; (void)x00080058;
gdcm::TagToType<0x0008,0x0060> x00080060; (void)x00080060;
gdcm::TagToType<0x0008,0x0061> x00080061; (void)x00080061;
gdcm::TagToType<0x0008,0x0062> x00080062; (void)x00080062;
gdcm::TagToType<0x0008,0x0064> x00080064; (void)x00080064;
gdcm::TagToType<0x0008,0x0068> x00080068; (void)x00080068;
gdcm::TagToType<0x0008,0x0070> x00080070; (void)x00080070;
gdcm::TagToType<0x0008,0x0080> x00080080; (void)x00080080;
gdcm::TagToType<0x0008,0x0081> x00080081; (void)x00080081;
gdcm::TagToType<0x0008,0x0082> x00080082; (void)x00080082;
gdcm::TagToType<0x0008,0x0090> x00080090; (void)x00080090;
gdcm::TagToType<0x0008,0x0092> x00080092; (void)x00080092;
gdcm::TagToType<0x0008,0x0094> x00080094; (void)x00080094;
gdcm::TagToType<0x0008,0x0096> x00080096; (void)x00080096;
gdcm::TagToType<0x0008,0x0100> x00080100; (void)x00080100;
gdcm::TagToType<0x0008,0x0102> x00080102; (void)x00080102;
gdcm::TagToType<0x0008,0x0103> x00080103; (void)x00080103;
gdcm::TagToType<0x0008,0x0104> x00080104; (void)x00080104;
gdcm::TagToType<0x0008,0x0105> x00080105; (void)x00080105;
gdcm::TagToType<0x0008,0x0106> x00080106; (void)x00080106;
gdcm::TagToType<0x0008,0x0107> x00080107; (void)x00080107;
gdcm::TagToType<0x0008,0x010b> x0008010b; (void)x0008010b;
gdcm::TagToType<0x0008,0x010c> x0008010c; (void)x0008010c;
gdcm::TagToType<0x0008,0x010d> x0008010d; (void)x0008010d;
gdcm::TagToType<0x0008,0x010f> x0008010f; (void)x0008010f;
gdcm::TagToType<0x0008,0x0110> x00080110; (void)x00080110;
gdcm::TagToType<0x0008,0x0112> x00080112; (void)x00080112;
gdcm::TagToType<0x0008,0x0114> x00080114; (void)x00080114;
gdcm::TagToType<0x0008,0x0115> x00080115; (void)x00080115;
gdcm::TagToType<0x0008,0x0116> x00080116; (void)x00080116;
gdcm::TagToType<0x0008,0x0201> x00080201; (void)x00080201;
gdcm::TagToType<0x0008,0x1000> x00081000; (void)x00081000;
gdcm::TagToType<0x0008,0x1010> x00081010; (void)x00081010;
gdcm::TagToType<0x0008,0x1030> x00081030; (void)x00081030;
gdcm::TagToType<0x0008,0x1032> x00081032; (void)x00081032;
gdcm::TagToType<0x0008,0x103e> x0008103e; (void)x0008103e;
gdcm::TagToType<0x0008,0x1040> x00081040; (void)x00081040;
gdcm::TagToType<0x0008,0x1048> x00081048; (void)x00081048;
gdcm::TagToType<0x0008,0x1049> x00081049; (void)x00081049;
gdcm::TagToType<0x0008,0x1050> x00081050; (void)x00081050;
gdcm::TagToType<0x0008,0x1052> x00081052; (void)x00081052;
gdcm::TagToType<0x0008,0x1060> x00081060; (void)x00081060;
gdcm::TagToType<0x0008,0x1062> x00081062; (void)x00081062;
gdcm::TagToType<0x0008,0x1070> x00081070; (void)x00081070;
gdcm::TagToType<0x0008,0x1072> x00081072; (void)x00081072;
gdcm::TagToType<0x0008,0x1080> x00081080; (void)x00081080;
gdcm::TagToType<0x0008,0x1084> x00081084; (void)x00081084;
gdcm::TagToType<0x0008,0x1090> x00081090; (void)x00081090;
gdcm::TagToType<0x0008,0x1100> x00081100; (void)x00081100;
gdcm::TagToType<0x0008,0x1110> x00081110; (void)x00081110;
gdcm::TagToType<0x0008,0x1111> x00081111; (void)x00081111;
gdcm::TagToType<0x0008,0x1115> x00081115; (void)x00081115;
gdcm::TagToType<0x0008,0x1120> x00081120; (void)x00081120;
gdcm::TagToType<0x0008,0x1125> x00081125; (void)x00081125;
gdcm::TagToType<0x0008,0x1130> x00081130; (void)x00081130;
gdcm::TagToType<0x0008,0x113a> x0008113a; (void)x0008113a;
gdcm::TagToType<0x0008,0x1140> x00081140; (void)x00081140;
gdcm::TagToType<0x0008,0x1145> x00081145; (void)x00081145;
gdcm::TagToType<0x0008,0x114a> x0008114a; (void)x0008114a;
gdcm::TagToType<0x0008,0x114b> x0008114b; (void)x0008114b;
gdcm::TagToType<0x0008,0x1150> x00081150; (void)x00081150;
gdcm::TagToType<0x0008,0x1155> x00081155; (void)x00081155;
gdcm::TagToType<0x0008,0x115a> x0008115a; (void)x0008115a;
gdcm::TagToType<0x0008,0x1160> x00081160; (void)x00081160;
gdcm::TagToType<0x0008,0x1195> x00081195; (void)x00081195;
gdcm::TagToType<0x0008,0x1197> x00081197; (void)x00081197;
gdcm::TagToType<0x0008,0x1198> x00081198; (void)x00081198;
gdcm::TagToType<0x0008,0x1199> x00081199; (void)x00081199;
gdcm::TagToType<0x0008,0x1200> x00081200; (void)x00081200;
gdcm::TagToType<0x0008,0x1250> x00081250; (void)x00081250;
gdcm::TagToType<0x0008,0x2110> x00082110; (void)x00082110;
gdcm::TagToType<0x0008,0x2111> x00082111; (void)x00082111;
gdcm::TagToType<0x0008,0x2112> x00082112; (void)x00082112;
gdcm::TagToType<0x0008,0x2120> x00082120; (void)x00082120;
gdcm::TagToType<0x0008,0x2122> x00082122; (void)x00082122;
gdcm::TagToType<0x0008,0x2124> x00082124; (void)x00082124;
gdcm::TagToType<0x0008,0x2127> x00082127; (void)x00082127;
gdcm::TagToType<0x0008,0x2128> x00082128; (void)x00082128;
gdcm::TagToType<0x0008,0x2129> x00082129; (void)x00082129;
gdcm::TagToType<0x0008,0x212a> x0008212a; (void)x0008212a;
gdcm::TagToType<0x0008,0x2130> x00082130; (void)x00082130;
gdcm::TagToType<0x0008,0x2132> x00082132; (void)x00082132;
gdcm::TagToType<0x0008,0x2142> x00082142; (void)x00082142;
gdcm::TagToType<0x0008,0x2143> x00082143; (void)x00082143;
gdcm::TagToType<0x0008,0x2144> x00082144; (void)x00082144;
gdcm::TagToType<0x0008,0x2200> x00082200; (void)x00082200;
gdcm::TagToType<0x0008,0x2204> x00082204; (void)x00082204;
gdcm::TagToType<0x0008,0x2208> x00082208; (void)x00082208;
gdcm::TagToType<0x0008,0x2218> x00082218; (void)x00082218;
gdcm::TagToType<0x0008,0x2220> x00082220; (void)x00082220;
gdcm::TagToType<0x0008,0x2228> x00082228; (void)x00082228;
gdcm::TagToType<0x0008,0x2229> x00082229; (void)x00082229;
gdcm::TagToType<0x0008,0x2230> x00082230; (void)x00082230;
gdcm::TagToType<0x0008,0x2240> x00082240; (void)x00082240;
gdcm::TagToType<0x0008,0x2242> x00082242; (void)x00082242;
gdcm::TagToType<0x0008,0x2244> x00082244; (void)x00082244;
gdcm::TagToType<0x0008,0x2246> x00082246; (void)x00082246;
gdcm::TagToType<0x0008,0x2251> x00082251; (void)x00082251;
gdcm::TagToType<0x0008,0x2253> x00082253; (void)x00082253;
gdcm::TagToType<0x0008,0x2255> x00082255; (void)x00082255;
gdcm::TagToType<0x0008,0x2256> x00082256; (void)x00082256;
gdcm::TagToType<0x0008,0x2257> x00082257; (void)x00082257;
gdcm::TagToType<0x0008,0x2258> x00082258; (void)x00082258;
gdcm::TagToType<0x0008,0x2259> x00082259; (void)x00082259;
gdcm::TagToType<0x0008,0x225a> x0008225a; (void)x0008225a;
gdcm::TagToType<0x0008,0x225c> x0008225c; (void)x0008225c;
gdcm::TagToType<0x0008,0x3001> x00083001; (void)x00083001;
gdcm::TagToType<0x0008,0x3010> x00083010; (void)x00083010;
gdcm::TagToType<0x0008,0x4000> x00084000; (void)x00084000;
gdcm::TagToType<0x0008,0x9007> x00089007; (void)x00089007;
gdcm::TagToType<0x0008,0x9092> x00089092; (void)x00089092;
gdcm::TagToType<0x0008,0x9121> x00089121; (void)x00089121;
gdcm::TagToType<0x0008,0x9123> x00089123; (void)x00089123;
gdcm::TagToType<0x0008,0x9124> x00089124; (void)x00089124;
gdcm::TagToType<0x0008,0x9154> x00089154; (void)x00089154;
gdcm::TagToType<0x0008,0x9205> x00089205; (void)x00089205;
gdcm::TagToType<0x0008,0x9206> x00089206; (void)x00089206;
gdcm::TagToType<0x0008,0x9207> x00089207; (void)x00089207;
gdcm::TagToType<0x0008,0x9208> x00089208; (void)x00089208;
gdcm::TagToType<0x0008,0x9209> x00089209; (void)x00089209;
gdcm::TagToType<0x0008,0x9215> x00089215; (void)x00089215;
gdcm::TagToType<0x0008,0x9237> x00089237; (void)x00089237;
gdcm::TagToType<0x0008,0x9410> x00089410; (void)x00089410;
gdcm::TagToType<0x0008,0x9458> x00089458; (void)x00089458;
gdcm::TagToType<0x0008,0x9459> x00089459; (void)x00089459;
gdcm::TagToType<0x0008,0x9460> x00089460; (void)x00089460;
gdcm::TagToType<0x0010,0x0010> x00100010; (void)x00100010;
gdcm::TagToType<0x0010,0x0020> x00100020; (void)x00100020;
gdcm::TagToType<0x0010,0x0021> x00100021; (void)x00100021;
gdcm::TagToType<0x0010,0x0022> x00100022; (void)x00100022;
gdcm::TagToType<0x0010,0x0030> x00100030; (void)x00100030;
gdcm::TagToType<0x0010,0x0032> x00100032; (void)x00100032;
gdcm::TagToType<0x0010,0x0040> x00100040; (void)x00100040;
gdcm::TagToType<0x0010,0x0050> x00100050; (void)x00100050;
gdcm::TagToType<0x0010,0x0101> x00100101; (void)x00100101;
gdcm::TagToType<0x0010,0x0102> x00100102; (void)x00100102;
gdcm::TagToType<0x0010,0x1000> x00101000; (void)x00101000;
gdcm::TagToType<0x0010,0x1001> x00101001; (void)x00101001;
gdcm::TagToType<0x0010,0x1002> x00101002; (void)x00101002;
gdcm::TagToType<0x0010,0x1005> x00101005; (void)x00101005;
gdcm::TagToType<0x0010,0x1010> x00101010; (void)x00101010;
gdcm::TagToType<0x0010,0x1020> x00101020; (void)x00101020;
gdcm::TagToType<0x0010,0x1030> x00101030; (void)x00101030;
gdcm::TagToType<0x0010,0x1040> x00101040; (void)x00101040;
gdcm::TagToType<0x0010,0x1050> x00101050; (void)x00101050;
gdcm::TagToType<0x0010,0x1060> x00101060; (void)x00101060;
gdcm::TagToType<0x0010,0x1080> x00101080; (void)x00101080;
gdcm::TagToType<0x0010,0x1081> x00101081; (void)x00101081;
gdcm::TagToType<0x0010,0x1090> x00101090; (void)x00101090;
gdcm::TagToType<0x0010,0x2000> x00102000; (void)x00102000;
gdcm::TagToType<0x0010,0x2110> x00102110; (void)x00102110;
gdcm::TagToType<0x0010,0x2150> x00102150; (void)x00102150;
gdcm::TagToType<0x0010,0x2152> x00102152; (void)x00102152;
gdcm::TagToType<0x0010,0x2154> x00102154; (void)x00102154;
gdcm::TagToType<0x0010,0x2160> x00102160; (void)x00102160;
gdcm::TagToType<0x0010,0x2180> x00102180; (void)x00102180;
gdcm::TagToType<0x0010,0x21a0> x001021a0; (void)x001021a0;
gdcm::TagToType<0x0010,0x21b0> x001021b0; (void)x001021b0;
gdcm::TagToType<0x0010,0x21c0> x001021c0; (void)x001021c0;
gdcm::TagToType<0x0010,0x21d0> x001021d0; (void)x001021d0;
gdcm::TagToType<0x0010,0x21f0> x001021f0; (void)x001021f0;
gdcm::TagToType<0x0010,0x2201> x00102201; (void)x00102201;
gdcm::TagToType<0x0010,0x2202> x00102202; (void)x00102202;
gdcm::TagToType<0x0010,0x2203> x00102203; (void)x00102203;
gdcm::TagToType<0x0010,0x2292> x00102292; (void)x00102292;
gdcm::TagToType<0x0010,0x2293> x00102293; (void)x00102293;
gdcm::TagToType<0x0010,0x2294> x00102294; (void)x00102294;
gdcm::TagToType<0x0010,0x2295> x00102295; (void)x00102295;
gdcm::TagToType<0x0010,0x2296> x00102296; (void)x00102296;
gdcm::TagToType<0x0010,0x2297> x00102297; (void)x00102297;
gdcm::TagToType<0x0010,0x2298> x00102298; (void)x00102298;
gdcm::TagToType<0x0010,0x2299> x00102299; (void)x00102299;
gdcm::TagToType<0x0010,0x4000> x00104000; (void)x00104000;
gdcm::TagToType<0x0010,0x9431> x00109431; (void)x00109431;
gdcm::TagToType<0x0012,0x0010> x00120010; (void)x00120010;
gdcm::TagToType<0x0012,0x0020> x00120020; (void)x00120020;
gdcm::TagToType<0x0012,0x0021> x00120021; (void)x00120021;
gdcm::TagToType<0x0012,0x0030> x00120030; (void)x00120030;
gdcm::TagToType<0x0012,0x0031> x00120031; (void)x00120031;
gdcm::TagToType<0x0012,0x0040> x00120040; (void)x00120040;
gdcm::TagToType<0x0012,0x0042> x00120042; (void)x00120042;
gdcm::TagToType<0x0012,0x0050> x00120050; (void)x00120050;
gdcm::TagToType<0x0012,0x0051> x00120051; (void)x00120051;
gdcm::TagToType<0x0012,0x0060> x00120060; (void)x00120060;
gdcm::TagToType<0x0012,0x0062> x00120062; (void)x00120062;
gdcm::TagToType<0x0012,0x0063> x00120063; (void)x00120063;
gdcm::TagToType<0x0012,0x0064> x00120064; (void)x00120064;
gdcm::TagToType<0x0012,0x0071> x00120071; (void)x00120071;
gdcm::TagToType<0x0012,0x0072> x00120072; (void)x00120072;
gdcm::TagToType<0x0018,0x0010> x00180010; (void)x00180010;
gdcm::TagToType<0x0018,0x0012> x00180012; (void)x00180012;
gdcm::TagToType<0x0018,0x0014> x00180014; (void)x00180014;
gdcm::TagToType<0x0018,0x0015> x00180015; (void)x00180015;
gdcm::TagToType<0x0018,0x0020> x00180020; (void)x00180020;
gdcm::TagToType<0x0018,0x0021> x00180021; (void)x00180021;
gdcm::TagToType<0x0018,0x0022> x00180022; (void)x00180022;
gdcm::TagToType<0x0018,0x0023> x00180023; (void)x00180023;
gdcm::TagToType<0x0018,0x0024> x00180024; (void)x00180024;
gdcm::TagToType<0x0018,0x0025> x00180025; (void)x00180025;
gdcm::TagToType<0x0018,0x0026> x00180026; (void)x00180026;
gdcm::TagToType<0x0018,0x0027> x00180027; (void)x00180027;
gdcm::TagToType<0x0018,0x0028> x00180028; (void)x00180028;
gdcm::TagToType<0x0018,0x0029> x00180029; (void)x00180029;
gdcm::TagToType<0x0018,0x002a> x0018002a; (void)x0018002a;
gdcm::TagToType<0x0018,0x0030> x00180030; (void)x00180030;
gdcm::TagToType<0x0018,0x0031> x00180031; (void)x00180031;
gdcm::TagToType<0x0018,0x0032> x00180032; (void)x00180032;
gdcm::TagToType<0x0018,0x0033> x00180033; (void)x00180033;
gdcm::TagToType<0x0018,0x0034> x00180034; (void)x00180034;
gdcm::TagToType<0x0018,0x0035> x00180035; (void)x00180035;
gdcm::TagToType<0x0018,0x0036> x00180036; (void)x00180036;
gdcm::TagToType<0x0018,0x0037> x00180037; (void)x00180037;
gdcm::TagToType<0x0018,0x0038> x00180038; (void)x00180038;
gdcm::TagToType<0x0018,0x0039> x00180039; (void)x00180039;
gdcm::TagToType<0x0018,0x003a> x0018003a; (void)x0018003a;
gdcm::TagToType<0x0018,0x0040> x00180040; (void)x00180040;
gdcm::TagToType<0x0018,0x0050> x00180050; (void)x00180050;
gdcm::TagToType<0x0018,0x0060> x00180060; (void)x00180060;
gdcm::TagToType<0x0018,0x0070> x00180070; (void)x00180070;
gdcm::TagToType<0x0018,0x0071> x00180071; (void)x00180071;
gdcm::TagToType<0x0018,0x0072> x00180072; (void)x00180072;
gdcm::TagToType<0x0018,0x0073> x00180073; (void)x00180073;
gdcm::TagToType<0x0018,0x0074> x00180074; (void)x00180074;
gdcm::TagToType<0x0018,0x0075> x00180075; (void)x00180075;
gdcm::TagToType<0x0018,0x0080> x00180080; (void)x00180080;
gdcm::TagToType<0x0018,0x0081> x00180081; (void)x00180081;
gdcm::TagToType<0x0018,0x0082> x00180082; (void)x00180082;
gdcm::TagToType<0x0018,0x0083> x00180083; (void)x00180083;
gdcm::TagToType<0x0018,0x0084> x00180084; (void)x00180084;
gdcm::TagToType<0x0018,0x0085> x00180085; (void)x00180085;
gdcm::TagToType<0x0018,0x0086> x00180086; (void)x00180086;
gdcm::TagToType<0x0018,0x0087> x00180087; (void)x00180087;
gdcm::TagToType<0x0018,0x0088> x00180088; (void)x00180088;
gdcm::TagToType<0x0018,0x0089> x00180089; (void)x00180089;
gdcm::TagToType<0x0018,0x0090> x00180090; (void)x00180090;
gdcm::TagToType<0x0018,0x0091> x00180091; (void)x00180091;
gdcm::TagToType<0x0018,0x0093> x00180093; (void)x00180093;
gdcm::TagToType<0x0018,0x0094> x00180094; (void)x00180094;
gdcm::TagToType<0x0018,0x0095> x00180095; (void)x00180095;
gdcm::TagToType<0x0018,0x1000> x00181000; (void)x00181000;
gdcm::TagToType<0x0018,0x1002> x00181002; (void)x00181002;
gdcm::TagToType<0x0018,0x1003> x00181003; (void)x00181003;
gdcm::TagToType<0x0018,0x1004> x00181004; (void)x00181004;
gdcm::TagToType<0x0018,0x1005> x00181005; (void)x00181005;
gdcm::TagToType<0x0018,0x1006> x00181006; (void)x00181006;
gdcm::TagToType<0x0018,0x1007> x00181007; (void)x00181007;
gdcm::TagToType<0x0018,0x1008> x00181008; (void)x00181008;
gdcm::TagToType<0x0018,0x1010> x00181010; (void)x00181010;
gdcm::TagToType<0x0018,0x1011> x00181011; (void)x00181011;
gdcm::TagToType<0x0018,0x1012> x00181012; (void)x00181012;
gdcm::TagToType<0x0018,0x1014> x00181014; (void)x00181014;
gdcm::TagToType<0x0018,0x1016> x00181016; (void)x00181016;
gdcm::TagToType<0x0018,0x1017> x00181017; (void)x00181017;
gdcm::TagToType<0x0018,0x1018> x00181018; (void)x00181018;
gdcm::TagToType<0x0018,0x1019> x00181019; (void)x00181019;
gdcm::TagToType<0x0018,0x101a> x0018101a; (void)x0018101a;
gdcm::TagToType<0x0018,0x101b> x0018101b; (void)x0018101b;
gdcm::TagToType<0x0018,0x1020> x00181020; (void)x00181020;
gdcm::TagToType<0x0018,0x1022> x00181022; (void)x00181022;
gdcm::TagToType<0x0018,0x1023> x00181023; (void)x00181023;
gdcm::TagToType<0x0018,0x1030> x00181030; (void)x00181030;
gdcm::TagToType<0x0018,0x1040> x00181040; (void)x00181040;
gdcm::TagToType<0x0018,0x1041> x00181041; (void)x00181041;
gdcm::TagToType<0x0018,0x1042> x00181042; (void)x00181042;
gdcm::TagToType<0x0018,0x1043> x00181043; (void)x00181043;
gdcm::TagToType<0x0018,0x1044> x00181044; (void)x00181044;
gdcm::TagToType<0x0018,0x1045> x00181045; (void)x00181045;
gdcm::TagToType<0x0018,0x1046> x00181046; (void)x00181046;
gdcm::TagToType<0x0018,0x1047> x00181047; (void)x00181047;
gdcm::TagToType<0x0018,0x1048> x00181048; (void)x00181048;
gdcm::TagToType<0x0018,0x1049> x00181049; (void)x00181049;
gdcm::TagToType<0x0018,0x1050> x00181050; (void)x00181050;
gdcm::TagToType<0x0018,0x1060> x00181060; (void)x00181060;
gdcm::TagToType<0x0018,0x1061> x00181061; (void)x00181061;
gdcm::TagToType<0x0018,0x1062> x00181062; (void)x00181062;
gdcm::TagToType<0x0018,0x1063> x00181063; (void)x00181063;
gdcm::TagToType<0x0018,0x1064> x00181064; (void)x00181064;
gdcm::TagToType<0x0018,0x1065> x00181065; (void)x00181065;
gdcm::TagToType<0x0018,0x1066> x00181066; (void)x00181066;
gdcm::TagToType<0x0018,0x1067> x00181067; (void)x00181067;
gdcm::TagToType<0x0018,0x1068> x00181068; (void)x00181068;
gdcm::TagToType<0x0018,0x1069> x00181069; (void)x00181069;
gdcm::TagToType<0x0018,0x106a> x0018106a; (void)x0018106a;
gdcm::TagToType<0x0018,0x106c> x0018106c; (void)x0018106c;
gdcm::TagToType<0x0018,0x106e> x0018106e; (void)x0018106e;
gdcm::TagToType<0x0018,0x1070> x00181070; (void)x00181070;
gdcm::TagToType<0x0018,0x1071> x00181071; (void)x00181071;
gdcm::TagToType<0x0018,0x1072> x00181072; (void)x00181072;
gdcm::TagToType<0x0018,0x1073> x00181073; (void)x00181073;
gdcm::TagToType<0x0018,0x1074> x00181074; (void)x00181074;
gdcm::TagToType<0x0018,0x1075> x00181075; (void)x00181075;
gdcm::TagToType<0x0018,0x1076> x00181076; (void)x00181076;
gdcm::TagToType<0x0018,0x1077> x00181077; (void)x00181077;
gdcm::TagToType<0x0018,0x1078> x00181078; (void)x00181078;
gdcm::TagToType<0x0018,0x1079> x00181079; (void)x00181079;
gdcm::TagToType<0x0018,0x1080> x00181080; (void)x00181080;
gdcm::TagToType<0x0018,0x1081> x00181081; (void)x00181081;
gdcm::TagToType<0x0018,0x1082> x00181082; (void)x00181082;
gdcm::TagToType<0x0018,0x1083> x00181083; (void)x00181083;
gdcm::TagToType<0x0018,0x1084> x00181084; (void)x00181084;
gdcm::TagToType<0x0018,0x1085> x00181085; (void)x00181085;
gdcm::TagToType<0x0018,0x1086> x00181086; (void)x00181086;
gdcm::TagToType<0x0018,0x1088> x00181088; (void)x00181088;
gdcm::TagToType<0x0018,0x1090> x00181090; (void)x00181090;
gdcm::TagToType<0x0018,0x1094> x00181094; (void)x00181094;
gdcm::TagToType<0x0018,0x1100> x00181100; (void)x00181100;
gdcm::TagToType<0x0018,0x1110> x00181110; (void)x00181110;
gdcm::TagToType<0x0018,0x1111> x00181111; (void)x00181111;
gdcm::TagToType<0x0018,0x1114> x00181114; (void)x00181114;
gdcm::TagToType<0x0018,0x1120> x00181120; (void)x00181120;
gdcm::TagToType<0x0018,0x1121> x00181121; (void)x00181121;
gdcm::TagToType<0x0018,0x1130> x00181130; (void)x00181130;
gdcm::TagToType<0x0018,0x1131> x00181131; (void)x00181131;
gdcm::TagToType<0x0018,0x1134> x00181134; (void)x00181134;
gdcm::TagToType<0x0018,0x1135> x00181135; (void)x00181135;
gdcm::TagToType<0x0018,0x1136> x00181136; (void)x00181136;
gdcm::TagToType<0x0018,0x1137> x00181137; (void)x00181137;
gdcm::TagToType<0x0018,0x1138> x00181138; (void)x00181138;
gdcm::TagToType<0x0018,0x113a> x0018113a; (void)x0018113a;
gdcm::TagToType<0x0018,0x1140> x00181140; (void)x00181140;
gdcm::TagToType<0x0018,0x1141> x00181141; (void)x00181141;
gdcm::TagToType<0x0018,0x1142> x00181142; (void)x00181142;
gdcm::TagToType<0x0018,0x1143> x00181143; (void)x00181143;
gdcm::TagToType<0x0018,0x1144> x00181144; (void)x00181144;
gdcm::TagToType<0x0018,0x1145> x00181145; (void)x00181145;
gdcm::TagToType<0x0018,0x1146> x00181146; (void)x00181146;
gdcm::TagToType<0x0018,0x1147> x00181147; (void)x00181147;
gdcm::TagToType<0x0018,0x1149> x00181149; (void)x00181149;
gdcm::TagToType<0x0018,0x1150> x00181150; (void)x00181150;
gdcm::TagToType<0x0018,0x1151> x00181151; (void)x00181151;
gdcm::TagToType<0x0018,0x1152> x00181152; (void)x00181152;
gdcm::TagToType<0x0018,0x1153> x00181153; (void)x00181153;
gdcm::TagToType<0x0018,0x1154> x00181154; (void)x00181154;
gdcm::TagToType<0x0018,0x1155> x00181155; (void)x00181155;
gdcm::TagToType<0x0018,0x1156> x00181156; (void)x00181156;
gdcm::TagToType<0x0018,0x115a> x0018115a; (void)x0018115a;
gdcm::TagToType<0x0018,0x115e> x0018115e; (void)x0018115e;
gdcm::TagToType<0x0018,0x1160> x00181160; (void)x00181160;
gdcm::TagToType<0x0018,0x1161> x00181161; (void)x00181161;
gdcm::TagToType<0x0018,0x1162> x00181162; (void)x00181162;
gdcm::TagToType<0x0018,0x1164> x00181164; (void)x00181164;
gdcm::TagToType<0x0018,0x1166> x00181166; (void)x00181166;
gdcm::TagToType<0x0018,0x1170> x00181170; (void)x00181170;
gdcm::TagToType<0x0018,0x1180> x00181180; (void)x00181180;
gdcm::TagToType<0x0018,0x1181> x00181181; (void)x00181181;
gdcm::TagToType<0x0018,0x1182> x00181182; (void)x00181182;
gdcm::TagToType<0x0018,0x1183> x00181183; (void)x00181183;
gdcm::TagToType<0x0018,0x1184> x00181184; (void)x00181184;
gdcm::TagToType<0x0018,0x1190> x00181190; (void)x00181190;
gdcm::TagToType<0x0018,0x1191> x00181191; (void)x00181191;
gdcm::TagToType<0x0018,0x11a0> x001811a0; (void)x001811a0;
gdcm::TagToType<0x0018,0x11a2> x001811a2; (void)x001811a2;
gdcm::TagToType<0x0018,0x1200> x00181200; (void)x00181200;
gdcm::TagToType<0x0018,0x1201> x00181201; (void)x00181201;
gdcm::TagToType<0x0018,0x1210> x00181210; (void)x00181210;
gdcm::TagToType<0x0018,0x1240> x00181240; (void)x00181240;
gdcm::TagToType<0x0018,0x1242> x00181242; (void)x00181242;
gdcm::TagToType<0x0018,0x1243> x00181243; (void)x00181243;
gdcm::TagToType<0x0018,0x1244> x00181244; (void)x00181244;
gdcm::TagToType<0x0018,0x1250> x00181250; (void)x00181250;
gdcm::TagToType<0x0018,0x1251> x00181251; (void)x00181251;
gdcm::TagToType<0x0018,0x1260> x00181260; (void)x00181260;
gdcm::TagToType<0x0018,0x1261> x00181261; (void)x00181261;
gdcm::TagToType<0x0018,0x1300> x00181300; (void)x00181300;
gdcm::TagToType<0x0018,0x1301> x00181301; (void)x00181301;
gdcm::TagToType<0x0018,0x1302> x00181302; (void)x00181302;
gdcm::TagToType<0x0018,0x1310> x00181310; (void)x00181310;
gdcm::TagToType<0x0018,0x1312> x00181312; (void)x00181312;
gdcm::TagToType<0x0018,0x1314> x00181314; (void)x00181314;
gdcm::TagToType<0x0018,0x1315> x00181315; (void)x00181315;
gdcm::TagToType<0x0018,0x1316> x00181316; (void)x00181316;
gdcm::TagToType<0x0018,0x1318> x00181318; (void)x00181318;
gdcm::TagToType<0x0018,0x1400> x00181400; (void)x00181400;
gdcm::TagToType<0x0018,0x1401> x00181401; (void)x00181401;
gdcm::TagToType<0x0018,0x1402> x00181402; (void)x00181402;
gdcm::TagToType<0x0018,0x1403> x00181403; (void)x00181403;
gdcm::TagToType<0x0018,0x1404> x00181404; (void)x00181404;
gdcm::TagToType<0x0018,0x1405> x00181405; (void)x00181405;
gdcm::TagToType<0x0018,0x1450> x00181450; (void)x00181450;
gdcm::TagToType<0x0018,0x1460> x00181460; (void)x00181460;
gdcm::TagToType<0x0018,0x1470> x00181470; (void)x00181470;
gdcm::TagToType<0x0018,0x1480> x00181480; (void)x00181480;
gdcm::TagToType<0x0018,0x1490> x00181490; (void)x00181490;
gdcm::TagToType<0x0018,0x1491> x00181491; (void)x00181491;
gdcm::TagToType<0x0018,0x1495> x00181495; (void)x00181495;
gdcm::TagToType<0x0018,0x1500> x00181500; (void)x00181500;
gdcm::TagToType<0x0018,0x1508> x00181508; (void)x00181508;
gdcm::TagToType<0x0018,0x1510> x00181510; (void)x00181510;
gdcm::TagToType<0x0018,0x1511> x00181511; (void)x00181511;
gdcm::TagToType<0x0018,0x1520> x00181520; (void)x00181520;
gdcm::TagToType<0x0018,0x1521> x00181521; (void)x00181521;
gdcm::TagToType<0x0018,0x1530> x00181530; (void)x00181530;
gdcm::TagToType<0x0018,0x1531> x00181531; (void)x00181531;
gdcm::TagToType<0x0018,0x1600> x00181600; (void)x00181600;
gdcm::TagToType<0x0018,0x1602> x00181602; (void)x00181602;
gdcm::TagToType<0x0018,0x1604> x00181604; (void)x00181604;
gdcm::TagToType<0x0018,0x1606> x00181606; (void)x00181606;
gdcm::TagToType<0x0018,0x1608> x00181608; (void)x00181608;
gdcm::TagToType<0x0018,0x1610> x00181610; (void)x00181610;
gdcm::TagToType<0x0018,0x1612> x00181612; (void)x00181612;
gdcm::TagToType<0x0018,0x1620> x00181620; (void)x00181620;
gdcm::TagToType<0x0018,0x1622> x00181622; (void)x00181622;
gdcm::TagToType<0x0018,0x1623> x00181623; (void)x00181623;
gdcm::TagToType<0x0018,0x1624> x00181624; (void)x00181624;
gdcm::TagToType<0x0018,0x1700> x00181700; (void)x00181700;
gdcm::TagToType<0x0018,0x1702> x00181702; (void)x00181702;
gdcm::TagToType<0x0018,0x1704> x00181704; (void)x00181704;
gdcm::TagToType<0x0018,0x1706> x00181706; (void)x00181706;
gdcm::TagToType<0x0018,0x1708> x00181708; (void)x00181708;
gdcm::TagToType<0x0018,0x1710> x00181710; (void)x00181710;
gdcm::TagToType<0x0018,0x1712> x00181712; (void)x00181712;
gdcm::TagToType<0x0018,0x1720> x00181720; (void)x00181720;
gdcm::TagToType<0x0018,0x1800> x00181800; (void)x00181800;
gdcm::TagToType<0x0018,0x1801> x00181801; (void)x00181801;
gdcm::TagToType<0x0018,0x1802> x00181802; (void)x00181802;
gdcm::TagToType<0x0018,0x1803> x00181803; (void)x00181803;
gdcm::TagToType<0x0018,0x2001> x00182001; (void)x00182001;
gdcm::TagToType<0x0018,0x2002> x00182002; (void)x00182002;
gdcm::TagToType<0x0018,0x2003> x00182003; (void)x00182003;
gdcm::TagToType<0x0018,0x2004> x00182004; (void)x00182004;
gdcm::TagToType<0x0018,0x2005> x00182005; (void)x00182005;
gdcm::TagToType<0x0018,0x2006> x00182006; (void)x00182006;
gdcm::TagToType<0x0018,0x2010> x00182010; (void)x00182010;
gdcm::TagToType<0x0018,0x2020> x00182020; (void)x00182020;
gdcm::TagToType<0x0018,0x2030> x00182030; (void)x00182030;
gdcm::TagToType<0x0018,0x3100> x00183100; (void)x00183100;
gdcm::TagToType<0x0018,0x3101> x00183101; (void)x00183101;
gdcm::TagToType<0x0018,0x3102> x00183102; (void)x00183102;
gdcm::TagToType<0x0018,0x3103> x00183103; (void)x00183103;
gdcm::TagToType<0x0018,0x3104> x00183104; (void)x00183104;
gdcm::TagToType<0x0018,0x3105> x00183105; (void)x00183105;
gdcm::TagToType<0x0018,0x4000> x00184000; (void)x00184000;
gdcm::TagToType<0x0018,0x5000> x00185000; (void)x00185000;
gdcm::TagToType<0x0018,0x5010> x00185010; (void)x00185010;
gdcm::TagToType<0x0018,0x5012> x00185012; (void)x00185012;
gdcm::TagToType<0x0018,0x5020> x00185020; (void)x00185020;
gdcm::TagToType<0x0018,0x5021> x00185021; (void)x00185021;
gdcm::TagToType<0x0018,0x5022> x00185022; (void)x00185022;
gdcm::TagToType<0x0018,0x5024> x00185024; (void)x00185024;
gdcm::TagToType<0x0018,0x5026> x00185026; (void)x00185026;
gdcm::TagToType<0x0018,0x5027> x00185027; (void)x00185027;
gdcm::TagToType<0x0018,0x5028> x00185028; (void)x00185028;
gdcm::TagToType<0x0018,0x5029> x00185029; (void)x00185029;
gdcm::TagToType<0x0018,0x5030> x00185030; (void)x00185030;
gdcm::TagToType<0x0018,0x5040> x00185040; (void)x00185040;
gdcm::TagToType<0x0018,0x5050> x00185050; (void)x00185050;
gdcm::TagToType<0x0018,0x5100> x00185100; (void)x00185100;
gdcm::TagToType<0x0018,0x5101> x00185101; (void)x00185101;
gdcm::TagToType<0x0018,0x5104> x00185104; (void)x00185104;
gdcm::TagToType<0x0018,0x5210> x00185210; (void)x00185210;
gdcm::TagToType<0x0018,0x5212> x00185212; (void)x00185212;
gdcm::TagToType<0x0018,0x6000> x00186000; (void)x00186000;
gdcm::TagToType<0x0018,0x6011> x00186011; (void)x00186011;
gdcm::TagToType<0x0018,0x6012> x00186012; (void)x00186012;
gdcm::TagToType<0x0018,0x6014> x00186014; (void)x00186014;
gdcm::TagToType<0x0018,0x6016> x00186016; (void)x00186016;
gdcm::TagToType<0x0018,0x6018> x00186018; (void)x00186018;
gdcm::TagToType<0x0018,0x601a> x0018601a; (void)x0018601a;
gdcm::TagToType<0x0018,0x601c> x0018601c; (void)x0018601c;
gdcm::TagToType<0x0018,0x601e> x0018601e; (void)x0018601e;
gdcm::TagToType<0x0018,0x6020> x00186020; (void)x00186020;
gdcm::TagToType<0x0018,0x6022> x00186022; (void)x00186022;
gdcm::TagToType<0x0018,0x6024> x00186024; (void)x00186024;
gdcm::TagToType<0x0018,0x6026> x00186026; (void)x00186026;
gdcm::TagToType<0x0018,0x6028> x00186028; (void)x00186028;
gdcm::TagToType<0x0018,0x602a> x0018602a; (void)x0018602a;
gdcm::TagToType<0x0018,0x602c> x0018602c; (void)x0018602c;
gdcm::TagToType<0x0018,0x602e> x0018602e; (void)x0018602e;
gdcm::TagToType<0x0018,0x6030> x00186030; (void)x00186030;
gdcm::TagToType<0x0018,0x6031> x00186031; (void)x00186031;
gdcm::TagToType<0x0018,0x6032> x00186032; (void)x00186032;
gdcm::TagToType<0x0018,0x6034> x00186034; (void)x00186034;
gdcm::TagToType<0x0018,0x6036> x00186036; (void)x00186036;
gdcm::TagToType<0x0018,0x6038> x00186038; (void)x00186038;
gdcm::TagToType<0x0018,0x6039> x00186039; (void)x00186039;
gdcm::TagToType<0x0018,0x603a> x0018603a; (void)x0018603a;
gdcm::TagToType<0x0018,0x603b> x0018603b; (void)x0018603b;
gdcm::TagToType<0x0018,0x603c> x0018603c; (void)x0018603c;
gdcm::TagToType<0x0018,0x603d> x0018603d; (void)x0018603d;
gdcm::TagToType<0x0018,0x603e> x0018603e; (void)x0018603e;
gdcm::TagToType<0x0018,0x603f> x0018603f; (void)x0018603f;
gdcm::TagToType<0x0018,0x6040> x00186040; (void)x00186040;
gdcm::TagToType<0x0018,0x6041> x00186041; (void)x00186041;
gdcm::TagToType<0x0018,0x6042> x00186042; (void)x00186042;
gdcm::TagToType<0x0018,0x6043> x00186043; (void)x00186043;
gdcm::TagToType<0x0018,0x6044> x00186044; (void)x00186044;
gdcm::TagToType<0x0018,0x6046> x00186046; (void)x00186046;
gdcm::TagToType<0x0018,0x6048> x00186048; (void)x00186048;
gdcm::TagToType<0x0018,0x604a> x0018604a; (void)x0018604a;
gdcm::TagToType<0x0018,0x604c> x0018604c; (void)x0018604c;
gdcm::TagToType<0x0018,0x604e> x0018604e; (void)x0018604e;
gdcm::TagToType<0x0018,0x6050> x00186050; (void)x00186050;
gdcm::TagToType<0x0018,0x6052> x00186052; (void)x00186052;
gdcm::TagToType<0x0018,0x6054> x00186054; (void)x00186054;
gdcm::TagToType<0x0018,0x6056> x00186056; (void)x00186056;
gdcm::TagToType<0x0018,0x6058> x00186058; (void)x00186058;
gdcm::TagToType<0x0018,0x605a> x0018605a; (void)x0018605a;
gdcm::TagToType<0x0018,0x6060> x00186060; (void)x00186060;
gdcm::TagToType<0x0018,0x7000> x00187000; (void)x00187000;
gdcm::TagToType<0x0018,0x7001> x00187001; (void)x00187001;
gdcm::TagToType<0x0018,0x7004> x00187004; (void)x00187004;
gdcm::TagToType<0x0018,0x7005> x00187005; (void)x00187005;
gdcm::TagToType<0x0018,0x7006> x00187006; (void)x00187006;
gdcm::TagToType<0x0018,0x7008> x00187008; (void)x00187008;
gdcm::TagToType<0x0018,0x700a> x0018700a; (void)x0018700a;
gdcm::TagToType<0x0018,0x700c> x0018700c; (void)x0018700c;
gdcm::TagToType<0x0018,0x700e> x0018700e; (void)x0018700e;
gdcm::TagToType<0x0018,0x7010> x00187010; (void)x00187010;
gdcm::TagToType<0x0018,0x7011> x00187011; (void)x00187011;
gdcm::TagToType<0x0018,0x7012> x00187012; (void)x00187012;
gdcm::TagToType<0x0018,0x7014> x00187014; (void)x00187014;
gdcm::TagToType<0x0018,0x7016> x00187016; (void)x00187016;
gdcm::TagToType<0x0018,0x701a> x0018701a; (void)x0018701a;
gdcm::TagToType<0x0018,0x7020> x00187020; (void)x00187020;
gdcm::TagToType<0x0018,0x7022> x00187022; (void)x00187022;
gdcm::TagToType<0x0018,0x7024> x00187024; (void)x00187024;
gdcm::TagToType<0x0018,0x7026> x00187026; (void)x00187026;
gdcm::TagToType<0x0018,0x7028> x00187028; (void)x00187028;
gdcm::TagToType<0x0018,0x702a> x0018702a; (void)x0018702a;
gdcm::TagToType<0x0018,0x702b> x0018702b; (void)x0018702b;
gdcm::TagToType<0x0018,0x7030> x00187030; (void)x00187030;
gdcm::TagToType<0x0018,0x7032> x00187032; (void)x00187032;
gdcm::TagToType<0x0018,0x7034> x00187034; (void)x00187034;
gdcm::TagToType<0x0018,0x7040> x00187040; (void)x00187040;
gdcm::TagToType<0x0018,0x7041> x00187041; (void)x00187041;
gdcm::TagToType<0x0018,0x7042> x00187042; (void)x00187042;
gdcm::TagToType<0x0018,0x7044> x00187044; (void)x00187044;
gdcm::TagToType<0x0018,0x7046> x00187046; (void)x00187046;
gdcm::TagToType<0x0018,0x7048> x00187048; (void)x00187048;
gdcm::TagToType<0x0018,0x704c> x0018704c; (void)x0018704c;
gdcm::TagToType<0x0018,0x7050> x00187050; (void)x00187050;
gdcm::TagToType<0x0018,0x7052> x00187052; (void)x00187052;
gdcm::TagToType<0x0018,0x7054> x00187054; (void)x00187054;
gdcm::TagToType<0x0018,0x7060> x00187060; (void)x00187060;
gdcm::TagToType<0x0018,0x7062> x00187062; (void)x00187062;
gdcm::TagToType<0x0018,0x7064> x00187064; (void)x00187064;
gdcm::TagToType<0x0018,0x7065> x00187065; (void)x00187065;
gdcm::TagToType<0x0018,0x8150> x00188150; (void)x00188150;
gdcm::TagToType<0x0018,0x8151> x00188151; (void)x00188151;
gdcm::TagToType<0x0018,0x9004> x00189004; (void)x00189004;
gdcm::TagToType<0x0018,0x9005> x00189005; (void)x00189005;
gdcm::TagToType<0x0018,0x9006> x00189006; (void)x00189006;
gdcm::TagToType<0x0018,0x9008> x00189008; (void)x00189008;
gdcm::TagToType<0x0018,0x9009> x00189009; (void)x00189009;
gdcm::TagToType<0x0018,0x9010> x00189010; (void)x00189010;
gdcm::TagToType<0x0018,0x9011> x00189011; (void)x00189011;
gdcm::TagToType<0x0018,0x9012> x00189012; (void)x00189012;
gdcm::TagToType<0x0018,0x9014> x00189014; (void)x00189014;
gdcm::TagToType<0x0018,0x9015> x00189015; (void)x00189015;
gdcm::TagToType<0x0018,0x9016> x00189016; (void)x00189016;
gdcm::TagToType<0x0018,0x9017> x00189017; (void)x00189017;
gdcm::TagToType<0x0018,0x9018> x00189018; (void)x00189018;
gdcm::TagToType<0x0018,0x9019> x00189019; (void)x00189019;
gdcm::TagToType<0x0018,0x9020> x00189020; (void)x00189020;
gdcm::TagToType<0x0018,0x9021> x00189021; (void)x00189021;
gdcm::TagToType<0x0018,0x9022> x00189022; (void)x00189022;
gdcm::TagToType<0x0018,0x9024> x00189024; (void)x00189024;
gdcm::TagToType<0x0018,0x9025> x00189025; (void)x00189025;
gdcm::TagToType<0x0018,0x9026> x00189026; (void)x00189026;
gdcm::TagToType<0x0018,0x9027> x00189027; (void)x00189027;
gdcm::TagToType<0x0018,0x9028> x00189028; (void)x00189028;
gdcm::TagToType<0x0018,0x9029> x00189029; (void)x00189029;
gdcm::TagToType<0x0018,0x9030> x00189030; (void)x00189030;
gdcm::TagToType<0x0018,0x9032> x00189032; (void)x00189032;
gdcm::TagToType<0x0018,0x9033> x00189033; (void)x00189033;
gdcm::TagToType<0x0018,0x9034> x00189034; (void)x00189034;
gdcm::TagToType<0x0018,0x9035> x00189035; (void)x00189035;
gdcm::TagToType<0x0018,0x9036> x00189036; (void)x00189036;
gdcm::TagToType<0x0018,0x9037> x00189037; (void)x00189037;
gdcm::TagToType<0x0018,0x9041> x00189041; (void)x00189041;
gdcm::TagToType<0x0018,0x9042> x00189042; (void)x00189042;
gdcm::TagToType<0x0018,0x9043> x00189043; (void)x00189043;
gdcm::TagToType<0x0018,0x9044> x00189044; (void)x00189044;
gdcm::TagToType<0x0018,0x9045> x00189045; (void)x00189045;
gdcm::TagToType<0x0018,0x9046> x00189046; (void)x00189046;
gdcm::TagToType<0x0018,0x9047> x00189047; (void)x00189047;
gdcm::TagToType<0x0018,0x9048> x00189048; (void)x00189048;
gdcm::TagToType<0x0018,0x9049> x00189049; (void)x00189049;
gdcm::TagToType<0x0018,0x9050> x00189050; (void)x00189050;
gdcm::TagToType<0x0018,0x9051> x00189051; (void)x00189051;
gdcm::TagToType<0x0018,0x9052> x00189052; (void)x00189052;
gdcm::TagToType<0x0018,0x9053> x00189053; (void)x00189053;
gdcm::TagToType<0x0018,0x9054> x00189054; (void)x00189054;
gdcm::TagToType<0x0018,0x9058> x00189058; (void)x00189058;
gdcm::TagToType<0x0018,0x9059> x00189059; (void)x00189059;
gdcm::TagToType<0x0018,0x9060> x00189060; (void)x00189060;
gdcm::TagToType<0x0018,0x9061> x00189061; (void)x00189061;
gdcm::TagToType<0x0018,0x9062> x00189062; (void)x00189062;
gdcm::TagToType<0x0018,0x9063> x00189063; (void)x00189063;
gdcm::TagToType<0x0018,0x9064> x00189064; (void)x00189064;
gdcm::TagToType<0x0018,0x9065> x00189065; (void)x00189065;
gdcm::TagToType<0x0018,0x9066> x00189066; (void)x00189066;
gdcm::TagToType<0x0018,0x9067> x00189067; (void)x00189067;
gdcm::TagToType<0x0018,0x9069> x00189069; (void)x00189069;
gdcm::TagToType<0x0018,0x9070> x00189070; (void)x00189070;
gdcm::TagToType<0x0018,0x9073> x00189073; (void)x00189073;
gdcm::TagToType<0x0018,0x9074> x00189074; (void)x00189074;
gdcm::TagToType<0x0018,0x9075> x00189075; (void)x00189075;
gdcm::TagToType<0x0018,0x9076> x00189076; (void)x00189076;
gdcm::TagToType<0x0018,0x9077> x00189077; (void)x00189077;
gdcm::TagToType<0x0018,0x9078> x00189078; (void)x00189078;
gdcm::TagToType<0x0018,0x9079> x00189079; (void)x00189079;
gdcm::TagToType<0x0018,0x9080> x00189080; (void)x00189080;
gdcm::TagToType<0x0018,0x9081> x00189081; (void)x00189081;
gdcm::TagToType<0x0018,0x9082> x00189082; (void)x00189082;
gdcm::TagToType<0x0018,0x9083> x00189083; (void)x00189083;
gdcm::TagToType<0x0018,0x9084> x00189084; (void)x00189084;
gdcm::TagToType<0x0018,0x9085> x00189085; (void)x00189085;
gdcm::TagToType<0x0018,0x9087> x00189087; (void)x00189087;
gdcm::TagToType<0x0018,0x9089> x00189089; (void)x00189089;
gdcm::TagToType<0x0018,0x9090> x00189090; (void)x00189090;
gdcm::TagToType<0x0018,0x9091> x00189091; (void)x00189091;
gdcm::TagToType<0x0018,0x9093> x00189093; (void)x00189093;
gdcm::TagToType<0x0018,0x9094> x00189094; (void)x00189094;
gdcm::TagToType<0x0018,0x9095> x00189095; (void)x00189095;
gdcm::TagToType<0x0018,0x9096> x00189096; (void)x00189096;
gdcm::TagToType<0x0018,0x9098> x00189098; (void)x00189098;
gdcm::TagToType<0x0018,0x9100> x00189100; (void)x00189100;
gdcm::TagToType<0x0018,0x9101> x00189101; (void)x00189101;
gdcm::TagToType<0x0018,0x9103> x00189103; (void)x00189103;
gdcm::TagToType<0x0018,0x9104> x00189104; (void)x00189104;
gdcm::TagToType<0x0018,0x9105> x00189105; (void)x00189105;
gdcm::TagToType<0x0018,0x9106> x00189106; (void)x00189106;
gdcm::TagToType<0x0018,0x9107> x00189107; (void)x00189107;
gdcm::TagToType<0x0018,0x9112> x00189112; (void)x00189112;
gdcm::TagToType<0x0018,0x9114> x00189114; (void)x00189114;
gdcm::TagToType<0x0018,0x9115> x00189115; (void)x00189115;
gdcm::TagToType<0x0018,0x9117> x00189117; (void)x00189117;
gdcm::TagToType<0x0018,0x9118> x00189118; (void)x00189118;
gdcm::TagToType<0x0018,0x9119> x00189119; (void)x00189119;
gdcm::TagToType<0x0018,0x9125> x00189125; (void)x00189125;
gdcm::TagToType<0x0018,0x9126> x00189126; (void)x00189126;
gdcm::TagToType<0x0018,0x9127> x00189127; (void)x00189127;
gdcm::TagToType<0x0018,0x9147> x00189147; (void)x00189147;
gdcm::TagToType<0x0018,0x9151> x00189151; (void)x00189151;
gdcm::TagToType<0x0018,0x9152> x00189152; (void)x00189152;
gdcm::TagToType<0x0018,0x9155> x00189155; (void)x00189155;
gdcm::TagToType<0x0018,0x9159> x00189159; (void)x00189159;
gdcm::TagToType<0x0018,0x9166> x00189166; (void)x00189166;
gdcm::TagToType<0x0018,0x9168> x00189168; (void)x00189168;
gdcm::TagToType<0x0018,0x9169> x00189169; (void)x00189169;
gdcm::TagToType<0x0018,0x9170> x00189170; (void)x00189170;
gdcm::TagToType<0x0018,0x9171> x00189171; (void)x00189171;
gdcm::TagToType<0x0018,0x9172> x00189172; (void)x00189172;
gdcm::TagToType<0x0018,0x9173> x00189173; (void)x00189173;
gdcm::TagToType<0x0018,0x9174> x00189174; (void)x00189174;
gdcm::TagToType<0x0018,0x9175> x00189175; (void)x00189175;
gdcm::TagToType<0x0018,0x9176> x00189176; (void)x00189176;
gdcm::TagToType<0x0018,0x9177> x00189177; (void)x00189177;
gdcm::TagToType<0x0018,0x9178> x00189178; (void)x00189178;
gdcm::TagToType<0x0018,0x9179> x00189179; (void)x00189179;
gdcm::TagToType<0x0018,0x9180> x00189180; (void)x00189180;
gdcm::TagToType<0x0018,0x9181> x00189181; (void)x00189181;
gdcm::TagToType<0x0018,0x9182> x00189182; (void)x00189182;
gdcm::TagToType<0x0018,0x9183> x00189183; (void)x00189183;
gdcm::TagToType<0x0018,0x9184> x00189184; (void)x00189184;
gdcm::TagToType<0x0018,0x9185> x00189185; (void)x00189185;
gdcm::TagToType<0x0018,0x9186> x00189186; (void)x00189186;
gdcm::TagToType<0x0018,0x9195> x00189195; (void)x00189195;
gdcm::TagToType<0x0018,0x9196> x00189196; (void)x00189196;
gdcm::TagToType<0x0018,0x9197> x00189197; (void)x00189197;
gdcm::TagToType<0x0018,0x9198> x00189198; (void)x00189198;
gdcm::TagToType<0x0018,0x9199> x00189199; (void)x00189199;
gdcm::TagToType<0x0018,0x9200> x00189200; (void)x00189200;
gdcm::TagToType<0x0018,0x9214> x00189214; (void)x00189214;
gdcm::TagToType<0x0018,0x9217> x00189217; (void)x00189217;
gdcm::TagToType<0x0018,0x9218> x00189218; (void)x00189218;
gdcm::TagToType<0x0018,0x9219> x00189219; (void)x00189219;
gdcm::TagToType<0x0018,0x9220> x00189220; (void)x00189220;
gdcm::TagToType<0x0018,0x9226> x00189226; (void)x00189226;
gdcm::TagToType<0x0018,0x9227> x00189227; (void)x00189227;
gdcm::TagToType<0x0018,0x9231> x00189231; (void)x00189231;
gdcm::TagToType<0x0018,0x9232> x00189232; (void)x00189232;
gdcm::TagToType<0x0018,0x9234> x00189234; (void)x00189234;
gdcm::TagToType<0x0018,0x9236> x00189236; (void)x00189236;
gdcm::TagToType<0x0018,0x9239> x00189239; (void)x00189239;
gdcm::TagToType<0x0018,0x9240> x00189240; (void)x00189240;
gdcm::TagToType<0x0018,0x9241> x00189241; (void)x00189241;
gdcm::TagToType<0x0018,0x9295> x00189295; (void)x00189295;
gdcm::TagToType<0x0018,0x9296> x00189296; (void)x00189296;
gdcm::TagToType<0x0018,0x9301> x00189301; (void)x00189301;
gdcm::TagToType<0x0018,0x9302> x00189302; (void)x00189302;
gdcm::TagToType<0x0018,0x9303> x00189303; (void)x00189303;
gdcm::TagToType<0x0018,0x9304> x00189304; (void)x00189304;
gdcm::TagToType<0x0018,0x9305> x00189305; (void)x00189305;
gdcm::TagToType<0x0018,0x9306> x00189306; (void)x00189306;
gdcm::TagToType<0x0018,0x9307> x00189307; (void)x00189307;
gdcm::TagToType<0x0018,0x9308> x00189308; (void)x00189308;
gdcm::TagToType<0x0018,0x9309> x00189309; (void)x00189309;
gdcm::TagToType<0x0018,0x9310> x00189310; (void)x00189310;
gdcm::TagToType<0x0018,0x9311> x00189311; (void)x00189311;
gdcm::TagToType<0x0018,0x9312> x00189312; (void)x00189312;
gdcm::TagToType<0x0018,0x9313> x00189313; (void)x00189313;
gdcm::TagToType<0x0018,0x9314> x00189314; (void)x00189314;
gdcm::TagToType<0x0018,0x9315> x00189315; (void)x00189315;
gdcm::TagToType<0x0018,0x9316> x00189316; (void)x00189316;
gdcm::TagToType<0x0018,0x9317> x00189317; (void)x00189317;
gdcm::TagToType<0x0018,0x9318> x00189318; (void)x00189318;
gdcm::TagToType<0x0018,0x9319> x00189319; (void)x00189319;
gdcm::TagToType<0x0018,0x9320> x00189320; (void)x00189320;
gdcm::TagToType<0x0018,0x9321> x00189321; (void)x00189321;
gdcm::TagToType<0x0018,0x9322> x00189322; (void)x00189322;
gdcm::TagToType<0x0018,0x9323> x00189323; (void)x00189323;
gdcm::TagToType<0x0018,0x9324> x00189324; (void)x00189324;
gdcm::TagToType<0x0018,0x9325> x00189325; (void)x00189325;
gdcm::TagToType<0x0018,0x9326> x00189326; (void)x00189326;
gdcm::TagToType<0x0018,0x9327> x00189327; (void)x00189327;
gdcm::TagToType<0x0018,0x9328> x00189328; (void)x00189328;
gdcm::TagToType<0x0018,0x9329> x00189329; (void)x00189329;
gdcm::TagToType<0x0018,0x9330> x00189330; (void)x00189330;
gdcm::TagToType<0x0018,0x9332> x00189332; (void)x00189332;
gdcm::TagToType<0x0018,0x9333> x00189333; (void)x00189333;
gdcm::TagToType<0x0018,0x9334> x00189334; (void)x00189334;
gdcm::TagToType<0x0018,0x9335> x00189335; (void)x00189335;
gdcm::TagToType<0x0018,0x9337> x00189337; (void)x00189337;
gdcm::TagToType<0x0018,0x9338> x00189338; (void)x00189338;
gdcm::TagToType<0x0018,0x9340> x00189340; (void)x00189340;
gdcm::TagToType<0x0018,0x9341> x00189341; (void)x00189341;
gdcm::TagToType<0x0018,0x9342> x00189342; (void)x00189342;
gdcm::TagToType<0x0018,0x9343> x00189343; (void)x00189343;
gdcm::TagToType<0x0018,0x9344> x00189344; (void)x00189344;
gdcm::TagToType<0x0018,0x9345> x00189345; (void)x00189345;
gdcm::TagToType<0x0018,0x9346> x00189346; (void)x00189346;
gdcm::TagToType<0x0018,0x9351> x00189351; (void)x00189351;
gdcm::TagToType<0x0018,0x9352> x00189352; (void)x00189352;
gdcm::TagToType<0x0018,0x9360> x00189360; (void)x00189360;
gdcm::TagToType<0x0018,0x9401> x00189401; (void)x00189401;
gdcm::TagToType<0x0018,0x9402> x00189402; (void)x00189402;
gdcm::TagToType<0x0018,0x9403> x00189403; (void)x00189403;
gdcm::TagToType<0x0018,0x9404> x00189404; (void)x00189404;
gdcm::TagToType<0x0018,0x9405> x00189405; (void)x00189405;
gdcm::TagToType<0x0018,0x9406> x00189406; (void)x00189406;
gdcm::TagToType<0x0018,0x9407> x00189407; (void)x00189407;
gdcm::TagToType<0x0018,0x9412> x00189412; (void)x00189412;
gdcm::TagToType<0x0018,0x9417> x00189417; (void)x00189417;
gdcm::TagToType<0x0018,0x9420> x00189420; (void)x00189420;
gdcm::TagToType<0x0018,0x9423> x00189423; (void)x00189423;
gdcm::TagToType<0x0018,0x9424> x00189424; (void)x00189424;
gdcm::TagToType<0x0018,0x9425> x00189425; (void)x00189425;
gdcm::TagToType<0x0018,0x9426> x00189426; (void)x00189426;
gdcm::TagToType<0x0018,0x9427> x00189427; (void)x00189427;
gdcm::TagToType<0x0018,0x9428> x00189428; (void)x00189428;
gdcm::TagToType<0x0018,0x9429> x00189429; (void)x00189429;
gdcm::TagToType<0x0018,0x9430> x00189430; (void)x00189430;
gdcm::TagToType<0x0018,0x9432> x00189432; (void)x00189432;
gdcm::TagToType<0x0018,0x9433> x00189433; (void)x00189433;
gdcm::TagToType<0x0018,0x9434> x00189434; (void)x00189434;
gdcm::TagToType<0x0018,0x9435> x00189435; (void)x00189435;
gdcm::TagToType<0x0018,0x9436> x00189436; (void)x00189436;
gdcm::TagToType<0x0018,0x9437> x00189437; (void)x00189437;
gdcm::TagToType<0x0018,0x9438> x00189438; (void)x00189438;
gdcm::TagToType<0x0018,0x9439> x00189439; (void)x00189439;
gdcm::TagToType<0x0018,0x9440> x00189440; (void)x00189440;
gdcm::TagToType<0x0018,0x9441> x00189441; (void)x00189441;
gdcm::TagToType<0x0018,0x9442> x00189442; (void)x00189442;
gdcm::TagToType<0x0018,0x9447> x00189447; (void)x00189447;
gdcm::TagToType<0x0018,0x9449> x00189449; (void)x00189449;
gdcm::TagToType<0x0018,0x9451> x00189451; (void)x00189451;
gdcm::TagToType<0x0018,0x9452> x00189452; (void)x00189452;
gdcm::TagToType<0x0018,0x9455> x00189455; (void)x00189455;
gdcm::TagToType<0x0018,0x9456> x00189456; (void)x00189456;
gdcm::TagToType<0x0018,0x9457> x00189457; (void)x00189457;
gdcm::TagToType<0x0018,0x9461> x00189461; (void)x00189461;
gdcm::TagToType<0x0018,0x9462> x00189462; (void)x00189462;
gdcm::TagToType<0x0018,0x9463> x00189463; (void)x00189463;
gdcm::TagToType<0x0018,0x9464> x00189464; (void)x00189464;
gdcm::TagToType<0x0018,0x9465> x00189465; (void)x00189465;
gdcm::TagToType<0x0018,0x9466> x00189466; (void)x00189466;
gdcm::TagToType<0x0018,0x9467> x00189467; (void)x00189467;
gdcm::TagToType<0x0018,0x9468> x00189468; (void)x00189468;
gdcm::TagToType<0x0018,0x9469> x00189469; (void)x00189469;
gdcm::TagToType<0x0018,0x9470> x00189470; (void)x00189470;
gdcm::TagToType<0x0018,0x9471> x00189471; (void)x00189471;
gdcm::TagToType<0x0018,0x9472> x00189472; (void)x00189472;
gdcm::TagToType<0x0018,0x9473> x00189473; (void)x00189473;
gdcm::TagToType<0x0018,0x9474> x00189474; (void)x00189474;
gdcm::TagToType<0x0018,0x9476> x00189476; (void)x00189476;
gdcm::TagToType<0x0018,0x9477> x00189477; (void)x00189477;
gdcm::TagToType<0x0018,0x9504> x00189504; (void)x00189504;
gdcm::TagToType<0x0018,0x9506> x00189506; (void)x00189506;
gdcm::TagToType<0x0018,0x9507> x00189507; (void)x00189507;
gdcm::TagToType<0x0018,0x9508> x00189508; (void)x00189508;
gdcm::TagToType<0x0018,0x9509> x00189509; (void)x00189509;
gdcm::TagToType<0x0018,0x9510> x00189510; (void)x00189510;
gdcm::TagToType<0x0018,0x9511> x00189511; (void)x00189511;
gdcm::TagToType<0x0018,0x9514> x00189514; (void)x00189514;
gdcm::TagToType<0x0018,0x9515> x00189515; (void)x00189515;
gdcm::TagToType<0x0018,0x9516> x00189516; (void)x00189516;
gdcm::TagToType<0x0018,0x9517> x00189517; (void)x00189517;
gdcm::TagToType<0x0018,0x9524> x00189524; (void)x00189524;
gdcm::TagToType<0x0018,0x9525> x00189525; (void)x00189525;
gdcm::TagToType<0x0018,0x9526> x00189526; (void)x00189526;
gdcm::TagToType<0x0018,0x9527> x00189527; (void)x00189527;
gdcm::TagToType<0x0018,0x9528> x00189528; (void)x00189528;
gdcm::TagToType<0x0018,0x9530> x00189530; (void)x00189530;
gdcm::TagToType<0x0018,0x9531> x00189531; (void)x00189531;
gdcm::TagToType<0x0018,0x9538> x00189538; (void)x00189538;
gdcm::TagToType<0x0018,0x9601> x00189601; (void)x00189601;
gdcm::TagToType<0x0018,0x9602> x00189602; (void)x00189602;
gdcm::TagToType<0x0018,0x9603> x00189603; (void)x00189603;
gdcm::TagToType<0x0018,0x9604> x00189604; (void)x00189604;
gdcm::TagToType<0x0018,0x9605> x00189605; (void)x00189605;
gdcm::TagToType<0x0018,0x9606> x00189606; (void)x00189606;
gdcm::TagToType<0x0018,0x9607> x00189607; (void)x00189607;
gdcm::TagToType<0x0018,0xa001> x0018a001; (void)x0018a001;
gdcm::TagToType<0x0018,0xa002> x0018a002; (void)x0018a002;
gdcm::TagToType<0x0018,0xa003> x0018a003; (void)x0018a003;
gdcm::TagToType<0x0020,0x000d> x0020000d; (void)x0020000d;
gdcm::TagToType<0x0020,0x000e> x0020000e; (void)x0020000e;
gdcm::TagToType<0x0020,0x0010> x00200010; (void)x00200010;
gdcm::TagToType<0x0020,0x0011> x00200011; (void)x00200011;
gdcm::TagToType<0x0020,0x0012> x00200012; (void)x00200012;
gdcm::TagToType<0x0020,0x0013> x00200013; (void)x00200013;
gdcm::TagToType<0x0020,0x0014> x00200014; (void)x00200014;
gdcm::TagToType<0x0020,0x0015> x00200015; (void)x00200015;
gdcm::TagToType<0x0020,0x0016> x00200016; (void)x00200016;
gdcm::TagToType<0x0020,0x0017> x00200017; (void)x00200017;
gdcm::TagToType<0x0020,0x0018> x00200018; (void)x00200018;
gdcm::TagToType<0x0020,0x0019> x00200019; (void)x00200019;
gdcm::TagToType<0x0020,0x0020> x00200020; (void)x00200020;
gdcm::TagToType<0x0020,0x0022> x00200022; (void)x00200022;
gdcm::TagToType<0x0020,0x0024> x00200024; (void)x00200024;
gdcm::TagToType<0x0020,0x0026> x00200026; (void)x00200026;
gdcm::TagToType<0x0020,0x0030> x00200030; (void)x00200030;
gdcm::TagToType<0x0020,0x0032> x00200032; (void)x00200032;
gdcm::TagToType<0x0020,0x0035> x00200035; (void)x00200035;
gdcm::TagToType<0x0020,0x0037> x00200037; (void)x00200037;
gdcm::TagToType<0x0020,0x0050> x00200050; (void)x00200050;
gdcm::TagToType<0x0020,0x0052> x00200052; (void)x00200052;
gdcm::TagToType<0x0020,0x0060> x00200060; (void)x00200060;
gdcm::TagToType<0x0020,0x0062> x00200062; (void)x00200062;
gdcm::TagToType<0x0020,0x0070> x00200070; (void)x00200070;
gdcm::TagToType<0x0020,0x0080> x00200080; (void)x00200080;
gdcm::TagToType<0x0020,0x0100> x00200100; (void)x00200100;
gdcm::TagToType<0x0020,0x0105> x00200105; (void)x00200105;
gdcm::TagToType<0x0020,0x0110> x00200110; (void)x00200110;
gdcm::TagToType<0x0020,0x0200> x00200200; (void)x00200200;
gdcm::TagToType<0x0020,0x1000> x00201000; (void)x00201000;
gdcm::TagToType<0x0020,0x1001> x00201001; (void)x00201001;
gdcm::TagToType<0x0020,0x1002> x00201002; (void)x00201002;
gdcm::TagToType<0x0020,0x1003> x00201003; (void)x00201003;
gdcm::TagToType<0x0020,0x1004> x00201004; (void)x00201004;
gdcm::TagToType<0x0020,0x1005> x00201005; (void)x00201005;
gdcm::TagToType<0x0020,0x1020> x00201020; (void)x00201020;
gdcm::TagToType<0x0020,0x1040> x00201040; (void)x00201040;
gdcm::TagToType<0x0020,0x1041> x00201041; (void)x00201041;
gdcm::TagToType<0x0020,0x1070> x00201070; (void)x00201070;
gdcm::TagToType<0x0020,0x1200> x00201200; (void)x00201200;
gdcm::TagToType<0x0020,0x1202> x00201202; (void)x00201202;
gdcm::TagToType<0x0020,0x1204> x00201204; (void)x00201204;
gdcm::TagToType<0x0020,0x1206> x00201206; (void)x00201206;
gdcm::TagToType<0x0020,0x1208> x00201208; (void)x00201208;
gdcm::TagToType<0x0020,0x1209> x00201209; (void)x00201209;
gdcm::TagToType<0x0020,0x3401> x00203401; (void)x00203401;
gdcm::TagToType<0x0020,0x3402> x00203402; (void)x00203402;
gdcm::TagToType<0x0020,0x3403> x00203403; (void)x00203403;
gdcm::TagToType<0x0020,0x3404> x00203404; (void)x00203404;
gdcm::TagToType<0x0020,0x3405> x00203405; (void)x00203405;
gdcm::TagToType<0x0020,0x3406> x00203406; (void)x00203406;
gdcm::TagToType<0x0020,0x4000> x00204000; (void)x00204000;
gdcm::TagToType<0x0020,0x5000> x00205000; (void)x00205000;
gdcm::TagToType<0x0020,0x5002> x00205002; (void)x00205002;
gdcm::TagToType<0x0020,0x9056> x00209056; (void)x00209056;
gdcm::TagToType<0x0020,0x9057> x00209057; (void)x00209057;
gdcm::TagToType<0x0020,0x9071> x00209071; (void)x00209071;
gdcm::TagToType<0x0020,0x9072> x00209072; (void)x00209072;
gdcm::TagToType<0x0020,0x9111> x00209111; (void)x00209111;
gdcm::TagToType<0x0020,0x9113> x00209113; (void)x00209113;
gdcm::TagToType<0x0020,0x9116> x00209116; (void)x00209116;
gdcm::TagToType<0x0020,0x9128> x00209128; (void)x00209128;
gdcm::TagToType<0x0020,0x9153> x00209153; (void)x00209153;
gdcm::TagToType<0x0020,0x9156> x00209156; (void)x00209156;
gdcm::TagToType<0x0020,0x9157> x00209157; (void)x00209157;
gdcm::TagToType<0x0020,0x9158> x00209158; (void)x00209158;
gdcm::TagToType<0x0020,0x9161> x00209161; (void)x00209161;
gdcm::TagToType<0x0020,0x9162> x00209162; (void)x00209162;
gdcm::TagToType<0x0020,0x9163> x00209163; (void)x00209163;
gdcm::TagToType<0x0020,0x9164> x00209164; (void)x00209164;
gdcm::TagToType<0x0020,0x9165> x00209165; (void)x00209165;
gdcm::TagToType<0x0020,0x9167> x00209167; (void)x00209167;
gdcm::TagToType<0x0020,0x9213> x00209213; (void)x00209213;
gdcm::TagToType<0x0020,0x9221> x00209221; (void)x00209221;
gdcm::TagToType<0x0020,0x9222> x00209222; (void)x00209222;
gdcm::TagToType<0x0020,0x9228> x00209228; (void)x00209228;
gdcm::TagToType<0x0020,0x9238> x00209238; (void)x00209238;
gdcm::TagToType<0x0020,0x9241> x00209241; (void)x00209241;
gdcm::TagToType<0x0020,0x9245> x00209245; (void)x00209245;
gdcm::TagToType<0x0020,0x9246> x00209246; (void)x00209246;
gdcm::TagToType<0x0020,0x9247> x00209247; (void)x00209247;
gdcm::TagToType<0x0020,0x9248> x00209248; (void)x00209248;
gdcm::TagToType<0x0020,0x9249> x00209249; (void)x00209249;
gdcm::TagToType<0x0020,0x9250> x00209250; (void)x00209250;
gdcm::TagToType<0x0020,0x9251> x00209251; (void)x00209251;
gdcm::TagToType<0x0020,0x9252> x00209252; (void)x00209252;
gdcm::TagToType<0x0020,0x9253> x00209253; (void)x00209253;
gdcm::TagToType<0x0020,0x9254> x00209254; (void)x00209254;
gdcm::TagToType<0x0020,0x9255> x00209255; (void)x00209255;
gdcm::TagToType<0x0020,0x9256> x00209256; (void)x00209256;
gdcm::TagToType<0x0020,0x9257> x00209257; (void)x00209257;
gdcm::TagToType<0x0020,0x9421> x00209421; (void)x00209421;
gdcm::TagToType<0x0020,0x9450> x00209450; (void)x00209450;
gdcm::TagToType<0x0020,0x9453> x00209453; (void)x00209453;
gdcm::TagToType<0x0020,0x9518> x00209518; (void)x00209518;
gdcm::TagToType<0x0020,0x9529> x00209529; (void)x00209529;
gdcm::TagToType<0x0020,0x9536> x00209536; (void)x00209536;
gdcm::TagToType<0x0022,0x0001> x00220001; (void)x00220001;
gdcm::TagToType<0x0022,0x0002> x00220002; (void)x00220002;
gdcm::TagToType<0x0022,0x0003> x00220003; (void)x00220003;
gdcm::TagToType<0x0022,0x0004> x00220004; (void)x00220004;
gdcm::TagToType<0x0022,0x0005> x00220005; (void)x00220005;
gdcm::TagToType<0x0022,0x0006> x00220006; (void)x00220006;
gdcm::TagToType<0x0022,0x0007> x00220007; (void)x00220007;
gdcm::TagToType<0x0022,0x0008> x00220008; (void)x00220008;
gdcm::TagToType<0x0022,0x0009> x00220009; (void)x00220009;
gdcm::TagToType<0x0022,0x000a> x0022000a; (void)x0022000a;
gdcm::TagToType<0x0022,0x000b> x0022000b; (void)x0022000b;
gdcm::TagToType<0x0022,0x000c> x0022000c; (void)x0022000c;
gdcm::TagToType<0x0022,0x000d> x0022000d; (void)x0022000d;
gdcm::TagToType<0x0022,0x000e> x0022000e; (void)x0022000e;
gdcm::TagToType<0x0022,0x0010> x00220010; (void)x00220010;
gdcm::TagToType<0x0022,0x0011> x00220011; (void)x00220011;
gdcm::TagToType<0x0022,0x0012> x00220012; (void)x00220012;
gdcm::TagToType<0x0022,0x0013> x00220013; (void)x00220013;
gdcm::TagToType<0x0022,0x0014> x00220014; (void)x00220014;
gdcm::TagToType<0x0022,0x0015> x00220015; (void)x00220015;
gdcm::TagToType<0x0022,0x0016> x00220016; (void)x00220016;
gdcm::TagToType<0x0022,0x0017> x00220017; (void)x00220017;
gdcm::TagToType<0x0022,0x0018> x00220018; (void)x00220018;
gdcm::TagToType<0x0022,0x0019> x00220019; (void)x00220019;
gdcm::TagToType<0x0022,0x001a> x0022001a; (void)x0022001a;
gdcm::TagToType<0x0022,0x001b> x0022001b; (void)x0022001b;
gdcm::TagToType<0x0022,0x001c> x0022001c; (void)x0022001c;
gdcm::TagToType<0x0022,0x001d> x0022001d; (void)x0022001d;
gdcm::TagToType<0x0022,0x0020> x00220020; (void)x00220020;
gdcm::TagToType<0x0022,0x0021> x00220021; (void)x00220021;
gdcm::TagToType<0x0022,0x0022> x00220022; (void)x00220022;
gdcm::TagToType<0x0022,0x0030> x00220030; (void)x00220030;
gdcm::TagToType<0x0022,0x0031> x00220031; (void)x00220031;
gdcm::TagToType<0x0022,0x0032> x00220032; (void)x00220032;
gdcm::TagToType<0x0022,0x0035> x00220035; (void)x00220035;
gdcm::TagToType<0x0022,0x0036> x00220036; (void)x00220036;
gdcm::TagToType<0x0022,0x0037> x00220037; (void)x00220037;
gdcm::TagToType<0x0022,0x0038> x00220038; (void)x00220038;
gdcm::TagToType<0x0022,0x0039> x00220039; (void)x00220039;
gdcm::TagToType<0x0022,0x0041> x00220041; (void)x00220041;
gdcm::TagToType<0x0022,0x0042> x00220042; (void)x00220042;
gdcm::TagToType<0x0022,0x0048> x00220048; (void)x00220048;
gdcm::TagToType<0x0022,0x0049> x00220049; (void)x00220049;
gdcm::TagToType<0x0022,0x004e> x0022004e; (void)x0022004e;
gdcm::TagToType<0x0022,0x0055> x00220055; (void)x00220055;
gdcm::TagToType<0x0022,0x0056> x00220056; (void)x00220056;
gdcm::TagToType<0x0022,0x0057> x00220057; (void)x00220057;
gdcm::TagToType<0x0022,0x0058> x00220058; (void)x00220058;
gdcm::TagToType<0x0028,0x0002> x00280002; (void)x00280002;
gdcm::TagToType<0x0028,0x0003> x00280003; (void)x00280003;
gdcm::TagToType<0x0028,0x0004> x00280004; (void)x00280004;
gdcm::TagToType<0x0028,0x0005> x00280005; (void)x00280005;
gdcm::TagToType<0x0028,0x0006> x00280006; (void)x00280006;
gdcm::TagToType<0x0028,0x0008> x00280008; (void)x00280008;
gdcm::TagToType<0x0028,0x0009> x00280009; (void)x00280009;
gdcm::TagToType<0x0028,0x000a> x0028000a; (void)x0028000a;
gdcm::TagToType<0x0028,0x0010> x00280010; (void)x00280010;
gdcm::TagToType<0x0028,0x0011> x00280011; (void)x00280011;
gdcm::TagToType<0x0028,0x0012> x00280012; (void)x00280012;
gdcm::TagToType<0x0028,0x0014> x00280014; (void)x00280014;
gdcm::TagToType<0x0028,0x0030> x00280030; (void)x00280030;
gdcm::TagToType<0x0028,0x0031> x00280031; (void)x00280031;
gdcm::TagToType<0x0028,0x0032> x00280032; (void)x00280032;
gdcm::TagToType<0x0028,0x0034> x00280034; (void)x00280034;
gdcm::TagToType<0x0028,0x0040> x00280040; (void)x00280040;
gdcm::TagToType<0x0028,0x0050> x00280050; (void)x00280050;
gdcm::TagToType<0x0028,0x0051> x00280051; (void)x00280051;
gdcm::TagToType<0x0028,0x005f> x0028005f; (void)x0028005f;
gdcm::TagToType<0x0028,0x0060> x00280060; (void)x00280060;
gdcm::TagToType<0x0028,0x0061> x00280061; (void)x00280061;
gdcm::TagToType<0x0028,0x0062> x00280062; (void)x00280062;
gdcm::TagToType<0x0028,0x0063> x00280063; (void)x00280063;
gdcm::TagToType<0x0028,0x0065> x00280065; (void)x00280065;
gdcm::TagToType<0x0028,0x0066> x00280066; (void)x00280066;
gdcm::TagToType<0x0028,0x0068> x00280068; (void)x00280068;
gdcm::TagToType<0x0028,0x0069> x00280069; (void)x00280069;
gdcm::TagToType<0x0028,0x0070> x00280070; (void)x00280070;
gdcm::TagToType<0x0028,0x0080> x00280080; (void)x00280080;
gdcm::TagToType<0x0028,0x0081> x00280081; (void)x00280081;
gdcm::TagToType<0x0028,0x0082> x00280082; (void)x00280082;
gdcm::TagToType<0x0028,0x0090> x00280090; (void)x00280090;
gdcm::TagToType<0x0028,0x0091> x00280091; (void)x00280091;
gdcm::TagToType<0x0028,0x0092> x00280092; (void)x00280092;
gdcm::TagToType<0x0028,0x0093> x00280093; (void)x00280093;
gdcm::TagToType<0x0028,0x0094> x00280094; (void)x00280094;
gdcm::TagToType<0x0028,0x0100> x00280100; (void)x00280100;
gdcm::TagToType<0x0028,0x0101> x00280101; (void)x00280101;
gdcm::TagToType<0x0028,0x0102> x00280102; (void)x00280102;
gdcm::TagToType<0x0028,0x0103> x00280103; (void)x00280103;
gdcm::TagToType<0x0028,0x0200> x00280200; (void)x00280200;
gdcm::TagToType<0x0028,0x0300> x00280300; (void)x00280300;
gdcm::TagToType<0x0028,0x0301> x00280301; (void)x00280301;
gdcm::TagToType<0x0028,0x0400> x00280400; (void)x00280400;
gdcm::TagToType<0x0028,0x0401> x00280401; (void)x00280401;
gdcm::TagToType<0x0028,0x0402> x00280402; (void)x00280402;
gdcm::TagToType<0x0028,0x0403> x00280403; (void)x00280403;
gdcm::TagToType<0x0028,0x0404> x00280404; (void)x00280404;
gdcm::TagToType<0x0028,0x0700> x00280700; (void)x00280700;
gdcm::TagToType<0x0028,0x0701> x00280701; (void)x00280701;
gdcm::TagToType<0x0028,0x0702> x00280702; (void)x00280702;
gdcm::TagToType<0x0028,0x0710> x00280710; (void)x00280710;
gdcm::TagToType<0x0028,0x0720> x00280720; (void)x00280720;
gdcm::TagToType<0x0028,0x0721> x00280721; (void)x00280721;
gdcm::TagToType<0x0028,0x0722> x00280722; (void)x00280722;
gdcm::TagToType<0x0028,0x0730> x00280730; (void)x00280730;
gdcm::TagToType<0x0028,0x0740> x00280740; (void)x00280740;
gdcm::TagToType<0x0028,0x0a02> x00280a02; (void)x00280a02;
gdcm::TagToType<0x0028,0x0a04> x00280a04; (void)x00280a04;
gdcm::TagToType<0x0028,0x1040> x00281040; (void)x00281040;
gdcm::TagToType<0x0028,0x1041> x00281041; (void)x00281041;
gdcm::TagToType<0x0028,0x1050> x00281050; (void)x00281050;
gdcm::TagToType<0x0028,0x1051> x00281051; (void)x00281051;
gdcm::TagToType<0x0028,0x1052> x00281052; (void)x00281052;
gdcm::TagToType<0x0028,0x1053> x00281053; (void)x00281053;
gdcm::TagToType<0x0028,0x1054> x00281054; (void)x00281054;
gdcm::TagToType<0x0028,0x1055> x00281055; (void)x00281055;
gdcm::TagToType<0x0028,0x1056> x00281056; (void)x00281056;
gdcm::TagToType<0x0028,0x1080> x00281080; (void)x00281080;
gdcm::TagToType<0x0028,0x1090> x00281090; (void)x00281090;
gdcm::TagToType<0x0028,0x1199> x00281199; (void)x00281199;
gdcm::TagToType<0x0028,0x1201> x00281201; (void)x00281201;
gdcm::TagToType<0x0028,0x1202> x00281202; (void)x00281202;
gdcm::TagToType<0x0028,0x1203> x00281203; (void)x00281203;
gdcm::TagToType<0x0028,0x1211> x00281211; (void)x00281211;
gdcm::TagToType<0x0028,0x1212> x00281212; (void)x00281212;
gdcm::TagToType<0x0028,0x1213> x00281213; (void)x00281213;
gdcm::TagToType<0x0028,0x1214> x00281214; (void)x00281214;
gdcm::TagToType<0x0028,0x1221> x00281221; (void)x00281221;
gdcm::TagToType<0x0028,0x1222> x00281222; (void)x00281222;
gdcm::TagToType<0x0028,0x1223> x00281223; (void)x00281223;
gdcm::TagToType<0x0028,0x1300> x00281300; (void)x00281300;
gdcm::TagToType<0x0028,0x1350> x00281350; (void)x00281350;
gdcm::TagToType<0x0028,0x1351> x00281351; (void)x00281351;
gdcm::TagToType<0x0028,0x1352> x00281352; (void)x00281352;
gdcm::TagToType<0x0028,0x135a> x0028135a; (void)x0028135a;
gdcm::TagToType<0x0028,0x2000> x00282000; (void)x00282000;
gdcm::TagToType<0x0028,0x2110> x00282110; (void)x00282110;
gdcm::TagToType<0x0028,0x2112> x00282112; (void)x00282112;
gdcm::TagToType<0x0028,0x2114> x00282114; (void)x00282114;
gdcm::TagToType<0x0028,0x3000> x00283000; (void)x00283000;
gdcm::TagToType<0x0028,0x3003> x00283003; (void)x00283003;
gdcm::TagToType<0x0028,0x3004> x00283004; (void)x00283004;
gdcm::TagToType<0x0028,0x3010> x00283010; (void)x00283010;
gdcm::TagToType<0x0028,0x3110> x00283110; (void)x00283110;
gdcm::TagToType<0x0028,0x4000> x00284000; (void)x00284000;
gdcm::TagToType<0x0028,0x5000> x00285000; (void)x00285000;
gdcm::TagToType<0x0028,0x6010> x00286010; (void)x00286010;
gdcm::TagToType<0x0028,0x6020> x00286020; (void)x00286020;
gdcm::TagToType<0x0028,0x6022> x00286022; (void)x00286022;
gdcm::TagToType<0x0028,0x6023> x00286023; (void)x00286023;
gdcm::TagToType<0x0028,0x6030> x00286030; (void)x00286030;
gdcm::TagToType<0x0028,0x6040> x00286040; (void)x00286040;
gdcm::TagToType<0x0028,0x6100> x00286100; (void)x00286100;
gdcm::TagToType<0x0028,0x6101> x00286101; (void)x00286101;
gdcm::TagToType<0x0028,0x6102> x00286102; (void)x00286102;
gdcm::TagToType<0x0028,0x6110> x00286110; (void)x00286110;
gdcm::TagToType<0x0028,0x6112> x00286112; (void)x00286112;
gdcm::TagToType<0x0028,0x6114> x00286114; (void)x00286114;
gdcm::TagToType<0x0028,0x6120> x00286120; (void)x00286120;
gdcm::TagToType<0x0028,0x6190> x00286190; (void)x00286190;
gdcm::TagToType<0x0028,0x7fe0> x00287fe0; (void)x00287fe0;
gdcm::TagToType<0x0028,0x9001> x00289001; (void)x00289001;
gdcm::TagToType<0x0028,0x9002> x00289002; (void)x00289002;
gdcm::TagToType<0x0028,0x9003> x00289003; (void)x00289003;
gdcm::TagToType<0x0028,0x9099> x00289099; (void)x00289099;
gdcm::TagToType<0x0028,0x9108> x00289108; (void)x00289108;
gdcm::TagToType<0x0028,0x9110> x00289110; (void)x00289110;
gdcm::TagToType<0x0028,0x9132> x00289132; (void)x00289132;
gdcm::TagToType<0x0028,0x9145> x00289145; (void)x00289145;
gdcm::TagToType<0x0028,0x9235> x00289235; (void)x00289235;
gdcm::TagToType<0x0028,0x9411> x00289411; (void)x00289411;
gdcm::TagToType<0x0028,0x9415> x00289415; (void)x00289415;
gdcm::TagToType<0x0028,0x9416> x00289416; (void)x00289416;
gdcm::TagToType<0x0028,0x9422> x00289422; (void)x00289422;
gdcm::TagToType<0x0028,0x9443> x00289443; (void)x00289443;
gdcm::TagToType<0x0028,0x9444> x00289444; (void)x00289444;
gdcm::TagToType<0x0028,0x9445> x00289445; (void)x00289445;
gdcm::TagToType<0x0028,0x9446> x00289446; (void)x00289446;
gdcm::TagToType<0x0028,0x9454> x00289454; (void)x00289454;
gdcm::TagToType<0x0028,0x9474> x00289474; (void)x00289474;
gdcm::TagToType<0x0028,0x9520> x00289520; (void)x00289520;
gdcm::TagToType<0x0028,0x9537> x00289537; (void)x00289537;
gdcm::TagToType<0x0032,0x000a> x0032000a; (void)x0032000a;
gdcm::TagToType<0x0032,0x000c> x0032000c; (void)x0032000c;
gdcm::TagToType<0x0032,0x0012> x00320012; (void)x00320012;
gdcm::TagToType<0x0032,0x0032> x00320032; (void)x00320032;
gdcm::TagToType<0x0032,0x0033> x00320033; (void)x00320033;
gdcm::TagToType<0x0032,0x0034> x00320034; (void)x00320034;
gdcm::TagToType<0x0032,0x0035> x00320035; (void)x00320035;
gdcm::TagToType<0x0032,0x1000> x00321000; (void)x00321000;
gdcm::TagToType<0x0032,0x1001> x00321001; (void)x00321001;
gdcm::TagToType<0x0032,0x1010> x00321010; (void)x00321010;
gdcm::TagToType<0x0032,0x1011> x00321011; (void)x00321011;
gdcm::TagToType<0x0032,0x1020> x00321020; (void)x00321020;
gdcm::TagToType<0x0032,0x1021> x00321021; (void)x00321021;
gdcm::TagToType<0x0032,0x1030> x00321030; (void)x00321030;
gdcm::TagToType<0x0032,0x1031> x00321031; (void)x00321031;
gdcm::TagToType<0x0032,0x1032> x00321032; (void)x00321032;
gdcm::TagToType<0x0032,0x1033> x00321033; (void)x00321033;
gdcm::TagToType<0x0032,0x1040> x00321040; (void)x00321040;
gdcm::TagToType<0x0032,0x1041> x00321041; (void)x00321041;
gdcm::TagToType<0x0032,0x1050> x00321050; (void)x00321050;
gdcm::TagToType<0x0032,0x1051> x00321051; (void)x00321051;
gdcm::TagToType<0x0032,0x1055> x00321055; (void)x00321055;
gdcm::TagToType<0x0032,0x1060> x00321060; (void)x00321060;
gdcm::TagToType<0x0032,0x1064> x00321064; (void)x00321064;
gdcm::TagToType<0x0032,0x1070> x00321070; (void)x00321070;
gdcm::TagToType<0x0032,0x4000> x00324000; (void)x00324000;
gdcm::TagToType<0x0038,0x0004> x00380004; (void)x00380004;
gdcm::TagToType<0x0038,0x0008> x00380008; (void)x00380008;
gdcm::TagToType<0x0038,0x0010> x00380010; (void)x00380010;
gdcm::TagToType<0x0038,0x0011> x00380011; (void)x00380011;
gdcm::TagToType<0x0038,0x0016> x00380016; (void)x00380016;
gdcm::TagToType<0x0038,0x001a> x0038001a; (void)x0038001a;
gdcm::TagToType<0x0038,0x001b> x0038001b; (void)x0038001b;
gdcm::TagToType<0x0038,0x001c> x0038001c; (void)x0038001c;
gdcm::TagToType<0x0038,0x001d> x0038001d; (void)x0038001d;
gdcm::TagToType<0x0038,0x001e> x0038001e; (void)x0038001e;
gdcm::TagToType<0x0038,0x0020> x00380020; (void)x00380020;
gdcm::TagToType<0x0038,0x0021> x00380021; (void)x00380021;
gdcm::TagToType<0x0038,0x0030> x00380030; (void)x00380030;
gdcm::TagToType<0x0038,0x0032> x00380032; (void)x00380032;
gdcm::TagToType<0x0038,0x0040> x00380040; (void)x00380040;
gdcm::TagToType<0x0038,0x0044> x00380044; (void)x00380044;
gdcm::TagToType<0x0038,0x0050> x00380050; (void)x00380050;
gdcm::TagToType<0x0038,0x0060> x00380060; (void)x00380060;
gdcm::TagToType<0x0038,0x0061> x00380061; (void)x00380061;
gdcm::TagToType<0x0038,0x0062> x00380062; (void)x00380062;
gdcm::TagToType<0x0038,0x0100> x00380100; (void)x00380100;
gdcm::TagToType<0x0038,0x0300> x00380300; (void)x00380300;
gdcm::TagToType<0x0038,0x0400> x00380400; (void)x00380400;
gdcm::TagToType<0x0038,0x0500> x00380500; (void)x00380500;
gdcm::TagToType<0x0038,0x0502> x00380502; (void)x00380502;
gdcm::TagToType<0x0038,0x4000> x00384000; (void)x00384000;
gdcm::TagToType<0x003a,0x0004> x003a0004; (void)x003a0004;
gdcm::TagToType<0x003a,0x0005> x003a0005; (void)x003a0005;
gdcm::TagToType<0x003a,0x0010> x003a0010; (void)x003a0010;
gdcm::TagToType<0x003a,0x001a> x003a001a; (void)x003a001a;
gdcm::TagToType<0x003a,0x0020> x003a0020; (void)x003a0020;
gdcm::TagToType<0x003a,0x0200> x003a0200; (void)x003a0200;
gdcm::TagToType<0x003a,0x0202> x003a0202; (void)x003a0202;
gdcm::TagToType<0x003a,0x0203> x003a0203; (void)x003a0203;
gdcm::TagToType<0x003a,0x0205> x003a0205; (void)x003a0205;
gdcm::TagToType<0x003a,0x0208> x003a0208; (void)x003a0208;
gdcm::TagToType<0x003a,0x0209> x003a0209; (void)x003a0209;
gdcm::TagToType<0x003a,0x020a> x003a020a; (void)x003a020a;
gdcm::TagToType<0x003a,0x020c> x003a020c; (void)x003a020c;
gdcm::TagToType<0x003a,0x0210> x003a0210; (void)x003a0210;
gdcm::TagToType<0x003a,0x0211> x003a0211; (void)x003a0211;
gdcm::TagToType<0x003a,0x0212> x003a0212; (void)x003a0212;
gdcm::TagToType<0x003a,0x0213> x003a0213; (void)x003a0213;
gdcm::TagToType<0x003a,0x0214> x003a0214; (void)x003a0214;
gdcm::TagToType<0x003a,0x0215> x003a0215; (void)x003a0215;
gdcm::TagToType<0x003a,0x0218> x003a0218; (void)x003a0218;
gdcm::TagToType<0x003a,0x021a> x003a021a; (void)x003a021a;
gdcm::TagToType<0x003a,0x0220> x003a0220; (void)x003a0220;
gdcm::TagToType<0x003a,0x0221> x003a0221; (void)x003a0221;
gdcm::TagToType<0x003a,0x0222> x003a0222; (void)x003a0222;
gdcm::TagToType<0x003a,0x0223> x003a0223; (void)x003a0223;
gdcm::TagToType<0x003a,0x0230> x003a0230; (void)x003a0230;
gdcm::TagToType<0x003a,0x0231> x003a0231; (void)x003a0231;
gdcm::TagToType<0x003a,0x0240> x003a0240; (void)x003a0240;
gdcm::TagToType<0x003a,0x0241> x003a0241; (void)x003a0241;
gdcm::TagToType<0x003a,0x0242> x003a0242; (void)x003a0242;
gdcm::TagToType<0x003a,0x0244> x003a0244; (void)x003a0244;
gdcm::TagToType<0x003a,0x0245> x003a0245; (void)x003a0245;
gdcm::TagToType<0x003a,0x0246> x003a0246; (void)x003a0246;
gdcm::TagToType<0x003a,0x0247> x003a0247; (void)x003a0247;
gdcm::TagToType<0x003a,0x0248> x003a0248; (void)x003a0248;
gdcm::TagToType<0x003a,0x0300> x003a0300; (void)x003a0300;
gdcm::TagToType<0x003a,0x0301> x003a0301; (void)x003a0301;
gdcm::TagToType<0x003a,0x0302> x003a0302; (void)x003a0302;
gdcm::TagToType<0x0040,0x0001> x00400001; (void)x00400001;
gdcm::TagToType<0x0040,0x0002> x00400002; (void)x00400002;
gdcm::TagToType<0x0040,0x0003> x00400003; (void)x00400003;
gdcm::TagToType<0x0040,0x0004> x00400004; (void)x00400004;
gdcm::TagToType<0x0040,0x0005> x00400005; (void)x00400005;
gdcm::TagToType<0x0040,0x0006> x00400006; (void)x00400006;
gdcm::TagToType<0x0040,0x0007> x00400007; (void)x00400007;
gdcm::TagToType<0x0040,0x0008> x00400008; (void)x00400008;
gdcm::TagToType<0x0040,0x0009> x00400009; (void)x00400009;
gdcm::TagToType<0x0040,0x000a> x0040000a; (void)x0040000a;
gdcm::TagToType<0x0040,0x000b> x0040000b; (void)x0040000b;
gdcm::TagToType<0x0040,0x0010> x00400010; (void)x00400010;
gdcm::TagToType<0x0040,0x0011> x00400011; (void)x00400011;
gdcm::TagToType<0x0040,0x0012> x00400012; (void)x00400012;
gdcm::TagToType<0x0040,0x0020> x00400020; (void)x00400020;
gdcm::TagToType<0x0040,0x0100> x00400100; (void)x00400100;
gdcm::TagToType<0x0040,0x0220> x00400220; (void)x00400220;
gdcm::TagToType<0x0040,0x0241> x00400241; (void)x00400241;
gdcm::TagToType<0x0040,0x0242> x00400242; (void)x00400242;
gdcm::TagToType<0x0040,0x0243> x00400243; (void)x00400243;
gdcm::TagToType<0x0040,0x0244> x00400244; (void)x00400244;
gdcm::TagToType<0x0040,0x0245> x00400245; (void)x00400245;
gdcm::TagToType<0x0040,0x0250> x00400250; (void)x00400250;
gdcm::TagToType<0x0040,0x0251> x00400251; (void)x00400251;
gdcm::TagToType<0x0040,0x0252> x00400252; (void)x00400252;
gdcm::TagToType<0x0040,0x0253> x00400253; (void)x00400253;
gdcm::TagToType<0x0040,0x0254> x00400254; (void)x00400254;
gdcm::TagToType<0x0040,0x0255> x00400255; (void)x00400255;
gdcm::TagToType<0x0040,0x0260> x00400260; (void)x00400260;
gdcm::TagToType<0x0040,0x0270> x00400270; (void)x00400270;
gdcm::TagToType<0x0040,0x0275> x00400275; (void)x00400275;
gdcm::TagToType<0x0040,0x0280> x00400280; (void)x00400280;
gdcm::TagToType<0x0040,0x0281> x00400281; (void)x00400281;
gdcm::TagToType<0x0040,0x0293> x00400293; (void)x00400293;
gdcm::TagToType<0x0040,0x0294> x00400294; (void)x00400294;
gdcm::TagToType<0x0040,0x0295> x00400295; (void)x00400295;
gdcm::TagToType<0x0040,0x0296> x00400296; (void)x00400296;
gdcm::TagToType<0x0040,0x0300> x00400300; (void)x00400300;
gdcm::TagToType<0x0040,0x0301> x00400301; (void)x00400301;
gdcm::TagToType<0x0040,0x0302> x00400302; (void)x00400302;
gdcm::TagToType<0x0040,0x0303> x00400303; (void)x00400303;
gdcm::TagToType<0x0040,0x0306> x00400306; (void)x00400306;
gdcm::TagToType<0x0040,0x0307> x00400307; (void)x00400307;
gdcm::TagToType<0x0040,0x030e> x0040030e; (void)x0040030e;
gdcm::TagToType<0x0040,0x0310> x00400310; (void)x00400310;
gdcm::TagToType<0x0040,0x0312> x00400312; (void)x00400312;
gdcm::TagToType<0x0040,0x0314> x00400314; (void)x00400314;
gdcm::TagToType<0x0040,0x0316> x00400316; (void)x00400316;
gdcm::TagToType<0x0040,0x0318> x00400318; (void)x00400318;
gdcm::TagToType<0x0040,0x0320> x00400320; (void)x00400320;
gdcm::TagToType<0x0040,0x0321> x00400321; (void)x00400321;
gdcm::TagToType<0x0040,0x0324> x00400324; (void)x00400324;
gdcm::TagToType<0x0040,0x0330> x00400330; (void)x00400330;
gdcm::TagToType<0x0040,0x0340> x00400340; (void)x00400340;
gdcm::TagToType<0x0040,0x0400> x00400400; (void)x00400400;
gdcm::TagToType<0x0040,0x0440> x00400440; (void)x00400440;
gdcm::TagToType<0x0040,0x0441> x00400441; (void)x00400441;
gdcm::TagToType<0x0040,0x050a> x0040050a; (void)x0040050a;
gdcm::TagToType<0x0040,0x0550> x00400550; (void)x00400550;
gdcm::TagToType<0x0040,0x0551> x00400551; (void)x00400551;
gdcm::TagToType<0x0040,0x0552> x00400552; (void)x00400552;
gdcm::TagToType<0x0040,0x0553> x00400553; (void)x00400553;
gdcm::TagToType<0x0040,0x0555> x00400555; (void)x00400555;
gdcm::TagToType<0x0040,0x0556> x00400556; (void)x00400556;
gdcm::TagToType<0x0040,0x059a> x0040059a; (void)x0040059a;
gdcm::TagToType<0x0040,0x06fa> x004006fa; (void)x004006fa;
gdcm::TagToType<0x0040,0x071a> x0040071a; (void)x0040071a;
gdcm::TagToType<0x0040,0x072a> x0040072a; (void)x0040072a;
gdcm::TagToType<0x0040,0x073a> x0040073a; (void)x0040073a;
gdcm::TagToType<0x0040,0x074a> x0040074a; (void)x0040074a;
gdcm::TagToType<0x0040,0x08d8> x004008d8; (void)x004008d8;
gdcm::TagToType<0x0040,0x08da> x004008da; (void)x004008da;
gdcm::TagToType<0x0040,0x08ea> x004008ea; (void)x004008ea;
gdcm::TagToType<0x0040,0x09f8> x004009f8; (void)x004009f8;
gdcm::TagToType<0x0040,0x1001> x00401001; (void)x00401001;
gdcm::TagToType<0x0040,0x1002> x00401002; (void)x00401002;
gdcm::TagToType<0x0040,0x1003> x00401003; (void)x00401003;
gdcm::TagToType<0x0040,0x1004> x00401004; (void)x00401004;
gdcm::TagToType<0x0040,0x1005> x00401005; (void)x00401005;
gdcm::TagToType<0x0040,0x1006> x00401006; (void)x00401006;
gdcm::TagToType<0x0040,0x1007> x00401007; (void)x00401007;
gdcm::TagToType<0x0040,0x1008> x00401008; (void)x00401008;
gdcm::TagToType<0x0040,0x1009> x00401009; (void)x00401009;
gdcm::TagToType<0x0040,0x100a> x0040100a; (void)x0040100a;
gdcm::TagToType<0x0040,0x1010> x00401010; (void)x00401010;
gdcm::TagToType<0x0040,0x1011> x00401011; (void)x00401011;
gdcm::TagToType<0x0040,0x1101> x00401101; (void)x00401101;
gdcm::TagToType<0x0040,0x1102> x00401102; (void)x00401102;
gdcm::TagToType<0x0040,0x1103> x00401103; (void)x00401103;
gdcm::TagToType<0x0040,0x1400> x00401400; (void)x00401400;
gdcm::TagToType<0x0040,0x2001> x00402001; (void)x00402001;
gdcm::TagToType<0x0040,0x2004> x00402004; (void)x00402004;
gdcm::TagToType<0x0040,0x2005> x00402005; (void)x00402005;
gdcm::TagToType<0x0040,0x2006> x00402006; (void)x00402006;
gdcm::TagToType<0x0040,0x2007> x00402007; (void)x00402007;
gdcm::TagToType<0x0040,0x2008> x00402008; (void)x00402008;
gdcm::TagToType<0x0040,0x2009> x00402009; (void)x00402009;
gdcm::TagToType<0x0040,0x2010> x00402010; (void)x00402010;
gdcm::TagToType<0x0040,0x2016> x00402016; (void)x00402016;
gdcm::TagToType<0x0040,0x2017> x00402017; (void)x00402017;
gdcm::TagToType<0x0040,0x2400> x00402400; (void)x00402400;
gdcm::TagToType<0x0040,0x3001> x00403001; (void)x00403001;
gdcm::TagToType<0x0040,0x4001> x00404001; (void)x00404001;
gdcm::TagToType<0x0040,0x4002> x00404002; (void)x00404002;
gdcm::TagToType<0x0040,0x4003> x00404003; (void)x00404003;
gdcm::TagToType<0x0040,0x4004> x00404004; (void)x00404004;
gdcm::TagToType<0x0040,0x4005> x00404005; (void)x00404005;
gdcm::TagToType<0x0040,0x4006> x00404006; (void)x00404006;
gdcm::TagToType<0x0040,0x4007> x00404007; (void)x00404007;
gdcm::TagToType<0x0040,0x4009> x00404009; (void)x00404009;
gdcm::TagToType<0x0040,0x4010> x00404010; (void)x00404010;
gdcm::TagToType<0x0040,0x4011> x00404011; (void)x00404011;
gdcm::TagToType<0x0040,0x4015> x00404015; (void)x00404015;
gdcm::TagToType<0x0040,0x4016> x00404016; (void)x00404016;
gdcm::TagToType<0x0040,0x4018> x00404018; (void)x00404018;
gdcm::TagToType<0x0040,0x4019> x00404019; (void)x00404019;
gdcm::TagToType<0x0040,0x4020> x00404020; (void)x00404020;
gdcm::TagToType<0x0040,0x4021> x00404021; (void)x00404021;
gdcm::TagToType<0x0040,0x4022> x00404022; (void)x00404022;
gdcm::TagToType<0x0040,0x4023> x00404023; (void)x00404023;
gdcm::TagToType<0x0040,0x4025> x00404025; (void)x00404025;
gdcm::TagToType<0x0040,0x4026> x00404026; (void)x00404026;
gdcm::TagToType<0x0040,0x4027> x00404027; (void)x00404027;
gdcm::TagToType<0x0040,0x4028> x00404028; (void)x00404028;
gdcm::TagToType<0x0040,0x4029> x00404029; (void)x00404029;
gdcm::TagToType<0x0040,0x4030> x00404030; (void)x00404030;
gdcm::TagToType<0x0040,0x4031> x00404031; (void)x00404031;
gdcm::TagToType<0x0040,0x4032> x00404032; (void)x00404032;
gdcm::TagToType<0x0040,0x4033> x00404033; (void)x00404033;
gdcm::TagToType<0x0040,0x4034> x00404034; (void)x00404034;
gdcm::TagToType<0x0040,0x4035> x00404035; (void)x00404035;
gdcm::TagToType<0x0040,0x4036> x00404036; (void)x00404036;
gdcm::TagToType<0x0040,0x4037> x00404037; (void)x00404037;
gdcm::TagToType<0x0040,0x8302> x00408302; (void)x00408302;
gdcm::TagToType<0x0040,0x9094> x00409094; (void)x00409094;
gdcm::TagToType<0x0040,0x9096> x00409096; (void)x00409096;
gdcm::TagToType<0x0040,0x9098> x00409098; (void)x00409098;
gdcm::TagToType<0x0040,0x9210> x00409210; (void)x00409210;
gdcm::TagToType<0x0040,0x9212> x00409212; (void)x00409212;
gdcm::TagToType<0x0040,0x9224> x00409224; (void)x00409224;
gdcm::TagToType<0x0040,0x9225> x00409225; (void)x00409225;
gdcm::TagToType<0x0040,0xa010> x0040a010; (void)x0040a010;
gdcm::TagToType<0x0040,0xa027> x0040a027; (void)x0040a027;
gdcm::TagToType<0x0040,0xa030> x0040a030; (void)x0040a030;
gdcm::TagToType<0x0040,0xa032> x0040a032; (void)x0040a032;
gdcm::TagToType<0x0040,0xa040> x0040a040; (void)x0040a040;
gdcm::TagToType<0x0040,0xa043> x0040a043; (void)x0040a043;
gdcm::TagToType<0x0040,0xa050> x0040a050; (void)x0040a050;
gdcm::TagToType<0x0040,0xa073> x0040a073; (void)x0040a073;
gdcm::TagToType<0x0040,0xa075> x0040a075; (void)x0040a075;
gdcm::TagToType<0x0040,0xa078> x0040a078; (void)x0040a078;
gdcm::TagToType<0x0040,0xa07a> x0040a07a; (void)x0040a07a;
gdcm::TagToType<0x0040,0xa07c> x0040a07c; (void)x0040a07c;
gdcm::TagToType<0x0040,0xa080> x0040a080; (void)x0040a080;
gdcm::TagToType<0x0040,0xa082> x0040a082; (void)x0040a082;
gdcm::TagToType<0x0040,0xa084> x0040a084; (void)x0040a084;
gdcm::TagToType<0x0040,0xa088> x0040a088; (void)x0040a088;
gdcm::TagToType<0x0040,0xa090> x0040a090; (void)x0040a090;
gdcm::TagToType<0x0040,0xa0b0> x0040a0b0; (void)x0040a0b0;
gdcm::TagToType<0x0040,0xa120> x0040a120; (void)x0040a120;
gdcm::TagToType<0x0040,0xa121> x0040a121; (void)x0040a121;
gdcm::TagToType<0x0040,0xa122> x0040a122; (void)x0040a122;
gdcm::TagToType<0x0040,0xa123> x0040a123; (void)x0040a123;
gdcm::TagToType<0x0040,0xa124> x0040a124; (void)x0040a124;
gdcm::TagToType<0x0040,0xa130> x0040a130; (void)x0040a130;
gdcm::TagToType<0x0040,0xa132> x0040a132; (void)x0040a132;
gdcm::TagToType<0x0040,0xa136> x0040a136; (void)x0040a136;
gdcm::TagToType<0x0040,0xa138> x0040a138; (void)x0040a138;
gdcm::TagToType<0x0040,0xa13a> x0040a13a; (void)x0040a13a;
gdcm::TagToType<0x0040,0xa160> x0040a160; (void)x0040a160;
gdcm::TagToType<0x0040,0xa168> x0040a168; (void)x0040a168;
gdcm::TagToType<0x0040,0xa170> x0040a170; (void)x0040a170;
gdcm::TagToType<0x0040,0xa180> x0040a180; (void)x0040a180;
gdcm::TagToType<0x0040,0xa195> x0040a195; (void)x0040a195;
gdcm::TagToType<0x0040,0xa300> x0040a300; (void)x0040a300;
gdcm::TagToType<0x0040,0xa301> x0040a301; (void)x0040a301;
gdcm::TagToType<0x0040,0xa30a> x0040a30a; (void)x0040a30a;
gdcm::TagToType<0x0040,0xa353> x0040a353; (void)x0040a353;
gdcm::TagToType<0x0040,0xa354> x0040a354; (void)x0040a354;
gdcm::TagToType<0x0040,0xa360> x0040a360; (void)x0040a360;
gdcm::TagToType<0x0040,0xa370> x0040a370; (void)x0040a370;
gdcm::TagToType<0x0040,0xa372> x0040a372; (void)x0040a372;
gdcm::TagToType<0x0040,0xa375> x0040a375; (void)x0040a375;
gdcm::TagToType<0x0040,0xa385> x0040a385; (void)x0040a385;
gdcm::TagToType<0x0040,0xa390> x0040a390; (void)x0040a390;
gdcm::TagToType<0x0040,0xa491> x0040a491; (void)x0040a491;
gdcm::TagToType<0x0040,0xa492> x0040a492; (void)x0040a492;
gdcm::TagToType<0x0040,0xa493> x0040a493; (void)x0040a493;
gdcm::TagToType<0x0040,0xa494> x0040a494; (void)x0040a494;
gdcm::TagToType<0x0040,0xa504> x0040a504; (void)x0040a504;
gdcm::TagToType<0x0040,0xa525> x0040a525; (void)x0040a525;
gdcm::TagToType<0x0040,0xa730> x0040a730; (void)x0040a730;
gdcm::TagToType<0x0040,0xb020> x0040b020; (void)x0040b020;
gdcm::TagToType<0x0040,0xdb00> x0040db00; (void)x0040db00;
gdcm::TagToType<0x0040,0xdb06> x0040db06; (void)x0040db06;
gdcm::TagToType<0x0040,0xdb07> x0040db07; (void)x0040db07;
gdcm::TagToType<0x0040,0xdb0b> x0040db0b; (void)x0040db0b;
gdcm::TagToType<0x0040,0xdb0c> x0040db0c; (void)x0040db0c;
gdcm::TagToType<0x0040,0xdb0d> x0040db0d; (void)x0040db0d;
gdcm::TagToType<0x0040,0xdb73> x0040db73; (void)x0040db73;
gdcm::TagToType<0x0040,0xe001> x0040e001; (void)x0040e001;
gdcm::TagToType<0x0040,0xe004> x0040e004; (void)x0040e004;
gdcm::TagToType<0x0040,0xe006> x0040e006; (void)x0040e006;
gdcm::TagToType<0x0040,0xe010> x0040e010; (void)x0040e010;
gdcm::TagToType<0x0042,0x0010> x00420010; (void)x00420010;
gdcm::TagToType<0x0042,0x0011> x00420011; (void)x00420011;
gdcm::TagToType<0x0042,0x0012> x00420012; (void)x00420012;
gdcm::TagToType<0x0042,0x0013> x00420013; (void)x00420013;
gdcm::TagToType<0x0042,0x0014> x00420014; (void)x00420014;
gdcm::TagToType<0x0044,0x0001> x00440001; (void)x00440001;
gdcm::TagToType<0x0044,0x0002> x00440002; (void)x00440002;
gdcm::TagToType<0x0044,0x0003> x00440003; (void)x00440003;
gdcm::TagToType<0x0044,0x0004> x00440004; (void)x00440004;
gdcm::TagToType<0x0044,0x0007> x00440007; (void)x00440007;
gdcm::TagToType<0x0044,0x0008> x00440008; (void)x00440008;
gdcm::TagToType<0x0044,0x0009> x00440009; (void)x00440009;
gdcm::TagToType<0x0044,0x000a> x0044000a; (void)x0044000a;
gdcm::TagToType<0x0044,0x000b> x0044000b; (void)x0044000b;
gdcm::TagToType<0x0044,0x0010> x00440010; (void)x00440010;
gdcm::TagToType<0x0044,0x0011> x00440011; (void)x00440011;
gdcm::TagToType<0x0044,0x0012> x00440012; (void)x00440012;
gdcm::TagToType<0x0044,0x0013> x00440013; (void)x00440013;
gdcm::TagToType<0x0044,0x0019> x00440019; (void)x00440019;
gdcm::TagToType<0x0050,0x0004> x00500004; (void)x00500004;
gdcm::TagToType<0x0050,0x0010> x00500010; (void)x00500010;
gdcm::TagToType<0x0050,0x0014> x00500014; (void)x00500014;
gdcm::TagToType<0x0050,0x0016> x00500016; (void)x00500016;
gdcm::TagToType<0x0050,0x0017> x00500017; (void)x00500017;
gdcm::TagToType<0x0050,0x0018> x00500018; (void)x00500018;
gdcm::TagToType<0x0050,0x0019> x00500019; (void)x00500019;
gdcm::TagToType<0x0050,0x0020> x00500020; (void)x00500020;
gdcm::TagToType<0x0054,0x0010> x00540010; (void)x00540010;
gdcm::TagToType<0x0054,0x0011> x00540011; (void)x00540011;
gdcm::TagToType<0x0054,0x0012> x00540012; (void)x00540012;
gdcm::TagToType<0x0054,0x0013> x00540013; (void)x00540013;
gdcm::TagToType<0x0054,0x0014> x00540014; (void)x00540014;
gdcm::TagToType<0x0054,0x0015> x00540015; (void)x00540015;
gdcm::TagToType<0x0054,0x0016> x00540016; (void)x00540016;
gdcm::TagToType<0x0054,0x0017> x00540017; (void)x00540017;
gdcm::TagToType<0x0054,0x0018> x00540018; (void)x00540018;
gdcm::TagToType<0x0054,0x0020> x00540020; (void)x00540020;
gdcm::TagToType<0x0054,0x0021> x00540021; (void)x00540021;
gdcm::TagToType<0x0054,0x0022> x00540022; (void)x00540022;
gdcm::TagToType<0x0054,0x0030> x00540030; (void)x00540030;
gdcm::TagToType<0x0054,0x0031> x00540031; (void)x00540031;
gdcm::TagToType<0x0054,0x0032> x00540032; (void)x00540032;
gdcm::TagToType<0x0054,0x0033> x00540033; (void)x00540033;
gdcm::TagToType<0x0054,0x0036> x00540036; (void)x00540036;
gdcm::TagToType<0x0054,0x0038> x00540038; (void)x00540038;
gdcm::TagToType<0x0054,0x0039> x00540039; (void)x00540039;
gdcm::TagToType<0x0054,0x0050> x00540050; (void)x00540050;
gdcm::TagToType<0x0054,0x0051> x00540051; (void)x00540051;
gdcm::TagToType<0x0054,0x0052> x00540052; (void)x00540052;
gdcm::TagToType<0x0054,0x0053> x00540053; (void)x00540053;
gdcm::TagToType<0x0054,0x0060> x00540060; (void)x00540060;
gdcm::TagToType<0x0054,0x0061> x00540061; (void)x00540061;
gdcm::TagToType<0x0054,0x0062> x00540062; (void)x00540062;
gdcm::TagToType<0x0054,0x0063> x00540063; (void)x00540063;
gdcm::TagToType<0x0054,0x0070> x00540070; (void)x00540070;
gdcm::TagToType<0x0054,0x0071> x00540071; (void)x00540071;
gdcm::TagToType<0x0054,0x0072> x00540072; (void)x00540072;
gdcm::TagToType<0x0054,0x0073> x00540073; (void)x00540073;
gdcm::TagToType<0x0054,0x0080> x00540080; (void)x00540080;
gdcm::TagToType<0x0054,0x0081> x00540081; (void)x00540081;
gdcm::TagToType<0x0054,0x0090> x00540090; (void)x00540090;
gdcm::TagToType<0x0054,0x0100> x00540100; (void)x00540100;
gdcm::TagToType<0x0054,0x0101> x00540101; (void)x00540101;
gdcm::TagToType<0x0054,0x0200> x00540200; (void)x00540200;
gdcm::TagToType<0x0054,0x0202> x00540202; (void)x00540202;
gdcm::TagToType<0x0054,0x0210> x00540210; (void)x00540210;
gdcm::TagToType<0x0054,0x0211> x00540211; (void)x00540211;
gdcm::TagToType<0x0054,0x0220> x00540220; (void)x00540220;
gdcm::TagToType<0x0054,0x0222> x00540222; (void)x00540222;
gdcm::TagToType<0x0054,0x0300> x00540300; (void)x00540300;
gdcm::TagToType<0x0054,0x0302> x00540302; (void)x00540302;
gdcm::TagToType<0x0054,0x0304> x00540304; (void)x00540304;
gdcm::TagToType<0x0054,0x0306> x00540306; (void)x00540306;
gdcm::TagToType<0x0054,0x0308> x00540308; (void)x00540308;
gdcm::TagToType<0x0054,0x0400> x00540400; (void)x00540400;
gdcm::TagToType<0x0054,0x0410> x00540410; (void)x00540410;
gdcm::TagToType<0x0054,0x0412> x00540412; (void)x00540412;
gdcm::TagToType<0x0054,0x0414> x00540414; (void)x00540414;
gdcm::TagToType<0x0054,0x0500> x00540500; (void)x00540500;
gdcm::TagToType<0x0054,0x1000> x00541000; (void)x00541000;
gdcm::TagToType<0x0054,0x1001> x00541001; (void)x00541001;
gdcm::TagToType<0x0054,0x1002> x00541002; (void)x00541002;
gdcm::TagToType<0x0054,0x1004> x00541004; (void)x00541004;
gdcm::TagToType<0x0054,0x1100> x00541100; (void)x00541100;
gdcm::TagToType<0x0054,0x1101> x00541101; (void)x00541101;
gdcm::TagToType<0x0054,0x1102> x00541102; (void)x00541102;
gdcm::TagToType<0x0054,0x1103> x00541103; (void)x00541103;
gdcm::TagToType<0x0054,0x1104> x00541104; (void)x00541104;
gdcm::TagToType<0x0054,0x1105> x00541105; (void)x00541105;
gdcm::TagToType<0x0054,0x1200> x00541200; (void)x00541200;
gdcm::TagToType<0x0054,0x1201> x00541201; (void)x00541201;
gdcm::TagToType<0x0054,0x1202> x00541202; (void)x00541202;
gdcm::TagToType<0x0054,0x1203> x00541203; (void)x00541203;
gdcm::TagToType<0x0054,0x1210> x00541210; (void)x00541210;
gdcm::TagToType<0x0054,0x1220> x00541220; (void)x00541220;
gdcm::TagToType<0x0054,0x1300> x00541300; (void)x00541300;
gdcm::TagToType<0x0054,0x1310> x00541310; (void)x00541310;
gdcm::TagToType<0x0054,0x1311> x00541311; (void)x00541311;
gdcm::TagToType<0x0054,0x1320> x00541320; (void)x00541320;
gdcm::TagToType<0x0054,0x1321> x00541321; (void)x00541321;
gdcm::TagToType<0x0054,0x1322> x00541322; (void)x00541322;
gdcm::TagToType<0x0054,0x1323> x00541323; (void)x00541323;
gdcm::TagToType<0x0054,0x1324> x00541324; (void)x00541324;
gdcm::TagToType<0x0054,0x1330> x00541330; (void)x00541330;
gdcm::TagToType<0x0054,0x1400> x00541400; (void)x00541400;
gdcm::TagToType<0x0054,0x1401> x00541401; (void)x00541401;
gdcm::TagToType<0x0060,0x3000> x00603000; (void)x00603000;
gdcm::TagToType<0x0060,0x3002> x00603002; (void)x00603002;
gdcm::TagToType<0x0060,0x3008> x00603008; (void)x00603008;
gdcm::TagToType<0x0060,0x3010> x00603010; (void)x00603010;
gdcm::TagToType<0x0060,0x3020> x00603020; (void)x00603020;
gdcm::TagToType<0x0062,0x0001> x00620001; (void)x00620001;
gdcm::TagToType<0x0062,0x0002> x00620002; (void)x00620002;
gdcm::TagToType<0x0062,0x0003> x00620003; (void)x00620003;
gdcm::TagToType<0x0062,0x0004> x00620004; (void)x00620004;
gdcm::TagToType<0x0062,0x0005> x00620005; (void)x00620005;
gdcm::TagToType<0x0062,0x0006> x00620006; (void)x00620006;
gdcm::TagToType<0x0062,0x0008> x00620008; (void)x00620008;
gdcm::TagToType<0x0062,0x0009> x00620009; (void)x00620009;
gdcm::TagToType<0x0062,0x000a> x0062000a; (void)x0062000a;
gdcm::TagToType<0x0062,0x000b> x0062000b; (void)x0062000b;
gdcm::TagToType<0x0062,0x000c> x0062000c; (void)x0062000c;
gdcm::TagToType<0x0062,0x000d> x0062000d; (void)x0062000d;
gdcm::TagToType<0x0062,0x000e> x0062000e; (void)x0062000e;
gdcm::TagToType<0x0062,0x000f> x0062000f; (void)x0062000f;
gdcm::TagToType<0x0062,0x0010> x00620010; (void)x00620010;
gdcm::TagToType<0x0064,0x0002> x00640002; (void)x00640002;
gdcm::TagToType<0x0064,0x0003> x00640003; (void)x00640003;
gdcm::TagToType<0x0064,0x0005> x00640005; (void)x00640005;
gdcm::TagToType<0x0064,0x0007> x00640007; (void)x00640007;
gdcm::TagToType<0x0064,0x0008> x00640008; (void)x00640008;
gdcm::TagToType<0x0064,0x0009> x00640009; (void)x00640009;
gdcm::TagToType<0x0064,0x000f> x0064000f; (void)x0064000f;
gdcm::TagToType<0x0064,0x0010> x00640010; (void)x00640010;
gdcm::TagToType<0x0070,0x0001> x00700001; (void)x00700001;
gdcm::TagToType<0x0070,0x0002> x00700002; (void)x00700002;
gdcm::TagToType<0x0070,0x0003> x00700003; (void)x00700003;
gdcm::TagToType<0x0070,0x0004> x00700004; (void)x00700004;
gdcm::TagToType<0x0070,0x0005> x00700005; (void)x00700005;
gdcm::TagToType<0x0070,0x0006> x00700006; (void)x00700006;
gdcm::TagToType<0x0070,0x0008> x00700008; (void)x00700008;
gdcm::TagToType<0x0070,0x0009> x00700009; (void)x00700009;
gdcm::TagToType<0x0070,0x0010> x00700010; (void)x00700010;
gdcm::TagToType<0x0070,0x0011> x00700011; (void)x00700011;
gdcm::TagToType<0x0070,0x0012> x00700012; (void)x00700012;
gdcm::TagToType<0x0070,0x0014> x00700014; (void)x00700014;
gdcm::TagToType<0x0070,0x0015> x00700015; (void)x00700015;
gdcm::TagToType<0x0070,0x0020> x00700020; (void)x00700020;
gdcm::TagToType<0x0070,0x0021> x00700021; (void)x00700021;
gdcm::TagToType<0x0070,0x0022> x00700022; (void)x00700022;
gdcm::TagToType<0x0070,0x0023> x00700023; (void)x00700023;
gdcm::TagToType<0x0070,0x0024> x00700024; (void)x00700024;
gdcm::TagToType<0x0070,0x0040> x00700040; (void)x00700040;
gdcm::TagToType<0x0070,0x0041> x00700041; (void)x00700041;
gdcm::TagToType<0x0070,0x0042> x00700042; (void)x00700042;
gdcm::TagToType<0x0070,0x0050> x00700050; (void)x00700050;
gdcm::TagToType<0x0070,0x0051> x00700051; (void)x00700051;
gdcm::TagToType<0x0070,0x0052> x00700052; (void)x00700052;
gdcm::TagToType<0x0070,0x0053> x00700053; (void)x00700053;
gdcm::TagToType<0x0070,0x005a> x0070005a; (void)x0070005a;
gdcm::TagToType<0x0070,0x0060> x00700060; (void)x00700060;
gdcm::TagToType<0x0070,0x0062> x00700062; (void)x00700062;
gdcm::TagToType<0x0070,0x0066> x00700066; (void)x00700066;
gdcm::TagToType<0x0070,0x0067> x00700067; (void)x00700067;
gdcm::TagToType<0x0070,0x0068> x00700068; (void)x00700068;
gdcm::TagToType<0x0070,0x0080> x00700080; (void)x00700080;
gdcm::TagToType<0x0070,0x0081> x00700081; (void)x00700081;
gdcm::TagToType<0x0070,0x0082> x00700082; (void)x00700082;
gdcm::TagToType<0x0070,0x0083> x00700083; (void)x00700083;
gdcm::TagToType<0x0070,0x0084> x00700084; (void)x00700084;
gdcm::TagToType<0x0070,0x0086> x00700086; (void)x00700086;
gdcm::TagToType<0x0070,0x0100> x00700100; (void)x00700100;
gdcm::TagToType<0x0070,0x0101> x00700101; (void)x00700101;
gdcm::TagToType<0x0070,0x0102> x00700102; (void)x00700102;
gdcm::TagToType<0x0070,0x0103> x00700103; (void)x00700103;
gdcm::TagToType<0x0070,0x0306> x00700306; (void)x00700306;
gdcm::TagToType<0x0070,0x0308> x00700308; (void)x00700308;
gdcm::TagToType<0x0070,0x0309> x00700309; (void)x00700309;
gdcm::TagToType<0x0070,0x030a> x0070030a; (void)x0070030a;
gdcm::TagToType<0x0070,0x030c> x0070030c; (void)x0070030c;
gdcm::TagToType<0x0070,0x030d> x0070030d; (void)x0070030d;
gdcm::TagToType<0x0070,0x030f> x0070030f; (void)x0070030f;
gdcm::TagToType<0x0070,0x0310> x00700310; (void)x00700310;
gdcm::TagToType<0x0070,0x0311> x00700311; (void)x00700311;
gdcm::TagToType<0x0070,0x0312> x00700312; (void)x00700312;
gdcm::TagToType<0x0070,0x0314> x00700314; (void)x00700314;
gdcm::TagToType<0x0070,0x0318> x00700318; (void)x00700318;
gdcm::TagToType<0x0070,0x031a> x0070031a; (void)x0070031a;
gdcm::TagToType<0x0070,0x031c> x0070031c; (void)x0070031c;
gdcm::TagToType<0x0070,0x031e> x0070031e; (void)x0070031e;
gdcm::TagToType<0x0070,0x0401> x00700401; (void)x00700401;
gdcm::TagToType<0x0070,0x0402> x00700402; (void)x00700402;
gdcm::TagToType<0x0070,0x0403> x00700403; (void)x00700403;
gdcm::TagToType<0x0070,0x0404> x00700404; (void)x00700404;
gdcm::TagToType<0x0070,0x0405> x00700405; (void)x00700405;
gdcm::TagToType<0x0072,0x0002> x00720002; (void)x00720002;
gdcm::TagToType<0x0072,0x0004> x00720004; (void)x00720004;
gdcm::TagToType<0x0072,0x0006> x00720006; (void)x00720006;
gdcm::TagToType<0x0072,0x0008> x00720008; (void)x00720008;
gdcm::TagToType<0x0072,0x000a> x0072000a; (void)x0072000a;
gdcm::TagToType<0x0072,0x000c> x0072000c; (void)x0072000c;
gdcm::TagToType<0x0072,0x000e> x0072000e; (void)x0072000e;
gdcm::TagToType<0x0072,0x0010> x00720010; (void)x00720010;
gdcm::TagToType<0x0072,0x0012> x00720012; (void)x00720012;
gdcm::TagToType<0x0072,0x0014> x00720014; (void)x00720014;
gdcm::TagToType<0x0072,0x0020> x00720020; (void)x00720020;
gdcm::TagToType<0x0072,0x0022> x00720022; (void)x00720022;
gdcm::TagToType<0x0072,0x0024> x00720024; (void)x00720024;
gdcm::TagToType<0x0072,0x0026> x00720026; (void)x00720026;
gdcm::TagToType<0x0072,0x0028> x00720028; (void)x00720028;
gdcm::TagToType<0x0072,0x0030> x00720030; (void)x00720030;
gdcm::TagToType<0x0072,0x0032> x00720032; (void)x00720032;
gdcm::TagToType<0x0072,0x0034> x00720034; (void)x00720034;
gdcm::TagToType<0x0072,0x0038> x00720038; (void)x00720038;
gdcm::TagToType<0x0072,0x003a> x0072003a; (void)x0072003a;
gdcm::TagToType<0x0072,0x003c> x0072003c; (void)x0072003c;
gdcm::TagToType<0x0072,0x003e> x0072003e; (void)x0072003e;
gdcm::TagToType<0x0072,0x0040> x00720040; (void)x00720040;
gdcm::TagToType<0x0072,0x0050> x00720050; (void)x00720050;
gdcm::TagToType<0x0072,0x0052> x00720052; (void)x00720052;
gdcm::TagToType<0x0072,0x0054> x00720054; (void)x00720054;
gdcm::TagToType<0x0072,0x0056> x00720056; (void)x00720056;
gdcm::TagToType<0x0072,0x0060> x00720060; (void)x00720060;
gdcm::TagToType<0x0072,0x0062> x00720062; (void)x00720062;
gdcm::TagToType<0x0072,0x0064> x00720064; (void)x00720064;
gdcm::TagToType<0x0072,0x0066> x00720066; (void)x00720066;
gdcm::TagToType<0x0072,0x0068> x00720068; (void)x00720068;
gdcm::TagToType<0x0072,0x006a> x0072006a; (void)x0072006a;
gdcm::TagToType<0x0072,0x006c> x0072006c; (void)x0072006c;
gdcm::TagToType<0x0072,0x006e> x0072006e; (void)x0072006e;
gdcm::TagToType<0x0072,0x0070> x00720070; (void)x00720070;
gdcm::TagToType<0x0072,0x0072> x00720072; (void)x00720072;
gdcm::TagToType<0x0072,0x0074> x00720074; (void)x00720074;
gdcm::TagToType<0x0072,0x0076> x00720076; (void)x00720076;
gdcm::TagToType<0x0072,0x0078> x00720078; (void)x00720078;
gdcm::TagToType<0x0072,0x007a> x0072007a; (void)x0072007a;
gdcm::TagToType<0x0072,0x007c> x0072007c; (void)x0072007c;
gdcm::TagToType<0x0072,0x007e> x0072007e; (void)x0072007e;
gdcm::TagToType<0x0072,0x0080> x00720080; (void)x00720080;
gdcm::TagToType<0x0072,0x0100> x00720100; (void)x00720100;
gdcm::TagToType<0x0072,0x0102> x00720102; (void)x00720102;
gdcm::TagToType<0x0072,0x0104> x00720104; (void)x00720104;
gdcm::TagToType<0x0072,0x0106> x00720106; (void)x00720106;
gdcm::TagToType<0x0072,0x0108> x00720108; (void)x00720108;
gdcm::TagToType<0x0072,0x010a> x0072010a; (void)x0072010a;
gdcm::TagToType<0x0072,0x010c> x0072010c; (void)x0072010c;
gdcm::TagToType<0x0072,0x010e> x0072010e; (void)x0072010e;
gdcm::TagToType<0x0072,0x0200> x00720200; (void)x00720200;
gdcm::TagToType<0x0072,0x0202> x00720202; (void)x00720202;
gdcm::TagToType<0x0072,0x0203> x00720203; (void)x00720203;
gdcm::TagToType<0x0072,0x0204> x00720204; (void)x00720204;
gdcm::TagToType<0x0072,0x0206> x00720206; (void)x00720206;
gdcm::TagToType<0x0072,0x0208> x00720208; (void)x00720208;
gdcm::TagToType<0x0072,0x0210> x00720210; (void)x00720210;
gdcm::TagToType<0x0072,0x0212> x00720212; (void)x00720212;
gdcm::TagToType<0x0072,0x0214> x00720214; (void)x00720214;
gdcm::TagToType<0x0072,0x0216> x00720216; (void)x00720216;
gdcm::TagToType<0x0072,0x0218> x00720218; (void)x00720218;
gdcm::TagToType<0x0072,0x0300> x00720300; (void)x00720300;
gdcm::TagToType<0x0072,0x0302> x00720302; (void)x00720302;
gdcm::TagToType<0x0072,0x0304> x00720304; (void)x00720304;
gdcm::TagToType<0x0072,0x0306> x00720306; (void)x00720306;
gdcm::TagToType<0x0072,0x0308> x00720308; (void)x00720308;
gdcm::TagToType<0x0072,0x0310> x00720310; (void)x00720310;
gdcm::TagToType<0x0072,0x0312> x00720312; (void)x00720312;
gdcm::TagToType<0x0072,0x0314> x00720314; (void)x00720314;
gdcm::TagToType<0x0072,0x0316> x00720316; (void)x00720316;
gdcm::TagToType<0x0072,0x0318> x00720318; (void)x00720318;
gdcm::TagToType<0x0072,0x0320> x00720320; (void)x00720320;
gdcm::TagToType<0x0072,0x0330> x00720330; (void)x00720330;
gdcm::TagToType<0x0072,0x0400> x00720400; (void)x00720400;
gdcm::TagToType<0x0072,0x0402> x00720402; (void)x00720402;
gdcm::TagToType<0x0072,0x0404> x00720404; (void)x00720404;
gdcm::TagToType<0x0072,0x0406> x00720406; (void)x00720406;
gdcm::TagToType<0x0072,0x0500> x00720500; (void)x00720500;
gdcm::TagToType<0x0072,0x0510> x00720510; (void)x00720510;
gdcm::TagToType<0x0072,0x0512> x00720512; (void)x00720512;
gdcm::TagToType<0x0072,0x0514> x00720514; (void)x00720514;
gdcm::TagToType<0x0072,0x0516> x00720516; (void)x00720516;
gdcm::TagToType<0x0072,0x0520> x00720520; (void)x00720520;
gdcm::TagToType<0x0072,0x0600> x00720600; (void)x00720600;
gdcm::TagToType<0x0072,0x0602> x00720602; (void)x00720602;
gdcm::TagToType<0x0072,0x0604> x00720604; (void)x00720604;
gdcm::TagToType<0x0072,0x0700> x00720700; (void)x00720700;
gdcm::TagToType<0x0072,0x0702> x00720702; (void)x00720702;
gdcm::TagToType<0x0072,0x0704> x00720704; (void)x00720704;
gdcm::TagToType<0x0072,0x0706> x00720706; (void)x00720706;
gdcm::TagToType<0x0072,0x0710> x00720710; (void)x00720710;
gdcm::TagToType<0x0072,0x0712> x00720712; (void)x00720712;
gdcm::TagToType<0x0072,0x0714> x00720714; (void)x00720714;
gdcm::TagToType<0x0072,0x0716> x00720716; (void)x00720716;
gdcm::TagToType<0x0072,0x0717> x00720717; (void)x00720717;
gdcm::TagToType<0x0072,0x0718> x00720718; (void)x00720718;
gdcm::TagToType<0x0074,0x1000> x00741000; (void)x00741000;
gdcm::TagToType<0x0074,0x1002> x00741002; (void)x00741002;
gdcm::TagToType<0x0074,0x1004> x00741004; (void)x00741004;
gdcm::TagToType<0x0074,0x1006> x00741006; (void)x00741006;
gdcm::TagToType<0x0074,0x1008> x00741008; (void)x00741008;
gdcm::TagToType<0x0074,0x100a> x0074100a; (void)x0074100a;
gdcm::TagToType<0x0074,0x100c> x0074100c; (void)x0074100c;
gdcm::TagToType<0x0074,0x100e> x0074100e; (void)x0074100e;
gdcm::TagToType<0x0074,0x1020> x00741020; (void)x00741020;
gdcm::TagToType<0x0074,0x1022> x00741022; (void)x00741022;
gdcm::TagToType<0x0074,0x1024> x00741024; (void)x00741024;
gdcm::TagToType<0x0074,0x1030> x00741030; (void)x00741030;
gdcm::TagToType<0x0074,0x1032> x00741032; (void)x00741032;
gdcm::TagToType<0x0074,0x1034> x00741034; (void)x00741034;
gdcm::TagToType<0x0074,0x1036> x00741036; (void)x00741036;
gdcm::TagToType<0x0074,0x1038> x00741038; (void)x00741038;
gdcm::TagToType<0x0074,0x103a> x0074103a; (void)x0074103a;
gdcm::TagToType<0x0074,0x1040> x00741040; (void)x00741040;
gdcm::TagToType<0x0074,0x1042> x00741042; (void)x00741042;
gdcm::TagToType<0x0074,0x1044> x00741044; (void)x00741044;
gdcm::TagToType<0x0074,0x1046> x00741046; (void)x00741046;
gdcm::TagToType<0x0074,0x1048> x00741048; (void)x00741048;
gdcm::TagToType<0x0074,0x104a> x0074104a; (void)x0074104a;
gdcm::TagToType<0x0074,0x104c> x0074104c; (void)x0074104c;
gdcm::TagToType<0x0074,0x104e> x0074104e; (void)x0074104e;
gdcm::TagToType<0x0074,0x1050> x00741050; (void)x00741050;
gdcm::TagToType<0x0074,0x1052> x00741052; (void)x00741052;
gdcm::TagToType<0x0074,0x1054> x00741054; (void)x00741054;
gdcm::TagToType<0x0074,0x1056> x00741056; (void)x00741056;
gdcm::TagToType<0x0074,0x1200> x00741200; (void)x00741200;
gdcm::TagToType<0x0074,0x1202> x00741202; (void)x00741202;
gdcm::TagToType<0x0074,0x1204> x00741204; (void)x00741204;
gdcm::TagToType<0x0074,0x1210> x00741210; (void)x00741210;
gdcm::TagToType<0x0074,0x1212> x00741212; (void)x00741212;
gdcm::TagToType<0x0074,0x1216> x00741216; (void)x00741216;
gdcm::TagToType<0x0074,0x1220> x00741220; (void)x00741220;
gdcm::TagToType<0x0074,0x1222> x00741222; (void)x00741222;
gdcm::TagToType<0x0074,0x1230> x00741230; (void)x00741230;
gdcm::TagToType<0x0074,0x1234> x00741234; (void)x00741234;
gdcm::TagToType<0x0074,0x1236> x00741236; (void)x00741236;
gdcm::TagToType<0x0074,0x1238> x00741238; (void)x00741238;
gdcm::TagToType<0x0074,0x1242> x00741242; (void)x00741242;
gdcm::TagToType<0x0074,0x1244> x00741244; (void)x00741244;
gdcm::TagToType<0x0074,0x1246> x00741246; (void)x00741246;
gdcm::TagToType<0x0088,0x0130> x00880130; (void)x00880130;
gdcm::TagToType<0x0088,0x0140> x00880140; (void)x00880140;
gdcm::TagToType<0x0088,0x0200> x00880200; (void)x00880200;
gdcm::TagToType<0x0088,0x0904> x00880904; (void)x00880904;
gdcm::TagToType<0x0088,0x0906> x00880906; (void)x00880906;
gdcm::TagToType<0x0088,0x0910> x00880910; (void)x00880910;
gdcm::TagToType<0x0088,0x0912> x00880912; (void)x00880912;
gdcm::TagToType<0x0100,0x0410> x01000410; (void)x01000410;
gdcm::TagToType<0x0100,0x0420> x01000420; (void)x01000420;
gdcm::TagToType<0x0100,0x0424> x01000424; (void)x01000424;
gdcm::TagToType<0x0100,0x0426> x01000426; (void)x01000426;
gdcm::TagToType<0x0400,0x0005> x04000005; (void)x04000005;
gdcm::TagToType<0x0400,0x0010> x04000010; (void)x04000010;
gdcm::TagToType<0x0400,0x0015> x04000015; (void)x04000015;
gdcm::TagToType<0x0400,0x0020> x04000020; (void)x04000020;
gdcm::TagToType<0x0400,0x0100> x04000100; (void)x04000100;
gdcm::TagToType<0x0400,0x0105> x04000105; (void)x04000105;
gdcm::TagToType<0x0400,0x0110> x04000110; (void)x04000110;
gdcm::TagToType<0x0400,0x0115> x04000115; (void)x04000115;
gdcm::TagToType<0x0400,0x0120> x04000120; (void)x04000120;
gdcm::TagToType<0x0400,0x0305> x04000305; (void)x04000305;
gdcm::TagToType<0x0400,0x0310> x04000310; (void)x04000310;
gdcm::TagToType<0x0400,0x0401> x04000401; (void)x04000401;
gdcm::TagToType<0x0400,0x0402> x04000402; (void)x04000402;
gdcm::TagToType<0x0400,0x0403> x04000403; (void)x04000403;
gdcm::TagToType<0x0400,0x0404> x04000404; (void)x04000404;
gdcm::TagToType<0x0400,0x0500> x04000500; (void)x04000500;
gdcm::TagToType<0x0400,0x0510> x04000510; (void)x04000510;
gdcm::TagToType<0x0400,0x0520> x04000520; (void)x04000520;
gdcm::TagToType<0x0400,0x0550> x04000550; (void)x04000550;
gdcm::TagToType<0x0400,0x0561> x04000561; (void)x04000561;
gdcm::TagToType<0x0400,0x0562> x04000562; (void)x04000562;
gdcm::TagToType<0x0400,0x0563> x04000563; (void)x04000563;
gdcm::TagToType<0x0400,0x0564> x04000564; (void)x04000564;
gdcm::TagToType<0x0400,0x0565> x04000565; (void)x04000565;
gdcm::TagToType<0x2000,0x0010> x20000010; (void)x20000010;
gdcm::TagToType<0x2000,0x001e> x2000001e; (void)x2000001e;
gdcm::TagToType<0x2000,0x0020> x20000020; (void)x20000020;
gdcm::TagToType<0x2000,0x0030> x20000030; (void)x20000030;
gdcm::TagToType<0x2000,0x0040> x20000040; (void)x20000040;
gdcm::TagToType<0x2000,0x0050> x20000050; (void)x20000050;
gdcm::TagToType<0x2000,0x0060> x20000060; (void)x20000060;
gdcm::TagToType<0x2000,0x0061> x20000061; (void)x20000061;
gdcm::TagToType<0x2000,0x0062> x20000062; (void)x20000062;
gdcm::TagToType<0x2000,0x0063> x20000063; (void)x20000063;
gdcm::TagToType<0x2000,0x0065> x20000065; (void)x20000065;
gdcm::TagToType<0x2000,0x0067> x20000067; (void)x20000067;
gdcm::TagToType<0x2000,0x0069> x20000069; (void)x20000069;
gdcm::TagToType<0x2000,0x006a> x2000006a; (void)x2000006a;
gdcm::TagToType<0x2000,0x00a0> x200000a0; (void)x200000a0;
gdcm::TagToType<0x2000,0x00a1> x200000a1; (void)x200000a1;
gdcm::TagToType<0x2000,0x00a2> x200000a2; (void)x200000a2;
gdcm::TagToType<0x2000,0x00a4> x200000a4; (void)x200000a4;
gdcm::TagToType<0x2000,0x00a8> x200000a8; (void)x200000a8;
gdcm::TagToType<0x2000,0x0500> x20000500; (void)x20000500;
gdcm::TagToType<0x2000,0x0510> x20000510; (void)x20000510;
gdcm::TagToType<0x2010,0x0010> x20100010; (void)x20100010;
gdcm::TagToType<0x2010,0x0030> x20100030; (void)x20100030;
gdcm::TagToType<0x2010,0x0040> x20100040; (void)x20100040;
gdcm::TagToType<0x2010,0x0050> x20100050; (void)x20100050;
gdcm::TagToType<0x2010,0x0052> x20100052; (void)x20100052;
gdcm::TagToType<0x2010,0x0054> x20100054; (void)x20100054;
gdcm::TagToType<0x2010,0x0060> x20100060; (void)x20100060;
gdcm::TagToType<0x2010,0x0080> x20100080; (void)x20100080;
gdcm::TagToType<0x2010,0x00a6> x201000a6; (void)x201000a6;
gdcm::TagToType<0x2010,0x00a7> x201000a7; (void)x201000a7;
gdcm::TagToType<0x2010,0x00a8> x201000a8; (void)x201000a8;
gdcm::TagToType<0x2010,0x00a9> x201000a9; (void)x201000a9;
gdcm::TagToType<0x2010,0x0100> x20100100; (void)x20100100;
gdcm::TagToType<0x2010,0x0110> x20100110; (void)x20100110;
gdcm::TagToType<0x2010,0x0120> x20100120; (void)x20100120;
gdcm::TagToType<0x2010,0x0130> x20100130; (void)x20100130;
gdcm::TagToType<0x2010,0x0140> x20100140; (void)x20100140;
gdcm::TagToType<0x2010,0x0150> x20100150; (void)x20100150;
gdcm::TagToType<0x2010,0x0152> x20100152; (void)x20100152;
gdcm::TagToType<0x2010,0x0154> x20100154; (void)x20100154;
gdcm::TagToType<0x2010,0x015e> x2010015e; (void)x2010015e;
gdcm::TagToType<0x2010,0x0160> x20100160; (void)x20100160;
gdcm::TagToType<0x2010,0x0376> x20100376; (void)x20100376;
gdcm::TagToType<0x2010,0x0500> x20100500; (void)x20100500;
gdcm::TagToType<0x2010,0x0510> x20100510; (void)x20100510;
gdcm::TagToType<0x2010,0x0520> x20100520; (void)x20100520;
gdcm::TagToType<0x2020,0x0010> x20200010; (void)x20200010;
gdcm::TagToType<0x2020,0x0020> x20200020; (void)x20200020;
gdcm::TagToType<0x2020,0x0030> x20200030; (void)x20200030;
gdcm::TagToType<0x2020,0x0040> x20200040; (void)x20200040;
gdcm::TagToType<0x2020,0x0050> x20200050; (void)x20200050;
gdcm::TagToType<0x2020,0x00a0> x202000a0; (void)x202000a0;
gdcm::TagToType<0x2020,0x00a2> x202000a2; (void)x202000a2;
gdcm::TagToType<0x2020,0x0110> x20200110; (void)x20200110;
gdcm::TagToType<0x2020,0x0111> x20200111; (void)x20200111;
gdcm::TagToType<0x2020,0x0130> x20200130; (void)x20200130;
gdcm::TagToType<0x2020,0x0140> x20200140; (void)x20200140;
gdcm::TagToType<0x2030,0x0010> x20300010; (void)x20300010;
gdcm::TagToType<0x2030,0x0020> x20300020; (void)x20300020;
gdcm::TagToType<0x2040,0x0010> x20400010; (void)x20400010;
gdcm::TagToType<0x2040,0x0011> x20400011; (void)x20400011;
gdcm::TagToType<0x2040,0x0020> x20400020; (void)x20400020;
gdcm::TagToType<0x2040,0x0060> x20400060; (void)x20400060;
gdcm::TagToType<0x2040,0x0070> x20400070; (void)x20400070;
gdcm::TagToType<0x2040,0x0072> x20400072; (void)x20400072;
gdcm::TagToType<0x2040,0x0074> x20400074; (void)x20400074;
gdcm::TagToType<0x2040,0x0080> x20400080; (void)x20400080;
gdcm::TagToType<0x2040,0x0082> x20400082; (void)x20400082;
gdcm::TagToType<0x2040,0x0090> x20400090; (void)x20400090;
gdcm::TagToType<0x2040,0x0100> x20400100; (void)x20400100;
gdcm::TagToType<0x2040,0x0500> x20400500; (void)x20400500;
gdcm::TagToType<0x2050,0x0010> x20500010; (void)x20500010;
gdcm::TagToType<0x2050,0x0020> x20500020; (void)x20500020;
gdcm::TagToType<0x2050,0x0500> x20500500; (void)x20500500;
gdcm::TagToType<0x2100,0x0010> x21000010; (void)x21000010;
gdcm::TagToType<0x2100,0x0020> x21000020; (void)x21000020;
gdcm::TagToType<0x2100,0x0030> x21000030; (void)x21000030;
gdcm::TagToType<0x2100,0x0040> x21000040; (void)x21000040;
gdcm::TagToType<0x2100,0x0050> x21000050; (void)x21000050;
gdcm::TagToType<0x2100,0x0070> x21000070; (void)x21000070;
gdcm::TagToType<0x2100,0x0140> x21000140; (void)x21000140;
gdcm::TagToType<0x2100,0x0160> x21000160; (void)x21000160;
gdcm::TagToType<0x2100,0x0170> x21000170; (void)x21000170;
gdcm::TagToType<0x2100,0x0500> x21000500; (void)x21000500;
gdcm::TagToType<0x2110,0x0010> x21100010; (void)x21100010;
gdcm::TagToType<0x2110,0x0020> x21100020; (void)x21100020;
gdcm::TagToType<0x2110,0x0030> x21100030; (void)x21100030;
gdcm::TagToType<0x2110,0x0099> x21100099; (void)x21100099;
gdcm::TagToType<0x2120,0x0010> x21200010; (void)x21200010;
gdcm::TagToType<0x2120,0x0050> x21200050; (void)x21200050;
gdcm::TagToType<0x2120,0x0070> x21200070; (void)x21200070;
gdcm::TagToType<0x2130,0x0010> x21300010; (void)x21300010;
gdcm::TagToType<0x2130,0x0015> x21300015; (void)x21300015;
gdcm::TagToType<0x2130,0x0030> x21300030; (void)x21300030;
gdcm::TagToType<0x2130,0x0040> x21300040; (void)x21300040;
gdcm::TagToType<0x2130,0x0050> x21300050; (void)x21300050;
gdcm::TagToType<0x2130,0x0060> x21300060; (void)x21300060;
gdcm::TagToType<0x2130,0x0080> x21300080; (void)x21300080;
gdcm::TagToType<0x2130,0x00a0> x213000a0; (void)x213000a0;
gdcm::TagToType<0x2130,0x00c0> x213000c0; (void)x213000c0;
gdcm::TagToType<0x2200,0x0001> x22000001; (void)x22000001;
gdcm::TagToType<0x2200,0x0002> x22000002; (void)x22000002;
gdcm::TagToType<0x2200,0x0003> x22000003; (void)x22000003;
gdcm::TagToType<0x2200,0x0004> x22000004; (void)x22000004;
gdcm::TagToType<0x2200,0x0005> x22000005; (void)x22000005;
gdcm::TagToType<0x2200,0x0006> x22000006; (void)x22000006;
gdcm::TagToType<0x2200,0x0007> x22000007; (void)x22000007;
gdcm::TagToType<0x2200,0x0008> x22000008; (void)x22000008;
gdcm::TagToType<0x2200,0x0009> x22000009; (void)x22000009;
gdcm::TagToType<0x2200,0x000a> x2200000a; (void)x2200000a;
gdcm::TagToType<0x2200,0x000b> x2200000b; (void)x2200000b;
gdcm::TagToType<0x2200,0x000c> x2200000c; (void)x2200000c;
gdcm::TagToType<0x2200,0x000d> x2200000d; (void)x2200000d;
gdcm::TagToType<0x2200,0x000e> x2200000e; (void)x2200000e;
gdcm::TagToType<0x2200,0x000f> x2200000f; (void)x2200000f;
gdcm::TagToType<0x2200,0x0020> x22000020; (void)x22000020;
gdcm::TagToType<0x3002,0x0002> x30020002; (void)x30020002;
gdcm::TagToType<0x3002,0x0003> x30020003; (void)x30020003;
gdcm::TagToType<0x3002,0x0004> x30020004; (void)x30020004;
gdcm::TagToType<0x3002,0x000a> x3002000a; (void)x3002000a;
gdcm::TagToType<0x3002,0x000c> x3002000c; (void)x3002000c;
gdcm::TagToType<0x3002,0x000d> x3002000d; (void)x3002000d;
gdcm::TagToType<0x3002,0x000e> x3002000e; (void)x3002000e;
gdcm::TagToType<0x3002,0x0010> x30020010; (void)x30020010;
gdcm::TagToType<0x3002,0x0011> x30020011; (void)x30020011;
gdcm::TagToType<0x3002,0x0012> x30020012; (void)x30020012;
gdcm::TagToType<0x3002,0x0020> x30020020; (void)x30020020;
gdcm::TagToType<0x3002,0x0022> x30020022; (void)x30020022;
gdcm::TagToType<0x3002,0x0024> x30020024; (void)x30020024;
gdcm::TagToType<0x3002,0x0026> x30020026; (void)x30020026;
gdcm::TagToType<0x3002,0x0028> x30020028; (void)x30020028;
gdcm::TagToType<0x3002,0x0029> x30020029; (void)x30020029;
gdcm::TagToType<0x3002,0x0030> x30020030; (void)x30020030;
gdcm::TagToType<0x3002,0x0032> x30020032; (void)x30020032;
gdcm::TagToType<0x3002,0x0034> x30020034; (void)x30020034;
gdcm::TagToType<0x3002,0x0040> x30020040; (void)x30020040;
gdcm::TagToType<0x3002,0x0041> x30020041; (void)x30020041;
gdcm::TagToType<0x3002,0x0042> x30020042; (void)x30020042;
gdcm::TagToType<0x3004,0x0001> x30040001; (void)x30040001;
gdcm::TagToType<0x3004,0x0002> x30040002; (void)x30040002;
gdcm::TagToType<0x3004,0x0004> x30040004; (void)x30040004;
gdcm::TagToType<0x3004,0x0006> x30040006; (void)x30040006;
gdcm::TagToType<0x3004,0x0008> x30040008; (void)x30040008;
gdcm::TagToType<0x3004,0x000a> x3004000a; (void)x3004000a;
gdcm::TagToType<0x3004,0x000c> x3004000c; (void)x3004000c;
gdcm::TagToType<0x3004,0x000e> x3004000e; (void)x3004000e;
gdcm::TagToType<0x3004,0x0010> x30040010; (void)x30040010;
gdcm::TagToType<0x3004,0x0012> x30040012; (void)x30040012;
gdcm::TagToType<0x3004,0x0014> x30040014; (void)x30040014;
gdcm::TagToType<0x3004,0x0040> x30040040; (void)x30040040;
gdcm::TagToType<0x3004,0x0042> x30040042; (void)x30040042;
gdcm::TagToType<0x3004,0x0050> x30040050; (void)x30040050;
gdcm::TagToType<0x3004,0x0052> x30040052; (void)x30040052;
gdcm::TagToType<0x3004,0x0054> x30040054; (void)x30040054;
gdcm::TagToType<0x3004,0x0056> x30040056; (void)x30040056;
gdcm::TagToType<0x3004,0x0058> x30040058; (void)x30040058;
gdcm::TagToType<0x3004,0x0060> x30040060; (void)x30040060;
gdcm::TagToType<0x3004,0x0062> x30040062; (void)x30040062;
gdcm::TagToType<0x3004,0x0070> x30040070; (void)x30040070;
gdcm::TagToType<0x3004,0x0072> x30040072; (void)x30040072;
gdcm::TagToType<0x3004,0x0074> x30040074; (void)x30040074;
gdcm::TagToType<0x3006,0x0002> x30060002; (void)x30060002;
gdcm::TagToType<0x3006,0x0004> x30060004; (void)x30060004;
gdcm::TagToType<0x3006,0x0006> x30060006; (void)x30060006;
gdcm::TagToType<0x3006,0x0008> x30060008; (void)x30060008;
gdcm::TagToType<0x3006,0x0009> x30060009; (void)x30060009;
gdcm::TagToType<0x3006,0x0010> x30060010; (void)x30060010;
gdcm::TagToType<0x3006,0x0012> x30060012; (void)x30060012;
gdcm::TagToType<0x3006,0x0014> x30060014; (void)x30060014;
gdcm::TagToType<0x3006,0x0016> x30060016; (void)x30060016;
gdcm::TagToType<0x3006,0x0020> x30060020; (void)x30060020;
gdcm::TagToType<0x3006,0x0022> x30060022; (void)x30060022;
gdcm::TagToType<0x3006,0x0024> x30060024; (void)x30060024;
gdcm::TagToType<0x3006,0x0026> x30060026; (void)x30060026;
gdcm::TagToType<0x3006,0x0028> x30060028; (void)x30060028;
gdcm::TagToType<0x3006,0x002a> x3006002a; (void)x3006002a;
gdcm::TagToType<0x3006,0x002c> x3006002c; (void)x3006002c;
gdcm::TagToType<0x3006,0x0030> x30060030; (void)x30060030;
gdcm::TagToType<0x3006,0x0033> x30060033; (void)x30060033;
gdcm::TagToType<0x3006,0x0036> x30060036; (void)x30060036;
gdcm::TagToType<0x3006,0x0038> x30060038; (void)x30060038;
gdcm::TagToType<0x3006,0x0039> x30060039; (void)x30060039;
gdcm::TagToType<0x3006,0x0040> x30060040; (void)x30060040;
gdcm::TagToType<0x3006,0x0042> x30060042; (void)x30060042;
gdcm::TagToType<0x3006,0x0044> x30060044; (void)x30060044;
gdcm::TagToType<0x3006,0x0045> x30060045; (void)x30060045;
gdcm::TagToType<0x3006,0x0046> x30060046; (void)x30060046;
gdcm::TagToType<0x3006,0x0048> x30060048; (void)x30060048;
gdcm::TagToType<0x3006,0x0049> x30060049; (void)x30060049;
gdcm::TagToType<0x3006,0x0050> x30060050; (void)x30060050;
gdcm::TagToType<0x3006,0x0080> x30060080; (void)x30060080;
gdcm::TagToType<0x3006,0x0082> x30060082; (void)x30060082;
gdcm::TagToType<0x3006,0x0084> x30060084; (void)x30060084;
gdcm::TagToType<0x3006,0x0085> x30060085; (void)x30060085;
gdcm::TagToType<0x3006,0x0086> x30060086; (void)x30060086;
gdcm::TagToType<0x3006,0x0088> x30060088; (void)x30060088;
gdcm::TagToType<0x3006,0x00a0> x300600a0; (void)x300600a0;
gdcm::TagToType<0x3006,0x00a4> x300600a4; (void)x300600a4;
gdcm::TagToType<0x3006,0x00a6> x300600a6; (void)x300600a6;
gdcm::TagToType<0x3006,0x00b0> x300600b0; (void)x300600b0;
gdcm::TagToType<0x3006,0x00b2> x300600b2; (void)x300600b2;
gdcm::TagToType<0x3006,0x00b4> x300600b4; (void)x300600b4;
gdcm::TagToType<0x3006,0x00b6> x300600b6; (void)x300600b6;
gdcm::TagToType<0x3006,0x00b7> x300600b7; (void)x300600b7;
gdcm::TagToType<0x3006,0x00b8> x300600b8; (void)x300600b8;
gdcm::TagToType<0x3006,0x00c0> x300600c0; (void)x300600c0;
gdcm::TagToType<0x3006,0x00c2> x300600c2; (void)x300600c2;
gdcm::TagToType<0x3006,0x00c4> x300600c4; (void)x300600c4;
gdcm::TagToType<0x3006,0x00c6> x300600c6; (void)x300600c6;
gdcm::TagToType<0x3006,0x00c8> x300600c8; (void)x300600c8;
gdcm::TagToType<0x3008,0x0010> x30080010; (void)x30080010;
gdcm::TagToType<0x3008,0x0012> x30080012; (void)x30080012;
gdcm::TagToType<0x3008,0x0014> x30080014; (void)x30080014;
gdcm::TagToType<0x3008,0x0016> x30080016; (void)x30080016;
gdcm::TagToType<0x3008,0x0020> x30080020; (void)x30080020;
gdcm::TagToType<0x3008,0x0021> x30080021; (void)x30080021;
gdcm::TagToType<0x3008,0x0022> x30080022; (void)x30080022;
gdcm::TagToType<0x3008,0x0024> x30080024; (void)x30080024;
gdcm::TagToType<0x3008,0x0025> x30080025; (void)x30080025;
gdcm::TagToType<0x3008,0x002a> x3008002a; (void)x3008002a;
gdcm::TagToType<0x3008,0x002b> x3008002b; (void)x3008002b;
gdcm::TagToType<0x3008,0x002c> x3008002c; (void)x3008002c;
gdcm::TagToType<0x3008,0x0030> x30080030; (void)x30080030;
gdcm::TagToType<0x3008,0x0032> x30080032; (void)x30080032;
gdcm::TagToType<0x3008,0x0033> x30080033; (void)x30080033;
gdcm::TagToType<0x3008,0x0036> x30080036; (void)x30080036;
gdcm::TagToType<0x3008,0x0037> x30080037; (void)x30080037;
gdcm::TagToType<0x3008,0x003a> x3008003a; (void)x3008003a;
gdcm::TagToType<0x3008,0x003b> x3008003b; (void)x3008003b;
gdcm::TagToType<0x3008,0x0040> x30080040; (void)x30080040;
gdcm::TagToType<0x3008,0x0041> x30080041; (void)x30080041;
gdcm::TagToType<0x3008,0x0042> x30080042; (void)x30080042;
gdcm::TagToType<0x3008,0x0044> x30080044; (void)x30080044;
gdcm::TagToType<0x3008,0x0045> x30080045; (void)x30080045;
gdcm::TagToType<0x3008,0x0046> x30080046; (void)x30080046;
gdcm::TagToType<0x3008,0x0047> x30080047; (void)x30080047;
gdcm::TagToType<0x3008,0x0048> x30080048; (void)x30080048;
gdcm::TagToType<0x3008,0x0050> x30080050; (void)x30080050;
gdcm::TagToType<0x3008,0x0052> x30080052; (void)x30080052;
gdcm::TagToType<0x3008,0x0054> x30080054; (void)x30080054;
gdcm::TagToType<0x3008,0x0056> x30080056; (void)x30080056;
gdcm::TagToType<0x3008,0x005a> x3008005a; (void)x3008005a;
gdcm::TagToType<0x3008,0x0060> x30080060; (void)x30080060;
gdcm::TagToType<0x3008,0x0061> x30080061; (void)x30080061;
gdcm::TagToType<0x3008,0x0062> x30080062; (void)x30080062;
gdcm::TagToType<0x3008,0x0063> x30080063; (void)x30080063;
gdcm::TagToType<0x3008,0x0064> x30080064; (void)x30080064;
gdcm::TagToType<0x3008,0x0065> x30080065; (void)x30080065;
gdcm::TagToType<0x3008,0x0066> x30080066; (void)x30080066;
gdcm::TagToType<0x3008,0x0068> x30080068; (void)x30080068;
gdcm::TagToType<0x3008,0x006a> x3008006a; (void)x3008006a;
gdcm::TagToType<0x3008,0x0070> x30080070; (void)x30080070;
gdcm::TagToType<0x3008,0x0072> x30080072; (void)x30080072;
gdcm::TagToType<0x3008,0x0074> x30080074; (void)x30080074;
gdcm::TagToType<0x3008,0x0076> x30080076; (void)x30080076;
gdcm::TagToType<0x3008,0x0078> x30080078; (void)x30080078;
gdcm::TagToType<0x3008,0x007a> x3008007a; (void)x3008007a;
gdcm::TagToType<0x3008,0x0080> x30080080; (void)x30080080;
gdcm::TagToType<0x3008,0x0082> x30080082; (void)x30080082;
gdcm::TagToType<0x3008,0x0090> x30080090; (void)x30080090;
gdcm::TagToType<0x3008,0x0092> x30080092; (void)x30080092;
gdcm::TagToType<0x3008,0x00a0> x300800a0; (void)x300800a0;
gdcm::TagToType<0x3008,0x00b0> x300800b0; (void)x300800b0;
gdcm::TagToType<0x3008,0x00c0> x300800c0; (void)x300800c0;
gdcm::TagToType<0x3008,0x00d0> x300800d0; (void)x300800d0;
gdcm::TagToType<0x3008,0x00e0> x300800e0; (void)x300800e0;
gdcm::TagToType<0x3008,0x00f0> x300800f0; (void)x300800f0;
gdcm::TagToType<0x3008,0x00f2> x300800f2; (void)x300800f2;
gdcm::TagToType<0x3008,0x00f4> x300800f4; (void)x300800f4;
gdcm::TagToType<0x3008,0x00f6> x300800f6; (void)x300800f6;
gdcm::TagToType<0x3008,0x0100> x30080100; (void)x30080100;
gdcm::TagToType<0x3008,0x0105> x30080105; (void)x30080105;
gdcm::TagToType<0x3008,0x0110> x30080110; (void)x30080110;
gdcm::TagToType<0x3008,0x0116> x30080116; (void)x30080116;
gdcm::TagToType<0x3008,0x0120> x30080120; (void)x30080120;
gdcm::TagToType<0x3008,0x0122> x30080122; (void)x30080122;
gdcm::TagToType<0x3008,0x0130> x30080130; (void)x30080130;
gdcm::TagToType<0x3008,0x0132> x30080132; (void)x30080132;
gdcm::TagToType<0x3008,0x0134> x30080134; (void)x30080134;
gdcm::TagToType<0x3008,0x0136> x30080136; (void)x30080136;
gdcm::TagToType<0x3008,0x0138> x30080138; (void)x30080138;
gdcm::TagToType<0x3008,0x013a> x3008013a; (void)x3008013a;
gdcm::TagToType<0x3008,0x013c> x3008013c; (void)x3008013c;
gdcm::TagToType<0x3008,0x0140> x30080140; (void)x30080140;
gdcm::TagToType<0x3008,0x0142> x30080142; (void)x30080142;
gdcm::TagToType<0x3008,0x0150> x30080150; (void)x30080150;
gdcm::TagToType<0x3008,0x0152> x30080152; (void)x30080152;
gdcm::TagToType<0x3008,0x0160> x30080160; (void)x30080160;
gdcm::TagToType<0x3008,0x0162> x30080162; (void)x30080162;
gdcm::TagToType<0x3008,0x0164> x30080164; (void)x30080164;
gdcm::TagToType<0x3008,0x0166> x30080166; (void)x30080166;
gdcm::TagToType<0x3008,0x0168> x30080168; (void)x30080168;
gdcm::TagToType<0x3008,0x0200> x30080200; (void)x30080200;
gdcm::TagToType<0x3008,0x0202> x30080202; (void)x30080202;
gdcm::TagToType<0x3008,0x0220> x30080220; (void)x30080220;
gdcm::TagToType<0x3008,0x0223> x30080223; (void)x30080223;
gdcm::TagToType<0x3008,0x0224> x30080224; (void)x30080224;
gdcm::TagToType<0x3008,0x0230> x30080230; (void)x30080230;
gdcm::TagToType<0x3008,0x0240> x30080240; (void)x30080240;
gdcm::TagToType<0x3008,0x0250> x30080250; (void)x30080250;
gdcm::TagToType<0x3008,0x0251> x30080251; (void)x30080251;
gdcm::TagToType<0x300a,0x0002> x300a0002; (void)x300a0002;
gdcm::TagToType<0x300a,0x0003> x300a0003; (void)x300a0003;
gdcm::TagToType<0x300a,0x0004> x300a0004; (void)x300a0004;
gdcm::TagToType<0x300a,0x0006> x300a0006; (void)x300a0006;
gdcm::TagToType<0x300a,0x0007> x300a0007; (void)x300a0007;
gdcm::TagToType<0x300a,0x0009> x300a0009; (void)x300a0009;
gdcm::TagToType<0x300a,0x000a> x300a000a; (void)x300a000a;
gdcm::TagToType<0x300a,0x000b> x300a000b; (void)x300a000b;
gdcm::TagToType<0x300a,0x000c> x300a000c; (void)x300a000c;
gdcm::TagToType<0x300a,0x000e> x300a000e; (void)x300a000e;
gdcm::TagToType<0x300a,0x0010> x300a0010; (void)x300a0010;
gdcm::TagToType<0x300a,0x0012> x300a0012; (void)x300a0012;
gdcm::TagToType<0x300a,0x0013> x300a0013; (void)x300a0013;
gdcm::TagToType<0x300a,0x0014> x300a0014; (void)x300a0014;
gdcm::TagToType<0x300a,0x0015> x300a0015; (void)x300a0015;
gdcm::TagToType<0x300a,0x0016> x300a0016; (void)x300a0016;
gdcm::TagToType<0x300a,0x0018> x300a0018; (void)x300a0018;
gdcm::TagToType<0x300a,0x001a> x300a001a; (void)x300a001a;
gdcm::TagToType<0x300a,0x0020> x300a0020; (void)x300a0020;
gdcm::TagToType<0x300a,0x0021> x300a0021; (void)x300a0021;
gdcm::TagToType<0x300a,0x0022> x300a0022; (void)x300a0022;
gdcm::TagToType<0x300a,0x0023> x300a0023; (void)x300a0023;
gdcm::TagToType<0x300a,0x0025> x300a0025; (void)x300a0025;
gdcm::TagToType<0x300a,0x0026> x300a0026; (void)x300a0026;
gdcm::TagToType<0x300a,0x0027> x300a0027; (void)x300a0027;
gdcm::TagToType<0x300a,0x0028> x300a0028; (void)x300a0028;
gdcm::TagToType<0x300a,0x002a> x300a002a; (void)x300a002a;
gdcm::TagToType<0x300a,0x002b> x300a002b; (void)x300a002b;
gdcm::TagToType<0x300a,0x002c> x300a002c; (void)x300a002c;
gdcm::TagToType<0x300a,0x002d> x300a002d; (void)x300a002d;
gdcm::TagToType<0x300a,0x0040> x300a0040; (void)x300a0040;
gdcm::TagToType<0x300a,0x0042> x300a0042; (void)x300a0042;
gdcm::TagToType<0x300a,0x0043> x300a0043; (void)x300a0043;
gdcm::TagToType<0x300a,0x0044> x300a0044; (void)x300a0044;
gdcm::TagToType<0x300a,0x0046> x300a0046; (void)x300a0046;
gdcm::TagToType<0x300a,0x0048> x300a0048; (void)x300a0048;
gdcm::TagToType<0x300a,0x004a> x300a004a; (void)x300a004a;
gdcm::TagToType<0x300a,0x004b> x300a004b; (void)x300a004b;
gdcm::TagToType<0x300a,0x004c> x300a004c; (void)x300a004c;
gdcm::TagToType<0x300a,0x004e> x300a004e; (void)x300a004e;
gdcm::TagToType<0x300a,0x004f> x300a004f; (void)x300a004f;
gdcm::TagToType<0x300a,0x0050> x300a0050; (void)x300a0050;
gdcm::TagToType<0x300a,0x0051> x300a0051; (void)x300a0051;
gdcm::TagToType<0x300a,0x0052> x300a0052; (void)x300a0052;
gdcm::TagToType<0x300a,0x0053> x300a0053; (void)x300a0053;
gdcm::TagToType<0x300a,0x0055> x300a0055; (void)x300a0055;
gdcm::TagToType<0x300a,0x0070> x300a0070; (void)x300a0070;
gdcm::TagToType<0x300a,0x0071> x300a0071; (void)x300a0071;
gdcm::TagToType<0x300a,0x0072> x300a0072; (void)x300a0072;
gdcm::TagToType<0x300a,0x0078> x300a0078; (void)x300a0078;
gdcm::TagToType<0x300a,0x0079> x300a0079; (void)x300a0079;
gdcm::TagToType<0x300a,0x007a> x300a007a; (void)x300a007a;
gdcm::TagToType<0x300a,0x007b> x300a007b; (void)x300a007b;
gdcm::TagToType<0x300a,0x0080> x300a0080; (void)x300a0080;
gdcm::TagToType<0x300a,0x0082> x300a0082; (void)x300a0082;
gdcm::TagToType<0x300a,0x0084> x300a0084; (void)x300a0084;
gdcm::TagToType<0x300a,0x0086> x300a0086; (void)x300a0086;
gdcm::TagToType<0x300a,0x0088> x300a0088; (void)x300a0088;
gdcm::TagToType<0x300a,0x0089> x300a0089; (void)x300a0089;
gdcm::TagToType<0x300a,0x008a> x300a008a; (void)x300a008a;
gdcm::TagToType<0x300a,0x00a0> x300a00a0; (void)x300a00a0;
gdcm::TagToType<0x300a,0x00a2> x300a00a2; (void)x300a00a2;
gdcm::TagToType<0x300a,0x00a4> x300a00a4; (void)x300a00a4;
gdcm::TagToType<0x300a,0x00b0> x300a00b0; (void)x300a00b0;
gdcm::TagToType<0x300a,0x00b2> x300a00b2; (void)x300a00b2;
gdcm::TagToType<0x300a,0x00b3> x300a00b3; (void)x300a00b3;
gdcm::TagToType<0x300a,0x00b4> x300a00b4; (void)x300a00b4;
gdcm::TagToType<0x300a,0x00b6> x300a00b6; (void)x300a00b6;
gdcm::TagToType<0x300a,0x00b8> x300a00b8; (void)x300a00b8;
gdcm::TagToType<0x300a,0x00ba> x300a00ba; (void)x300a00ba;
gdcm::TagToType<0x300a,0x00bb> x300a00bb; (void)x300a00bb;
gdcm::TagToType<0x300a,0x00bc> x300a00bc; (void)x300a00bc;
gdcm::TagToType<0x300a,0x00be> x300a00be; (void)x300a00be;
gdcm::TagToType<0x300a,0x00c0> x300a00c0; (void)x300a00c0;
gdcm::TagToType<0x300a,0x00c2> x300a00c2; (void)x300a00c2;
gdcm::TagToType<0x300a,0x00c3> x300a00c3; (void)x300a00c3;
gdcm::TagToType<0x300a,0x00c4> x300a00c4; (void)x300a00c4;
gdcm::TagToType<0x300a,0x00c6> x300a00c6; (void)x300a00c6;
gdcm::TagToType<0x300a,0x00c7> x300a00c7; (void)x300a00c7;
gdcm::TagToType<0x300a,0x00c8> x300a00c8; (void)x300a00c8;
gdcm::TagToType<0x300a,0x00ca> x300a00ca; (void)x300a00ca;
gdcm::TagToType<0x300a,0x00cc> x300a00cc; (void)x300a00cc;
gdcm::TagToType<0x300a,0x00ce> x300a00ce; (void)x300a00ce;
gdcm::TagToType<0x300a,0x00d0> x300a00d0; (void)x300a00d0;
gdcm::TagToType<0x300a,0x00d1> x300a00d1; (void)x300a00d1;
gdcm::TagToType<0x300a,0x00d2> x300a00d2; (void)x300a00d2;
gdcm::TagToType<0x300a,0x00d3> x300a00d3; (void)x300a00d3;
gdcm::TagToType<0x300a,0x00d4> x300a00d4; (void)x300a00d4;
gdcm::TagToType<0x300a,0x00d5> x300a00d5; (void)x300a00d5;
gdcm::TagToType<0x300a,0x00d6> x300a00d6; (void)x300a00d6;
gdcm::TagToType<0x300a,0x00d7> x300a00d7; (void)x300a00d7;
gdcm::TagToType<0x300a,0x00d8> x300a00d8; (void)x300a00d8;
gdcm::TagToType<0x300a,0x00d9> x300a00d9; (void)x300a00d9;
gdcm::TagToType<0x300a,0x00da> x300a00da; (void)x300a00da;
gdcm::TagToType<0x300a,0x00db> x300a00db; (void)x300a00db;
gdcm::TagToType<0x300a,0x00dc> x300a00dc; (void)x300a00dc;
gdcm::TagToType<0x300a,0x00dd> x300a00dd; (void)x300a00dd;
gdcm::TagToType<0x300a,0x00e0> x300a00e0; (void)x300a00e0;
gdcm::TagToType<0x300a,0x00e1> x300a00e1; (void)x300a00e1;
gdcm::TagToType<0x300a,0x00e2> x300a00e2; (void)x300a00e2;
gdcm::TagToType<0x300a,0x00e3> x300a00e3; (void)x300a00e3;
gdcm::TagToType<0x300a,0x00e4> x300a00e4; (void)x300a00e4;
gdcm::TagToType<0x300a,0x00e5> x300a00e5; (void)x300a00e5;
gdcm::TagToType<0x300a,0x00e6> x300a00e6; (void)x300a00e6;
gdcm::TagToType<0x300a,0x00e7> x300a00e7; (void)x300a00e7;
gdcm::TagToType<0x300a,0x00e8> x300a00e8; (void)x300a00e8;
gdcm::TagToType<0x300a,0x00e9> x300a00e9; (void)x300a00e9;
gdcm::TagToType<0x300a,0x00ea> x300a00ea; (void)x300a00ea;
gdcm::TagToType<0x300a,0x00eb> x300a00eb; (void)x300a00eb;
gdcm::TagToType<0x300a,0x00ec> x300a00ec; (void)x300a00ec;
gdcm::TagToType<0x300a,0x00ed> x300a00ed; (void)x300a00ed;
gdcm::TagToType<0x300a,0x00ee> x300a00ee; (void)x300a00ee;
gdcm::TagToType<0x300a,0x00f0> x300a00f0; (void)x300a00f0;
gdcm::TagToType<0x300a,0x00f2> x300a00f2; (void)x300a00f2;
gdcm::TagToType<0x300a,0x00f3> x300a00f3; (void)x300a00f3;
gdcm::TagToType<0x300a,0x00f4> x300a00f4; (void)x300a00f4;
gdcm::TagToType<0x300a,0x00f5> x300a00f5; (void)x300a00f5;
gdcm::TagToType<0x300a,0x00f6> x300a00f6; (void)x300a00f6;
gdcm::TagToType<0x300a,0x00f7> x300a00f7; (void)x300a00f7;
gdcm::TagToType<0x300a,0x00f8> x300a00f8; (void)x300a00f8;
gdcm::TagToType<0x300a,0x00f9> x300a00f9; (void)x300a00f9;
gdcm::TagToType<0x300a,0x00fa> x300a00fa; (void)x300a00fa;
gdcm::TagToType<0x300a,0x00fb> x300a00fb; (void)x300a00fb;
gdcm::TagToType<0x300a,0x00fc> x300a00fc; (void)x300a00fc;
gdcm::TagToType<0x300a,0x00fe> x300a00fe; (void)x300a00fe;
gdcm::TagToType<0x300a,0x0100> x300a0100; (void)x300a0100;
gdcm::TagToType<0x300a,0x0102> x300a0102; (void)x300a0102;
gdcm::TagToType<0x300a,0x0104> x300a0104; (void)x300a0104;
gdcm::TagToType<0x300a,0x0106> x300a0106; (void)x300a0106;
gdcm::TagToType<0x300a,0x0107> x300a0107; (void)x300a0107;
gdcm::TagToType<0x300a,0x0108> x300a0108; (void)x300a0108;
gdcm::TagToType<0x300a,0x0109> x300a0109; (void)x300a0109;
gdcm::TagToType<0x300a,0x010a> x300a010a; (void)x300a010a;
gdcm::TagToType<0x300a,0x010c> x300a010c; (void)x300a010c;
gdcm::TagToType<0x300a,0x010e> x300a010e; (void)x300a010e;
gdcm::TagToType<0x300a,0x0110> x300a0110; (void)x300a0110;
gdcm::TagToType<0x300a,0x0111> x300a0111; (void)x300a0111;
gdcm::TagToType<0x300a,0x0112> x300a0112; (void)x300a0112;
gdcm::TagToType<0x300a,0x0114> x300a0114; (void)x300a0114;
gdcm::TagToType<0x300a,0x0115> x300a0115; (void)x300a0115;
gdcm::TagToType<0x300a,0x0116> x300a0116; (void)x300a0116;
gdcm::TagToType<0x300a,0x0118> x300a0118; (void)x300a0118;
gdcm::TagToType<0x300a,0x011a> x300a011a; (void)x300a011a;
gdcm::TagToType<0x300a,0x011c> x300a011c; (void)x300a011c;
gdcm::TagToType<0x300a,0x011e> x300a011e; (void)x300a011e;
gdcm::TagToType<0x300a,0x011f> x300a011f; (void)x300a011f;
gdcm::TagToType<0x300a,0x0120> x300a0120; (void)x300a0120;
gdcm::TagToType<0x300a,0x0121> x300a0121; (void)x300a0121;
gdcm::TagToType<0x300a,0x0122> x300a0122; (void)x300a0122;
gdcm::TagToType<0x300a,0x0123> x300a0123; (void)x300a0123;
gdcm::TagToType<0x300a,0x0124> x300a0124; (void)x300a0124;
gdcm::TagToType<0x300a,0x0125> x300a0125; (void)x300a0125;
gdcm::TagToType<0x300a,0x0126> x300a0126; (void)x300a0126;
gdcm::TagToType<0x300a,0x0128> x300a0128; (void)x300a0128;
gdcm::TagToType<0x300a,0x0129> x300a0129; (void)x300a0129;
gdcm::TagToType<0x300a,0x012a> x300a012a; (void)x300a012a;
gdcm::TagToType<0x300a,0x012c> x300a012c; (void)x300a012c;
gdcm::TagToType<0x300a,0x012e> x300a012e; (void)x300a012e;
gdcm::TagToType<0x300a,0x0130> x300a0130; (void)x300a0130;
gdcm::TagToType<0x300a,0x0134> x300a0134; (void)x300a0134;
gdcm::TagToType<0x300a,0x0140> x300a0140; (void)x300a0140;
gdcm::TagToType<0x300a,0x0142> x300a0142; (void)x300a0142;
gdcm::TagToType<0x300a,0x0144> x300a0144; (void)x300a0144;
gdcm::TagToType<0x300a,0x0146> x300a0146; (void)x300a0146;
gdcm::TagToType<0x300a,0x0148> x300a0148; (void)x300a0148;
gdcm::TagToType<0x300a,0x014a> x300a014a; (void)x300a014a;
gdcm::TagToType<0x300a,0x014c> x300a014c; (void)x300a014c;
gdcm::TagToType<0x300a,0x014e> x300a014e; (void)x300a014e;
gdcm::TagToType<0x300a,0x0180> x300a0180; (void)x300a0180;
gdcm::TagToType<0x300a,0x0182> x300a0182; (void)x300a0182;
gdcm::TagToType<0x300a,0x0183> x300a0183; (void)x300a0183;
gdcm::TagToType<0x300a,0x0184> x300a0184; (void)x300a0184;
gdcm::TagToType<0x300a,0x0190> x300a0190; (void)x300a0190;
gdcm::TagToType<0x300a,0x0192> x300a0192; (void)x300a0192;
gdcm::TagToType<0x300a,0x0194> x300a0194; (void)x300a0194;
gdcm::TagToType<0x300a,0x0196> x300a0196; (void)x300a0196;
gdcm::TagToType<0x300a,0x0198> x300a0198; (void)x300a0198;
gdcm::TagToType<0x300a,0x0199> x300a0199; (void)x300a0199;
gdcm::TagToType<0x300a,0x019a> x300a019a; (void)x300a019a;
gdcm::TagToType<0x300a,0x01a0> x300a01a0; (void)x300a01a0;
gdcm::TagToType<0x300a,0x01a2> x300a01a2; (void)x300a01a2;
gdcm::TagToType<0x300a,0x01a4> x300a01a4; (void)x300a01a4;
gdcm::TagToType<0x300a,0x01a6> x300a01a6; (void)x300a01a6;
gdcm::TagToType<0x300a,0x01a8> x300a01a8; (void)x300a01a8;
gdcm::TagToType<0x300a,0x01b0> x300a01b0; (void)x300a01b0;
gdcm::TagToType<0x300a,0x01b2> x300a01b2; (void)x300a01b2;
gdcm::TagToType<0x300a,0x01b4> x300a01b4; (void)x300a01b4;
gdcm::TagToType<0x300a,0x01b6> x300a01b6; (void)x300a01b6;
gdcm::TagToType<0x300a,0x01b8> x300a01b8; (void)x300a01b8;
gdcm::TagToType<0x300a,0x01ba> x300a01ba; (void)x300a01ba;
gdcm::TagToType<0x300a,0x01bc> x300a01bc; (void)x300a01bc;
gdcm::TagToType<0x300a,0x01d0> x300a01d0; (void)x300a01d0;
gdcm::TagToType<0x300a,0x01d2> x300a01d2; (void)x300a01d2;
gdcm::TagToType<0x300a,0x01d4> x300a01d4; (void)x300a01d4;
gdcm::TagToType<0x300a,0x01d6> x300a01d6; (void)x300a01d6;
gdcm::TagToType<0x300a,0x0200> x300a0200; (void)x300a0200;
gdcm::TagToType<0x300a,0x0202> x300a0202; (void)x300a0202;
gdcm::TagToType<0x300a,0x0206> x300a0206; (void)x300a0206;
gdcm::TagToType<0x300a,0x0210> x300a0210; (void)x300a0210;
gdcm::TagToType<0x300a,0x0212> x300a0212; (void)x300a0212;
gdcm::TagToType<0x300a,0x0214> x300a0214; (void)x300a0214;
gdcm::TagToType<0x300a,0x0216> x300a0216; (void)x300a0216;
gdcm::TagToType<0x300a,0x0218> x300a0218; (void)x300a0218;
gdcm::TagToType<0x300a,0x021a> x300a021a; (void)x300a021a;
gdcm::TagToType<0x300a,0x0222> x300a0222; (void)x300a0222;
gdcm::TagToType<0x300a,0x0224> x300a0224; (void)x300a0224;
gdcm::TagToType<0x300a,0x0226> x300a0226; (void)x300a0226;
gdcm::TagToType<0x300a,0x0228> x300a0228; (void)x300a0228;
gdcm::TagToType<0x300a,0x0229> x300a0229; (void)x300a0229;
gdcm::TagToType<0x300a,0x022a> x300a022a; (void)x300a022a;
gdcm::TagToType<0x300a,0x022b> x300a022b; (void)x300a022b;
gdcm::TagToType<0x300a,0x022c> x300a022c; (void)x300a022c;
gdcm::TagToType<0x300a,0x022e> x300a022e; (void)x300a022e;
gdcm::TagToType<0x300a,0x0230> x300a0230; (void)x300a0230;
gdcm::TagToType<0x300a,0x0232> x300a0232; (void)x300a0232;
gdcm::TagToType<0x300a,0x0234> x300a0234; (void)x300a0234;
gdcm::TagToType<0x300a,0x0236> x300a0236; (void)x300a0236;
gdcm::TagToType<0x300a,0x0238> x300a0238; (void)x300a0238;
gdcm::TagToType<0x300a,0x0240> x300a0240; (void)x300a0240;
gdcm::TagToType<0x300a,0x0242> x300a0242; (void)x300a0242;
gdcm::TagToType<0x300a,0x0244> x300a0244; (void)x300a0244;
gdcm::TagToType<0x300a,0x0250> x300a0250; (void)x300a0250;
gdcm::TagToType<0x300a,0x0260> x300a0260; (void)x300a0260;
gdcm::TagToType<0x300a,0x0262> x300a0262; (void)x300a0262;
gdcm::TagToType<0x300a,0x0263> x300a0263; (void)x300a0263;
gdcm::TagToType<0x300a,0x0264> x300a0264; (void)x300a0264;
gdcm::TagToType<0x300a,0x0266> x300a0266; (void)x300a0266;
gdcm::TagToType<0x300a,0x026a> x300a026a; (void)x300a026a;
gdcm::TagToType<0x300a,0x026c> x300a026c; (void)x300a026c;
gdcm::TagToType<0x300a,0x0280> x300a0280; (void)x300a0280;
gdcm::TagToType<0x300a,0x0282> x300a0282; (void)x300a0282;
gdcm::TagToType<0x300a,0x0284> x300a0284; (void)x300a0284;
gdcm::TagToType<0x300a,0x0286> x300a0286; (void)x300a0286;
gdcm::TagToType<0x300a,0x0288> x300a0288; (void)x300a0288;
gdcm::TagToType<0x300a,0x028a> x300a028a; (void)x300a028a;
gdcm::TagToType<0x300a,0x028c> x300a028c; (void)x300a028c;
gdcm::TagToType<0x300a,0x0290> x300a0290; (void)x300a0290;
gdcm::TagToType<0x300a,0x0291> x300a0291; (void)x300a0291;
gdcm::TagToType<0x300a,0x0292> x300a0292; (void)x300a0292;
gdcm::TagToType<0x300a,0x0294> x300a0294; (void)x300a0294;
gdcm::TagToType<0x300a,0x0296> x300a0296; (void)x300a0296;
gdcm::TagToType<0x300a,0x0298> x300a0298; (void)x300a0298;
gdcm::TagToType<0x300a,0x029c> x300a029c; (void)x300a029c;
gdcm::TagToType<0x300a,0x029e> x300a029e; (void)x300a029e;
gdcm::TagToType<0x300a,0x02a0> x300a02a0; (void)x300a02a0;
gdcm::TagToType<0x300a,0x02a2> x300a02a2; (void)x300a02a2;
gdcm::TagToType<0x300a,0x02a4> x300a02a4; (void)x300a02a4;
gdcm::TagToType<0x300a,0x02b0> x300a02b0; (void)x300a02b0;
gdcm::TagToType<0x300a,0x02b2> x300a02b2; (void)x300a02b2;
gdcm::TagToType<0x300a,0x02b3> x300a02b3; (void)x300a02b3;
gdcm::TagToType<0x300a,0x02b4> x300a02b4; (void)x300a02b4;
gdcm::TagToType<0x300a,0x02b8> x300a02b8; (void)x300a02b8;
gdcm::TagToType<0x300a,0x02ba> x300a02ba; (void)x300a02ba;
gdcm::TagToType<0x300a,0x02c8> x300a02c8; (void)x300a02c8;
gdcm::TagToType<0x300a,0x02d0> x300a02d0; (void)x300a02d0;
gdcm::TagToType<0x300a,0x02d2> x300a02d2; (void)x300a02d2;
gdcm::TagToType<0x300a,0x02d4> x300a02d4; (void)x300a02d4;
gdcm::TagToType<0x300a,0x02d6> x300a02d6; (void)x300a02d6;
gdcm::TagToType<0x300a,0x02e0> x300a02e0; (void)x300a02e0;
gdcm::TagToType<0x300a,0x02e1> x300a02e1; (void)x300a02e1;
gdcm::TagToType<0x300a,0x02e2> x300a02e2; (void)x300a02e2;
gdcm::TagToType<0x300a,0x02e3> x300a02e3; (void)x300a02e3;
gdcm::TagToType<0x300a,0x02e4> x300a02e4; (void)x300a02e4;
gdcm::TagToType<0x300a,0x02e5> x300a02e5; (void)x300a02e5;
gdcm::TagToType<0x300a,0x02e6> x300a02e6; (void)x300a02e6;
gdcm::TagToType<0x300a,0x02e7> x300a02e7; (void)x300a02e7;
gdcm::TagToType<0x300a,0x02e8> x300a02e8; (void)x300a02e8;
gdcm::TagToType<0x300a,0x02ea> x300a02ea; (void)x300a02ea;
gdcm::TagToType<0x300a,0x02eb> x300a02eb; (void)x300a02eb;
gdcm::TagToType<0x300a,0x0302> x300a0302; (void)x300a0302;
gdcm::TagToType<0x300a,0x0304> x300a0304; (void)x300a0304;
gdcm::TagToType<0x300a,0x0306> x300a0306; (void)x300a0306;
gdcm::TagToType<0x300a,0x0308> x300a0308; (void)x300a0308;
gdcm::TagToType<0x300a,0x030a> x300a030a; (void)x300a030a;
gdcm::TagToType<0x300a,0x030c> x300a030c; (void)x300a030c;
gdcm::TagToType<0x300a,0x030d> x300a030d; (void)x300a030d;
gdcm::TagToType<0x300a,0x030f> x300a030f; (void)x300a030f;
gdcm::TagToType<0x300a,0x0312> x300a0312; (void)x300a0312;
gdcm::TagToType<0x300a,0x0314> x300a0314; (void)x300a0314;
gdcm::TagToType<0x300a,0x0316> x300a0316; (void)x300a0316;
gdcm::TagToType<0x300a,0x0318> x300a0318; (void)x300a0318;
gdcm::TagToType<0x300a,0x0320> x300a0320; (void)x300a0320;
gdcm::TagToType<0x300a,0x0322> x300a0322; (void)x300a0322;
gdcm::TagToType<0x300a,0x0330> x300a0330; (void)x300a0330;
gdcm::TagToType<0x300a,0x0332> x300a0332; (void)x300a0332;
gdcm::TagToType<0x300a,0x0334> x300a0334; (void)x300a0334;
gdcm::TagToType<0x300a,0x0336> x300a0336; (void)x300a0336;
gdcm::TagToType<0x300a,0x0338> x300a0338; (void)x300a0338;
gdcm::TagToType<0x300a,0x033a> x300a033a; (void)x300a033a;
gdcm::TagToType<0x300a,0x033c> x300a033c; (void)x300a033c;
gdcm::TagToType<0x300a,0x0340> x300a0340; (void)x300a0340;
gdcm::TagToType<0x300a,0x0342> x300a0342; (void)x300a0342;
gdcm::TagToType<0x300a,0x0344> x300a0344; (void)x300a0344;
gdcm::TagToType<0x300a,0x0346> x300a0346; (void)x300a0346;
gdcm::TagToType<0x300a,0x0348> x300a0348; (void)x300a0348;
gdcm::TagToType<0x300a,0x034a> x300a034a; (void)x300a034a;
gdcm::TagToType<0x300a,0x034c> x300a034c; (void)x300a034c;
gdcm::TagToType<0x300a,0x0350> x300a0350; (void)x300a0350;
gdcm::TagToType<0x300a,0x0352> x300a0352; (void)x300a0352;
gdcm::TagToType<0x300a,0x0354> x300a0354; (void)x300a0354;
gdcm::TagToType<0x300a,0x0356> x300a0356; (void)x300a0356;
gdcm::TagToType<0x300a,0x0358> x300a0358; (void)x300a0358;
gdcm::TagToType<0x300a,0x035a> x300a035a; (void)x300a035a;
gdcm::TagToType<0x300a,0x0360> x300a0360; (void)x300a0360;
gdcm::TagToType<0x300a,0x0362> x300a0362; (void)x300a0362;
gdcm::TagToType<0x300a,0x0364> x300a0364; (void)x300a0364;
gdcm::TagToType<0x300a,0x0366> x300a0366; (void)x300a0366;
gdcm::TagToType<0x300a,0x0370> x300a0370; (void)x300a0370;
gdcm::TagToType<0x300a,0x0372> x300a0372; (void)x300a0372;
gdcm::TagToType<0x300a,0x0374> x300a0374; (void)x300a0374;
gdcm::TagToType<0x300a,0x0380> x300a0380; (void)x300a0380;
gdcm::TagToType<0x300a,0x0382> x300a0382; (void)x300a0382;
gdcm::TagToType<0x300a,0x0384> x300a0384; (void)x300a0384;
gdcm::TagToType<0x300a,0x0386> x300a0386; (void)x300a0386;
gdcm::TagToType<0x300a,0x0388> x300a0388; (void)x300a0388;
gdcm::TagToType<0x300a,0x038a> x300a038a; (void)x300a038a;
gdcm::TagToType<0x300a,0x0390> x300a0390; (void)x300a0390;
gdcm::TagToType<0x300a,0x0392> x300a0392; (void)x300a0392;
gdcm::TagToType<0x300a,0x0394> x300a0394; (void)x300a0394;
gdcm::TagToType<0x300a,0x0396> x300a0396; (void)x300a0396;
gdcm::TagToType<0x300a,0x0398> x300a0398; (void)x300a0398;
gdcm::TagToType<0x300a,0x039a> x300a039a; (void)x300a039a;
gdcm::TagToType<0x300a,0x03a0> x300a03a0; (void)x300a03a0;
gdcm::TagToType<0x300a,0x03a2> x300a03a2; (void)x300a03a2;
gdcm::TagToType<0x300a,0x03a4> x300a03a4; (void)x300a03a4;
gdcm::TagToType<0x300a,0x03a6> x300a03a6; (void)x300a03a6;
gdcm::TagToType<0x300a,0x03a8> x300a03a8; (void)x300a03a8;
gdcm::TagToType<0x300a,0x03aa> x300a03aa; (void)x300a03aa;
gdcm::TagToType<0x300a,0x03ac> x300a03ac; (void)x300a03ac;
gdcm::TagToType<0x300a,0x0401> x300a0401; (void)x300a0401;
gdcm::TagToType<0x300a,0x0402> x300a0402; (void)x300a0402;
gdcm::TagToType<0x300a,0x0410> x300a0410; (void)x300a0410;
gdcm::TagToType<0x300a,0x0412> x300a0412; (void)x300a0412;
gdcm::TagToType<0x300a,0x0420> x300a0420; (void)x300a0420;
gdcm::TagToType<0x300a,0x0421> x300a0421; (void)x300a0421;
gdcm::TagToType<0x300a,0x0422> x300a0422; (void)x300a0422;
gdcm::TagToType<0x300a,0x0423> x300a0423; (void)x300a0423;
gdcm::TagToType<0x300a,0x0424> x300a0424; (void)x300a0424;
gdcm::TagToType<0x300c,0x0002> x300c0002; (void)x300c0002;
gdcm::TagToType<0x300c,0x0004> x300c0004; (void)x300c0004;
gdcm::TagToType<0x300c,0x0006> x300c0006; (void)x300c0006;
gdcm::TagToType<0x300c,0x0007> x300c0007; (void)x300c0007;
gdcm::TagToType<0x300c,0x0008> x300c0008; (void)x300c0008;
gdcm::TagToType<0x300c,0x0009> x300c0009; (void)x300c0009;
gdcm::TagToType<0x300c,0x000a> x300c000a; (void)x300c000a;
gdcm::TagToType<0x300c,0x000c> x300c000c; (void)x300c000c;
gdcm::TagToType<0x300c,0x000e> x300c000e; (void)x300c000e;
gdcm::TagToType<0x300c,0x0020> x300c0020; (void)x300c0020;
gdcm::TagToType<0x300c,0x0022> x300c0022; (void)x300c0022;
gdcm::TagToType<0x300c,0x0040> x300c0040; (void)x300c0040;
gdcm::TagToType<0x300c,0x0042> x300c0042; (void)x300c0042;
gdcm::TagToType<0x300c,0x0050> x300c0050; (void)x300c0050;
gdcm::TagToType<0x300c,0x0051> x300c0051; (void)x300c0051;
gdcm::TagToType<0x300c,0x0055> x300c0055; (void)x300c0055;
gdcm::TagToType<0x300c,0x0060> x300c0060; (void)x300c0060;
gdcm::TagToType<0x300c,0x006a> x300c006a; (void)x300c006a;
gdcm::TagToType<0x300c,0x0080> x300c0080; (void)x300c0080;
gdcm::TagToType<0x300c,0x00a0> x300c00a0; (void)x300c00a0;
gdcm::TagToType<0x300c,0x00b0> x300c00b0; (void)x300c00b0;
gdcm::TagToType<0x300c,0x00c0> x300c00c0; (void)x300c00c0;
gdcm::TagToType<0x300c,0x00d0> x300c00d0; (void)x300c00d0;
gdcm::TagToType<0x300c,0x00e0> x300c00e0; (void)x300c00e0;
gdcm::TagToType<0x300c,0x00f0> x300c00f0; (void)x300c00f0;
gdcm::TagToType<0x300c,0x00f2> x300c00f2; (void)x300c00f2;
gdcm::TagToType<0x300c,0x00f4> x300c00f4; (void)x300c00f4;
gdcm::TagToType<0x300c,0x00f6> x300c00f6; (void)x300c00f6;
gdcm::TagToType<0x300c,0x0100> x300c0100; (void)x300c0100;
gdcm::TagToType<0x300c,0x0102> x300c0102; (void)x300c0102;
gdcm::TagToType<0x300c,0x0104> x300c0104; (void)x300c0104;
gdcm::TagToType<0x300e,0x0002> x300e0002; (void)x300e0002;
gdcm::TagToType<0x300e,0x0004> x300e0004; (void)x300e0004;
gdcm::TagToType<0x300e,0x0005> x300e0005; (void)x300e0005;
gdcm::TagToType<0x300e,0x0008> x300e0008; (void)x300e0008;
gdcm::TagToType<0x4000,0x0010> x40000010; (void)x40000010;
gdcm::TagToType<0x4000,0x4000> x40004000; (void)x40004000;
gdcm::TagToType<0x4008,0x0040> x40080040; (void)x40080040;
gdcm::TagToType<0x4008,0x0042> x40080042; (void)x40080042;
gdcm::TagToType<0x4008,0x0050> x40080050; (void)x40080050;
gdcm::TagToType<0x4008,0x0100> x40080100; (void)x40080100;
gdcm::TagToType<0x4008,0x0101> x40080101; (void)x40080101;
gdcm::TagToType<0x4008,0x0102> x40080102; (void)x40080102;
gdcm::TagToType<0x4008,0x0103> x40080103; (void)x40080103;
gdcm::TagToType<0x4008,0x0108> x40080108; (void)x40080108;
gdcm::TagToType<0x4008,0x0109> x40080109; (void)x40080109;
gdcm::TagToType<0x4008,0x010a> x4008010a; (void)x4008010a;
gdcm::TagToType<0x4008,0x010b> x4008010b; (void)x4008010b;
gdcm::TagToType<0x4008,0x010c> x4008010c; (void)x4008010c;
gdcm::TagToType<0x4008,0x0111> x40080111; (void)x40080111;
gdcm::TagToType<0x4008,0x0112> x40080112; (void)x40080112;
gdcm::TagToType<0x4008,0x0113> x40080113; (void)x40080113;
gdcm::TagToType<0x4008,0x0114> x40080114; (void)x40080114;
gdcm::TagToType<0x4008,0x0115> x40080115; (void)x40080115;
gdcm::TagToType<0x4008,0x0117> x40080117; (void)x40080117;
gdcm::TagToType<0x4008,0x0118> x40080118; (void)x40080118;
gdcm::TagToType<0x4008,0x0119> x40080119; (void)x40080119;
gdcm::TagToType<0x4008,0x011a> x4008011a; (void)x4008011a;
gdcm::TagToType<0x4008,0x0200> x40080200; (void)x40080200;
gdcm::TagToType<0x4008,0x0202> x40080202; (void)x40080202;
gdcm::TagToType<0x4008,0x0210> x40080210; (void)x40080210;
gdcm::TagToType<0x4008,0x0212> x40080212; (void)x40080212;
gdcm::TagToType<0x4008,0x0300> x40080300; (void)x40080300;
gdcm::TagToType<0x4008,0x4000> x40084000; (void)x40084000;
gdcm::TagToType<0x4ffe,0x0001> x4ffe0001; (void)x4ffe0001;
gdcm::TagToType<0x5000,0x0005> x50000005; (void)x50000005;
gdcm::TagToType<0x5000,0x0010> x50000010; (void)x50000010;
gdcm::TagToType<0x5000,0x0020> x50000020; (void)x50000020;
gdcm::TagToType<0x5000,0x0022> x50000022; (void)x50000022;
gdcm::TagToType<0x5000,0x0030> x50000030; (void)x50000030;
gdcm::TagToType<0x5000,0x0040> x50000040; (void)x50000040;
gdcm::TagToType<0x5000,0x0103> x50000103; (void)x50000103;
gdcm::TagToType<0x5000,0x0104> x50000104; (void)x50000104;
gdcm::TagToType<0x5000,0x0105> x50000105; (void)x50000105;
gdcm::TagToType<0x5000,0x0106> x50000106; (void)x50000106;
gdcm::TagToType<0x5000,0x0110> x50000110; (void)x50000110;
gdcm::TagToType<0x5000,0x0112> x50000112; (void)x50000112;
gdcm::TagToType<0x5000,0x0114> x50000114; (void)x50000114;
gdcm::TagToType<0x5000,0x1001> x50001001; (void)x50001001;
gdcm::TagToType<0x5000,0x2000> x50002000; (void)x50002000;
gdcm::TagToType<0x5000,0x2002> x50002002; (void)x50002002;
gdcm::TagToType<0x5000,0x2004> x50002004; (void)x50002004;
gdcm::TagToType<0x5000,0x2006> x50002006; (void)x50002006;
gdcm::TagToType<0x5000,0x2008> x50002008; (void)x50002008;
gdcm::TagToType<0x5000,0x200a> x5000200a; (void)x5000200a;
gdcm::TagToType<0x5000,0x200e> x5000200e; (void)x5000200e;
gdcm::TagToType<0x5000,0x2500> x50002500; (void)x50002500;
gdcm::TagToType<0x5000,0x2600> x50002600; (void)x50002600;
gdcm::TagToType<0x5000,0x2610> x50002610; (void)x50002610;
gdcm::TagToType<0x5200,0x9229> x52009229; (void)x52009229;
gdcm::TagToType<0x5200,0x9230> x52009230; (void)x52009230;
gdcm::TagToType<0x5400,0x0100> x54000100; (void)x54000100;
gdcm::TagToType<0x5400,0x1004> x54001004; (void)x54001004;
gdcm::TagToType<0x5400,0x1006> x54001006; (void)x54001006;
gdcm::TagToType<0x5600,0x0010> x56000010; (void)x56000010;
gdcm::TagToType<0x5600,0x0020> x56000020; (void)x56000020;
gdcm::TagToType<0x6000,0x0010> x60000010; (void)x60000010;
gdcm::TagToType<0x6000,0x0011> x60000011; (void)x60000011;
gdcm::TagToType<0x6000,0x0012> x60000012; (void)x60000012;
gdcm::TagToType<0x6000,0x0015> x60000015; (void)x60000015;
gdcm::TagToType<0x6000,0x0022> x60000022; (void)x60000022;
gdcm::TagToType<0x6000,0x0040> x60000040; (void)x60000040;
gdcm::TagToType<0x6000,0x0045> x60000045; (void)x60000045;
gdcm::TagToType<0x6000,0x0050> x60000050; (void)x60000050;
gdcm::TagToType<0x6000,0x0051> x60000051; (void)x60000051;
gdcm::TagToType<0x6000,0x0052> x60000052; (void)x60000052;
gdcm::TagToType<0x6000,0x0060> x60000060; (void)x60000060;
gdcm::TagToType<0x6000,0x0061> x60000061; (void)x60000061;
gdcm::TagToType<0x6000,0x0062> x60000062; (void)x60000062;
gdcm::TagToType<0x6000,0x0063> x60000063; (void)x60000063;
gdcm::TagToType<0x6000,0x0066> x60000066; (void)x60000066;
gdcm::TagToType<0x6000,0x0068> x60000068; (void)x60000068;
gdcm::TagToType<0x6000,0x0069> x60000069; (void)x60000069;
gdcm::TagToType<0x6000,0x0100> x60000100; (void)x60000100;
gdcm::TagToType<0x6000,0x0102> x60000102; (void)x60000102;
gdcm::TagToType<0x6000,0x0110> x60000110; (void)x60000110;
gdcm::TagToType<0x6000,0x0200> x60000200; (void)x60000200;
gdcm::TagToType<0x6000,0x0800> x60000800; (void)x60000800;
gdcm::TagToType<0x6000,0x0802> x60000802; (void)x60000802;
gdcm::TagToType<0x6000,0x0803> x60000803; (void)x60000803;
gdcm::TagToType<0x6000,0x0804> x60000804; (void)x60000804;
gdcm::TagToType<0x6000,0x1001> x60001001; (void)x60001001;
gdcm::TagToType<0x6000,0x1100> x60001100; (void)x60001100;
gdcm::TagToType<0x6000,0x1101> x60001101; (void)x60001101;
gdcm::TagToType<0x6000,0x1102> x60001102; (void)x60001102;
gdcm::TagToType<0x6000,0x1103> x60001103; (void)x60001103;
gdcm::TagToType<0x6000,0x1200> x60001200; (void)x60001200;
gdcm::TagToType<0x6000,0x1201> x60001201; (void)x60001201;
gdcm::TagToType<0x6000,0x1202> x60001202; (void)x60001202;
gdcm::TagToType<0x6000,0x1203> x60001203; (void)x60001203;
gdcm::TagToType<0x6000,0x1301> x60001301; (void)x60001301;
gdcm::TagToType<0x6000,0x1302> x60001302; (void)x60001302;
gdcm::TagToType<0x6000,0x1303> x60001303; (void)x60001303;
gdcm::TagToType<0x6000,0x1500> x60001500; (void)x60001500;
gdcm::TagToType<0x6000,0x4000> x60004000; (void)x60004000;
gdcm::TagToType<0x7fe0,0x0020> x7fe00020; (void)x7fe00020;
gdcm::TagToType<0x7fe0,0x0030> x7fe00030; (void)x7fe00030;
gdcm::TagToType<0x7fe0,0x0040> x7fe00040; (void)x7fe00040;
gdcm::TagToType<0x7f00,0x0011> x7f000011; (void)x7f000011;
gdcm::TagToType<0x7f00,0x0020> x7f000020; (void)x7f000020;
gdcm::TagToType<0x7f00,0x0030> x7f000030; (void)x7f000030;
gdcm::TagToType<0x7f00,0x0040> x7f000040; (void)x7f000040;
gdcm::TagToType<0xfffa,0xfffa> xfffafffa; (void)xfffafffa;
gdcm::TagToType<0xfffc,0xfffc> xfffcfffc; (void)xfffcfffc;
return 0;
}
gdcm-3.0.22/Testing/Source/DataDictionary/Cxx/TestDicts.cxx 000664 001766 001770 00000003410 14517730450 026023 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmDicts.h"
#include "gdcmGlobal.h"
#include "gdcmDict.h"
#include
int TestDicts(int, char *[])
{
gdcm::Dicts dicts;
//const gdcm::Dict &d = dicts.GetPublicDict();
//std::cout << d << std::endl;
const gdcm::Global& g = gdcm::GlobalInstance;
// get the Part 6 dicts from it:
const gdcm::Dicts &ds = g.GetDicts();
const gdcm::Dict &pub = ds.GetPublicDict();
gdcm::Dict::ConstIterator it = pub.Begin();
int ret = 0;
std::set names;
for( ; it != pub.End(); ++it)
{
const gdcm::Tag &t = it->first;
const gdcm::DictEntry &de = it->second;
// A couple of tests:
if( t.GetElement() == 0x0 )
{
// Check group length
if( de.GetVR() != gdcm::VR::UL || de.GetVM() != gdcm::VM::VM1 )
{
std::cerr << "Group length issue: Problem with tag: " << t << " " << de << std::endl;
++ret;
}
}
// I need a test that check there is no duplicate name for data elements since python-gdcm
// will rely on it
if( names.count( de.GetName() ) != 0 )
{
//std::cerr << "Name issue: Problem with tag: " << t << " " << de << std::endl;
//++ret;
}
names.insert( de.GetName() );
}
return ret;
}
gdcm-3.0.22/Testing/Source/Data/ 000775 001766 001770 00000000000 14517731550 020605 5 ustar 00mmalaterre mmalaterre 000000 000000 gdcm-3.0.22/Testing/Source/Data/encrypted_text 000664 001766 001770 00000000731 14517730450 023570 0 ustar 00mmalaterre mmalaterre 000000 000000 0‚Õ *†H†÷
‚Æ0‚Â 1‚n0‚j 0R0E10 UAU10U
Some-State1!0U
Internet Widgits Pty Ltd ¬–mˆxzQ´0
*†H†÷
‚ 5"Ú/}¸Rë
Tpñ³`¯vìÿñ˜b
V»#‹®ª¿¡a2è§å²„zw\ÛÈ©”“·áí€>˜@2„‡5¶¶6D¯·TÐm\ëk…‡²¬ú¦E|ÎPÚ8‚ݵÖUÑyà95å^t¢èÊ'á¬î/ tÅKœû×áãUû½WMboÔÏnÂÏ“Tß9&{^: *ÛHH,9q,˜½3ͰB$·Âǽ³u†êÆoyÔ;ªO–#UÚûq?ÌììkwxÈØ+Fzô¨„m}ÒvêåÄ+fi
EâFõòÛàûkÆ@ È¥W?²J¬É·Í3 dº|<î“0K *†H†÷
0*†H†÷
›3è®ÙÙž‘€(9†ùæ1ͥͪM×J¾ö£»£™{ß°qMÀØz¼8Íá-3ÙçH]‰? gdcm-3.0.22/Testing/Source/Data/certificate.pem 000664 001766 001770 00000002502 14517730450 023567 0 ustar 00mmalaterre mmalaterre 000000 000000 -----BEGIN CERTIFICATE-----
MIIDtTCCAp2gAwIBAgIJAKyWbYh4elG0MA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNV
BAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX
aWRnaXRzIFB0eSBMdGQwHhcNMDkwNDI3MDk1NzE1WhcNMTAwNDI3MDk1NzE1WjBF
MQswCQYDVQQGEwJBVTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50
ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
CgKCAQEA4k5GEgO9mI5K2UuywuGxcO4xJdygQlpvL2IS9XEbXOWBEwJZx1tccfzC
a929DCijlJE6/f5KBzDNPdLpPt3eyUKB3n7mOos7ATWEFCZgE7RWGRBhIfN2R9LD
kLT2eaUhXDzsk7L1qmKPP9nSdAXoUB6sj0EmHrQQWIPEZwGcPcvMUhcUpjD/hnmC
X6DAWHVCvE7vhbHntNYFwu1Bmau5ZY6Ywk5lQ/ZTfEYcRD1ZmUB2Wkzv4InvRc1z
YbTBpL/Lkft1B9/A7+LzJJRHoNvHaMN5pRF2qFyZW3sb+bh8z8SC0oJNzIbrWZvW
M9TEnQ8P+GCw4y68juSvlcLcBsoxCQIDAQABo4GnMIGkMB0GA1UdDgQWBBTNWfHq
ZOUwrkeH39jLz0qgBV1LaDB1BgNVHSMEbjBsgBTNWfHqZOUwrkeH39jLz0qgBV1L
aKFJpEcwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgTClNvbWUtU3RhdGUxITAfBgNV
BAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZIIJAKyWbYh4elG0MAwGA1UdEwQF
MAMBAf8wDQYJKoZIhvcNAQEFBQADggEBAMvT7rwSoHwOUMr1ZnjCYccuBsWND1Vt
JvMzELX/IUs2f0BbDVZeyn1NC7VyoAOfvgJwLccK6v49p2J/SbBaAiixlgGAi670
V7VkwMaDKIAR/AEIbORwcRoogHYSft4to1kNcPmYOhiny2VFWSp3Fmoc/egU3Cbo
pVH/ixjcCT7q/6MIuklnvULGSOajtE/+fz+KzlX8nZyD22oMk/TtxVsys8F0qWtZ
HsGoXUY15xg+HjHcSCOBeU7pAglCyRCLyO3mhAgfE3o4T5HBp4opjfRGDaVd+uPj
XRjzAZgfgLQAmiUixyCzzG8wDgpFVdoOcWQ9RcNnR9XgIw5Omas75so=
-----END CERTIFICATE-----
gdcm-3.0.22/Testing/Source/Data/CMakeLists.txt 000664 001766 001770 00000010645 14517730450 023351 0 ustar 00mmalaterre mmalaterre 000000 000000 #-----------------------------------------------------------------------------
# We need to test the reading of all dicom images in the gdcmData directory
# First parse this directory and extract all images
set(GDCM_DATA_IMAGE_FILENAMES_GLOB_EXPR
"${GDCM_DATA_ROOT}/*.acr"
"${GDCM_DATA_ROOT}/*.nema"
"${GDCM_DATA_ROOT}/*.dcm"
)
set(GDCM_DATA_DICOMDIR_FILENAMES_GLOB_EXPR
# Those files do not have any extension, special regex:
"${GDCM_DATA_ROOT}/dicomdir*"
)
# Case sensitive system:
if(UNIX)
set(GDCM_DATA_IMAGE_FILENAMES_GLOB_EXPR
${GDCM_DATA_IMAGE_FILENAMES_GLOB_EXPR}
"${GDCM_DATA_ROOT}/*.DCM"
)
set(GDCM_DATA_DICOMDIR_FILENAMES_GLOB_EXPR
${GDCM_DATA_DICOMDIR_FILENAMES_GLOB_EXPR}
"${GDCM_DATA_ROOT}/DICOMDIR*"
)
endif()
# GLOB expression !
file(GLOB GDCM_DATA_IMAGE_FILENAMES_GLOB
${GDCM_DATA_IMAGE_FILENAMES_GLOB_EXPR}
)
# Same for DICOMDIR:
file(GLOB GDCM_DATA_DICOMDIR_FILENAMES_GLOB
${GDCM_DATA_DICOMDIR_FILENAMES_GLOB_EXPR}
)
set(GDCM_DATA_FILENAMES_GLOB
${GDCM_DATA_IMAGE_FILENAMES_GLOB}
${GDCM_DATA_DICOMDIR_FILENAMES_GLOB}
)
# List of images that are technically difficult to read
# Hopefully we will soon be able to read them
set(BLACK_LIST_READER
# grrrrrr do not handle swapping correctly (implicit dataset are such a pain)
LIBIDO-16-ACR_NEMA-Volume.dcm
# Papyrus:
PET-cardio-Multiframe-Papyrus.dcm
# No way to read this image:
ELSCINT1_LOSSLESS_RICE.dcm
# SignedShortLossless has never really been supported anyway:
SignedShortLosslessBug.dcm
# Would need to process ALL Pixel Data element when decompressing:
PET-GE-dicomwrite-PixelDataSQUNv3.dcm
# Toshiba US Private Data Storage 1.2.392.200036.9116.7.8.1.1.1
TOSHIBA_MDW_HEADER.dcm
# TODO, nasty:
PhilipsLosslessRice.dcm
# This file is incorrect
IM-0001-0066.dcm
# Problem with RLE
SIEMENS_GBS_III-16-ACR_NEMA_1.acr
SIEMENS_GBS_III-16-ACR_NEMA_1-ULis2Bytes.dcm
# TestImageChangeTransferSyntax1
MR-MONO2-12-angio-an1.acr
# Openjpeg / Part 2:
lena512_rot90.j2k.dcm
# Remove this one for now:
LengthOfItemLarger.dcm
# https://github.com/team-charls/charls/issues/16
JPEG_LS_InvalidEscapeSequence_COM_padding.dcm
# MITRA_CORNELL
MITRA_CORNELL.dcm
# FIXME
PET-GE-dicomwrite-PixelDataSQUN.dcm
)
if(NOT GDCM_USE_PVRG)
set(BLACK_LIST_READER
# The following should really fails according to JPEG spec, IJG is failing and even when forcing
# decompression using IJG output is different from PVRG...
# Apparently pvrg likes it this way...
# PHILIPS_Gyroscan-12-Jpeg_Extended_Process_2_4.dcm
${BLACK_LIST_READER}
PHILIPS_Gyroscan-12-Jpeg_Extended_Process_2_4.dcm
)
endif()
if(GDCM_WORDS_BIGENDIAN)
set(BLACK_LIST_READER
${BLACK_LIST_READER}
MR_Philips_Intera_PrivateSequenceExplicitVR_in_SQ_2001_e05f_item_wrong_lgt_use_NOSHADOWSEQ.dcm
MR_Philips_Intera_SwitchIndianess_noLgtSQItem_in_trueLgtSeq.dcm
PHILIPS_Intera-16-MONO2-Uncompress.dcm
SIEMENS_MAGNETOM-12-MONO2-GDCM12-VRUN.dcm
PICKER-16-MONO2-No_DicomV3_Preamble.dcm
)
endif()
if(NOT GDCM_SUPPORT_BROKEN_IMPLEMENTATION)
set(BLACK_LIST_READER
${BLACK_LIST_READER}
GE_GENESIS-16-MONO2-WrongLengthItem.dcm # can't read odd length
PHILIPS_GDCM12xBug2.dcm # odd length
KODAK-12-MONO1-Odd_Terminated_Sequence.dcmq # odd length
PrivateGEImplicitVRBigEndianTransferSyntax16Bits.dcm # odd length
PHILIPS_Gyroscan-8-MONO2-Odd_Sequence.dcm # odd length
BugGDCM2_UndefItemWrongVL.dcm # odd length
THERALYS-12-MONO2-Uncompressed-Even_Length_Tag.dcm
CT-SIEMENS-MissingPixelDataInIconSQ.dcm # odd length
00191113.dcm
MR_Philips_Intera_PrivateSequenceImplicitVR.dcm
PICKER-16-MONO2-Nested_icon.dcm
PHILIPS_GDCM12xBug.dcm # odd length
MR_Philips-Intera_BreaksNOSHADOW.dcm
NM_Kakadu44_SOTmarkerincons.dcm
MARCONI_MxTWin-12-MONO2-JpegLossless-ZeroLengthSQ.dcm
)
endif()
set(GDCM_DATA_FILENAMES)
set(GDCM_BLACK_LIST_READER_DATA_FILENAMES)
foreach(filename ${GDCM_DATA_FILENAMES_GLOB})
get_filename_component(filename_name ${filename} NAME)
string(REGEX MATCH ${filename_name} bad_dicom ${BLACK_LIST_READER})
if(NOT bad_dicom)
set(GDCM_DATA_FILENAMES "${GDCM_DATA_FILENAMES}\n\"${filename}\",")
else()
set(GDCM_BLACK_LIST_READER_DATA_FILENAMES "${GDCM_BLACK_LIST_READER_DATA_FILENAMES}\n\"${filename}\",")
endif()
endforeach()
# Populate GDCM_DATA_FILENAMES:
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/gdcmDataFileNames.cxx.in"
"${CMAKE_CURRENT_BINARY_DIR}/gdcmDataFileNames.cxx"
)
gdcm-3.0.22/Testing/Source/Data/gdcmSelectedTagsOffsetDataFiles.cxx 000664 001766 001770 00000024120 14517730450 027454 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http:/gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
/*
* See TestReaderSelectedTags
*/
#if 0
struct StreamOffset
{
const char *filename;
std::streamoff offset;
};
#endif
static const StreamOffset gdcmSelectedTagsOffsetDataFiles[] = {
{ "SC16BitsAllocated_8BitsStoredJ2K.dcm", 752},
{ "SC16BitsAllocated_8BitsStoredJPEG.dcm", 946},
{ "CT-MONO2-12-lomb-an2.acr",1222 },
{ "LIBIDO-8-ACR_NEMA-Lena_128_128.acr",174 },
{ "MR-MONO2-12-an2.acr",1858 },
{ "SIEMENS_SOMATOM-12-ACR_NEMA-ZeroLengthUs.acr",5056 },
{ "gdcm-ACR-LibIDO.acr",174 },
{ "gdcm-MR-SIEMENS-16-2.acr",6044 },
{ "libido1.0-vol.acr",162 },
{ "test.acr",174 },
{ "00191113.dcm",922 },
{ "012345.002.050.dcm",9592 },
{ "05115014-mr-siemens-avanto-syngo-with-palette-icone.dcm",41936 },
{ "05148044-mr-siemens-avanto-syngo.dcm",55872 },
{ "3E768EB7.dcm",3222 },
{ "ACUSON-24-YBR_FULL-RLE-b.dcm",2020 },
{ "ACUSON-24-YBR_FULL-RLE.dcm",1908 },
{ "ALOKA_SSD-8-MONO2-RLE-SQ.dcm",1386 },
{ "AMIInvalidPrivateDefinedLengthSQasUN.dcm",12732 },
{ "BugGDCM2_UndefItemWrongVL.dcm",9562 },
{ "CR-MONO1-10-chest.dcm",768 },
{ "CT-MONO2-16-ankle.dcm",1140 },
{ "CT-MONO2-16-brain.dcm",1668 },
{ "CT-MONO2-16-chest.dcm",1626 },
{ "CT-MONO2-16-ort.dcm",1666 },
{ "CT-MONO2-8-abdo.dcm",788 },
{ "CT-SIEMENS-Icone-With-PaletteColor.dcm",8150 },
{ "CT-SIEMENS-MissingPixelDataInIconSQ.dcm",20496 },
{ "CT_16b_signed-UsedBits13.dcm",2574 },
{ "DCMTK_JPEGExt_12Bits.dcm",784 },
{ "DMCPACS_ExplicitImplicit_BogusIOP.dcm",20018 },
{ "DX_GE_FALCON_SNOWY-VOI.dcm",104002 },
{ "DX_J2K_0Padding.dcm",1482 },
{ "D_CLUNIE_CT1_J2KI.dcm",6584 },
{ "D_CLUNIE_CT1_J2KR.dcm",6484 },
{ "D_CLUNIE_CT1_JLSL.dcm",6452 },
{ "D_CLUNIE_CT1_JLSN.dcm",6566 },
{ "D_CLUNIE_CT1_JPLL.dcm",6456 },
{ "D_CLUNIE_CT1_RLE.dcm",6390 },
{ "D_CLUNIE_CT2_JPLL.dcm",1744 },
{ "D_CLUNIE_CT2_RLE.dcm",1676 },
{ "D_CLUNIE_MR1_JPLL.dcm",1750 },
{ "D_CLUNIE_MR1_JPLY.dcm",1836 },
{ "D_CLUNIE_MR1_RLE.dcm",1682 },
{ "D_CLUNIE_MR2_JPLL.dcm",1946 },
{ "D_CLUNIE_MR2_JPLY.dcm",2034 },
{ "D_CLUNIE_MR2_RLE.dcm",1878 },
{ "D_CLUNIE_MR3_JPLL.dcm",9570 },
{ "D_CLUNIE_MR3_JPLY.dcm",9658 },
{ "D_CLUNIE_MR3_RLE.dcm",9504 },
{ "D_CLUNIE_MR4_JPLL.dcm",1968 },
{ "D_CLUNIE_MR4_JPLY.dcm",2056 },
{ "D_CLUNIE_MR4_RLE.dcm",1900 },
{ "D_CLUNIE_NM1_JPLL.dcm",2890 },
{ "D_CLUNIE_NM1_JPLY.dcm",2978 },
{ "D_CLUNIE_NM1_RLE.dcm",2826 },
{ "D_CLUNIE_RG1_JPLL.dcm",1858 },
{ "D_CLUNIE_RG1_RLE.dcm",1794 },
{ "D_CLUNIE_RG2_JPLL.dcm",1444 },
{ "D_CLUNIE_RG2_JPLY.dcm",1532 },
{ "D_CLUNIE_RG2_RLE.dcm",1368 },
{ "D_CLUNIE_RG3_JPLL.dcm",1514 },
{ "D_CLUNIE_RG3_JPLY.dcm",1602 },
{ "D_CLUNIE_RG3_RLE.dcm",1432 },
{ "D_CLUNIE_SC1_JPLY.dcm",1340 },
{ "D_CLUNIE_SC1_RLE.dcm",1176 },
{ "D_CLUNIE_US1_RLE.dcm",1306 },
{ "D_CLUNIE_VL1_RLE.dcm",1188 },
{ "D_CLUNIE_VL2_RLE.dcm",1186 },
{ "D_CLUNIE_VL3_RLE.dcm",1198 },
{ "D_CLUNIE_VL4_RLE.dcm",1180 },
{ "D_CLUNIE_VL6_RLE.dcm",1198 },
{ "D_CLUNIE_XA1_JPLL.dcm",1192 },
{ "D_CLUNIE_XA1_JPLY.dcm",1280 },
{ "D_CLUNIE_XA1_RLE.dcm",1116 },
{ "DermaColorLossLess.dcm",928 },
{ "ELSCINT1_JP2vsJ2K.dcm",1808 },
{ "ELSCINT1_PMSCT_RLE1.dcm",67912 },
{ "ExplicitVRforPublicElementsImplicitVRforShadowElements.dcm",9534 },
{ "FUJI-10-MONO1-ACR_NEMA_2.dcm",854 },
{ "GDCMJ2K_TextGBR.dcm",758 },
{ "GE_CT_With_Private_compressed-icon.dcm",10798 },
{ "GE_DLX-8-MONO2-Multiframe-Jpeg_Lossless.dcm",14126 },
{ "GE_DLX-8-MONO2-Multiframe.dcm",4976 },
{ "GE_DLX-8-MONO2-PrivateSyntax.dcm",2912 },
{ "GE_GENESIS-16-MONO2-Uncompressed-UnusualVR.dcm",9654 },
{ "GE_GENESIS-16-MONO2-WrongLengthItem.dcm",1922 },
{ "GE_LOGIQBook-8-RGB-HugePreview.dcm",935596 },
{ "GE_MR_0025xx1bProtocolDataBlock.dcm",11870 },
{ "GE_RHAPSODE-16-MONO2-JPEG-Fragments.dcm",6456 },
{ "IM-0001-0066.CommandTag00.dcm",3042 },
{ "ITK_GDCM124_MultiframeSecondaryCaptureInvalid.dcm",1132 },
{ "JDDICOM_Sample2-dcmdjpeg.dcm",836 },
{ "JDDICOM_Sample2.dcm",822 },
{ "JPEGDefinedLengthSequenceOfFragments.dcm",2862 },
{ "JPEG_LossyYBR.dcm",2366 },
{ "KODAK-12-MONO1-Odd_Terminated_Sequence.dcm",9126 },
{ "KODAK_CompressedIcon.dcm",8634 },
{ "LEADTOOLS_FLOWERS-16-MONO2-JpegLossless.dcm",1932 },
{ "LEADTOOLS_FLOWERS-16-MONO2-RLE.dcm",1930 },
{ "LEADTOOLS_FLOWERS-16-MONO2-Uncompressed.dcm",1930 },
{ "LEADTOOLS_FLOWERS-24-RGB-JpegLossless.dcm",1924 },
{ "LEADTOOLS_FLOWERS-24-RGB-JpegLossy.dcm",1924 },
{ "LEADTOOLS_FLOWERS-24-RGB-Uncompressed.dcm",1922 },
{ "LEADTOOLS_FLOWERS-8-MONO2-JpegLossy.dcm",1932 },
{ "LEADTOOLS_FLOWERS-8-MONO2-RLE.dcm",1930 },
{ "LEADTOOLS_FLOWERS-8-MONO2-Uncompressed.dcm",1930 },
{ "LEADTOOLS_FLOWERS-8-PAL-RLE.dcm",3526 },
{ "LEADTOOLS_FLOWERS-8-PAL-Uncompressed.dcm",3526 },
{ "LIBIDO-24-ACR_NEMA-Rectangle.dcm",174 },
{ "LJPEG_BuginGDCM12.dcm",2236 },
{ "MARCONI_MxTWin-12-MONO2-JpegLossless-ZeroLengthSQ.dcm",1904 },
{ "MAROTECH_CT_JP2Lossy.dcm",33844 },
{ "MEDILABInvalidCP246_EVRLESQasUN.dcm",19162 },
{ "MR-Brucker-CineTagging-NonSquarePixels.dcm",1530 },
{ "MR-MONO2-12-shoulder.dcm",1568 },
{ "MR-MONO2-16-head.dcm",1796 },
{ "MR-MONO2-8-16x-heart.dcm",908 },
{ "MR-SIEMENS-DICOM-WithOverlays-extracted-overlays.dcm",42600 },
{ "MR-SIEMENS-DICOM-WithOverlays.dcm",42404 },
{ "MR16BitsAllocated_8BitsStored.dcm",928 },
{ "MR_ELSCINT1_00e1_1042_SQ_feff_00e0_Item.dcm",7696 },
{ "MR_GE_with_Private_Compressed_Icon_0009_1110.dcm",20700 },
{ "MR_Philips-Intera_BreaksNOSHADOW.dcm",7618 },
{ "MR_Philips_Intera_No_PrivateSequenceImplicitVR.dcm",9500 },
{ "MR_Philips_Intera_PrivateSequenceExplicitVR_in_SQ_2001_e05f_item_wrong_lgt_use_NOSHADOWSEQ.dcm",7512 },
{ "MR_Philips_Intera_PrivateSequenceImplicitVR.dcm",7018 },
{ "MR_Philips_Intera_SwitchIndianess_noLgtSQItem_in_trueLgtSeq.dcm",9264 },
{ "MR_SIEMENS_forceLoad29-1010_29-1020.dcm",60556 },
{ "MR_Spectroscopy_SIEMENS_OF.dcm",2102344 },
{ "NM-MONO2-16-13x-heart.dcm",1222 },
{ "NM-PAL-16-PixRep1.dcm", 4456},
{ "NM_Kakadu44_SOTmarkerincons.dcm",1564 },
{ "OT-MONO2-8-a7.dcm",430 },
{ "OT-PAL-8-face.dcm",1646 },
{ "OsirixFake16BitsStoredFakeSpacing.dcm",1306 },
{ "PHILIPS_Brilliance_ExtraBytesInOverlay.dcm",34538 },
{ "PHILIPS_GDCM12xBug.dcm",9330 },
{ "PHILIPS_GDCM12xBug2.dcm",9662 },
{ "PHILIPS_Gyroscan-12-Jpeg_Extended_Process_2_4.dcm",5944 },
{ "PHILIPS_Gyroscan-12-MONO2-Jpeg_Lossless.dcm",15366 },
{ "PHILIPS_Gyroscan-8-MONO2-Odd_Sequence.dcm",6576 },
{ "PHILIPS_Intera-16-MONO2-Uncompress.dcm",9264 },
{ "PICKER-16-MONO2-Nested_icon.dcm",18220 },
{ "PICKER-16-MONO2-No_DicomV3_Preamble.dcm",1398 },
{ "PhilipsInteraSeqTermInvLen.dcm",7440 },
{ "PrivateGEImplicitVRBigEndianTransferSyntax16Bits.dcm",14964 },
{ "RadBWLossLess.dcm",930 },
{ "SIEMENS-12-Jpeg_Process_2_4-Lossy-a.dcm",3032 },
{ "SIEMENS-MR-RGB-16Bits.dcm",49840 },
{ "SIEMENS_CSA2.dcm",104340 },
{ "SIEMENS_ImageLocationUN.dcm",6336 },
{ "SIEMENS_MAGNETOM-12-ACR_NEMA_2-Modern.dcm",6044 },
{ "SIEMENS_MAGNETOM-12-MONO2-FileSeq0.dcm",6422 },
{ "SIEMENS_MAGNETOM-12-MONO2-FileSeq1.dcm",6422 },
{ "SIEMENS_MAGNETOM-12-MONO2-FileSeq2.dcm",6422 },
{ "SIEMENS_MAGNETOM-12-MONO2-FileSeq3.dcm",6422 },
{ "SIEMENS_MAGNETOM-12-MONO2-GDCM12-VRUN.dcm",5158 },
{ "SIEMENS_MAGNETOM-12-MONO2-Uncompressed.dcm",5148 },
{ "SIEMENS_MAGNETOM-12-MONO2-VRUN.dcm",5290 },
{ "SIEMENS_MOSAIC_12BitsStored-16BitsJPEG.dcm",105714 },
{ "SIEMENS_Sonata-12-MONO2-SQ.dcm",51792 },
{ "SIEMENS_Sonata-16-MONO2-Value_Multiplicity.dcm",25674 },
{ "SignedShortLosslessBug.dcm",1772 },
{ "TG18-CH-2k-01.dcm",2300 },
{ "THERALYS-12-MONO2-Uncompressed-Even_Length_Tag.dcm",1831 },
{ "TOSHIBA_J2K_OpenJPEGv2Regression.dcm",2350 },
{ "TOSHIBA_J2K_SIZ0_PixRep1.dcm",2334 },
{ "TOSHIBA_J2K_SIZ1_PixRep0.dcm",2350 },
{ "TOSHIBA_MRT150-16-MONO2-ACR_NEMA_2.dcm",1122 },
{ "TheralysGDCM120Bug.dcm",8438 },
{ "US-GE-4AICL142.dcm",14060 },
{ "US-IRAD-NoPreambleStartWith0003.dcm",3322 },
{ "US-IRAD-NoPreambleStartWith0005.dcm",2482 },
{ "US-MONO2-8-8x-execho.dcm",964 },
{ "US-PAL-8-10x-echo.dcm",2416 },
{ "US-RGB-8-epicard.dcm",1000 },
{ "US-RGB-8-esopecho.dcm",892 },
{ "UnexpectedSequenceDelimiterInFixedLengthSequence.dcm",4178 },
{ "XA-MONO2-8-12x-catheter.dcm",994 },
{ "fffc0000UN.dcm",1142 },
{ "gdcm-CR-DCMTK-16-NonSamplePerPix.dcm",728 },
{ "gdcm-JPEG-Extended.dcm",2934 },
{ "gdcm-JPEG-LossLess3a.dcm",2528 },
{ "gdcm-JPEG-LossLessThoravision.dcm",3132 },
{ "gdcm-MR-PHILIPS-16-Multi-Seq.dcm",35834 },
{ "gdcm-MR-PHILIPS-16-NonSquarePixels.dcm",4998 },
{ "gdcm-US-ALOKA-16.dcm",258732 },
{ "rle16loo.dcm",394214 },
{ "rle16sti.dcm",394158 },
{ "simpleImageWithIcon.dcm",17466 },
{ "undefined_length_un_vr.dcm",9156 },
{ "JPEGInvalidSecondFrag.dcm",4788 },
{ "lena512_rot90.j2k.dcm",756 },
{ "ELSCINT1_PMSCT_RLE1_priv.dcm",298002 },
{ "00191113.dcm",922 },
{ "SIEMENS_SYNGO-12-MONO2-LUTWrongLength512.dcm", 48714 },
{ "JPEGNote_empty.dcm", 704 },
{ "JPEGLS_CharLS_10742.dcm", 748 },
{ "JPEGLosslessYBR_FULL_422.dcm", 802 },
{ "JPEGNote_missing.dcm", 596 },
{ "JPEGNote_bogus.dcm", 722 },
{ "RLEDebianBug816607Orig.dcm", 768 },
{ "IllegalGroup2ImplicitTS.dcm", 2264 },
{ "JPEG_LS_InvalidEscapeSequence_COM_padding.dcm", 752 },
{ "LengthOfItemLarger.dcm", 12748 },
{ "GE_MR_0025xx1bProtocolDataBlockXML.dcm",6462 },
{ "EmptyIcon_Bug417.dcm",4470},
{ "EnhancedWithIPPPerFrameIOPShared.dcm",23212},
{ "FUJI-ffff-MONO1-J2K.dcm",2040},
{ "JPEGLosslessSeNonZero.dcm",748},
{ "US-YBR_FULL_422-EVRLE.dcm",1542},
{ "Osirix10vs8BitsStored.dcm",73966},
{ "Bug_Siemens_PrivateIconNoItem.dcm",12966},
{ "HardcopyColor_YBR_RCT_J2K_PC1.dcm",2614},
{ "PET-GE-dicomwrite-PixelDataSQUNv2.dcm",7706},
{ "MEDILABValidCP246_EVRLESQasOB.dcm",18996},
{ "dicomdir_Acusson_WithPrivate_WithSR",3826 },
{ "dicomdir_Pms_WithVisit_WithPrivate_WithStudyComponents",37218 },
{ "dicomdir_Pms_With_heavy_embedded_sequence",3003414 },
{ "dicomdir_With_embedded_icons",7125212 },
{ "DICOMDIR",1112434 },
{ "DICOMDIR-Philips-EasyVision-4200-Entries",1297194 },
{ "DICOMDIR_MR_B_VA12A",14853880 },
/* Stopping condition */
{ nullptr ,0 },
};
gdcm-3.0.22/Testing/Source/Data/privatekey.pem 000664 001766 001770 00000003217 14517730450 023474 0 ustar 00mmalaterre mmalaterre 000000 000000 -----BEGIN RSA PRIVATE KEY-----
MIIEpAIBAAKCAQEA4k5GEgO9mI5K2UuywuGxcO4xJdygQlpvL2IS9XEbXOWBEwJZ
x1tccfzCa929DCijlJE6/f5KBzDNPdLpPt3eyUKB3n7mOos7ATWEFCZgE7RWGRBh
IfN2R9LDkLT2eaUhXDzsk7L1qmKPP9nSdAXoUB6sj0EmHrQQWIPEZwGcPcvMUhcU
pjD/hnmCX6DAWHVCvE7vhbHntNYFwu1Bmau5ZY6Ywk5lQ/ZTfEYcRD1ZmUB2Wkzv
4InvRc1zYbTBpL/Lkft1B9/A7+LzJJRHoNvHaMN5pRF2qFyZW3sb+bh8z8SC0oJN
zIbrWZvWM9TEnQ8P+GCw4y68juSvlcLcBsoxCQIDAQABAoIBAQDW1ogewf5TvYHB
F+P0rl3NX9K4puJdG41B5lEpQN9BKX+HlEu2vjzc2Z+Y10CJMmtYtybRyX5tpR6y
+m8Dh43gcorntoDKQzMYyr1Ag83h5ul1kd8kZAR92tBdp+31PZaWAiB1dwdRYY+s
hhUMoC8TIIug07BkpXx/C1iAkT7KSc4D2djWFbEOoAENykycM1Q+0dgumkZAO1C4
ZDjW4y6DBfbdS8+edgr/Qa3LbeF1uB7d23s4slCVs5h+J0IXVe4/LjrpRfXWUCQM
1YJDY3PVgZOhhnrhfUb0e0gMFAKinNPo7L4d5ZTp3pR5d5Rex1luhbv+E/ZTaLBL
RZQWWTgBAoGBAPH5ob3RxQa7e+a1HkbfmP/vW5vBr1aa2hxqjU3UnKR6azoKCBgf
+LWbkSAZ1dLhjgsL6M3585WvHDzJJuhLX+Rcd38D+eFz+YjOi6o721iiFJ4lNQPj
qymWPwDiia+g1diVfo+3I/l9UPvaQdwkGqFtl6Waty1BSOIEC8/WXhlhAoGBAO9s
JMVEvhrP26ve3iPcEwBD7CfAxiSgtZAOt8VxIq2p2BzWnRWysrC3vP8CKfuxG1/b
9cFehCQp0Q1PYRzvR/tmP3vcMh0e/mg1eMTLDjp3VFRTvi3OXsdbXNcV4eDfq0GA
/Jp0s1nRBSxY7obQEoSBxPOyyn5zssOlC+D8MXCpAoGBAIegEJzxP4q3eQnlyHOX
Dg2dnm4d0GYtY0T8H/lYyveRuhoM116WRPOdn2krseKCE/hzE2inyXTDcoNLh6g5
3ySDA2NI2j0YoOuiQTwIUrhKGF5Ponhsmloz4VpgnyW2c0Xy/L4Wu24yZDrVqYZ3
IgoLAC2NG1CdP/mWpPw4PgPhAoGAH4cIGIoC1pkEfk9sxSAXyHMpR9rUvMIE5qFp
hbBuNpwk/zcrnE3ZxfeMBbCNQr2Bs0/NvtbpY7G1+6C2Uw8XVX2TYoYOe1M3gRV5
f8CVcRGBo1EbvABu7qWTRid1hR0u+gM4QEaZz3v8yGg1kL8ZkSVdgBHNJHWr1qOH
Ous6v3ECgYBVMV9OpGZfqH9VFX+SLcKnGpL9DsrikDKwAvX0xS6VZJd8nqwpMEJW
KtiKZqvrHaIlRSGJ6HLNP1wYd4YzHhQg2Y/AWaw1BioUa2ZmI4OS7oDJlTx0qw69
RBbyWY5Cys+DS17xTjp/bqX+DTZESpWuqNuOIQftE/8KETgh4VD9NQ==
-----END RSA PRIVATE KEY-----
gdcm-3.0.22/Testing/Source/Data/gdcmSelectedPrivateGroupOffsetDataFiles.cxx 000664 001766 001770 00000023570 14517730450 031215 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http:/gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
/*
* See TestReaderSelectedPrivateGroup
*/
#if 0
struct StreamOffset
{
const char *filename;
std::streamoff offset;
};
#endif
static const StreamOffset gdcmSelectedPrivateGroupOffsetDataFiles[] = {
{ "gdcm-ACR-LibIDO.acr",50 },
{ "test.acr",50 },
{ "libido1.0-vol.acr",50 },
{ "gdcm-MR-SIEMENS-16-2.acr",686 },
{ "SIEMENS_SOMATOM-12-ACR_NEMA-ZeroLengthUs.acr",686 },
{ "MR-MONO2-12-an2.acr",546 },
{ "LIBIDO-8-ACR_NEMA-Lena_128_128.acr",50 },
{ "CT-MONO2-12-lomb-an2.acr",366 },
{ "D_CLUNIE_CT1_J2KR.dcm",1178 },
{ "TOSHIBA_J2K_SIZ0_PixRep1.dcm",746 },
{ "ExplicitVRforPublicElementsImplicitVRforShadowElements.dcm",1796 },
{ "LJPEG_BuginGDCM12.dcm",886 },
{ "GE_MR_0025xx1bProtocolDataBlock.dcm",1146 },
{ "LEADTOOLS_FLOWERS-8-MONO2-RLE.dcm",848 },
{ "SIEMENS_ImageLocationUN.dcm",960 },
{ "JPEGDefinedLengthSequenceOfFragments.dcm",1496 },
{ "TOSHIBA_J2K_OpenJPEGv2Regression.dcm",748 },
{ "MR-SIEMENS-DICOM-WithOverlays.dcm",1042 },
{ "GDCMJ2K_TextGBR.dcm",534 },
{ "rle16loo.dcm",524 },
{ "GE_DLX-8-MONO2-Multiframe.dcm",780 },
{ "SC16BitsAllocated_8BitsStoredJ2K.dcm",534 },
{ "MR-MONO2-12-shoulder.dcm",674 },
{ "GE_DLX-8-MONO2-Multiframe-Jpeg_Lossless.dcm",794 },
{ "SIEMENS_MOSAIC_12BitsStored-16BitsJPEG.dcm",1384 },
{ "NM-MONO2-16-13x-heart.dcm",578 },
{ "LEADTOOLS_FLOWERS-8-MONO2-Uncompressed.dcm",848 },
{ "CT-MONO2-16-chest.dcm",838 },
{ "D_CLUNIE_MR4_JPLY.dcm",1028 },
{ "D_CLUNIE_SC1_JPLY.dcm",964 },
{ "MR_Philips_Intera_PrivateSequenceExplicitVR_in_SQ_2001_e05f_item_wrong_lgt_use_NOSHADOWSEQ.dcm",1302 },
{ "D_CLUNIE_VL6_RLE.dcm",866 },
{ "DX_J2K_0Padding.dcm",746 },
{ "D_CLUNIE_XA1_RLE.dcm",800 },
{ "PHILIPS_Intera-16-MONO2-Uncompress.dcm",1622 },
{ "US-RGB-8-esopecho.dcm",598 },
{ "GE_GENESIS-16-MONO2-WrongLengthItem.dcm",760 },
{ "D_CLUNIE_MR3_JPLL.dcm",1200 },
{ "SIEMENS-12-Jpeg_Process_2_4-Lossy-a.dcm",1252 },
{ "D_CLUNIE_MR1_RLE.dcm",908 },
{ "SIEMENS_CSA2.dcm",1260 },
{ "gdcm-MR-PHILIPS-16-Multi-Seq.dcm",1354 },
{ "GE_DLX-8-MONO2-PrivateSyntax.dcm",770 },
{ "D_CLUNIE_MR2_JPLY.dcm",1030 },
{ "DX_GE_FALCON_SNOWY-VOI.dcm",1152 },
{ "AMIInvalidPrivateDefinedLengthSQasUN.dcm",1028 },
{ "SC16BitsAllocated_8BitsStoredJPEG.dcm",606 },
{ "OT-PAL-8-face.dcm",140 },
{ "LEADTOOLS_FLOWERS-16-MONO2-RLE.dcm",848 },
{ "TOSHIBA_J2K_SIZ1_PixRep0.dcm",762 },
{ "D_CLUNIE_RG2_JPLL.dcm",1014 },
{ "SIEMENS_MAGNETOM-12-MONO2-FileSeq1.dcm",968 },
{ "MR_ELSCINT1_00e1_1042_SQ_feff_00e0_Item.dcm",774 },
{ "PHILIPS_GDCM12xBug2.dcm",1184 },
{ "PICKER-16-MONO2-No_DicomV3_Preamble.dcm",496 },
{ "MR_Spectroscopy_SIEMENS_OF.dcm",1372 },
{ "ELSCINT1_JP2vsJ2K.dcm",680 },
{ "US-PAL-8-10x-echo.dcm",496 },
{ "OT-MONO2-8-a7.dcm",186 },
{ "SIEMENS_MAGNETOM-12-MONO2-FileSeq0.dcm",968 },
{ "D_CLUNIE_NM1_JPLL.dcm",1406 },
{ "D_CLUNIE_RG2_JPLY.dcm",1100 },
{ "KODAK-12-MONO1-Odd_Terminated_Sequence.dcm",310 },
{ "CT-MONO2-16-ort.dcm",784 },
{ "D_CLUNIE_VL1_RLE.dcm",856 },
{ "NM-PAL-16-PixRep1.dcm",820 },
{ "ELSCINT1_PMSCT_RLE1.dcm",778 },
{ "GE_GENESIS-16-MONO2-Uncompressed-UnusualVR.dcm",1012 },
{ "D_CLUNIE_MR2_JPLL.dcm",944 },
{ "GE_CT_With_Private_compressed-icon.dcm",1112 },
{ "LEADTOOLS_FLOWERS-16-MONO2-JpegLossless.dcm",850 },
{ "MR_GE_with_Private_Compressed_Icon_0009_1110.dcm",1258 },
{ "TOSHIBA_MRT150-16-MONO2-ACR_NEMA_2.dcm",400 },
{ "simpleImageWithIcon.dcm",616 },
{ "D_CLUNIE_CT1_JLSL.dcm",1162 },
{ "US-IRAD-NoPreambleStartWith0005.dcm",684 },
{ "TheralysGDCM120Bug.dcm",1964 },
{ "SIEMENS_Sonata-16-MONO2-Value_Multiplicity.dcm",1152 },
{ "D_CLUNIE_NM1_RLE.dcm",1366 },
{ "CR-MONO1-10-chest.dcm",298 },
{ "ACUSON-24-YBR_FULL-RLE-b.dcm",822 },
{ "TG18-CH-2k-01.dcm",1294 },
{ "US-MONO2-8-8x-execho.dcm",630 },
{ "GE_RHAPSODE-16-MONO2-JPEG-Fragments.dcm",1164 },
{ "PrivateGEImplicitVRBigEndianTransferSyntax16Bits.dcm",753 },
{ "MR_SIEMENS_forceLoad29-1010_29-1020.dcm",838 },
{ "LEADTOOLS_FLOWERS-16-MONO2-Uncompressed.dcm",848 },
{ "ACUSON-24-YBR_FULL-RLE.dcm",710 },
{ "D_CLUNIE_MR1_JPLY.dcm",1036 },
{ "D_CLUNIE_VL4_RLE.dcm",848 },
{ "MR-MONO2-8-16x-heart.dcm",536 },
{ "PHILIPS_Gyroscan-12-MONO2-Jpeg_Lossless.dcm",1060 },
{ "D_CLUNIE_MR4_JPLL.dcm",942 },
{ "LEADTOOLS_FLOWERS-24-RGB-JpegLossy.dcm",850 },
{ "D_CLUNIE_CT1_J2KI.dcm",1270 },
{ "US-GE-4AICL142.dcm",688 },
{ "CT-MONO2-16-ankle.dcm",750 },
{ "LEADTOOLS_FLOWERS-24-RGB-JpegLossless.dcm",850 },
{ "SIEMENS_MAGNETOM-12-MONO2-FileSeq2.dcm",968 },
{ "RadBWLossLess.dcm",542 },
{ "DermaColorLossLess.dcm",542 },
{ "D_CLUNIE_MR2_RLE.dcm",900 },
{ "CT-SIEMENS-Icone-With-PaletteColor.dcm",1138 },
{ "fffc0000UN.dcm",594 },
{ "PHILIPS_Gyroscan-8-MONO2-Odd_Sequence.dcm",1340 },
{ "BugGDCM2_UndefItemWrongVL.dcm",1466 },
{ "THERALYS-12-MONO2-Uncompressed-Even_Length_Tag.dcm",753 },
{ "SIEMENS_MAGNETOM-12-MONO2-GDCM12-VRUN.dcm",1014 },
{ "05148044-mr-siemens-avanto-syngo.dcm",1174 },
{ "gdcm-JPEG-LossLessThoravision.dcm",954 },
{ "D_CLUNIE_CT1_JPLL.dcm",1164 },
{ "MR16BitsAllocated_8BitsStored.dcm",536 },
{ "gdcm-CR-DCMTK-16-NonSamplePerPix.dcm",420 },
{ "JDDICOM_Sample2-dcmdjpeg.dcm",464 },
{ "SIEMENS_MAGNETOM-12-MONO2-FileSeq3.dcm",968 },
{ "gdcm-JPEG-Extended.dcm",1332 },
{ "CT-SIEMENS-MissingPixelDataInIconSQ.dcm",922 },
{ "LEADTOOLS_FLOWERS-8-MONO2-JpegLossy.dcm",850 },
{ "CT-MONO2-16-brain.dcm",946 },
{ "IM-0001-0066.CommandTag00.dcm",1472 },
{ "SIEMENS_MAGNETOM-12-MONO2-VRUN.dcm",646 },
{ "MAROTECH_CT_JP2Lossy.dcm",1244 },
{ "MR-SIEMENS-DICOM-WithOverlays-extracted-overlays.dcm",1236 },
{ "D_CLUNIE_MR1_JPLL.dcm",952 },
{ "D_CLUNIE_MR4_RLE.dcm",898 },
{ "MEDILABInvalidCP246_EVRLESQasUN.dcm",1182 },
{ "DCMTK_JPEGExt_12Bits.dcm",498 },
{ "D_CLUNIE_RG2_RLE.dcm",966 },
{ "05115014-mr-siemens-avanto-syngo-with-palette-icone.dcm",1026 },
{ "MR-Brucker-CineTagging-NonSquarePixels.dcm",652 },
{ "ITK_GDCM124_MultiframeSecondaryCaptureInvalid.dcm",590 },
{ "D_CLUNIE_RG3_JPLL.dcm",988 },
{ "00191113.dcm",536 },
{ "PhilipsInteraSeqTermInvLen.dcm",922 },
{ "MR_Philips_Intera_PrivateSequenceImplicitVR.dcm",1528 },
{ "gdcm-JPEG-LossLess3a.dcm",1022 },
{ "PHILIPS_Brilliance_ExtraBytesInOverlay.dcm",834 },
{ "D_CLUNIE_RG3_JPLY.dcm",1074 },
{ "PICKER-16-MONO2-Nested_icon.dcm",13296 },
{ "LIBIDO-24-ACR_NEMA-Rectangle.dcm",50 },
{ "SignedShortLosslessBug.dcm",794 },
{ "LEADTOOLS_FLOWERS-8-PAL-RLE.dcm",848 },
{ "MR_Philips-Intera_BreaksNOSHADOW.dcm",1382 },
{ "US-RGB-8-epicard.dcm",668 },
{ "SIEMENS_MAGNETOM-12-MONO2-Uncompressed.dcm",962 },
{ "D_CLUNIE_VL2_RLE.dcm",854 },
{ "3E768EB7.dcm",1282 },
{ "012345.002.050.dcm",964 },
{ "D_CLUNIE_CT1_JLSN.dcm",1260 },
{ "PHILIPS_GDCM12xBug.dcm",1566 },
{ "OsirixFake16BitsStoredFakeSpacing.dcm",664 },
{ "CT_16b_signed-UsedBits13.dcm",1724 },
{ "D_CLUNIE_CT2_RLE.dcm",922 },
{ "LEADTOOLS_FLOWERS-8-PAL-Uncompressed.dcm",848 },
{ "UnexpectedSequenceDelimiterInFixedLengthSequence.dcm",1310 },
{ "rle16sti.dcm",520 },
{ "D_CLUNIE_NM1_JPLY.dcm",1492 },
{ "JDDICOM_Sample2.dcm",450 },
{ "D_CLUNIE_RG1_RLE.dcm",1044 },
{ "DMCPACS_ExplicitImplicit_BogusIOP.dcm",538 },
{ "SIEMENS_Sonata-12-MONO2-SQ.dcm",1228 },
{ "D_CLUNIE_XA1_JPLL.dcm",848 },
{ "NM_Kakadu44_SOTmarkerincons.dcm",874 },
{ "JPEG_LossyYBR.dcm",1142 },
{ "gdcm-MR-PHILIPS-16-NonSquarePixels.dcm",772 },
{ "D_CLUNIE_SC1_RLE.dcm",830 },
{ "SIEMENS-MR-RGB-16Bits.dcm",1466 },
{ "JPEGInvalidSecondFrag.dcm",1394 },
{ "MR_Philips_Intera_No_PrivateSequenceImplicitVR.dcm",1632 },
{ "MARCONI_MxTWin-12-MONO2-JpegLossless-ZeroLengthSQ.dcm",626 },
{ "SIEMENS_MAGNETOM-12-ACR_NEMA_2-Modern.dcm",686 },
{ "LEADTOOLS_FLOWERS-24-RGB-Uncompressed.dcm",848 },
{ "MR_Philips_Intera_SwitchIndianess_noLgtSQItem_in_trueLgtSeq.dcm",1622 },
{ "MR-MONO2-16-head.dcm",752 },
{ "D_CLUNIE_XA1_JPLY.dcm",934 },
{ "D_CLUNIE_CT2_JPLL.dcm",966 },
{ "D_CLUNIE_RG3_RLE.dcm",934 },
{ "ALOKA_SSD-8-MONO2-RLE-SQ.dcm",612 },
{ "GE_LOGIQBook-8-RGB-HugePreview.dcm",742 },
{ "gdcm-US-ALOKA-16.dcm",702 },
{ "D_CLUNIE_US1_RLE.dcm",918 },
{ "undefined_length_un_vr.dcm",1434 },
{ "D_CLUNIE_MR3_JPLY.dcm",1286 },
{ "D_CLUNIE_VL3_RLE.dcm",866 },
{ "US-IRAD-NoPreambleStartWith0003.dcm",1504 },
{ "CT-MONO2-8-abdo.dcm",422 },
{ "FUJI-10-MONO1-ACR_NEMA_2.dcm",312 },
{ "D_CLUNIE_MR3_RLE.dcm",1158 },
{ "D_CLUNIE_CT1_RLE.dcm",1122 },
{ "KODAK_CompressedIcon.dcm",890 },
{ "D_CLUNIE_RG1_JPLL.dcm",1084 },
{ "XA-MONO2-8-12x-catheter.dcm",644 },
{ "PHILIPS_Gyroscan-12-Jpeg_Extended_Process_2_4.dcm",1314},
{ "SIEMENS_SYNGO-12-MONO2-LUTWrongLength512.dcm", 1596 },
{ "00191113.dcm",536 },
{ "JPEGNote_empty.dcm", 482 },
{ "JPEGLS_CharLS_10742.dcm", 532 },
{ "JPEGLosslessYBR_FULL_422.dcm", 534 },
{ "JPEGNote_missing.dcm", 406 },
{ "JPEGNote_bogus.dcm", 482 },
{ "RLEDebianBug816607Orig.dcm", 534 },
{ "IllegalGroup2ImplicitTS.dcm", 1088 },
{ "JPEG_LS_InvalidEscapeSequence_COM_padding.dcm", 534 },
{ "LengthOfItemLarger.dcm", 1044 },
{ "GE_MR_0025xx1bProtocolDataBlockXML.dcm",1358},
{ "EmptyIcon_Bug417.dcm",1000},
{ "EnhancedWithIPPPerFrameIOPShared.dcm",772},
{ "FUJI-ffff-MONO1-J2K.dcm",982},
{ "JPEGLosslessSeNonZero.dcm",530},
{ "US-YBR_FULL_422-EVRLE.dcm",744},
{ "Osirix10vs8BitsStored.dcm",1512},
{ "Bug_Siemens_PrivateIconNoItem.dcm",1360},
{ "HardcopyColor_YBR_RCT_J2K_PC1.dcm",1284},
{ "PET-GE-dicomwrite-PixelDataSQUNv2.dcm",4620},
{ "MEDILABValidCP246_EVRLESQasOB.dcm",1148},
{ "dicomdir_With_embedded_icons",7125212 },
{ "dicomdir_Pms_WithVisit_WithPrivate_WithStudyComponents",37218 },
{ "dicomdir_Acusson_WithPrivate_WithSR",3826 },
{ "dicomdir_Pms_With_heavy_embedded_sequence",3003414 },
{ "DICOMDIR-Philips-EasyVision-4200-Entries",1297194 },
{ "DICOMDIR",1112434 },
{ "DICOMDIR_MR_B_VA12A",14853880 },
/* Stopping condition */
{ nullptr ,0 },
};
gdcm-3.0.22/Testing/Source/Data/NativeDICOM.rng 000664 001766 001770 00000012627 14517730450 023325 0 ustar 00mmalaterre mmalaterre 000000 000000
8
8
[0-9A-F]{8}
AE
AS
AT
CS
DA
DS
DT
FL
FD
IS
LO
LT
OB
OF
OW
PN
SH
SL
SQ
SS
ST
TM
UI
UL
UN
US
UT
gdcm-3.0.22/Testing/Source/Data/QIDO-RS_examplesup166.json 000664 001766 001770 00000013426 14517730450 025262 0 ustar 00mmalaterre mmalaterre 000000 000000 // The following example is a QIDO-RS SearchForStudies response consisting
// of two matching studies, corresponding to the example QIDO-RS request:
// GET http://qido.nema.org/studies?PatientID=12345&includefield=all&limit=2
[
{ // Result 1
"SpecificCharacterSet": {
"Tag": "00080005",
"VR": "CS",
"Value": [ "ISO_IR192" ]
},
"StudyDate": {
"Tag": "00080020",
"VR": "DT",
"Value": [ "20130409" ]
},
"StudyTime": {
"Tag": "00080030",
"VR": "TM",
"Value": [ "131600.0000" ]
},
"AccessionNumber": {
"Tag": "00080050",
"VR": "SH",
"Value": [ "11235813" ]
},
"InstanceAvailability": {
"Tag": "00080056",
"VR": "CS",
"Value": [ "ONLINE" ]
},
"ModalitiesInStudy": {
"Tag": "00080061",
"VR": "CS",
"Value": [
"CT",
"PET"
]
},
"ReferringPhysiciansName": {
"Tag": "00080090",
"VR": "PN",
"PersonName": [
{
"SingleByte": "^Bob^^Dr."
}
]
},
"00090010": {
"Tag": "00090010",
"VR": "LO",
"Value": [ "Vendor A" ]
},
"00091002": {
"Tag": "00091002",
"VR": "UN",
"PrivateCreator": "Vendor A",
"Value": [ "z0x9c8v7" ]
},
"PatientName": {
"Tag": "00100010",
"VR": "PN",
"PersonName": [
{
"SingleByte": "Wang^XiaoDong",
"Ideographic": "王^å°æ±"
}
]
},
"PatientID": {
"Tag": "00100020",
"VR": "LO",
"Value": [ "12345" ]
},
"IssuerOfPatientID": {
"Tag": "00100021",
"VR": "LO",
"Value": [ "Hospital A" ]
},
"PatientsBirthDate": {
"Tag": "00100030",
"VR": "DT",
"Value": [ "19670701" ]
},
"PatientsSex": {
"Tag": "00100040",
"VR": "CS",
"Value": [ "M" ]
},
"OtherPatientIDsSequence": {
"Tag": "00101002",
"VR": "SQ",
"Sequence": [
{
"PatientID": {
"Tag": "00100020",
"VR": "LO",
"Value": [ "54321" ]
},
"IssuerOfPatientID": {
"Tag": "00100021",
"VR": "LO",
"Value": [ "Hospital B" ]
}
},
{
"PatientID": {
"Tag": "00100020",
"VR": "LO",
"Value": [ "24680" ]
},
"IssuerOfPatientID": {
"Tag": "00100021",
"VR": "LO",
"Value": [ "Hospital C" ]
}
}
]
},
"StudyID": {
"Tag": "00200010",
"VR": "SH",
"Value": [ "11235813" ]
},
"StudyInstanceUID": {
"Tag": "0020000D",
"VR": "UI",
"Value": [
"1.2.392.200036.9116.2.2.2.1762893313.1029997326.945873" ]
},
"NumberOfStudyRelatedSeries": {
"Tag": "00201206",
"VR": "IS",
"Value": [ "4" ]
},
"NumberOfStudyRelatedInstances": {
"Tag": "00201208",
"VR": "IS",
"Value": [ "942" ]
},
"RetrieveURL": {
"Tag": "00081190",
"VR": "UT",
"Value": [
"http://wado.nema.org/studies/1.2.392.200036.9116.2.2.2.1762893313.1029997326.945873" ]
}
},
{ // Result 2
"SpecificCharacterSet": {
"Tag": "00080005",
"VR": "CS",
"Value": [ "ISO_IR192" ]
},
"StudyDate": {
"Tag": "00080020",
"VR": "DT",
"Value": [ "20130309" ]
},
"StudyTime": {
"Tag": "00080030",
"VR": "TM",
"Value": [ "111900.0000" ]
},
"AccessionNumber": {
"Tag": "00080050",
"VR": "SH",
"Value": [ "11235821" ]
},
"InstanceAvailability": {
"Tag": "00080056",
"VR": "CS",
"Value": [ "ONLINE" ]
},
"ModalitiesInStudy": {
"Tag": "00080061",
"VR": "CS",
"Value": [
"CT",
"PET"
]
},
"ReferringPhysiciansName": {
"Tag": "00080090",
"VR": "PN",
"PersonName": [
{
"SingleByte": "^Bob^^Dr."
}
]
},
"00090010": {
"Tag": "00090010",
"VR": "LO",
"Value": [ "Vendor A" ]
},
"00091002": {
"Tag": "00091002",
"VR": "UN",
"PrivateCreator": "Modality Vendor A",
"Value": [ "z0x9c8v7" ]
},
"PatientName": {
"Tag": "00100010",
"VR": "PN",
"PersonName": [
{
"SingleByte": "Wang^XiaoDong",
"Ideographic": "王^å°æ±"
}
]
},
"PatientID": {
"Tag": "00100020",
"VR": "LO",
"Value": [ "12345" ]
},
"IssuerOfPatientID": {
"Tag": "00100021",
"VR": "LO",
"Value": [ "Hospital A" ]
},
"PatientsBirthDate": {
"Tag": "00100030",
"VR": "DT",
"Value": [ "19670701" ]
},
"PatientsSex": {
"Tag": "00100040",
"VR": "CS",
"Value": [ "M" ]
},
"OtherPatientIDsSequence": {
"Tag": "00101002",
"VR": "SQ",
"Sequence": [
{
"PatientID": {
"Tag": "00100020",
"VR": "LO",
"Value": [ "54321" ]
},
"IssuerOfPatientID": {
"Tag": "00100021",
"VR": "LO",
"Value": [ "Hospital B" ]
}
},
{
"PatientID": {
"Tag": "00100020",
"VR": "LO",
"Value": [ "24680" ]
},
"IssuerOfPatientID": {
"Tag": "00100021",
"VR": "LO",
"Value": [ "Hospital C" ]
}
}
]
},
"StudyID": {
"Tag": "00200010",
"VR": "SH",
"Value": [ "11235821" ]
},
"StudyInstanceUID": {
"Tag": "0020000D",
"VR": "UI",
"Value": [
"1.2.392.200036.9116.2.2.2.2162893313.1029997326.945876" ]
},
"NumberOfStudyRelatedSeries": {
"Tag": "00201206",
"VR": "IS",
"Value": [ "5" ]
},
"NumberOfStudyRelatedInstances": {
"Tag": "00201208",
"VR": "IS",
"Value": [ "1123" ]
},
"RetrieveURL": {
"Tag": "00081190",
"VR": "UT",
"Value": [
"http://wado.nema.org/studies/1.2.392.200036.9116.2.2.2.2162893313.1029997326.945876" ]
}
}
]
gdcm-3.0.22/Testing/Source/Data/gdcmMD5DataImages.cxx 000664 001766 001770 00000113717 14517730450 024501 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
// See tst2md5 in GDCM/Utilities/md5
//
// Another way to do it is:
//
// dcmdrle ACUSON-24-YBR_FULL-RLE.dcm bla.dcm
// gdcmraw -i bla.dcm -o bla.raw
// md5sum bla.raw
// So this md5 checksum should match the one in dcmtk...hopefully :)
//
static const char * const gdcmMD5DataImages[][2] = {
/* gdcm 512 512 4 8 1 */
{ "bfff320d1b058e91b4819aa4560c16f7" , "00191113.dcm" },
/* gdcm 256 256 1 16 1 */
{ "d594a5e2fde12f32b6633ca859b4d4a6" , "012345.002.050.dcm" },
/* gdcm 512 512 1 16 1 */
{ "c68cf1c4ae59903930e334498389ea88" , "05115014-mr-siemens-avanto-syngo-with-palette-icone.dcm" },
/* gdcm 448 336 1 16 1 */
{ "a9d455ca171294fe56d29bf714f4f845" , "05119865-mr-siemens-avanto-syngo.dcm" },
/* gdcm 192 192 1 16 1 */
{ "9acdd9969f5d0584ddd67e994f00b7c7" , "05148044-mr-siemens-avanto-syngo.dcm" },
/* gdcm 512 512 1 16 1 */
{ "c3541091a3794753065022f4defc4343" , "3E768EB7.dcm" },
/* gdcm 768 576 40 8 3 */
{ "6a796be399aefebc1479e924f6051d69" , "ACUSON-24-YBR_FULL_422-Jpeg_Baseline_1.dcm" },
/* gdcm 384 288 1 8 3 */
//{ "2a922d5c606354612bfdbece1421d863" , "ACUSON-24-YBR_FULL-RLE-b.dcm" },
//{ "22b32f23beb118f7b64c13bf04bc2809" , "ACUSON-24-YBR_FULL-RLE-b.dcm" },
{ "22b32f23beb118f7b64c13bf04bc2809" , "ACUSON-24-YBR_FULL-RLE-b.dcm" },
/* gdcm 768 576 1 8 3 */
//{ "f9bb8a37acabdf8b0cfa4fd1b471e6aa" , "ACUSON-24-YBR_FULL-RLE.dcm" },
//{ "435c66f7e113d11d226d500294aae865" , "ACUSON-24-YBR_FULL-RLE.dcm" },
{ "435c66f7e113d11d226d500294aae865" , "ACUSON-24-YBR_FULL-RLE.dcm" },
/* gdcm 768 576 25 8 3 */
{ "e36350b0711fd34eb86c386164554679" , "ACUSON-8-YBR_FULL-JPEG-TrailingInfo.dcm" },
/* gdcm 608 420 1 8 1 */
{ "7d8858e3419392b7f39a99fdc8028064" , "ALOKA_SSD-8-MONO2-RLE-SQ.dcm" },
/* gdcm 440 440 1 16 1 */
//{ "8acaa88edcc2c29d3be3ee373fbaed5e" , "CR-MONO1-10-chest.dcm" },
{ "1f772b4849727a9750931b60d920436f" , "CR-MONO1-10-chest.dcm" },
/* gdcm 512 512 1 16 1 */
{ "8c8b9d99ad12fb4d231182d4fc14c042" , "CT_16b_signed-UsedBits13.dcm" },
/* gdcm 512 512 1 16 1 */
{ "160c0b4432cfab8d36531b5a3693ff3e" , "CT-MONO2-12-lomb-an2.acr" },
/* gdcm 512 512 1 16 1 */
{ "90cca03ada67c6a1fcb48cfcc2b52eeb" , "CT-MONO2-16-ankle.dcm" },
/* gdcm 512 512 1 16 1 */
{ "a6cf43e05087b6c31644c1d360701ff2" , "CT-MONO2-16-brain.dcm" },
/* gdcm 512 400 1 16 1 */
{ "78bb9ea4b746ff2aa5559be567f95030" , "CT-MONO2-16-chest.dcm" },
/* gdcm 512 512 1 16 1 */
{ "dcb3aa1defd85d93d69d445e3e9b3074" , "CT-MONO2-16-ort.dcm" },
/* gdcm 512 512 1 8 1 */
{ "86d3e09a5858aa3844cb3be1b822a069" , "CT-MONO2-8-abdo.dcm" },
/* gdcm 512 614 1 16 1 */
{ "3695d167c298646b877efccaeff92682" , "CT_Phillips_JPEG2K_Decompr_Problem.dcm" },
/* gdcm 512 512 1 16 1 */
{ "3372195a35448b76daee682d23502090" , "CT-SIEMENS-Icone-With-PaletteColor.dcm" },
/* gdcm 512 512 1 16 1 */
{ "05bbdbcc81081791f6f9f8a1ffa648c8" , "D_CLUNIE_CT1_J2KI.dcm" },
/* gdcm 512 512 1 16 1 */
{ "f3a3d0e739e5f4fbeddd1452b81f4d89" , "D_CLUNIE_CT1_J2KR.dcm" },
/* gdcm 512 512 1 16 1 */
{ "f3a3d0e739e5f4fbeddd1452b81f4d89" , "D_CLUNIE_CT1_JPLL.dcm" },
/* gdcm 512 512 1 16 1 */
{ "f3a3d0e739e5f4fbeddd1452b81f4d89" , "D_CLUNIE_CT1_RLE.dcm" },
/* gdcm 512 512 1 16 1 */
{ "2e389ddbfc1b29d55c52c97e7f2c6f9c" , "D_CLUNIE_CT2_JPLL.dcm" },
/* gdcm 512 512 1 16 1 */
{ "2e389ddbfc1b29d55c52c97e7f2c6f9c" , "D_CLUNIE_CT2_RLE.dcm" },
/* gdcm 3064 4664 1 16 1 */
{ "d9b97ad9199d429960123dcc1e74bdbc" , "D_CLUNIE_MG1_JPLL.dcm" },
/* gdcm 3064 4664 1 16 1 */
{ "02742062fcad004500d73d7c61b9b9e6" , "D_CLUNIE_MG1_JPLY.dcm" },
/* gdcm 3064 4664 1 16 1 */
{ "d9b97ad9199d429960123dcc1e74bdbc" , "D_CLUNIE_MG1_RLE.dcm" },
/* gdcm 512 512 1 16 1 */
{ "7b7424e6115931c371f3c94c2f5d32d9" , "D_CLUNIE_MR1_JPLL.dcm" },
/* gdcm 512 512 1 16 1 */
{ "2824e914ecae250a755a8a0bb1a7d4b1" , "D_CLUNIE_MR1_JPLY.dcm" },
/* gdcm 512 512 1 16 1 */
{ "7b7424e6115931c371f3c94c2f5d32d9" , "D_CLUNIE_MR1_RLE.dcm" },
/* gdcm 1024 1024 1 16 1 */
{ "a70676f0e60a58f55a5ac517ff662e7e" , "D_CLUNIE_MR2_JPLL.dcm" },
/* gdcm 1024 1024 1 16 1 */
{ "981510df3a57e98141c7d192b45bd93f" , "D_CLUNIE_MR2_JPLY.dcm" },
/* gdcm 1024 1024 1 16 1 */
{ "a70676f0e60a58f55a5ac517ff662e7e" , "D_CLUNIE_MR2_RLE.dcm" },
/* gdcm 512 512 1 16 1 */
{ "fb03254fad02d2330d404225c3ea9b4e" , "D_CLUNIE_MR3_JPLL.dcm" },
/* gdcm 512 512 1 16 1 */
{ "d7009808a147f59a9bdf58d5c5924ef2" , "D_CLUNIE_MR3_JPLY.dcm" },
/* gdcm 512 512 1 16 1 */
{ "fb03254fad02d2330d404225c3ea9b4e" , "D_CLUNIE_MR3_RLE.dcm" },
/* gdcm 512 512 1 16 1 */
{ "14fa2ae9f63742af6944edd4a61145e8" , "D_CLUNIE_MR4_JPLL.dcm" },
/* gdcm 512 512 1 16 1 */
{ "a33ad864b49ae7daa59cfaabdf751976" , "D_CLUNIE_MR4_JPLY.dcm" },
/* gdcm 512 512 1 16 1 */
{ "14fa2ae9f63742af6944edd4a61145e8" , "D_CLUNIE_MR4_RLE.dcm" },
/* gdcm 256 1024 1 16 1 */
{ "6b5c1eff0ef65e36b0565f96507e96fd" , "D_CLUNIE_NM1_JPLL.dcm" },
/* gdcm 256 1024 1 16 1 */
{ "812050a7fc53b5735f7740b60969cb6b" , "D_CLUNIE_NM1_JPLY.dcm" },
/* gdcm 256 1024 1 16 1 */
{ "6b5c1eff0ef65e36b0565f96507e96fd" , "D_CLUNIE_NM1_RLE.dcm" },
/* gdcm 1841 1955 1 16 1 */
//{ "01518af70491372814fb056d536ffb7e" , "D_CLUNIE_RG1_JPLL.dcm" },
{ "ae141f6fb91f63769a6adc572a942fb9" , "D_CLUNIE_RG1_JPLL.dcm" },
/* gdcm 1841 1955 1 16 1 */
//{ "01518af70491372814fb056d536ffb7e" , "D_CLUNIE_RG1_RLE.dcm" },
{ "ae141f6fb91f63769a6adc572a942fb9" , "D_CLUNIE_RG1_RLE.dcm" },
/* gdcm 1760 2140 1 16 1 */
{ "06900ee4323a91b7f5ffab8655e3c845" , "D_CLUNIE_RG2_JPLL.dcm" },
/* gdcm 1760 2140 1 16 1 */
{ "27fa50d4cf6b31baa669e9746ce10f63" , "D_CLUNIE_RG2_JPLY.dcm" },
/* gdcm 1760 2140 1 16 1 */
{ "06900ee4323a91b7f5ffab8655e3c845" , "D_CLUNIE_RG2_RLE.dcm" },
/* gdcm 1760 1760 1 16 1 */
//{ "6588b7b8e6e53b2276d919a053316153" , "D_CLUNIE_RG3_JPLL.dcm" },
{ "e7c857ef7e6a2c81498297a072a0332e" , "D_CLUNIE_RG3_JPLL.dcm" },
/* gdcm 1760 1760 1 16 1 */
//{ "cb381c53172242404346b237bf741eb4" , "D_CLUNIE_RG3_JPLY.dcm" },
{ "cc2968949ffbb6548288ffde7e5202e4" , "D_CLUNIE_RG3_JPLY.dcm" },
/* gdcm 1760 1760 1 16 1 */
//{ "6588b7b8e6e53b2276d919a053316153" , "D_CLUNIE_RG3_RLE.dcm" },
{ "e7c857ef7e6a2c81498297a072a0332e" , "D_CLUNIE_RG3_RLE.dcm" },
/* gdcm 2048 2487 1 16 1 */
{ "bd0cccbfd8db465c0af306ba0f482d72" , "D_CLUNIE_SC1_JPLL.dcm" },
/* gdcm 2048 2487 1 16 1 */
{ "994a5abb70d3f5968672ce4970a9d4da" , "D_CLUNIE_SC1_JPLY.dcm" },
/* gdcm 2048 2487 1 16 1 */
{ "bd0cccbfd8db465c0af306ba0f482d72" , "D_CLUNIE_SC1_RLE.dcm" },
/* gdcm 640 480 1 8 3 */
{ "eb52dce9eed5ad677364baadf6144ac4" , "D_CLUNIE_US1_RLE.dcm" },
/* gdcm 756 486 1 8 3 */
{ "b07e34ec35ba1be62ee7d4a404cf0b90" , "D_CLUNIE_VL1_RLE.dcm" },
/* gdcm 756 486 1 8 3 */
{ "d215c88125359d34474a741d793c2215" , "D_CLUNIE_VL2_RLE.dcm" },
/* gdcm 756 486 1 8 3 */
{ "65cd359ea4c6c13ca89b906215a4b762" , "D_CLUNIE_VL3_RLE.dcm" },
/* gdcm 2226 1868 1 8 3 */
{ "e2fdf24d2c03dd0991b4f4e9d6e84ed6" , "D_CLUNIE_VL4_RLE.dcm" },
/* gdcm 2670 3340 1 8 3 */
{ "0ed86ef35d1fb443e1b63c28afe84bd0" , "D_CLUNIE_VL5_RLE.dcm" },
/* gdcm 756 486 1 8 3 */
{ "b825c0ed35c7c896fb707c14b534c233" , "D_CLUNIE_VL6_RLE.dcm" },
/* gdcm 1024 1024 1 16 1 */
{ "6111657e6b01ec7b243d63f5dec6ec48" , "D_CLUNIE_XA1_JPLL.dcm" },
/* gdcm 1024 1024 1 16 1 */
{ "51af0d83fe795f9c9544c20d0bbac11c" , "D_CLUNIE_XA1_JPLY.dcm" },
/* gdcm 1024 1024 1 16 1 */
{ "6111657e6b01ec7b243d63f5dec6ec48" , "D_CLUNIE_XA1_RLE.dcm" },
/* gdcm 117 181 1 8 3 */
{ "b4f442047a209a98af015c89b4a3c4ed" , "DermaColorLossLess.dcm" },
/* gdcm 1024 1024 1 16 1 */
{ "0b4dff77726ccf037fa83c42cc186a98" , "ExplicitVRforPublicElementsImplicitVRforShadowElements.dcm" },
/* gdcm 512 512 1 16 1 */
{ "6b92115ec7a394c4aaad74e88d7dbc98" , "FLAIR-wrong-group-length.dcm" },
/* gdcm 1670 2010 1 16 1 */
//{ "9ca80d44bfb1af2f96495fac4b57fa29" , "FUJI-10-MONO1-ACR_NEMA_2.dcm" },
{ "da2415a1e58b4ca2e588d0de18274f60" , "FUJI-10-MONO1-ACR_NEMA_2.dcm" },
/* gdcm 512 301 1 8 1 */
{ "59d9851ca0f214d57fdfd6a8c13bc91c" , "gdcm-ACR-LibIDO.acr" },
/* gdcm 750 750 1 8 1 */
{ "73f20916abaea83abebe9135c365d81a" , "gdcm-CR-DCMTK-16-NonSamplePerPix.dcm" },
/* gdcm 512 512 1 16 1 */
{ "f2c026beea9da0a78404f1299c4628bb" , "gdcm-JPEG-Extended-Allready_present.dcm" },
/* gdcm 512 512 1 16 1 */
{ "f2c026beea9da0a78404f1299c4628bb" , "gdcm-JPEG-Extended.dcm" },
/* gdcm 512 512 1 16 1 */
{ "ad67e448e8923c34f1e019c3395e616c" , "gdcm-JPEG-LossLess3a.dcm" },
/* gdcm 1876 2076 1 16 1 */
{ "c15c1e18a0c41970fbded48b20e834a1" , "gdcm-JPEG-LossLessThoravision.dcm" },
/* gdcm 128 128 1 16 1 */
{ "ad85be428c08ab4166347ef04bda9637" , "gdcm-MR-PHILIPS-16-Multi-Seq.dcm" },
/* gdcm 160 64 1 16 1 */
{ "2f7f9ef80b49111c5a7cfdb60a97f523" , "gdcm-MR-PHILIPS-16-NonSquarePixels.dcm" },
/* gdcm 512 512 1 16 1 */
{ "864e2c5d6acf5a371fe9eaa7ee0dcf5f" , "gdcm-MR-SIEMENS-16-2.acr" },
/* gdcm 640 480 1 16 1 */
{ "f85ff02a143c426edc4b2f6b9a175305" , "gdcm-US-ALOKA-16.dcm" },
/* gdcm 512 512 1 16 1 */
{ "80527e9c17a4a3d12d408e9a354f37f9" , "GE_CT_With_Private_compressed-icon.dcm" },
/* gdcm 512 512 67 8 1 */
{ "b8bcbccd17b76a0f8e3d4c342f855f9f" , "GE_DLX-8-MONO2-Multiframe-Jpeg_Lossless.dcm" },
/* gdcm 512 512 56 8 1 */
{ "71e4ea61df4f7ada2955799c91f93e74" , "GE_DLX-8-MONO2-Multiframe.dcm" },
/* gdcm 512 512 54 8 1 */
{ "51c998d3474c069b5703e98313258a1e" , "GE_DLX-8-MONO2-PrivateSyntax.dcm" },
/* gdcm 256 256 1 16 1 */
{ "8ac7f7891fb4506e2cd3ae2f0f7e9f46" , "GE_GENESIS-16-MONO2-Uncompressed-UnusualVR.dcm" },
/* gdcm 256 256 1 16 1 */
{ "1497fb9d7467b1eb36d5618e254aac76" , "GE_GENESIS-16-MONO2-WrongLengthItem.dcm" },
/* gdcm 640 480 1 8 3 */
{ "13fd8c7e533a3d7199bb78de45710f5c" , "GE_LOGIQBook-8-RGB-HugePreview.dcm" },
/* gdcm 512 512 1 16 1 */
{ "f3a3d0e739e5f4fbeddd1452b81f4d89" , "GE_RHAPSODE-16-MONO2-JPEG-Fragments.dcm" },
/* gdcm 1792 2392 1 16 1 */
//{ "821acfdb5d5ad9dc13275d3ad3827d43" , "KODAK-12-MONO1-Odd_Terminated_Sequence.dcm" },
{ "c1ed06d39821a5fd65abc397982e2ac1" , "KODAK-12-MONO1-Odd_Terminated_Sequence.dcm" },
/* gdcm 800 535 1 16 1 */
{ "70166425c4dca767e22d3f25f737922b" , "LEADTOOLS_FLOWERS-16-MONO2-JpegLossless.dcm" },
/* gdcm 800 535 1 16 1 */
{ "70166425c4dca767e22d3f25f737922b" , "LEADTOOLS_FLOWERS-16-MONO2-RLE.dcm" },
/* gdcm 800 535 1 16 1 */
{ "70166425c4dca767e22d3f25f737922b" , "LEADTOOLS_FLOWERS-16-MONO2-Uncompressed.dcm" },
/* gdcm 800 535 1 8 3 */
{ "279e2b0363394a553ff8571cf3540c6c" , "LEADTOOLS_FLOWERS-24-RGB-JpegLossless.dcm" },
/* gdcm 800 535 1 8 3 */
{ "38c2784aa485733fef45b6517479a4f5" , "LEADTOOLS_FLOWERS-24-RGB-JpegLossy.dcm" },
/* gdcm 800 535 1 8 3 */
{ "279e2b0363394a553ff8571cf3540c6c" , "LEADTOOLS_FLOWERS-24-RGB-Uncompressed.dcm" },
/* gdcm 800 535 1 8 1 */
{ "fa08fec923f34e009ec89f77232e52ad" , "LEADTOOLS_FLOWERS-8-MONO2-JpegLossy.dcm" },
/* gdcm 800 535 1 8 1 */
{ "3cd8bd92db17bff54e376885dfefdd8d" , "LEADTOOLS_FLOWERS-8-MONO2-RLE.dcm" },
/* gdcm 800 535 1 8 1 */
{ "3cd8bd92db17bff54e376885dfefdd8d" , "LEADTOOLS_FLOWERS-8-MONO2-Uncompressed.dcm" },
/* gdcm 800 535 1 8 3 */
//{ "d613050ca0f9c924fb5282d140281fcc" , "LEADTOOLS_FLOWERS-8-PAL-RLE.dcm" },
{ "16e999d6afc5574bcb075f296c3bcbbc" , "LEADTOOLS_FLOWERS-8-PAL-RLE.dcm" },
/* gdcm 800 535 1 8 3 */
//{ "d613050ca0f9c924fb5282d140281fcc" , "LEADTOOLS_FLOWERS-8-PAL-Uncompressed.dcm" },
{ "16e999d6afc5574bcb075f296c3bcbbc" , "LEADTOOLS_FLOWERS-8-PAL-Uncompressed.dcm" },
/* duh ! This should be the exact same md5...if only the testing was a little
* smarter */
{ "d613050ca0f9c924fb5282d140281fcc" , "LEADTOOLS_FLOWERS-8-PAL-RAW.dcm" },
/* gdcm 50 50 262 16 1 */
{ "ce1cc8ebb1efb86213d5912a1cfde843" , "LIBIDO-16-ACR_NEMA-Volume.dcm" },
/* gdcm 400 100 1 8 3 */
{ "81a40454eec2b18f4331cfd1ba4e501e" , "LIBIDO-24-ACR_NEMA-Rectangle.dcm" },
/* gdcm 128 128 1 8 1 */
{ "fc5db4e2e7fca8445342b83799ff16d8" , "LIBIDO-8-ACR_NEMA-Lena_128_128.acr" },
/* gdcm 512 512 1 16 1 */
{ "b1476cacdd32216b3295d2a494af2945" , "MARCONI_MxTWin-12-MONO2-JpegLossless-ZeroLengthSQ.dcm" },
/* gdcm 256 192 1 16 1 */
{ "d9f47017de79e8755e4bc5d3c9146ebd" , "MR-Brucker-CineTagging-NonSquarePixels.dcm" },
/* gdcm 512 512 1 16 1 */
{ "8fe67e8e1f849c1b61f59e70d2d53cf7" , "MR_GE_with_Private_Compressed_Icon_0009_1110.dcm" },
/* gdcm 256 256 1 16 1 */
{ "f54c7ea520ab3ec32b6303581ecd262f" , "MR-MONO2-12-an2.acr" },
/* gdcm 256 256 1 16 1 */
//{ "48345bccbd67f57b4c13060b6a9a0d35" , "MR-MONO2-12-angio-an1.acr" },
//{ "19cd553b53c8c35b8f2c20f27ed31d2d" , "MR-MONO2-12-angio-an1.acr" },
{ "ae5c00b60a58849b19aaabfc6521eeed" , "MR-MONO2-12-angio-an1.acr" },
/* gdcm 1024 1024 1 16 1 */
{ "a70676f0e60a58f55a5ac517ff662e7e" , "MR-MONO2-12-shoulder.dcm" },
/* gdcm 256 256 1 16 1 */
{ "83be31fb5e5cee60dedaf485bf592ac3" , "MR-MONO2-16-head.dcm" },
/* gdcm 256 256 16 8 1 */
{ "01db0d71100c47013e588082d5f39bab" , "MR-MONO2-8-16x-heart.dcm" },
/* gdcm 256 256 1 16 1 */
{ "b606add66c681bbe674f972799c6d336" , "MR_Philips-Intera_BreaksNOSHADOW.dcm" },
/* gdcm 1024 1024 1 16 1 */
{ "0b4dff77726ccf037fa83c42cc186a98" , "MR_Philips_Intera_No_PrivateSequenceImplicitVR.dcm" },
/* gdcm 512 512 1 16 1 */
{ "f69bca6228b0ca07d97ee11c0ab3b989" , "MR_Philips_Intera_PrivateSequenceImplicitVR.dcm" },
/* gdcm 1024 1024 1 16 1 */
{ "0b4dff77726ccf037fa83c42cc186a98" , "MR_Philips_Intera_SwitchIndianess_noLgtSQItem_in_trueLgtSeq.dcm" },
/* ?? */
{ "7775ffdd374994b7dd029f45f198844f" , "MR_Philips_Intera_PrivateSequenceExplicitVR_in_SQ_2001_e05f_item_wrong_lgt_use_NOSHADOWSEQ.dcm" },
/* gdcm 484 484 1 8 1 */
{ "8b636107a6d8e6a6b3d1d7eed966d7a0" , "MR-SIEMENS-DICOM-WithOverlays-extracted-overlays.dcm" },
/* gdcm 484 484 1 16 1 */
{ "3027eda10630e5c845f456264dc65210" , "MR-SIEMENS-DICOM-WithOverlays.dcm" },
/* gdcm 128 128 1 16 1 */
{ "6a925f871c58553f84ad24195e155c52" , "MR_SIEMENS_forceLoad29-1010_29-1020.dcm" },
/* gdcm 64 64 13 16 1 */
{ "c83ef2159abef677229d3afd26f9e6a0" , "NM-MONO2-16-13x-heart.dcm" },
/* gdcm 512 512 1 8 1 */
{ "a155c3004bb902ed3f2d78f482923b32" , "OT-MONO2-8-a7.dcm" },
/* gdcm 640 480 1 8 3 */
//{ "47715f0a5d5089268bbef6f83251a8ad" , "OT-PAL-8-face.dcm" },
{ "d7c30d57af821b02c67103250a744235" , "OT-PAL-8-face.dcm" },
/* gdcm 512 512 1 16 1 */
//{ "4b0021efe5a675f24c82e1ff28a1e2eb" , "PHILIPS_Gyroscan-12-Jpeg_Extended_Process_2_4.dcm" },
{ "d93d2f78d845c7a132489aab92eadd32" , "PHILIPS_Gyroscan-12-Jpeg_Extended_Process_2_4.dcm" },
/* gdcm 256 256 1 16 1 */
{ "b78366162d9d43b2852d2637c5365c89" , "PHILIPS_Gyroscan-12-MONO2-Jpeg_Lossless.dcm" },
/* gdcm 256 256 1 16 1 */
{ "4842ccbaac5b563ce915d2e21eb4c06e" , "PHILIPS_Gyroscan-8-MONO2-Odd_Sequence.dcm" },
/* gdcm 512 512 76 8 1 */
{ "1f8951a6f8b599ad4ebc97efd7aab6be" , "PHILIPS_Integris_H-8-MONO2-Multiframe.dcm" },
/* gdcm 1024 1024 31 16 1 */
{ "3d005cd3270c6d2562c2a8d9069c9295" , "PHILIPS_Integris_V-10-MONO2-Multiframe.dcm" },
/* gdcm 1024 1024 1 16 1 */
{ "0b4dff77726ccf037fa83c42cc186a98" , "PHILIPS_Intera-16-MONO2-Uncompress.dcm" },
/* gdcm 512 512 1 16 1 */
{ "6c9e477330d70d4a1360888121c7c3d3" , "PICKER-16-MONO2-Nested_icon.dcm" },
/* gdcm 512 512 1 16 1 */
{ "5ea911b29f472f371d21f2da2fd6b016" , "PICKER-16-MONO2-No_DicomV3_Preamble.dcm" },
/* gdcm 512 512 1 16 1 */
{ "498f80fd27882351b9a09e6ceef470bc" , "PrivateGEImplicitVRBigEndianTransferSyntax16Bits.dcm" },
/* gdcm 136 92 1 16 1 */
{ "dbbf39ac11a39372b1e961f40ac6f62a" , "RadBWLossLess.dcm" },
/* gdcm 600 430 1 16 3 */
//{ "964ea27345a7004325896d34b257f289" , "rle16sti.dcm" },
{ "f799773abbe36a1a8a3a881e27f8084d" , "rle16sti.dcm" },
/* gdcm 512 512 1 16 1 */
{ "80527e9c17a4a3d12d408e9a354f37f9" , "ser002img00026.dcm" },
/* gdcm 512 512 1 16 1 */
{ "7b55fd124331adde6276416678543048" , "SIEMENS-12-Jpeg_Process_2_4-Lossy-a.dcm" },
/* gdcm 256 256 1 16 1 */
{ "ea24c09f475a4e9643e27f6d470edc67" , "SIEMENS_GBS_III-16-ACR_NEMA_1.acr" },
/* gdcm 512 512 1 16 1 */
{ "864e2c5d6acf5a371fe9eaa7ee0dcf5f" , "SIEMENS_MAGNETOM-12-ACR_NEMA_2-Modern.dcm" },
/* gdcm 128 128 1 16 1 */
{ "a13466d96b2f068c4844240797069f13" , "SIEMENS_MAGNETOM-12-MONO2-FileSeq0.dcm" },
/* gdcm 128 128 1 16 1 */
{ "73f5986082729c2661cdc8de81fd26d0" , "SIEMENS_MAGNETOM-12-MONO2-FileSeq1.dcm" },
/* gdcm 128 128 1 16 1 */
{ "f932a194df62ec99aef676c563893496" , "SIEMENS_MAGNETOM-12-MONO2-FileSeq2.dcm" },
/* gdcm 128 128 1 16 1 */
{ "b6e4780d8aa8c1d3642377a60a5302dd" , "SIEMENS_MAGNETOM-12-MONO2-FileSeq3.dcm" },
/* gdcm 512 512 1 16 1 */
{ "4b426d4cd570bd4c998f3d19cfddfbb8" , "SIEMENS_MAGNETOM-12-MONO2-Uncompressed.dcm" },
/* gdcm 192 256 1 16 3 */
{ "faff9970b905458c0844400b5b869e25" , "SIEMENS-MR-RGB-16Bits.dcm" },
/* gdcm 512 512 1 16 1 */
{ "7ccf7c7c4b2a5fa9d337ea8b01f75c42" , "SIEMENS_SOMATOM-12-ACR_NEMA-ZeroLengthUs.acr" },
/* gdcm 192 192 1 16 1 */
{ "a3009bc70444148c5ea2441a099f9dc6" , "SIEMENS_Sonata-12-MONO2-SQ.dcm" },
/* gdcm 256 208 1 16 1 */
{ "017237320ccded3a367f07b44851788e" , "SIEMENS_Sonata-16-MONO2-Value_Multiplicity.dcm" },
/* gdcm 512 512 1 8 1 */
{ "f845c8f283d39a0204c325654493ba53" , "test.acr" },
/* gdcm 256 256 1 16 1 */
{ "62c98e89a37c9a527d95d5ac3e2548b0" , "THERALYS-12-MONO2-Uncompressed-E_Film_Template.dcm" },
/* gdcm 256 256 1 16 1 */
{ "0121cd64c3b9957f76dd338d27454bc6" , "THERALYS-12-MONO2-Uncompressed-Even_Length_Tag.dcm" },
/* gdcm 512 512 1 16 1 */
{ "09661bd8516aeb5a6f09239f9ca1b092" , "TOSHIBA_MRT150-16-MONO2-ACR_NEMA_2.dcm" },
/* gdcm 636 434 1 8 3 */
{ "23ec8ed09e1ecc353c2e6436a1de6cb2" , "US-GE-4AICL142.dcm" },
/* gdcm 640 480 1 8 1 */
{ "ba092234639594ee9091b46997532cce" , "US-IRAD-NoPreambleStartWith0003.dcm" },
/* gdcm 640 480 1 8 1 */
{ "1bde104ba256fb73528c5d9a02e363d7" , "US-IRAD-NoPreambleStartWith0005.dcm" },
/* gdcm 128 120 8 8 1 */
{ "bf63affde325b3fa81cd5a700f30bd5b" , "US-MONO2-8-8x-execho.dcm" },
/* gdcm 600 430 10 8 3 */
//{ "c70309b66045140b8e08c11aa319c0ab" , "US-PAL-8-10x-echo.dcm" },
{ "1785f4d8af4717c17bfb78ba74c18ea5" , "US-PAL-8-10x-echo.dcm" },
/* gdcm 640 480 1 8 3 */
//{ "fe2d477d699e327be2d3d65eb76203e9" , "US-RGB-8-epicard.dcm" },
{ "eb3433568c6b0cee90688ccf228ffc02" , "US-RGB-8-epicard.dcm" },
/* gdcm 256 120 1 8 3 */
{ "4b350b9353a93c747917c7c3bf9b8f44" , "US-RGB-8-esopecho.dcm" },
/* gdcm 512 512 12 8 1 */
{ "136eaf8f7d654bbb08741c201a945561" , "XA-MONO2-8-12x-catheter.dcm" },
// Those where added manually:
// If you are lucky and the image is raw (MONOCHROME2) you simply need to
// do (assuming you are under UNIX)
// $ ./bin/gdcmraw -i 42166745.dcm -o bla.raw
// $ md5sum bla.raw
// For JPEG and RLE file, you need to check result against dcmtk (dcmdjpeg,
// dcmdrle will help you).
// Image1 & Image2 are crap, some kind of decompression went wrong
// and PixelData is raw so not much you can do...
{ "1b0768a3518a6b6ed425c3c1d7a7ea3b" , "Image1.dcm" },
{ "a41c7f4e75cf637ae8912f5c3cd2c69d" , "Image2.dcm" },
{ "22c9be23446a7be61a90d3578f3c9739" , "deflate_image.dcm" },
{ "d5681b156af55899835293286c57d887" , "brain.dcm" },
{ "d4d365f0500f2ccff932317833d8804b" , "abdominal.dcm" },
{ "138d9bd642c6f1cdc427ef6f99132677" , "ankle.dcm" },
{ "ff8d450e47e8989478a1b6f19d0988cc" , "spine.dcm" },
{ "c78c1721a5ac585a12cf9a52abc25d4c" , "42166745.dcm" },
{ "d48ae6ccc815fd171169591a1048c5ed" , "JDDICOM_Sample4.dcm" },
{ "63c45c2e73403af781d07ae02247654f" , "I20051107115955.dcm" },
{ "938ac04374eadbe6ac4d7df80e5aa178" , "JDDICOM_Sample1.dcm" },
// This one can not be decompressed properly with dcmdjpeg. Until
// they fix dcmdjpeg I'll assume decompression went right
{ "33aa469ec024188d692262d03e7108a0" , "JDDICOM_Sample2.dcm" },
// Same problem
{ "308b1b6fbc01df4dc3fb168830777cb1" , "JDDICOM_Sample3.dcm" },
// Same thing
{ "b8b5030261f92574227fe91902738558" , "JDDICOM_Sample5.dcm" },
// This one was computed from dcmtk, gdcm 1.x fails to read it...
//{ "49ca8ad45fa7f24b0406a5a03ba8aff6" , "rle16loo.dcm" },
{ "04b42f011bdcf56e8a22607cb715447c" , "rle16loo.dcm" },
// Name is poorly chosen since it's actually a Dicom Objects bug
// Cannot only be read by gdcm 1.2.x
{ "f1436c1800ccbba8da82acb7f2dff29d" , "GE_JPEG-Broken.dcm" },
// For some reason the numbers gets funny
{ "73dd2a43ab7c2810714a8ea1079f3c38" , "10200901_8b_Palette_RLE_blinker.dcm" },
{ "609ede096636ae804dbb0fb4d78be2c2" , "10200900_8b_Palette_RLE_blinker.dcm" },
{ "ed6078d83f467f9eda5d8cd06f87080f" , "10200905_8b_Palette_RLE_blinker.dcm" },
// This is the same image as rle16loo ...
{ "49ca8ad45fa7f24b0406a5a03ba8aff6" , "rle16loop_16b_Palette_RLE.dcm" },
// dummy image, this is the same as US-IRAD-NoPreambleStartWith0005.dcm
{ "1bde104ba256fb73528c5d9a02e363d7" , "US.irad.27702.1.dcm"},
// ACR NEMA with a PhotometricInterpretation..
{ "1e3acacba2ae92b52011804ebddbf5df" , "acc-max.dcm" },
{ "d5037d66855c7815f55185b808e48750" , "Originale_015.dcm" },
{ "bbca0e3e26acdd1ab4f6c4871810ac50" , "PETAt001_PT001.dcm" },
{ "5a33e3a2cd414d734984c7a6a5a32a41" , "i0116.dcm" },
{ "5a0ebe04ffe50d4373624e444093b855" , "eclipse_dose.dcm" },
{ "c4e4589b884cfee49db81746cd18a41c" , "MRMN1786V1L.dcm" },
{ "bc8f9791b75916e85c91e458cd1364a3" , "MRMN1786V1T.dcm" },
{ "6cee5011d0dcce93d259d272eb94336f" , "MRMN1786V2L.dcm" },
{ "793d177bd10188e66483ddc04cbca9e7" , "gdcm-CT-GE-16-GantryTilt.dcm" },
{ "7db6d7da455d94ed1a3afda437c3f09e" , "MRMN1786V2T.dcm" },
// JPEG lossy:
{ "bea6e06fe30abd455288e35aaf47477d" , "angiograms.dcm" },
{ "350aea8820dbbdbb15eabc88f3dd3b16" , "image09-bis.dcm" },
// The same as US-IRAD-NoPreambleStartWith0003.dcm
{ "ba092234639594ee9091b46997532cce" , "US.irad.28317.1.dcm" },
{ "21a11f961726c81684be3241eb961819" , "PETAt001_PT204.dcm" },
{ "23b5d0a918fb882c08c458c1507c39f7" , "SiemensIcon.dcm" },
{ "0121cd64c3b9957f76dd338d27454bc6" , "RMI_Mattes_1_150_001_7_150_cEval0_038.dcm" },
{ "350aea8820dbbdbb15eabc88f3dd3b16" , "image09.dcm" },
{ "1bde104ba256fb73528c5d9a02e363d7" , "image12.dcm" },
{ "417ca9bf1db40dd8656cfb6de0aef181" , "JPEGLosslessLongSQ.dcm" },
{ "d5037d66855c7815f55185b808e48750" , "readWrite.dcm" },
// Visible Human written in DICOM with ITK-GDCM (1.2)
{ "e114252b9acf985cf53b06c39118a290" , "vhm.1001.dcm" },
{ "0b4dff77726ccf037fa83c42cc186a98" , "MR_Philips_Intera_Kosher.dcm" },
{ "f9d9898ad844a73c0656539388fec85c" , "0001.dcm" },
{ "c4031c607b7312952bb560e55cbbb072" , "exp000.dcm" },
{ "2bb620b2c516b66faeef7397d30b83f1" , "exp001.dcm" },
{ "0dfbe8aa4c20b52e1b8bf3cb6cbdf193" , "RMI_Mattes_unevenLengthTags.dcm" },
// The famous Siemens 0029-1010/1020
{ "6a925f871c58553f84ad24195e155c52" , "MR_forceLoad29-1010_29-1020.dcm" },
{ "255769e6c9d8a161fce520c958c94de7" , "MR_Siemens_ShadowGroupsImplicitVR.dcm" },
{ "5c25c435ecd8eeac124ab427668186de" , "01f7_7fdf.dcm" },
{ "0dfbe8aa4c20b52e1b8bf3cb6cbdf193" , "RMI_Mattes_1_1_001_7_1_cEval0_000.dcm" },
{ "620012cfec4ae2e6dd0137b2e16947d7" , "ElemZeroNotGroupLength.dcm" },
{ "57994245238730f4b4c5eaed21c4144b" , "File000138.dcm" },
{ "826b6bc1e36efda1b727b08248a71dd2" , "File000139.dcm" },
{ "6b26a5561678b26aa2f21a68ea334819" , "SYNGORTImage.dcm" },
{ "a198893279520631657781d47c4097b2" , "Implicit-0001.dcm" },
{ "99540b33d088646b8e424a57afdccbe6" , "CT_PET001_CT001.dcm" },
{ "343e27f0867b55af74b21a5ba55bd9cc" , "rattag.dcm" },
{ "0038402afc09d44d3c75ed207171976b" , "i0002.dcm" },
{ "0ad4eca25cc0f783bd60c07b2d73f8b0" , "fudd_post.dcm" },
{ "b85ca0e38d91ba0ee3a97f9c709415ac" , "brain_001.dcm" },
{ "f1436c1800ccbba8da82acb7f2dff29d" , "SignedShortLosslessBug.dcm" },
{ "eb87ca4a01e55dc7a7f1c92f0aa31017" , "ATTMA002_DS.dcm" },
{ "f17cf873a3c07f3d91dc88f34664bf0d" , "libido1.0-vol.acr" },
{ "d2fab61e0fff8869e448d69951f1084d" , "SIEMENS_MAGNETOM-12-MONO2-GDCM12-VRUN.dcm" },
{ "e0221ddcc9febdc3c266bb8cd0fcf14f" , "undefined_length_un_vr.dcm" },
{ "a136e501bcd1b8ee0835981d2bc8dd87" , "fffc0000UN.dcm" },
{ "33aa469ec024188d692262d03e7108a0" , "JDDICOM_Sample2-dcmdjpeg.dcm" }, // mismatch DICOM / JPEG
{ "d2fab61e0fff8869e448d69951f1084d" , "SIEMENS_MAGNETOM-12-MONO2-VRUN.dcm" },
{ "fc5db4e2e7fca8445342b83799ff16d8" , "simpleImageWithIcon.dcm" },
// Following need to be proof checked:
{ "0b4dff77726ccf037fa83c42cc186a98" , "imp.dcm" },
{ "eb5fc6c9e86a69c27b7208d72370a92d" , "Renal_Clearance.dcm" },
{ "1b130fa646f8d6b3c14b9443b35c80b4" , "IM0046A0.dcm" },
{ "8c00e7f797d8bb4a629ae1e4b08084b9" , "rvg_analysis.dcm" },
{ "0d7c2f8714ed3c7dec8194c6e4b359c3" , "BRTUM001.dcm" },
{ "e5dbfc8673ea25dd73c95f4df3353b10" , "3DDCM011.dcm" },
{ "12150f9067ea72bc56c75d83c42c8108" , "MIRA.dcm" },
{ "ae9a191c716dfda2651a147728910a89" , "NM.dcm" },
{ "d4444bcca0ee13919f867e486a8f3553" , "QCpatternC-v1.dcm" },
{ "ad85be428c08ab4166347ef04bda9637" , "gdcm-MR-PHILIPS-16-Multi-Seq-Correct.dcm" },
{ "9c390fc010105325427e3ff29a9b186c" , "SIEMENS_ORIGINAL.dcm" },
{ "0b4dff77726ccf037fa83c42cc186a98" , "venticles32004-11-09-08-55-57-6750000000.dcm" },
{ "bfff320d1b058e91b4819aa4560c16f7" , "test.dcm" },
{ "8c9666cef26a0cc76491a7a8a5239b85" , "Renal_Flow.dcm" },
{ "f3a3d0e739e5f4fbeddd1452b81f4d89" , "dclunie.dcm" },
{ "78dae0e2d9b7a124fe63300b6356ded4" , "Toshiba7005.dcm" },
{ "8240955d1e4b72989f8f49549f1617b2" , "PhilipsWith15Overlays.dcm" },
{ "3cd8bd92db17bff54e376885dfefdd8d" , "toto.dcm" },
{ "14ad8ae28cc5e5e5dc4c4d010c291a7f" , "test20.dcm" },
{ "e7408198028983cd6643a00fd7668c00" , "testacr-jpll.dcm" },
{ "6633fb8bce0a648763e7ed2b7de1db5c" , "1_172.dcm" },
{ "29cfe7038fae548abd4af4551b2a37cb" , "example.dcm" },
{ "6b18e445fbc917e7d6f55b616f17d3e1" , "WrongVRFor00271033.dcm" },
{ "0b4dff77726ccf037fa83c42cc186a98" , "ExplicitVRforPublicElementsImplicitVRforShadowElementsCorrected.dcm" },
{ "9570a06da59988ff3a7271cdde14abf5" , "3DT1_5138_0077.dcm" },
{ "20c5f63d65732703e3fffeb8d67c62ed" , "FluroWithDisplayShutter.dcm" },
{ "92b62f22fc44b8563c19f5536d9e499f" , "fudd_ant.dcm" },
{ "b92a22ef55d6a1fbd24a6a24a7a84a7f" , "yazhi.dcm" },
{ "2b69286289543afc3be7df0400abb8fc" , "IM_0001.dcm" },
//{ "67d86e26740882586b6bf3fe7e09c831" , "PMMA-Treppe.dcm" },
{ "287e002ebf84424fe66558b642c51bce" , "PMMA-Treppe.dcm" },
{ "82a8d3398c98d23e1b34f5364f967287" , "PERFORM_T1_Symphony_VA25.dcm" },
//{ "00b4b3282855c96744355892caf9d310" , "Al-Treppe.dcm" },
{ "2c0ccfeff0a6d4afd7929a672dec0cc0" , "Al-Treppe.dcm" },
{ "f891eae2cdfecd578b2204ebbb93f606" , "ImplicitDeclaredAsExplicit.dcm" },
{ "7ceb7886f9fbcb7ae979fdb6f1305414" , "CR-Preamble-NoMeta.dcm" },
{ "d2fab61e0fff8869e448d69951f1084d" , "db318_MR_STN_stimulator_T2_TSE_TRA__20071005161618048_4.dcm" },
{ "2b4d7fb6b039b43145f2766b2339c460" , "0019004_Baseline_IMG1.dcm" },
{ "f02e48f4b7df2ff4855733febc92e4e6" , "SIEMENS_GBS_III-16-ACR_NEMA_1.acr.ovly.6002.dcm" },
{ "6a34b606135c4cd1c31511164e2cb235" , "SIEMENS_GBS_III-16-ACR_NEMA_1.acr.ovly.6000.dcm" },
{ "65f961aca90fb61952d723feec6dec89" , "SIEMENS_GBS_III-16-ACR_NEMA_1.acr.ovly.6006.dcm" },
{ "fc137690ae436bb44a695fb2f1e49d85" , "SIEMENS_GBS_III-16-ACR_NEMA_1.acr.ovly.6004.dcm" },
// No tested:
{ "864e2c5d6acf5a371fe9eaa7ee0dcf5f" , "acr_image_with_non_printable_in_0051_1010.acr" },
{ "7efed1c332c62ea34d5edad901081c36" , "mr_r_opptak000_20000925_t2.nema" },
{ "d6995bd1d76eb36913c985c8397ff02d" , "mr_r_opptak000_20000925_t1.nema" },
{ "dc549f804f1f59bfee245ddf100ee26b" , "SIEMENS-IncompletePixelData.dcm" },
{ "51b7e83cdc569b8f355662d80bd7036d" , "20061119171007906.dcm" },
{ "01db0d71100c47013e588082d5f39bab" , "MR0001.dcm" },
{ "d9df75ff0394bb9a3753b625933d94fc" , "ModalityLUT.dcm" },
{ "acd3f756192a9f0484c971db2869d70b" , "PublicElementsImplicitInExplicitDataSet.dcm" },
{ "820575fcc05338f3e95296107d9ddf7a" , "MR3.dcm" },
{ "3c6984afa2af4257565d8f622f7f5e5b" , "SIEMENS-JPEG-CorruptFragClean.dcm" },
{ "cc2968949ffbb6548288ffde7e5202e4" , "D_CLUNIE_RG3_JPLY_dcmtk.dcm" },
{ "83656f4989a2d4be8f9ad56d83a907f5" , "5decf5b5-6695-4557-867e-a1f97321cd80.dcm" },
{ "92655f77a55eb9c316223b9e73d55800" , "PMS-IncompletePixelData.dcm" },
{ "6a23c9f150a360381c8fbceb2277efc5" , "TOSHIBA-CurveData2.dcm" },
{ "6ad75566935554fcc60ca35a003fba6d" , "IM_00003.dcm" },
{ "ab7cab6e7b5f9043f8fa7c0ae3f1b282" , "19872890.dcm" },
{ "48eb24e37d41faca8b629b3807c20d92" , "rm6_DICM.dcm" },
{ "201c9761ed911ad12508248252f4ff16" , "T2*_1484_0009.dcm" },
{ "90017033c3916259cad63615385a1d02" , "BogugsItemAndSequenceLength.dcm" },
{ "b09dc714f6d56d29005996b3204eec25" , "TOSHIBA-CurveData1.dcm" },
{ "5ed3d1de2a086ac7efd31a6f1463f129" , "SCIsMR.dcm" },
{ "9bbb1d908401299e73e636ad5b19a225" , "Siemens_CT_Sensation64_has_VR_RT.dcm" },
{ "13e41624a8b86c18ac257e3588f818ce" , "tst_ok.dcm" },
{ "17f514732d5f7e9484ed33c35bddc930" , "ImplicitVRInExplicitDataSet.dcm" },
{ "0826b8cc512a8e4d726c1c019af2eaf9" , "29627381.dcm" },
{ "727383f164107aaa9ee6c2182f94b91d" , "1.2.752.24.6.1820537353.20080220145707750.8.1.dcm" },
{ "5588652e673e745ad56441f5a26c2305" , "22484474.dcm" },
{ "cf6fde116c90e4e56512b22004503d96" , "PHILIPS_PrivateSeqWithPublicElems.dcm" },
{ "098bba76d4e75a3148c9b62aee35f950" , "GEMS-IncompletePixelData.dcm" },
{ "1fe71a52a211d1a56cc49cdcb71c1dbb" , "IM03.dcm" },
{ "b857b6cce2afd7033476526b89ed9678" , "TheralysGDCM1.dcm" },
{ "e998bbfca8b892fd0955c95b6f1584ea" , "Theralys2048Thingy.dcm" },
{ "0508d28682e209f87d28184ae10060bd" , "Compress_16bit_noPVRG.dcm" },
{ "90017033c3916259cad63615385a1d02" , "BogugsItemAndSequenceLengthCorrected.dcm" },
{ "51b7e83cdc569b8f355662d80bd7036d" , "debian_medcon_401529.dcm" },
{ "51b7e83cdc569b8f355662d80bd7036d" , "BogusItemStartItemEnd.dcm" },
{ "3c6984afa2af4257565d8f622f7f5e5b" , "SIEMENS-JPEG-CorruptFrag.dcm" },
{ "192f5ebd4d8f6164a4142421408172b2" , "PhilipsByteSwapping.dcm" },
{ "2438b8feef6c8f682b2f468aff4475e5" , "MismatchSOPClassUID.dcm" },
{ "738092e703655b6ae22a907d9f9f0c9c" , "YBRisGray.dcm" },
{ "635e947fc156c89a8d10ced8317ace82" , "2mAs.dcm" },
{ "54d648704507de7cd6e4be12061a5fb2" , "OSIRIX_MONOCHROME2_BUG.dcm" },
{ "1db40fc52b962c8b6823980fe9dad6d8" , "5mAs.dcm" },
{ "1b130fa646f8d6b3c14b9443b35c80b4" , "IM0046A0_2.dcm" },
{ "cdfb45de5ddad3e7e2b0053c848d0d2b" , "ImplicitVRInExplicitDataSet2.dcm" },
{ "ec5c421832df7cc43801d038705cd2cf" , "OverlayPrivateDataInBetween.dcm" },
{ "9a375c3b2a72a6ccf687250b17f646c9" , "ItemTerminatorVLnot0.dcm" },
{ "5269176094127c6f106cbcf9dbdf55b0" , "I0000017.dcm" },
{ "eb87ca4a01e55dc7a7f1c92f0aa31017" , "EmptyItemStarter.dcm" },
{ "cae8f644373163cb3970999f7ac00fd3" , "169585.dcm" },
{ "5ea911b29f472f371d21f2da2fd6b016" , "VRUNInMetaHeader.dcm" },
{ "ad7b664eed26e95f790c24cdb3060fb9" , "IM000450.dcm" },
{ "4f113f33863067b8ca8d560cb194da09" , "TOSHIBA-CurveData3.dcm" },
{ "14fa2ae9f63742af6944edd4a61145e8" , "mrbrainR.dcm" },
{ "ba17ae006314a097fef7a32fa1a624b0" , "c42g57hg64ca02.dcm" },
{ "10047ec574a6401ad90606e63304de6e" , "0020.DCM" },
{ "5184839806c9a9583fe192d43cede939" , "001005XA" },
{ "5291e36a7d54d4c8e00d5765cd0b3d17" , "001007XA" },
{ "a57df7bc23977977832f98bfb662cdb4" , "001003XA" },
{ "b36329c27f359daede3205d7c57cccd1" , "001009XA" },
{ "1d173a6f31e0e4dd1078adf3557774c7" , "001008XA" },
{ "9b42aa4e5d3b5f889164b5a734b954b3" , "001010XA" },
{ "87f72a961292c83f8a9230e8eefecc6b" , "001004XA" },
{ "6c7a303d25b418988ef9a37c4315a746" , "001001XA" },
{ "9dde002e4e99218891df5f98da56ec9d" , "001002XA" },
{ "6c7a303d25b418988ef9a37c4315a746" , "001001XA.1" },
{ "8891d44376bc53c7bd0d36d2b776cd9b" , "001006XA" },
{ "a6d10a3de9499d8853c6667b82628e86" , "TOSHIBA-EnhancedCT.dcm" },
{ "71b3b19571f5b9e7ec931071bf5157dd" , "CroppedArm.dcm" },
{ "bab06b7112dbce4f528bab5c1b89abc1" , "Bug_Philips_ItemTag_3F3F.dcm" },
{ "8d3a64a67b4d8d15561fb586fd0706ee" , "Nm.dcm" },
{ "05392d4f7a0c05223eeb957ee60203a9" , "MergeCOM3_330_IM50.dcm" },
{ "635c2dbedea549a89f88e959934ed93c" , "ELSCINT1_OW.dcm" },
{ "594995a6eb12a565247cd98f967a378d" , "KONICA_VROX.dcm" },
{ "1497b865a4c6ab73cd6797b8834baa9f" , "TheralysNoModalityNoObject.dcm" },
{ "d1f8cbdb279d038e2674ec0907afffe1" , "gastrolateral.dcm" },
{ "ea24c09f475a4e9643e27f6d470edc67" , "SIEMENS_GBS_III-16-ACR_NEMA_1-ULis2Bytes.dcm" },
{ "ecd26fb1fa914918ff9292c4f7340050" , "MR00010001.dcm" },
{ "c56567bbb8f1924d6c0c6fd8ca7f239d" , "006872.003.107.dcm" },
{ "228e9af71b8ce00cae3066e3fdd3641f" , "SIEMENS_MONOCHROME2_LUT_MOCO.dcm" },
{ "ef8c3435ee7a9b332976f2dc56833d3a" , "GENESIS_SIGNA-JPEG-CorruptFrag.dcm" }, // FIXME !
{ "42a4f33eb34456e3e82f30d707c84870" , "DCMOBJ_IMG57.dcm" },
{ "3a85617df95abbb63cd84a183515c697" , "image.acr" },
{ "8c5a627c461688cfa5dc708a170c5eda" , "IM-0001-0001.dcm" },
{ "ec87a838931d4d5d2e94a04644788a55" , "test_att.acr" },
{ "0621954acd5815e0b4f7b65fcc6506b1" , "SIEMENS_ImageLocationUN.dcm" },
{ "e1e34e81050d17b07a20c0e43c355187" , "GDCMFakeJPEG.dcm" },
{ "ef9f915086db838334ddc656a10486f2" , "DMCPACS_ExplicitImplicit_BogusIOP.dcm" },
{ "498f80fd27882351b9a09e6ceef470bc" , "ELSCINT1_GDCM12Bug.dcm" },
{ "34b5c1ce40f09f0dbede87ebf3f6ed3c" , "korean_agfa_infinitt_2008-3.dcm" },
{ "2c8b8ee9950582af472cf652005f07d4" , "c_vf1001.dcm" },
{ "a1ea6633f17ef1e0d702cdd46434b393" , "MARTIN_ALBERT-20010502-2-1.nema" },
{ "d85237c7ff838f5246643a027d3727ae" , "GDCMPrinterDisplayUNasSQ.dcm" },
{ "2dbe2da7fbcf1bd73e2221e9cd4ad7ee" , "MissingPixelRepresentation.dcm" },
{ "a3009bc70444148c5ea2441a099f9dc6" , "E00001S03I0015.dcm" },
{ "afe5937be25ac657e48b1270b52e6d98" , "Martin.dcm" },
{ "4d790e17ee35572d64e37c55dbc36725" , "MR_ELSCINT1_00e1_1042_SQ_feff_00e0_Item.dcm" },
{ "93ddc0c3d642af60f55630232d2801ae" , "CT_Image_Storage_multiframe.dcm" },
{ "6127740892542f23e37e6ab516b17caf" , "ELSCINT1_JP2vsJ2K.dcm" },
{ "b620a57170941e26dfd07ff334c73cb4" , "GE_MR_0025xx1bProtocolDataBlock.dcm" },
{ "4b5423b34ab4e104c222359a91448a5d" , "CT-SIEMENS-MissingPixelDataInIconSQ.dcm" },
{ "79b8705f2e6c7464bd3e2fc7e1d3483b" , "KODAK_CompressedIcon.dcm" },
{ "59071590099d21dd439896592338bf95" , "ima43.dcm" },
{ "46bf12c412590767bb8cd7f0d53eaa87" , "TG18-CH-2k-01.dcm" },
{ "9214cc4f62fbea873ffad88e1be877c5" , "LJPEG_BuginGDCM12.dcm" },
{ "52607a16af1eaddbbc71c14d32e489d8" , "DX_J2K_0Padding.dcm" },
{ "6af53848fe77feb56a12aba74dadea8e" , "TheralysGDCM120Bug.dcm" },
{ "79b8705f2e6c7464bd3e2fc7e1d3483b" , "TestVRSQUN2.dcm" },
{ "71e4ea61df4f7ada2955799c91f93e74" , "TestVRSQUN1.dcm" },
{ "6396332b75b15bf30b1dd1cd0f212691" , "SIEMENS_MOSAIC_12BitsStored-16BitsJPEG.dcm" },
{ "ba8dae4b43075c7e8562f5addf5f95c3" , "DX_GE_FALCON_SNOWY-VOI.dcm" },
{ "d6fb1fb06318dd305a461db9c84cf825" , "JPEG_LossyYBR.dcm" },
{ "43f33c06d56f239ce9ed5ca0d66a69d2" , "PHILIPS_Brilliance_ExtraBytesInOverlay.dcm" },
{ "dae9d2e2b412646fd0a0f31dc2d17aa4" , "BugGDCM2_UndefItemWrongVL.dcm" },
{ "62687f0a17e9c4153f18b55c8abfcef3" , "SIEMENS_CSA2.dcm" },
{ "a02fa05065b3a93a391f820ac38bd9ee" , "MAROTECH_CT_JP2Lossy.dcm" },
{ "8b5e38699887158c3defd47900a68fc5" , "ITK_GDCM124_MultiframeSecondaryCaptureInvalid.dcm" },
{ "c57035e2dac52e339b27e8c965251b3d" , "DCMTK_JPEGExt_12Bits.dcm" }, // checked with dcmdjpeg v3.5.4+ 2009-05-07
{ "d7673c8575cb2765f8ae25aa3899c77e" , "PHILIPS_GDCM12xBug.dcm"},
{ "a597540a79306be4710f4f04497fc23a" , "PHILIPS_GDCM12xBug2.dcm"},
{ "1e8843c2d247f9e9e7a44c9c6de43f6d" , "multiframegrayscalewordscis.dcm" },
{ "928b41468193f0eecaea216866bbe735" , "signedtruecoloroldsc.dcm" },
{ "209bc9b02004a712f0436a1ca5e676b4" , "multiframesinglebitscis.dcm" },
{ "c8698fa1ec0b227113f244954b8e88f4" , "multiframegrayscalebytescis.dcm" },
{ "dce1513162a762bf43dcc3c9d5c5c3f7" , "multiframetruecolorscis.dcm" },
{ "6bf95a48f366bdf8af3a198c7b723c77" , "SinglePrecisionSC.dcm" },
{ "42cb593979fcc4630f965c31caaf4ec1" , "MR16BitsAllocated_8BitsStored.dcm" },
{ "da153c2f438d6dd4277e0c6ad2aeae74" , "OsirixFake16BitsStoredFakeSpacing.dcm" },
{ "1c485e1ac2b2bdbeeba14391b8c1e0c8" , "JPEGDefinedLengthSequenceOfFragments.dcm" },
{ "ae1290d59c63b0c334a4834c5995fe45" , "AMIInvalidPrivateDefinedLengthSQasUN.dcm" },
{ "f3a3d0e739e5f4fbeddd1452b81f4d89" , "D_CLUNIE_CT1_JLSL.dcm" },
{ "5e9085c66976d2f5f9989d88bf7a90c4" , "D_CLUNIE_CT1_JLSN.dcm" },
{ "9eb513314b2fcf25d895e18ffb2ead0b" , "UnexpectedSequenceDelimiterInFixedLengthSequence.dcm" },
{ "fb8119f30ec32ff575789caa969180ca" , "IM-0001-0066.CommandTag00.dcm" },
{ "6f26e552a1b71d386483118779d192ad" , "NM_Kakadu44_SOTmarkerincons.dcm" },
{ "56238d3665ebdb0251d1161fb7f4edc6" , "GDCMJ2K_TextGBR.dcm" },
{ "f8a1f4ce85b51527267e670a8aa0c308" , "PhilipsInteraSeqTermInvLen.dcm" },
// following 3 md5 computes with kdu_expand v6.3.1
{ "d6347ed051d7b887bdaad1a91433c6ba" , "TOSHIBA_J2K_SIZ1_PixRep0.dcm" },
{ "d6347ed051d7b887bdaad1a91433c6ba" , "TOSHIBA_J2K_SIZ0_PixRep1.dcm" },
{ "94414d8b4300aa3d8cbe4475d34e8e54" , "TOSHIBA_J2K_OpenJPEGv2Regression.dcm" },
{ "304f147752d46adfdcff71a30cd03d0a" , "NM-PAL-16-PixRep1.dcm" },
{ "20b1e4de7b864d44fcd0dda1fc42402c" , "MEDILABInvalidCP246_EVRLESQasUN.dcm" },
// gdcmDataExtra:
{ "cb26bfacea534b5cd6881bc36520ecfc" , "US_512x512x2496_JPEG_BaseLine_Process_1.dcm" },
{ "d40e2d27988f0c546b0daeb67fcbfba8" , "i32.XADC.7.215MegaBytes.dcm" },
{ "c383b244fd43cb0a9db764b71cb59741" , "1.3.46.670589.7.5.10.80002138018.20001204.181556.9.1.1.dcm" },
{ "f111ed4eea73f535261039d3f7b112e9" , "JPEGInvalidSecondFrag.dcm" },
// Computed with kakadu:
{ "a218fcee00e16d430f30ec7ebd4937dc" , "lena512_rot90.j2k.dcm" },
{ "dbf83984984741c98205d77a947b442c" , "SC16BitsAllocated_8BitsStoredJ2K.dcm" },
{ "f845c8f283d39a0204c325654493ba53" , "SC16BitsAllocated_8BitsStoredJPEG.dcm" },
{ "4a5d8549791432b29948dd8ff63e2534" , "SIEMENS_SYNGO-12-MONO2-LUTWrongLength512.dcm" },
{ "2c8630ae1bff925b258d98e742dfc632" , "JPEGLS_CharLS_10742.dcm" },
{ "f666a95dde9ddfdec0cf9574a7985ae3" , "IllegalGroup2ImplicitTS.dcm" },
{ "b85686dd3169b99725149abb00181254" , "RLEDebianBug816607Orig.dcm" },
{ "464960d948dff0ded72b0380080f18a3" , "JPEGNote_empty.dcm" },
{ "cdfb5dd0c999d88badeb00a16f96554f" , "JPEGLosslessYBR_FULL_422.dcm" },
{ "464960d948dff0ded72b0380080f18a3" , "JPEGNote_missing.dcm" },
{ "161e9fd986ea87adf2596e8e16641f11" , "JPEGNote_bogus.dcm" },
{ "ad8f1164f0517ee150bf510d5dba5cc6" , "GE_MR_0025xx1bProtocolDataBlockXML.dcm" },
{ "a0e0effa8d5638721b19e592acc11a4c" , "EmptyIcon_Bug417.dcm" },
{ "2b64303085d747956bfdda2ee8cc33bc" , "EnhancedWithIPPPerFrameIOPShared.dcm" },
{ "4ca2f3a88d21d941f6485a8d91f96e29" , "FUJI-ffff-MONO1-J2K.dcm" },
{ "b9697e3615a841e4c04f45ede6923278" , "JPEGLosslessSeNonZero.dcm" },
{ "5fcd7d6573cab16d2ef575bba878ec78" , "US-YBR_FULL_422-EVRLE.dcm" },
{ "d62b4c13e8108671f1c66626c5bdee55" , "Osirix10vs8BitsStored.dcm" },
{ "b7c6fb507da1b7a3f81f821a2e3eaf49" , "Bug_Siemens_PrivateIconNoItem.dcm" },
{ "56238d3665ebdb0251d1161fb7f4edc6" , "HardcopyColor_YBR_RCT_J2K_PC1.dcm" },
{ "5fe2b8742f05a0ba06d354f965266dbc" , "PET-GE-dicomwrite-PixelDataSQUNv2.dcm" },
{ "20b1e4de7b864d44fcd0dda1fc42402c" , "MEDILABValidCP246_EVRLESQasOB.dcm" },
/* Stopping condition */
{ nullptr ,nullptr }
};
gdcm-3.0.22/Testing/Source/Data/gdcmDataFileNames.cxx.in 000664 001766 001770 00000002322 14517730450 025223 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
/* Hardcode the path to GDCM_DATA_ROOT */
static const char GDCM_DATA_ROOT[] = "@GDCM_DATA_ROOT@";
static const char GDCM_DATA_EXTRA_ROOT[] = "@GDCM_DATA_EXTRA_ROOT@";
static const char GDCM_PIXEL_SPACING_DATA_ROOT[] = "@GDCM_PIXEL_SPACING_DATA_ROOT@";
/* Hardcode the path to GDCM_TEMP_DIRECTORY */
static const char GDCM_TEMP_DIRECTORY[] = "@GDCM_TEMP_DIRECTORY@";
static const char * const gdcmDataFileNames[] = {
@GDCM_DATA_FILENAMES@
0 };
static const char * const gdcmBlackListReaderDataFileNames[] = {
@GDCM_BLACK_LIST_READER_DATA_FILENAMES@
0 };
//const char * const gdcmBlackListWriterDataImages[] = {
// @GDCM_BLACK_LIST_WRITER_DATA_IMAGES@
//0 };
gdcm-3.0.22/Testing/Source/Data/gdcmMediaStorageDataFiles.cxx 000664 001766 001770 00000037734 14517730450 026321 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http:/gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
/*
* gdcmscanner -d /path/to/gdcmData/ -t 8,16 -p
*/
static const char * const gdcmMediaStorageDataFiles[][2] = {
{ "LEADTOOLS_FLOWERS-8-PAL-Uncompressed.dcm","1.2.840.10008.5.1.4.1.1.7" },
{ "SIEMENS_GBS_III-16-ACR_NEMA_1.acr", "1.2.840.10008.5.1.4.1.1.4"},
{ "00191113.dcm","1.2.840.10008.5.1.4.1.1.12.1"},
{ "SignedShortLosslessBug.dcm","1.2.840.10008.5.1.4.1.1.2"},
{ "gdcm-MR-PHILIPS-16-NonSquarePixels.dcm","1.2.840.10008.5.1.4.1.1.4"},
{ "MARCONI_MxTWin-12-MONO2-JpegLossless-ZeroLengthSQ.dcm","1.2.840.10008.5.1.4.1.1.2"},
{ "ACUSON-24-YBR_FULL-RLE.dcm","1.2.840.10008.5.1.4.1.1.6.1"},
{ "D_CLUNIE_VL2_RLE.dcm","1.2.840.10008.5.1.4.1.1.7"},
{ "MR_Philips_Intera_No_PrivateSequenceImplicitVR.dcm","1.2.840.10008.5.1.4.1.1.4"},
{ "MR_Philips-Intera_BreaksNOSHADOW.dcm","1.2.840.10008.5.1.4.1.1.4"},
{ "D_CLUNIE_MR2_JPLL.dcm","1.2.840.10008.5.1.4.1.1.4"},
{ "D_CLUNIE_XA1_JPLL.dcm","1.2.840.10008.5.1.4.1.1.7"},
{ "JPEG_LossyYBR.dcm","1.2.840.10008.5.1.4.1.1.6.1"},
{ "ALOKA_SSD-8-MONO2-RLE-SQ.dcm","1.2.840.10008.5.1.4.1.1.6.1"},
{ "PHILIPS_Gyroscan-8-MONO2-Odd_Sequence.dcm","1.2.840.10008.5.1.4.1.1.4"},
{ "PHILIPS_Gyroscan-12-MONO2-Jpeg_Lossless.dcm","1.2.840.10008.5.1.4.1.1.4"},
{ "MR-MONO2-12-shoulder.dcm","1.2.840.10008.5.1.4.1.1.4"},
//{ "MR_SIEMENS_forceLoad29-1010_29-1020.README.txt (could not be read)},
//{ "ExplicitVRforPublicElementsImplicitVRforShadowElements.README.txt (could not be read)},
{ "D_CLUNIE_RG3_JPLY.dcm","1.2.840.10008.5.1.4.1.1.1"},
{ "SIEMENS_SOMATOM-12-ACR_NEMA-ZeroLengthUs.acr","1.2.840.10008.5.1.4.1.1.2"},
{ "PHILIPS_Gyroscan-12-Jpeg_Extended_Process_2_4.dcm","1.2.840.10008.5.1.4.1.1.4"},
{ "DICOMDIR_MR_B_VA12A" , "1.2.840.10008.1.3.10" },
{ "MR-MONO2-8-16x-heart.dcm","1.2.840.10008.5.1.4.1.1.4"},
{ "SIEMENS_ImageLocationUN.dcm","1.2.840.10008.5.1.4.1.1.4"},
{ "US-PAL-8-10x-echo.dcm","1.2.840.10008.5.1.4.1.1.3.1"},
{ "PHILIPS_Brilliance_ExtraBytesInOverlay.dcm","1.2.840.10008.5.1.4.1.1.7"},
{ "SIEMENS_MAGNETOM-12-MONO2-Uncompressed.dcm","1.2.840.10008.5.1.4.1.1.4"},
{ "MR-MONO2-12-an2.acr","1.2.840.10008.5.1.4.1.1.4"},
{ "LEADTOOLS_FLOWERS-8-PAL-RLE.dcm","1.2.840.10008.5.1.4.1.1.7"},
{ "US-RGB-8-esopecho.dcm","1.2.840.10008.5.1.4.1.1.6"},
{ "GE_RHAPSODE-16-MONO2-JPEG-Fragments.dcm","1.2.840.10008.5.1.4.1.1.2"},
{ "CT-SIEMENS-Icone-With-PaletteColor.dcm","1.2.840.10008.5.1.4.1.1.2"},
{ "gdcm-ACR-LibIDO.acr" , "1.2.840.10008.5.1.4.1.1.7"}, // COMPAT
{ "LEADTOOLS_FLOWERS-16-MONO2-Uncompressed.dcm","1.2.840.10008.5.1.4.1.1.7"},
{ "FUJI-10-MONO1-ACR_NEMA_2.dcm","1.2.840.10008.5.1.4.1.1.1"},
{ "D_CLUNIE_CT1_RLE.dcm","1.2.840.10008.5.1.4.1.1.2"},
{ "undefined_length_un_vr.dcm","1.2.840.10008.5.1.4.1.1.4"},
{ "D_CLUNIE_MR4_JPLL.dcm","1.2.840.10008.5.1.4.1.1.4"},
{ "PET-cardio-Multiframe-Papyrus.dcm", "" },
{ "dicomdir_Pms_WithVisit_WithPrivate_WithStudyComponents" , "1.2.840.10008.1.3.10"},
{ "CT_16b_signed-UsedBits13.dcm","1.2.840.10008.5.1.4.1.1.2"},
//{ "TestAllEntryVerifyReference.txt (could not be read)},
{ "DX_J2K_0Padding.dcm","1.2.840.10008.5.1.4.1.1.1.1"},
{ "KODAK_CompressedIcon.dcm","1.2.840.10008.5.1.4.1.1.1"},
{ "D_CLUNIE_CT2_JPLL.dcm","1.2.840.10008.5.1.4.1.1.2"},
{ "DermaColorLossLess.dcm","1.2.840.10008.5.1.4.1.1.7"},
{ "DICOMDIR" , "1.2.840.10008.1.3.10" },
{ "LIBIDO-24-ACR_NEMA-Rectangle.dcm", "" },
{ "GE_GENESIS-16-MONO2-Uncompressed-UnusualVR.dcm","1.2.840.10008.5.1.4.1.1.4"},
//{ "MR-SIEMENS-DICOM-WithOverlays.README.txt (could not be read)},
{ "D_CLUNIE_NM1_JPLY.dcm","1.2.840.10008.5.1.4.1.1.7"},
{ "MR_Philips_Intera_SwitchIndianess_noLgtSQItem_in_trueLgtSeq.dcm","1.2.840.10008.5.1.4.1.1.4"},
{ "LEADTOOLS_FLOWERS-24-RGB-JpegLossy.dcm","1.2.840.10008.5.1.4.1.1.7"},
{ "D_CLUNIE_CT1_J2KR.dcm","1.2.840.10008.5.1.4.1.1.2"},
{ "LEADTOOLS_FLOWERS-16-MONO2-RLE.dcm","1.2.840.10008.5.1.4.1.1.7"},
{ "US-RGB-8-epicard.dcm","1.2.840.10008.5.1.4.1.1.6.1"},
{ "D_CLUNIE_MR3_RLE.dcm","1.2.840.10008.5.1.4.1.1.4"},
{ "test.acr" ,"1.2.840.10008.5.1.4.1.1.7"}, // COMPAT
{ "LEADTOOLS_FLOWERS-8-MONO2-Uncompressed.dcm","1.2.840.10008.5.1.4.1.1.7"},
{ "US-IRAD-NoPreambleStartWith0005.dcm","1.2.840.10008.5.1.4.1.1.6"},
{ "D_CLUNIE_RG2_JPLL.dcm","1.2.840.10008.5.1.4.1.1.1"},
{ "ELSCINT1_PMSCT_RLE1.dcm","1.2.840.10008.5.1.4.1.1.4"},
{ "DMCPACS_ExplicitImplicit_BogusIOP.dcm","1.2.840.10008.5.1.4.1.1.2"},
{ "MR_ELSCINT1_00e1_1042_SQ_feff_00e0_Item.dcm","1.2.840.10008.5.1.4.1.1.4"},
{ "LIBIDO-16-ACR_NEMA-Volume.dcm", "" },
//{ "Changelog (could not be read)},
//{ "ELSCINT1_LOSSLESS_RICE.txt (could not be read)},
{ "MR-SIEMENS-DICOM-WithOverlays.dcm","1.2.840.10008.5.1.4.1.1.4"},
{ "SIEMENS_MOSAIC_12BitsStored-16BitsJPEG.dcm","1.2.840.10008.5.1.4.1.1.4"},
{ "JDDICOM_Sample2-dcmdjpeg.dcm", "" },
{ "SIEMENS_MAGNETOM-12-MONO2-FileSeq2.dcm","1.2.840.10008.5.1.4.1.1.4"},
{ "D_CLUNIE_MR3_JPLY.dcm","1.2.840.10008.5.1.4.1.1.4"},
{ "MR_Philips_Intera_PrivateSequenceExplicitVR_in_SQ_2001_e05f_item_wrong_lgt_use_NOSHADOWSEQ.dcm","1.2.840.10008.5.1.4.1.1.4"},
{ "TheralysGDCM120Bug.dcm","1.2.840.10008.5.1.4.1.1.4"},
{ "PrivateGEImplicitVRBigEndianTransferSyntax16Bits.dcm","1.2.840.10008.5.1.4.1.1.2"},
{ "US-GE-4AICL142.dcm","1.2.840.10008.5.1.4.1.1.6.1"},
{ "3E768EB7.dcm","1.2.840.10008.5.1.4.1.1.2"},
//{ "gdcm-MR-PHILIPS-16-Multi-Seq.README.txt (could not be read)},
{ "SIEMENS_Sonata-16-MONO2-Value_Multiplicity.dcm","1.2.840.10008.5.1.4.1.1.4"},
{ "GE_MR_0025xx1bProtocolDataBlock.dcm","1.2.840.10008.5.1.4.1.1.4"},
{ "MR_GE_with_Private_Compressed_Icon_0009_1110.dcm","1.2.840.10008.5.1.4.1.1.4"},
{ "ExplicitVRforPublicElementsImplicitVRforShadowElements.dcm","1.2.840.10008.5.1.4.1.1.4"},
{ "D_CLUNIE_SC1_JPLY.dcm","1.2.840.10008.5.1.4.1.1.7"},
//{ "imagesWithOverlays.README.txt (could not be read)},
{ "CT-MONO2-16-chest.dcm","1.2.840.10008.5.1.4.1.1.2"},
{ "D_CLUNIE_MR4_RLE.dcm","1.2.840.10008.5.1.4.1.1.4"},
{ "gdcm-CR-DCMTK-16-NonSamplePerPix.dcm" , "" },
{ "SIEMENS_MAGNETOM-12-MONO2-FileSeq1.dcm","1.2.840.10008.5.1.4.1.1.4"},
{ "ELSCINT1_JP2vsJ2K.dcm","1.2.840.10008.5.1.4.1.1.2"},
{ "D_CLUNIE_CT2_RLE.dcm","1.2.840.10008.5.1.4.1.1.2"},
{ "D_CLUNIE_MR2_RLE.dcm","1.2.840.10008.5.1.4.1.1.4"},
{ "OT-MONO2-8-a7.dcm","1.2.840.10008.5.1.4.1.1.7"},
{ "MR-MONO2-16-head.dcm","1.2.840.10008.5.1.4.1.1.4"},
{ "PICKER-16-MONO2-No_DicomV3_Preamble.dcm","1.2.840.10008.5.1.4.1.1.4"},
{ "gdcm-JPEG-Extended.dcm","1.2.840.10008.5.1.4.1.1.2"},
{ "MR-MONO2-12-angio-an1.acr", ""},
{ "BugGDCM2_UndefItemWrongVL.dcm","1.2.840.10008.5.1.4.1.1.4"},
{ "D_CLUNIE_MR1_RLE.dcm","1.2.840.10008.5.1.4.1.1.4"},
{ "ELSCINT1_LOSSLESS_RICE.dcm","1.2.840.10008.5.1.4.1.1.2"},
{ "dicomdir_Pms_With_heavy_embedded_sequence" , "1.2.840.10008.1.3.10" },
{ "PICKER-16-MONO2-Nested_icon.dcm","1.2.840.10008.5.1.4.1.1.2"},
{ "D_CLUNIE_VL4_RLE.dcm","1.2.840.10008.5.1.4.1.1.7"},
{ "D_CLUNIE_RG1_RLE.dcm","1.2.840.10008.5.1.4.1.1.1"},
{ "JDDICOM_Sample2.dcm", "" },
{ "SIEMENS_MAGNETOM-12-MONO2-FileSeq3.dcm","1.2.840.10008.5.1.4.1.1.4"},
{ "CT-MONO2-8-abdo.dcm","1.2.840.10008.5.1.4.1.1.7"},
{ "D_CLUNIE_SC1_RLE.dcm","1.2.840.10008.5.1.4.1.1.7"},
{ "LEADTOOLS_FLOWERS-24-RGB-JpegLossless.dcm","1.2.840.10008.5.1.4.1.1.7"},
{ "LIBIDO-8-ACR_NEMA-Lena_128_128.acr" , "" },
{ "D_CLUNIE_RG3_JPLL.dcm","1.2.840.10008.5.1.4.1.1.1"},
{ "SIEMENS_CSA2.dcm","1.2.840.10008.5.1.4.1.1.4"},
{ "SIEMENS_GBS_III-16-ACR_NEMA_1-ULis2Bytes.dcm", "" },
{ "LJPEG_BuginGDCM12.dcm","1.2.840.10008.5.1.4.1.1.4"},
{ "CT-SIEMENS-MissingPixelDataInIconSQ.dcm","1.2.840.10008.5.1.4.1.1.2"},
{ "05115014-mr-siemens-avanto-syngo-with-palette-icone.dcm","1.2.840.10008.5.1.4.1.1.4"},
{ "libido1.0-vol.acr" , "" },
{ "MR_Spectroscopy_SIEMENS_OF.dcm","1.2.840.10008.5.1.4.1.1.4.2"},
{ "GE_CT_With_Private_compressed-icon.dcm","1.2.840.10008.5.1.4.1.1.2"},
{ "D_CLUNIE_XA1_JPLY.dcm","1.2.840.10008.5.1.4.1.1.7"},
{ "012345.002.050.dcm","1.2.840.10008.5.1.4.1.1.4"},
{ "TOSHIBA_MRT150-16-MONO2-ACR_NEMA_2.dcm","1.2.840.10008.5.1.4.1.1.4"},
{ "LEADTOOLS_FLOWERS-8-MONO2-JpegLossy.dcm","1.2.840.10008.5.1.4.1.1.7"},
{ "gdcm-US-ALOKA-16.dcm","1.2.840.10008.5.1.4.1.1.6.1"},
{ "THERALYS-12-MONO2-Uncompressed-Even_Length_Tag.dcm","1.2.840.10008.5.1.4.1.1.4"},
{ "D_CLUNIE_CT1_JPLL.dcm","1.2.840.10008.5.1.4.1.1.2"},
{ "rle16loo.dcm","1.2.840.10008.5.1.4.1.1.3.1"},
{ "D_CLUNIE_US1_RLE.dcm","1.2.840.10008.5.1.4.1.1.6.1"},
{ "LEADTOOLS_FLOWERS-8-MONO2-RLE.dcm","1.2.840.10008.5.1.4.1.1.7"},
{ "RadBWLossLess.dcm","1.2.840.10008.5.1.4.1.1.7"},
{ "dicomdir_Acusson_WithPrivate_WithSR" , "1.2.840.10008.1.3.10"},
{ "D_CLUNIE_MR1_JPLY.dcm","1.2.840.10008.5.1.4.1.1.4"},
{ "GE_DLX-8-MONO2-PrivateSyntax.dcm","1.2.840.10008.5.1.4.1.1.12.1"},
{ "gdcm-JPEG-LossLess3a.dcm","1.2.840.10008.5.1.4.1.1.2"},
{ "TG18-CH-2k-01.dcm","1.2.840.10008.5.1.4.1.1.7"},
{ "OT-PAL-8-face.dcm","1.2.840.10008.5.1.4.1.1.7"},
{ "D_CLUNIE_NM1_RLE.dcm","1.2.840.10008.5.1.4.1.1.7"},
{ "rle16sti.dcm","1.2.840.10008.5.1.4.1.1.6.1"},
{ "GE_GENESIS-16-MONO2-WrongLengthItem.dcm","1.2.840.10008.5.1.4.1.1.4"},
{ "D_CLUNIE_CT1_J2KI.dcm","1.2.840.10008.5.1.4.1.1.2"},
{ "SIEMENS_MAGNETOM-12-MONO2-FileSeq0.dcm","1.2.840.10008.5.1.4.1.1.4"},
{ "LEADTOOLS_FLOWERS-24-RGB-Uncompressed.dcm","1.2.840.10008.5.1.4.1.1.7"},
{ "D_CLUNIE_MR4_JPLY.dcm","1.2.840.10008.5.1.4.1.1.4"},
{ "D_CLUNIE_RG3_RLE.dcm","1.2.840.10008.5.1.4.1.1.1"},
{ "SIEMENS-12-Jpeg_Process_2_4-Lossy-a.dcm","1.2.840.10008.5.1.4.1.1.2"},
{ "DICOMDIR-Philips-EasyVision-4200-Entries", "1.2.840.10008.1.3.10"},
{ "CT-MONO2-16-brain.dcm","1.2.840.10008.5.1.4.1.1.2"},
{ "D_CLUNIE_RG2_JPLY.dcm","1.2.840.10008.5.1.4.1.1.1"},
{ "MAROTECH_CT_JP2Lossy.dcm","1.2.840.10008.5.1.4.1.1.2"},
{ "D_CLUNIE_MR1_JPLL.dcm","1.2.840.10008.5.1.4.1.1.4"},
{ "ITK_GDCM124_MultiframeSecondaryCaptureInvalid.dcm","1.2.840.10008.5.1.4.1.1.7"},
{ "dicomdir_With_embedded_icons", "1.2.840.10008.1.3.10"},
{ "SIEMENS_MAGNETOM-12-ACR_NEMA_2-Modern.dcm", "" },
{ "MR_SIEMENS_forceLoad29-1010_29-1020.dcm","1.2.840.10008.5.1.4.1.1.4"},
{ "simpleImageWithIcon.dcm","1.2.840.10008.5.1.4.1.1.7"},
{ "D_CLUNIE_MR3_JPLL.dcm","1.2.840.10008.5.1.4.1.1.4"},
{ "D_CLUNIE_RG1_JPLL.dcm","1.2.840.10008.5.1.4.1.1.1"},
{ "US-MONO2-8-8x-execho.dcm","1.2.840.10008.5.1.4.1.1.3"},
{ "XA-MONO2-8-12x-catheter.dcm","1.2.840.10008.5.1.4.1.1.12.1"},
//{ "TheralysGDCM120Bug.README.txt (could not be read)},
{ "GE_LOGIQBook-8-RGB-HugePreview.dcm","1.2.840.10008.5.1.4.1.1.7"},
//{ "MR_Philips_Intera_PrivateSequenceImplicitVR.README.txt (could not be read)},
{ "gdcm-MR-SIEMENS-16-2.acr", ""},
{ "gdcm-MR-PHILIPS-16-Multi-Seq.dcm","1.2.840.10008.5.1.4.1.1.4"},
{ "D_CLUNIE_XA1_RLE.dcm","1.2.840.10008.5.1.4.1.1.7"},
{ "NM-MONO2-16-13x-heart.dcm","1.2.840.10008.5.1.4.1.1.20"},
{ "gdcm-JPEG-LossLessThoravision.dcm","1.2.840.10008.5.1.4.1.1.1"},
//{ "SIEMENS_MAGNETOM-12-MONO2-GDCM12-VRUN.txt (could not be read)},
{ "GE_DLX-8-MONO2-Multiframe.dcm","1.2.840.10008.5.1.4.1.1.12.1"},
{ "PHILIPS_Intera-16-MONO2-Uncompress.dcm","1.2.840.10008.5.1.4.1.1.4"},
{ "D_CLUNIE_MR2_JPLY.dcm","1.2.840.10008.5.1.4.1.1.4"},
{ "05148044-mr-siemens-avanto-syngo.dcm","1.2.840.10008.5.1.4.1.1.4"},
{ "D_CLUNIE_VL3_RLE.dcm","1.2.840.10008.5.1.4.1.1.7"},
{ "D_CLUNIE_RG2_RLE.dcm","1.2.840.10008.5.1.4.1.1.1"},
{ "SIEMENS_MAGNETOM-12-MONO2-GDCM12-VRUN.dcm","1.2.840.10008.5.1.4.1.1.4"},
{ "KODAK-12-MONO1-Odd_Terminated_Sequence.dcm","1.2.840.10008.5.1.4.1.1.1"},
{ "SIEMENS-MR-RGB-16Bits.dcm","1.2.840.10008.5.1.4.1.1.4"},
{ "CR-MONO1-10-chest.dcm","1.2.840.10008.5.1.4.1.1.1"},
{ "DX_GE_FALCON_SNOWY-VOI.dcm","1.2.840.10008.5.1.4.1.1.1.1"},
{ "US-IRAD-NoPreambleStartWith0003.dcm","1.2.840.10008.5.1.4.1.1.6"},
{ "MR-Brucker-CineTagging-NonSquarePixels.dcm","1.2.840.10008.5.1.4.1.1.4"},
{ "D_CLUNIE_VL6_RLE.dcm","1.2.840.10008.5.1.4.1.1.7"},
{ "MR_Philips_Intera_PrivateSequenceImplicitVR.dcm","1.2.840.10008.5.1.4.1.1.4"},
{ "fffc0000UN.dcm","1.2.840.10008.5.1.4.1.1.7"},
{ "CT-MONO2-12-lomb-an2.acr" , "" },
{ "SIEMENS_Sonata-12-MONO2-SQ.dcm","1.2.840.10008.5.1.4.1.1.4"},
{ "ACUSON-24-YBR_FULL-RLE-b.dcm","1.2.840.10008.5.1.4.1.1.6.1"},
{ "CT-MONO2-16-ankle.dcm","1.2.840.10008.5.1.4.1.1.7"},
{ "GE_DLX-8-MONO2-Multiframe-Jpeg_Lossless.dcm","1.2.840.10008.5.1.4.1.1.12.1"},
{ "MR-SIEMENS-DICOM-WithOverlays-extracted-overlays.dcm","1.2.840.10008.5.1.4.1.1.7"},
{ "CT-MONO2-16-ort.dcm","1.2.840.10008.5.1.4.1.1.2"},
{ "LEADTOOLS_FLOWERS-16-MONO2-JpegLossless.dcm","1.2.840.10008.5.1.4.1.1.7"},
{ "D_CLUNIE_NM1_JPLL.dcm","1.2.840.10008.5.1.4.1.1.7"},
{ "D_CLUNIE_VL1_RLE.dcm","1.2.840.10008.5.1.4.1.1.7"},
{ "IM-0001-0066.dcm","1.2.840.10008.5.1.4.1.1.4"},
{ "SIEMENS_MAGNETOM-12-MONO2-VRUN.dcm","1.2.840.10008.5.1.4.1.1.4"},
{ "PhilipsInteraSeqTermInvLen.dcm","1.2.840.10008.5.1.4.1.1.4"},
{ "PHILIPS_GDCM12xBug.dcm" , "1.2.840.10008.5.1.4.1.1.4" },
{ "OsirixFake16BitsStoredFakeSpacing.dcm", "1.2.840.10008.5.1.4.1.1.7" },
{ "IM-0001-0066.CommandTag00.dcm", "1.2.840.10008.5.1.4.1.1.4" },
{ "AMIInvalidPrivateDefinedLengthSQasUN.dcm" , "1.2.840.10008.5.1.4.1.1.4" },
{ "GDCMJ2K_TextGBR.dcm" , "1.2.840.10008.5.1.4.1.1.7" },
{ "MR16BitsAllocated_8BitsStored.dcm" , "1.2.840.10008.5.1.4.1.1.4" },
{ "D_CLUNIE_CT1_JLSL.dcm", "1.2.840.10008.5.1.4.1.1.2" },
{ "JPEGDefinedLengthSequenceOfFragments.dcm" , "1.2.840.10008.5.1.4.1.1.2" },
{ "PHILIPS_GDCM12xBug2.dcm" , "1.2.840.10008.5.1.4.1.1.4" },
{ "DCMTK_JPEGExt_12Bits.dcm" , "1.2.840.10008.5.1.4.1.1.7" },
{ "UnexpectedSequenceDelimiterInFixedLengthSequence.dcm" , "1.2.840.10008.5.1.4.1.1.20" },
{ "NM_Kakadu44_SOTmarkerincons.dcm" , "1.2.840.10008.5.1.4.1.1.1" },
{ "D_CLUNIE_CT1_JLSN.dcm", "1.2.840.10008.5.1.4.1.1.2" },
{ "TOSHIBA_J2K_SIZ1_PixRep0.dcm", "1.2.840.10008.5.1.4.1.1.2"},
{ "TOSHIBA_J2K_SIZ0_PixRep1.dcm", "1.2.840.10008.5.1.4.1.1.2" },
{ "TOSHIBA_J2K_OpenJPEGv2Regression.dcm", "1.2.840.10008.5.1.4.1.1.2" },
{ "NM-PAL-16-PixRep1.dcm", "1.2.840.10008.5.1.4.1.1.20" },
{ "MEDILABInvalidCP246_EVRLESQasUN.dcm", "1.2.840.10008.5.1.4.1.1.2" },
{ "JPEGInvalidSecondFrag.dcm", "1.2.840.10008.5.1.4.1.1.2" },
{ "ELSCINT1_PMSCT_RLE1_priv.dcm", "1.2.840.10008.5.1.4.1.1.2" },
{ "unreadable.dcm", "1.2.840.10008.5.1.4.1.1.2" },
{ "SC16BitsAllocated_8BitsStoredJPEG.dcm" , "1.2.840.10008.5.1.4.1.1.7" },
{ "SC16BitsAllocated_8BitsStoredJ2K.dcm" , "1.2.840.10008.5.1.4.1.1.7" },
{ "SIEMENS_SYNGO-12-MONO2-LUTWrongLength512.dcm" , "1.2.840.10008.5.1.4.1.1.4" },
{ "JPEGNote_empty.dcm" , "1.2.840.10008.5.1.4.1.1.7" },
{ "JPEGLS_CharLS_10742.dcm" , "1.2.840.10008.5.1.4.1.1.7" },
{ "JPEGLosslessYBR_FULL_422.dcm" , "1.2.840.10008.5.1.4.1.1.7" },
{ "JPEGNote_missing.dcm" , "1.2.840.10008.5.1.4.1.1.7" },
{ "JPEGNote_bogus.dcm" , "1.2.840.10008.5.1.4.1.1.7" },
{ "RLEDebianBug816607Orig.dcm" , "1.2.840.10008.5.1.4.1.1.7" },
{ "IllegalGroup2ImplicitTS.dcm" , "1.2.840.10008.5.1.4.1.1.1" },
{ "JPEG_LS_InvalidEscapeSequence_COM_padding.dcm" , "1.2.840.10008.5.1.4.1.1.7" },
{ "LengthOfItemLarger.dcm" , "1.2.840.10008.5.1.4.1.1.4" },
{ "GE_MR_0025xx1bProtocolDataBlockXML.dcm" , "1.2.840.10008.5.1.4.1.1.4" },
{ "MITRA_CORNELL.dcm" , "1.2.840.10008.5.1.4.1.1.7" },
{ "EmptyIcon_Bug417.dcm" , "1.2.840.10008.5.1.4.1.1.2" },
{ "EnhancedWithIPPPerFrameIOPShared.dcm" , "1.2.840.10008.5.1.4.1.1.13.1.2" },
{ "FUJI-ffff-MONO1-J2K.dcm" , "1.2.840.10008.5.1.4.1.1.1" },
{ "JPEGLosslessSeNonZero.dcm" , "1.2.840.10008.5.1.4.1.1.7" },
{ "US-YBR_FULL_422-EVRLE.dcm" , "1.2.840.10008.5.1.4.1.1.6.1" },
{ "PET-GE-dicomwrite-PixelDataSQUN.dcm" , "1.2.840.10008.5.1.4.1.1.128" },
{ "Osirix10vs8BitsStored.dcm" , "1.2.840.10008.5.1.4.1.1.4" },
{ "Bug_Siemens_PrivateIconNoItem.dcm" , "1.2.840.10008.5.1.4.1.1.2" },
{ "HardcopyColor_YBR_RCT_J2K_PC1.dcm" , "1.2.840.10008.5.1.1.30" },
{ "PET-GE-dicomwrite-PixelDataSQUNv2.dcm" , "1.2.840.10008.5.1.4.1.1.128" },
{ "PET-GE-dicomwrite-PixelDataSQUNv3.dcm" , "1.2.840.10008.5.1.4.1.1.128" },
{ "MEDILABValidCP246_EVRLESQasOB.dcm" , "1.2.840.10008.5.1.4.1.1.2" },
/* Stopping condition */
{ nullptr ,nullptr }
};
gdcm-3.0.22/Testing/Source/Data/NativeDICOM.rnc 000664 001766 001770 00000005140 14517730450 023311 0 ustar 00mmalaterre mmalaterre 000000 000000 # PS 3.19-2011
# A.1.6 Schema
# The Normative version of the XML Schema for the Native DICOM Model follows:
default namespace="http://dicom.nema.org/PS3.19/models/NativeDICOM"
# This schema was created as an intermediary, a means of describing
# native binary encoded DICOM objects as XML Infosets, thus allowing
# one to manipulate binary DICOM objects using familiar XML tools.
# As such, the schema is designed to facilitate a simple, mechanical,
# bi-directional translation between binary encoded DICOM and XML-like
# constructs without constraints, and to simplify identifying portions
# of a DICOM object using XPath statements.
#
# Since this schema has minimal type checking, it is neither intended
# to be used for any operation that involves hand coding, nor to
# describe a definitive, fully validating encoding of DICOM concepts
# into XML, as what one might use, for example, in a robust XML
# database system or in XML-based forms, though it may be used
# as a means for translating binary DICOM Objects into such a form
# (e.g. through an XSLT script).
start = element NativeDicomModel { DicomDataSet }
# A DICOM Data Set is as defined in PS3.5. It does not appear
# as an XML Element, since it does not appear in the binary encoded
# DICOM objects. It exists here merely as a documentation aid.
DicomDataSet = DicomAttribute*
DicomAttribute = element DicomAttribute {
Tag, VR, Keyword?, PrivateCreator?,
( BulkData | Value+ | Item+ | PersonName+ )?
}
BulkData = element BulkData{ UUID }
Value = element Value { Number, xsd:string }
Item = element Item { Number, DicomDataSet }
PersonName = element PersonName {
Number,
element SingleByte { NameComponents }?,
element Ideographic { NameComponents }?,
element Phonetic { NameComponents }?
}
NameComponents =
element FamilyName {xsd:string}?,
element GivenName {xsd:string}?,
element MiddleName {xsd:string}?,
element NamePrefix {xsd:string}?,
element NameSuffix {xsd:string}?
# keyword is the attribute tag from PS3.6
# (derived from the DICOM Attribute's name)
Keyword = attribute keyword { xsd:token }
# canonical XML definition of Hex, with lowercase letters disallowed
Tag = attribute tag { xsd:string{ minLength="8" maxLength="8" pattern="[0-9A-F]{8}" } }
VR = attribute vr { "AE" | "AS" | "AT" | "CS" | "DA" | "DS" | "DT" | "FL" | "FD"
| "IS" | "LO" | "LT" | "OB" | "OF" | "OW" | "PN" | "SH" | "SL"
| "SQ" | "SS" | "ST" | "TM" | "UI" | "UL" | "UN" | "US" | "UT" }
PrivateCreator = attribute privateCreator{ xsd:string }
UUID = attribute uuid { xsd:string }
Number = attribute number { xsd:positiveInteger }
gdcm-3.0.22/Testing/Source/Data/gdcmStreamOffsetDataFiles.cxx 000664 001766 001770 00000024210 14517730450 026340 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http:/gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
/*
* See TestReaderUpToTag
*/
struct StreamOffset
{
const char *filename;
std::streamoff offset;
};
static const StreamOffset gdcmStreamOffsetDataFiles[] = {
{ "00191113.dcm",934 },
{ "012345.002.050.dcm",9604 },
{ "05115014-mr-siemens-avanto-syngo-with-palette-icone.dcm",41948 },
{ "05148044-mr-siemens-avanto-syngo.dcm",55884 },
{ "3E768EB7.dcm",3234 },
{ "ACUSON-24-YBR_FULL-RLE-b.dcm",2032 },
{ "ACUSON-24-YBR_FULL-RLE.dcm",1920 },
{ "ALOKA_SSD-8-MONO2-RLE-SQ.dcm",1398 },
{ "AMIInvalidPrivateDefinedLengthSQasUN.dcm", 12744 },
{ "BugGDCM2_UndefItemWrongVL.dcm",9570 },
{ "CR-MONO1-10-chest.dcm",776 },
{ "CT-MONO2-12-lomb-an2.acr",1230 },
{ "CT-MONO2-16-ankle.dcm",1148 },
{ "CT-MONO2-16-brain.dcm",1680 },
{ "CT-MONO2-16-chest.dcm",1638 },
{ "CT-MONO2-16-ort.dcm",1674 },
{ "CT-MONO2-8-abdo.dcm",796 },
{ "CT-SIEMENS-Icone-With-PaletteColor.dcm",8162 },
{ "CT-SIEMENS-MissingPixelDataInIconSQ.dcm",20504 },
{ "CT_16b_signed-UsedBits13.dcm",2582 },
{ "DCMTK_JPEGExt_12Bits.dcm",796 },
{ "DICOMDIR",1112434 },
{ "DICOMDIR-Philips-EasyVision-4200-Entries",1297194 },
{ "DICOMDIR_MR_B_VA12A", 14853880},
{ "DMCPACS_ExplicitImplicit_BogusIOP.dcm",66618 },
{ "DX_GE_FALCON_SNOWY-VOI.dcm",104014 },
{ "DX_J2K_0Padding.dcm",1494 },
{ "D_CLUNIE_CT1_J2KI.dcm",6596 },
{ "D_CLUNIE_CT1_J2KR.dcm",6496 },
{ "D_CLUNIE_CT1_JLSL.dcm", 6464 },
{ "D_CLUNIE_CT1_JLSN.dcm", 6578 },
{ "D_CLUNIE_CT1_JPLL.dcm",6468 },
{ "D_CLUNIE_CT1_RLE.dcm",6402 },
{ "D_CLUNIE_CT2_JPLL.dcm",1756 },
{ "D_CLUNIE_CT2_RLE.dcm",1688 },
{ "D_CLUNIE_MR1_JPLL.dcm",1762 },
{ "D_CLUNIE_MR1_JPLY.dcm",1848 },
{ "D_CLUNIE_MR1_RLE.dcm",1694 },
{ "D_CLUNIE_MR2_JPLL.dcm",1958 },
{ "D_CLUNIE_MR2_JPLY.dcm",2046 },
{ "D_CLUNIE_MR2_RLE.dcm",1890 },
{ "D_CLUNIE_MR3_JPLL.dcm",9582 },
{ "D_CLUNIE_MR3_JPLY.dcm",9670 },
{ "D_CLUNIE_MR3_RLE.dcm",9516 },
{ "D_CLUNIE_MR4_JPLL.dcm",1980 },
{ "D_CLUNIE_MR4_JPLY.dcm",2068 },
{ "D_CLUNIE_MR4_RLE.dcm",1912 },
{ "D_CLUNIE_NM1_JPLL.dcm",2902 },
{ "D_CLUNIE_NM1_JPLY.dcm",2990 },
{ "D_CLUNIE_NM1_RLE.dcm",2838 },
{ "D_CLUNIE_RG1_JPLL.dcm",1870 },
{ "D_CLUNIE_RG1_RLE.dcm",1806 },
{ "D_CLUNIE_RG2_JPLL.dcm",1456 },
{ "D_CLUNIE_RG2_JPLY.dcm",1544 },
{ "D_CLUNIE_RG2_RLE.dcm",1380 },
{ "D_CLUNIE_RG3_JPLL.dcm",1526 },
{ "D_CLUNIE_RG3_JPLY.dcm",1614 },
{ "D_CLUNIE_RG3_RLE.dcm",1444 },
{ "D_CLUNIE_SC1_JPLY.dcm",1352 },
{ "D_CLUNIE_SC1_RLE.dcm",1188 },
{ "D_CLUNIE_US1_RLE.dcm",1318 },
{ "D_CLUNIE_VL1_RLE.dcm",1200 },
{ "D_CLUNIE_VL2_RLE.dcm",1198 },
{ "D_CLUNIE_VL3_RLE.dcm",1210 },
{ "D_CLUNIE_VL4_RLE.dcm",1192 },
{ "D_CLUNIE_VL6_RLE.dcm",1210 },
{ "D_CLUNIE_XA1_JPLL.dcm",1204 },
{ "D_CLUNIE_XA1_JPLY.dcm",1292 },
{ "D_CLUNIE_XA1_RLE.dcm",1128 },
{ "DermaColorLossLess.dcm",940 },
{ "ELSCINT1_JP2vsJ2K.dcm",1820 },
{ "ELSCINT1_PMSCT_RLE1.dcm",67912 },
{ "ExplicitVRforPublicElementsImplicitVRforShadowElements.dcm",9546 },
{ "FUJI-10-MONO1-ACR_NEMA_2.dcm",862 },
{ "GE_CT_With_Private_compressed-icon.dcm",10810 },
{ "GE_DLX-8-MONO2-Multiframe-Jpeg_Lossless.dcm",14138 },
{ "GE_DLX-8-MONO2-Multiframe.dcm",4984 },
{ "GE_DLX-8-MONO2-PrivateSyntax.dcm",2920 },
{ "GE_GENESIS-16-MONO2-Uncompressed-UnusualVR.dcm",9666 },
{ "GE_GENESIS-16-MONO2-WrongLengthItem.dcm",1930 },
{ "GE_LOGIQBook-8-RGB-HugePreview.dcm",935608 },
{ "GE_MR_0025xx1bProtocolDataBlock.dcm",11882 },
{ "GE_RHAPSODE-16-MONO2-JPEG-Fragments.dcm",6468 },
{ "ITK_GDCM124_MultiframeSecondaryCaptureInvalid.dcm",1144 },
{ "JDDICOM_Sample2-dcmdjpeg.dcm",848 },
{ "JDDICOM_Sample2.dcm",834 },
{ "JPEGDefinedLengthSequenceOfFragments.dcm",2874 },
{ "JPEG_LossyYBR.dcm",2378 },
{ "KODAK-12-MONO1-Odd_Terminated_Sequence.dcm",9134 },
{ "KODAK_CompressedIcon.dcm",8646 },
{ "LEADTOOLS_FLOWERS-16-MONO2-JpegLossless.dcm",1944 },
{ "LEADTOOLS_FLOWERS-16-MONO2-RLE.dcm",1942 },
{ "LEADTOOLS_FLOWERS-16-MONO2-Uncompressed.dcm",1942 },
{ "LEADTOOLS_FLOWERS-24-RGB-JpegLossless.dcm",1936 },
{ "LEADTOOLS_FLOWERS-24-RGB-JpegLossy.dcm",1936 },
{ "LEADTOOLS_FLOWERS-24-RGB-Uncompressed.dcm",1934 },
{ "LEADTOOLS_FLOWERS-8-MONO2-JpegLossy.dcm",1944 },
{ "LEADTOOLS_FLOWERS-8-MONO2-RLE.dcm",1942 },
{ "LEADTOOLS_FLOWERS-8-MONO2-Uncompressed.dcm",1942 },
{ "LEADTOOLS_FLOWERS-8-PAL-RLE.dcm",3538 },
{ "LEADTOOLS_FLOWERS-8-PAL-Uncompressed.dcm",3538 },
{ "LIBIDO-8-ACR_NEMA-Lena_128_128.acr",182 },
{ "LJPEG_BuginGDCM12.dcm",2248 },
{ "MARCONI_MxTWin-12-MONO2-JpegLossless-ZeroLengthSQ.dcm",1916 },
{ "MAROTECH_CT_JP2Lossy.dcm",33856 },
{ "MR-Brucker-CineTagging-NonSquarePixels.dcm",1542 },
{ "MR-MONO2-12-an2.acr",1866 },
{ "MR-MONO2-12-angio-an1.acr",650 },
{ "MR-MONO2-12-shoulder.dcm",1580 },
{ "MR-MONO2-16-head.dcm",1804 },
{ "MR-MONO2-8-16x-heart.dcm",920 },
{ "MR-SIEMENS-DICOM-WithOverlays-extracted-overlays.dcm", 42612 },
{ "MR-SIEMENS-DICOM-WithOverlays.dcm",42416 },
{ "MR16BitsAllocated_8BitsStored.dcm",940 },
{ "MR_ELSCINT1_00e1_1042_SQ_feff_00e0_Item.dcm",7704 },
{ "MR_GE_with_Private_Compressed_Icon_0009_1110.dcm",20712 },
{ "MR_Philips-Intera_BreaksNOSHADOW.dcm",7626 },
{ "MR_Philips_Intera_No_PrivateSequenceImplicitVR.dcm",9508 },
{ "MR_Philips_Intera_PrivateSequenceExplicitVR_in_SQ_2001_e05f_item_wrong_lgt_use_NOSHADOWSEQ.dcm",7524 },
{ "MR_Philips_Intera_PrivateSequenceImplicitVR.dcm",7026 },
{ "MR_Philips_Intera_SwitchIndianess_noLgtSQItem_in_trueLgtSeq.dcm",9276 },
{ "MR_SIEMENS_forceLoad29-1010_29-1020.dcm",60564 },
{ "MR_Spectroscopy_SIEMENS_OF.dcm",2102344 },
{ "NM-MONO2-16-13x-heart.dcm",1234 },
{ "OT-MONO2-8-a7.dcm",438 },
{ "OT-PAL-8-face.dcm",1654 },
{ "OsirixFake16BitsStoredFakeSpacing.dcm",1318 },
{ "PHILIPS_Brilliance_ExtraBytesInOverlay.dcm",34550 },
{ "PHILIPS_GDCM12xBug.dcm",9338 },
{ "PHILIPS_GDCM12xBug2.dcm",9670 },
{ "PHILIPS_Gyroscan-12-MONO2-Jpeg_Lossless.dcm",15378 },
{ "PHILIPS_Gyroscan-8-MONO2-Odd_Sequence.dcm", 6584 },
{ "PHILIPS_Intera-16-MONO2-Uncompress.dcm",9276 },
{ "PICKER-16-MONO2-Nested_icon.dcm",18228 },
{ "PICKER-16-MONO2-No_DicomV3_Preamble.dcm",1406 },
{ "PrivateGEImplicitVRBigEndianTransferSyntax16Bits.dcm",14972 },
{ "RadBWLossLess.dcm",942 },
{ "SIEMENS-12-Jpeg_Process_2_4-Lossy-a.dcm",3044 },
{ "SIEMENS-MR-RGB-16Bits.dcm",49852 },
{ "SIEMENS_CSA2.dcm",104352 },
{ "SIEMENS_ImageLocationUN.dcm",6348 },
{ "SIEMENS_MAGNETOM-12-ACR_NEMA_2-Modern.dcm",6052 },
{ "SIEMENS_MAGNETOM-12-MONO2-FileSeq0.dcm",6430 },
{ "SIEMENS_MAGNETOM-12-MONO2-FileSeq1.dcm",6430 },
{ "SIEMENS_MAGNETOM-12-MONO2-FileSeq2.dcm",6430 },
{ "SIEMENS_MAGNETOM-12-MONO2-FileSeq3.dcm",6430 },
{ "SIEMENS_MAGNETOM-12-MONO2-GDCM12-VRUN.dcm",5170 },
{ "SIEMENS_MAGNETOM-12-MONO2-Uncompressed.dcm",5160 },
{ "SIEMENS_MAGNETOM-12-MONO2-VRUN.dcm",5302 },
{ "SIEMENS_MOSAIC_12BitsStored-16BitsJPEG.dcm",105726 },
{ "SIEMENS_SOMATOM-12-ACR_NEMA-ZeroLengthUs.acr",5064 },
{ "SIEMENS_Sonata-12-MONO2-SQ.dcm",51804 },
{ "SIEMENS_Sonata-16-MONO2-Value_Multiplicity.dcm",25686 },
{ "SignedShortLosslessBug.dcm",1784 },
{ "TG18-CH-2k-01.dcm",2308 },
{ "THERALYS-12-MONO2-Uncompressed-Even_Length_Tag.dcm",1839 },
{ "TOSHIBA_MRT150-16-MONO2-ACR_NEMA_2.dcm",1130 },
{ "TheralysGDCM120Bug.dcm",8450 },
{ "US-GE-4AICL142.dcm",14072 },
{ "US-IRAD-NoPreambleStartWith0003.dcm",3330 },
{ "US-IRAD-NoPreambleStartWith0005.dcm",2490 },
{ "US-MONO2-8-8x-execho.dcm",976 },
{ "US-PAL-8-10x-echo.dcm",2428 },
{ "US-RGB-8-epicard.dcm",1012 },
{ "US-RGB-8-esopecho.dcm",904 },
{ "XA-MONO2-8-12x-catheter.dcm",1006 },
{ "dicomdir_Acusson_WithPrivate_WithSR",3826 },
{ "dicomdir_Pms_WithVisit_WithPrivate_WithStudyComponents",37218 },
{ "dicomdir_Pms_With_heavy_embedded_sequence",3003414 },
{ "dicomdir_With_embedded_icons", 7125212 },
{ "fffc0000UN.dcm",1154 },
{ "gdcm-ACR-LibIDO.acr",182 },
{ "gdcm-CR-DCMTK-16-NonSamplePerPix.dcm",740 },
{ "gdcm-JPEG-Extended.dcm",2946 },
{ "gdcm-JPEG-LossLess3a.dcm",2540 },
{ "gdcm-JPEG-LossLessThoravision.dcm",3144 },
{ "gdcm-MR-PHILIPS-16-Multi-Seq.dcm",35846 },
{ "gdcm-MR-PHILIPS-16-NonSquarePixels.dcm",5010 },
{ "gdcm-MR-SIEMENS-16-2.acr",6052 },
{ "gdcm-US-ALOKA-16.dcm",258740 },
{ "libido1.0-vol.acr",170 },
{ "rle16loo.dcm",394226 },
{ "rle16sti.dcm",394170 },
{ "simpleImageWithIcon.dcm",17478 },
{ "test.acr",182 },
{ "undefined_length_un_vr.dcm",9168 },
{ "IM-0001-0066.CommandTag00.dcm", 3050 },
{ "PHILIPS_Gyroscan-12-Jpeg_Extended_Process_2_4.dcm", 5956 },
{ "UnexpectedSequenceDelimiterInFixedLengthSequence.dcm", 4190 },
{ "GDCMJ2K_TextGBR.dcm", 770 },
{ "NM_Kakadu44_SOTmarkerincons.dcm", 1576 },
{ "PhilipsInteraSeqTermInvLen.dcm", 7452},
{ "LIBIDO-24-ACR_NEMA-Rectangle.dcm", 182 },
{ "TOSHIBA_J2K_SIZ1_PixRep0.dcm", 2362 },
{ "TOSHIBA_J2K_OpenJPEGv2Regression.dcm", 2362 },
{ "TOSHIBA_J2K_SIZ0_PixRep1.dcm", 2346 },
{ "NM-PAL-16-PixRep1.dcm", 4468 },
{ "MEDILABInvalidCP246_EVRLESQasUN.dcm", 19174 },
{ "JPEGInvalidSecondFrag.dcm", 4800 },
{ "lena512_rot90.j2k.dcm", 768 },
{ "ELSCINT1_PMSCT_RLE1_priv.dcm", 298002 },
{ "unreadable.dcm", 249230 },
{ "SC16BitsAllocated_8BitsStoredJ2K.dcm", 764 },
{ "SC16BitsAllocated_8BitsStoredJPEG.dcm", 958 },
{ "SIEMENS_SYNGO-12-MONO2-LUTWrongLength512.dcm", 48726 },
{ "JPEGNote_empty.dcm", 716 },
{ "JPEGLS_CharLS_10742.dcm", 760 },
{ "JPEGLosslessYBR_FULL_422.dcm", 814 },
{ "JPEGNote_missing.dcm", 608 },
{ "JPEGNote_bogus.dcm", 734 },
{ "RLEDebianBug816607Orig.dcm", 780 },
{ "IllegalGroup2ImplicitTS.dcm", 2272 },
{ "JPEG_LS_InvalidEscapeSequence_COM_padding.dcm", 764 },
{ "LengthOfItemLarger.dcm", 12748 },
{ "GE_MR_0025xx1bProtocolDataBlockXML.dcm",6474 },
{ "EmptyIcon_Bug417.dcm",4482 },
{ "EnhancedWithIPPPerFrameIOPShared.dcm",23224 },
{ "FUJI-ffff-MONO1-J2K.dcm",2052 },
{ "JPEGLosslessSeNonZero.dcm",760 },
{ "US-YBR_FULL_422-EVRLE.dcm",1554 },
{ "Osirix10vs8BitsStored.dcm",73978 },
{ "Bug_Siemens_PrivateIconNoItem.dcm",12978 },
{ "HardcopyColor_YBR_RCT_J2K_PC1.dcm",2626 },
{ "PET-GE-dicomwrite-PixelDataSQUNv2.dcm",7718 },
{ "MEDILABValidCP246_EVRLESQasOB.dcm",19008 },
/* Stopping condition */
{ nullptr ,0 },
};
gdcm-3.0.22/Testing/Source/Data/text 000664 001766 001770 00000000044 14517730450 021510 0 ustar 00mmalaterre mmalaterre 000000 000000 1234567890abcdefghijklmnopqrstuvwxyz gdcm-3.0.22/Testing/Source/Data/out.bin 000664 001766 001770 00000000731 14517730450 022105 0 ustar 00mmalaterre mmalaterre 000000 000000 0‚Õ *†H†÷
‚Æ0‚Â 1‚n0‚j 0R0E10 UAU10U
Some-State1!0U
Internet Widgits Pty Ltd ¬–mˆxzQ´0
*†H†÷
‚ Å.iÎÅߨîùÕ3åGG€œ{šk‘!ºÙ³–ñ_.S#+múNqÝ
ÌÔý‡:HÊTíý;#Þ7¨‡¤µîū剋—^J9ššv¤¤¾É,JœC¶c§ˆâ/Xq‚ 4“f"v}…>Lë¡ãÏ»ü¡Àqƒ¸)#Õ;dÄ=æ³Dc>s;J¾2‘İKÏ< %\ÞV‡Sj‹°6R‰ç¹9>õ0@ÊÉHG߉ü¢åš=;—×BÌLsA&Ҟі°šªac’
뵘õb|C¥šjga™YÉé×pñP¤ÍB¶‡ŒØÉ©§œThý÷†—–H
ïL+,9Â+è¾Íå•0K *†H†÷
0*†H†÷
5Åq"ÈäaÓ€(Ä6‘c‡ “š™rUþ@yÁ‹uV ¡Ö9b}„¡úz-¡˜½NÙ
Þ|¹ gdcm-3.0.22/Testing/Source/Data/gdcmMD5DataBrokenImages.cxx 000664 001766 001770 00000012553 14517730450 025636 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http:/gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
/*
* See TestWriter
*/
// This is the full md5 of the rewritten file. The file was manually check
// and is (should be) exactly what should have been written in the first place
// test was done using dcmtk 3.5.4 / dicom3tools
static const char * const gdcmMD5DataBrokenImages[][2] = {
// file has some garbage at the end, replace with a trailing end item.
{ "e8ed75f5e13cc20e96ee716bcc78351b" , "gdcm-JPEG-LossLess3a.dcm" }, // size match
// files are little endian implicit meta data header:
{ "8cb29ba0173c66e7adb4c54c6b0a5896" , "GE_DLX-8-MONO2-PrivateSyntax.dcm" },
{ "ed93b34819bf2acbacefb510476e8d4a" , "PICKER-16-MONO2-No_DicomV3_Preamble.dcm" },
// stupidest file ever, 0x6 was sent in place of 0x4 ... sigh
{ "c8cce480eac80770a3c6e456c7d8d66f" , "SIEMENS_MAGNETOM-12-MONO2-Uncompressed.dcm" }, // size match
// big endian / little endian nightmare from PMS
{ "df0e01aae299317db1719e4de72b8937" , "MR_Philips_Intera_SwitchIndianess_noLgtSQItem_in_trueLgtSeq.dcm" }, // size match and CheckbigEndian match => ok !
{ "df632a3b5ca38340faa612a23b907ac4" , "PHILIPS_Intera-16-MONO2-Uncompress.dcm" }, // size match and CheckbigEndian match => ok !
{ "6bf002815fad665392acab24f09caa5e" , "MR_Philips_Intera_PrivateSequenceExplicitVR_in_SQ_2001_e05f_item_wrong_lgt_use_NOSHADOWSEQ.dcm" }, // size match and CheckbigEndian match => ok !
// little endian implicit meta header + a couple of attribute sent with correct, but odd length:
{ "e1b2956f781685fc9e46e0da26b8a0fd" , "THERALYS-12-MONO2-Uncompressed-Even_Length_Tag.dcm" },
// name says it all. dcmtk does not support this. dicom3tools confirmed that dataset is compatible
{ "66a75503221ef32b0236cf9f78e169ff" , "ExplicitVRforPublicElementsImplicitVRforShadowElements.dcm" }, // size mismatch
// item length are supposed to be 0, not FFFF...
{ "3cc629fa470efb114a14ca3909117eb8" , "SIEMENS-MR-RGB-16Bits.dcm" }, // size match
{ "0fb0cb12f2b038bbfe1014bbf2935026" , "MR-SIEMENS-DICOM-WithOverlays-extracted-overlays.dcm" }, // size match
// this is a private syntax from ge with a little endian dataset and big endian pixel data
// FMI is little endian implicit, it also contained a couple of odd length attributes.
// using dcmtk it looks like file are identical
{ "2d23a8d55425c88bdd5e90f866a11607" , "PrivateGEImplicitVRBigEndianTransferSyntax16Bits.dcm" }, // size mismatch
// couple of weird stuff going on... dcdump confirmed dataset is identical in both file
{ "34abc36682a6e6ba22d7295931b39d85" , "DMCPACS_ExplicitImplicit_BogusIOP.dcm" }, // size mismatch
// weird stuff going on. dcdump confirmed dataset are identical. dcmdump can read output, and size match.
{ "82fda19e1f2046a289fe1307b70510af" , "gdcm-MR-PHILIPS-16-Multi-Seq.dcm" },
// yet another stupidest ever bug, 0xd was replaced with 0xa ... don't ask
{ "a047110a3935dc0fdda24d3b9e4769af" , "GE_GENESIS-16-MONO2-WrongLengthItem.dcm" }, // size match
// empty 16bits after VR should be 0 not garbage...
{ "6cded0f160edfab809cddfce2d562671" , "JDDICOM_Sample2.dcm" }, // size match
// simple issue, last fragment is odd, simply need to pad (easy, should be handle by most implementation)
{ "6234a50361f02cb9a739755d63cdd673" , "00191113.dcm" }, // size mismatch (obviously)
{ "28f9d4114b0699630a77d027910e5e41" , "MARCONI_MxTWin-12-MONO2-JpegLossless-ZeroLengthSQ.dcm" },
// serious bug from gdcm 1.2.0, where VR=UN would be written on 16bits length sigh... no toolkit will ever be able to deal with that thing (and should not anyway)
{ "50752239f24669697897c4b6542bc161" , "SIEMENS_MAGNETOM-12-MONO2-GDCM12-VRUN.dcm" },
// unordered dataset
{ "f221e76c6f0758877aa3cf13632480f4" , "dicomdir_Pms_WithVisit_WithPrivate_WithStudyComponents" }, // size match
// frankenstein-type dicom file:
// 1. Implicit encoding is used any time it is not known (most of the time, private element)
// 2. > (0x2001,0x1068) SQ ? VR= VL=<0xffffffff> is sent twice (don't ask), second entry cannot be stored...
// dcdump kindda show file are somewhat compatible.
{ "69ca7a4300967cf2841da34d7904c6c4" , "TheralysGDCM120Bug.dcm" }, // size mismatch
// GDCM 1.0 generated file. At that time, VL for a start/end item delimiter would be set to 0xFFF... instead of 0x0
// dcmtk / dicom3tools do not seems to care about the value stored for VL, so does GDCM (now).
// As a side note the FMI was set to Little Endian Implicit ...
{ "ddf83cd708e58021a633588927d55ab8" , "BugGDCM2_UndefItemWrongVL.dcm" }, // size mismatch
{ "cb43a6ad60b8eacf718687b82126f625" , "NM_Kakadu44_SOTmarkerincons.dcm" }, // item size mismatch
// Item length are bogus (explicit length)
{ "1225ea0a03b93393f70c73be35e2619d" , "PhilipsInteraSeqTermInvLen.dcm" },
// Two Items in a single Frame JPEG compressed DICOM image:
{ "cd00658f54dbd2d2a9d02d64c6f6497e" , "JPEGInvalidSecondFrag.dcm" },
// VR is set to 'OX'
{ "5793021ffb7b3506ae22ae9329d67d29" , "Bug_Siemens_PrivateIconNoItem.dcm" },
{ nullptr ,nullptr }
};
gdcm-3.0.22/Testing/Source/InformationObjectDefinition/ 000775 001766 001770 00000000000 14517731550 025361 5 ustar 00mmalaterre mmalaterre 000000 000000 gdcm-3.0.22/Testing/Source/InformationObjectDefinition/CMakeLists.txt 000664 001766 001770 00000000117 14517730450 030116 0 ustar 00mmalaterre mmalaterre 000000 000000 add_subdirectory(Cxx)
if(GDCM_WRAP_PYTHON)
add_subdirectory(Python)
endif()
gdcm-3.0.22/Testing/Source/InformationObjectDefinition/Python/ 000775 001766 001770 00000000000 14517731550 026642 5 ustar 00mmalaterre mmalaterre 000000 000000 gdcm-3.0.22/Testing/Source/InformationObjectDefinition/Python/TestMRModule.py 000664 001766 001770 00000002064 14517730450 031540 0 ustar 00mmalaterre mmalaterre 000000 000000 ############################################################################
#
# Program: GDCM (Grassroots DICOM). A DICOM library
#
# Copyright (c) 2006-2011 Mathieu Malaterre
# All rights reserved.
# See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even
# the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the above copyright notice for more information.
#
############################################################################
import gdcm
import os,sys
g = gdcm.Global.GetInstance()
g.LoadResourcesFiles()
defs = g.GetDefs()
modules = defs.GetModules()
macros = defs.GetMacros()
#module = modules.GetModule( "MR Image Module Attributes" )
module = modules.GetModule( "C.8.3.1" )
#print dir(module)
mentry = module.GetModuleEntryInMacros( macros, gdcm.Tag(0x0018,0x0087) )
#print dir(mentry)
print(mentry)
mentry = module.GetModuleEntryInMacros( macros, gdcm.Tag(0x0018,0x1080) )
print(mentry)
# Test succeed ?
sys.exit(0)
gdcm-3.0.22/Testing/Source/InformationObjectDefinition/Python/CMakeLists.txt 000664 001766 001770 00000000350 14517730450 031376 0 ustar 00mmalaterre mmalaterre 000000 000000 # Define the tests for gdcm-python
# gdcm-python
set(GDCM_PYTHON_TEST_SRCS
TestMRModule
)
# Loop over files and create executables
foreach(name ${GDCM_PYTHON_TEST_SRCS})
ADD_PYTHON_TEST(${name}Python ${name}.py)
endforeach()
gdcm-3.0.22/Testing/Source/InformationObjectDefinition/Cxx/ 000775 001766 001770 00000000000 14517731550 026123 5 ustar 00mmalaterre mmalaterre 000000 000000 gdcm-3.0.22/Testing/Source/InformationObjectDefinition/Cxx/TestStudy.cxx 000664 001766 001770 00000001216 14517730450 030615 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmStudy.h"
int TestStudy(int, char *[])
{
gdcm::Study study;
return 0;
}
gdcm-3.0.22/Testing/Source/InformationObjectDefinition/Cxx/TestSeries.cxx 000664 001766 001770 00000001242 14517730450 030736 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmSeries.h"
int TestSeries(int, char *[])
{
gdcm::Series series;
(void)series;
return 0;
}
gdcm-3.0.22/Testing/Source/InformationObjectDefinition/Cxx/TestDefinedTerms.cxx 000664 001766 001770 00000001254 14517730450 032060 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmDefinedTerms.h"
int TestDefinedTerms(int, char *[])
{
gdcm::DefinedTerms dt;
(void)dt;
return 0;
}
gdcm-3.0.22/Testing/Source/InformationObjectDefinition/Cxx/CMakeLists.txt 000664 001766 001770 00000002331 14517730450 030660 0 ustar 00mmalaterre mmalaterre 000000 000000 # Define the tests for Information Object Definition
# IOD
set(IOD_TEST_SRCS
TestTableReader.cxx
TestTable.cxx
TestTableEntry.cxx
TestType.cxx
TestModule.cxx
TestModules.cxx
TestModuleEntry.cxx
TestNestedModuleEntries.cxx
TestIODEntry.cxx
TestIOD.cxx
TestIODs.cxx
TestDefs.cxx
TestPatient.cxx
TestSeries.cxx
TestStudy.cxx
TestDefinedTerms.cxx
TestEnumeratedValues.cxx
TestUsage.cxx
#TestXMLDictReader.cxx
#TestXMLPrivateDictReader.cxx
)
# Add the include paths
include_directories(
"${GDCM_BINARY_DIR}/Source/Common"
"${GDCM_SOURCE_DIR}/Source/Common"
"${GDCM_SOURCE_DIR}/Source/DataStructureAndEncodingDefinition"
"${GDCM_SOURCE_DIR}/Source/DataDictionary"
"${GDCM_SOURCE_DIR}/Source/InformationObjectDefinition"
"${GDCM_BINARY_DIR}/Source/InformationObjectDefinition" # gdcmTables.h
)
create_test_sourcelist(IODTests gdcmIODTests.cxx ${IOD_TEST_SRCS}
EXTRA_INCLUDE gdcmTestDriver.h
)
add_executable(gdcmIODTests ${IODTests})
target_link_libraries(gdcmIODTests gdcmIOD gdcmMSFF)
# Loop over files and create executables
foreach(name ${IOD_TEST_SRCS})
get_filename_component(testname ${name} NAME_WE)
add_test(NAME ${testname} COMMAND gdcmIODTests ${testname})
endforeach()
gdcm-3.0.22/Testing/Source/InformationObjectDefinition/Cxx/TestTableReader.cxx 000664 001766 001770 00000002623 14517730450 031662 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmTableReader.h"
#include "gdcmModules.h"
// generated file:
#include "gdcmTables.h"
void TestReadTable(const char *filename, bool dump = false )
{
gdcm::Defs defs;
gdcm::TableReader tr(defs);
tr.SetFilename(filename);
tr.Read();
const gdcm::Modules &modules = defs.GetModules();
if(dump)
std::cout << modules << std::endl;
const gdcm::Macros ¯os = defs.GetMacros();
if(dump)
std::cout << macros << std::endl;
const gdcm::IODs &iods = defs.GetIODs();
if(dump)
std::cout << iods << std::endl;
}
int TestTableReader(int argc, char *argv[])
{
if( argc == 2 )
{
const char *filename = argv[1];
TestReadTable(filename, true);
return 0;
}
// else
int i = 0;
const char *filename;
while( (filename = gdcmTables[i]) )
{
TestReadTable( filename );
++i;
}
return 0;
}
gdcm-3.0.22/Testing/Source/InformationObjectDefinition/Cxx/TestXMLPrivateDictReader.cxx 000664 001766 001770 00000001616 14517730450 033433 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmXMLPrivateDictReader.h"
int TestXMLPrivateDictReader(int argc, char *argv[])
{
if( argc < 2 )
{
return 1;
}
const char *filename = argv[1];
gdcm::XMLPrivateDictReader tr;
tr.SetFilename(filename);
tr.Read();
std::cout << tr.GetPrivateDict() << std::endl;
//tr.GetPrivateDict().PrintXML();
return 0;
}
gdcm-3.0.22/Testing/Source/InformationObjectDefinition/Cxx/TestIODEntry.cxx 000664 001766 001770 00000001226 14517730450 031143 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmIODEntry.h"
int TestIODEntry(int, char *[])
{
gdcm::IODEntry iode;
return 0;
}
gdcm-3.0.22/Testing/Source/InformationObjectDefinition/Cxx/TestNestedModuleEntries.cxx 000664 001766 001770 00000001266 14517730450 033434 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmNestedModuleEntries.h"
int TestNestedModuleEntries(int, char *[])
{
gdcm::NestedModuleEntries nme;
return 0;
}
gdcm-3.0.22/Testing/Source/InformationObjectDefinition/Cxx/TestXMLDictReader.cxx 000664 001766 001770 00000001516 14517730450 032077 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmXMLDictReader.h"
int TestXMLDictReader(int argc, char *argv[])
{
if( argc < 2 )
{
return 1;
}
const char *filename = argv[1];
gdcm::XMLDictReader tr;
tr.SetFilename(filename);
tr.Read();
std::cout << tr.GetDict() << std::endl;
return 0;
}
gdcm-3.0.22/Testing/Source/InformationObjectDefinition/Cxx/TestType.cxx 000664 001766 001770 00000001213 14517730450 030423 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmType.h"
int TestType(int, char *[])
{
gdcm::Type type;
return 0;
}
gdcm-3.0.22/Testing/Source/InformationObjectDefinition/Cxx/TestDefs.cxx 000664 001766 001770 00000005703 14517730450 030373 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmDefs.h"
#include "gdcmUIDs.h"
#include "gdcmGlobal.h"
#include "gdcmMediaStorage.h"
#include "gdcmSOPClassUIDToIOD.h"
int TestDefs(int, char *[])
{
using gdcm::MediaStorage;
gdcm::Global& g = gdcm::Global::GetInstance();
if( !g.LoadResourcesFiles() )
{
std::cerr << "Could not LoadResourcesFiles" << std::endl;
return 1;
}
const gdcm::Defs &defs = g.GetDefs();
//std::cout << defs.GetMacros() << std::endl;
int ret = 0;
gdcm::MediaStorage::MSType mst;
for ( mst = gdcm::MediaStorage::MediaStorageDirectoryStorage;
mst < gdcm::MediaStorage::MS_END; mst = (gdcm::MediaStorage::MSType)(mst + 1) )
{
const char *iod = defs.GetIODNameFromMediaStorage(mst);
gdcm::UIDs uid;
uid.SetFromUID( gdcm::MediaStorage::GetMSString(mst) /*mst.GetString()*/ );
if( !iod )
{
// We do not support Private IODs (for now??)
if( mst != MediaStorage::PhilipsPrivateMRSyntheticImageStorage
&& mst != MediaStorage::ToshibaPrivateDataStorage
&& mst != MediaStorage::GEPrivate3DModelStorage
&& mst != MediaStorage::Philips3D
&& mst != MediaStorage::CSANonImageStorage
&& mst != MediaStorage::GeneralElectricMagneticResonanceImageStorage )
{
std::cerr << "Missing iod for MS: " << (int)mst << " " <<
gdcm::MediaStorage::GetMSString(mst) << " "; //std::endl;
std::cerr << "MediaStorage is " << (int)mst << " [" << uid.GetName() << "]" << std::endl;
++ret;
}
}
else
{
const char *iod_ref = gdcm::SOPClassUIDToIOD::GetIOD(uid);
if( !iod_ref )
{
std::cerr << "Could not find IOD for SOPClass: " << uid << std::endl;
++ret;
}
else
{
std::string iod_ref_str = iod_ref;
//iod_ref_str += " IOD Modules";
if( iod_ref_str != iod )
{
std::cerr << "UID: " << uid << " ";
std::cerr << "Incompatible IODs: [" << iod << "] versus ref= [" <<
iod_ref_str << "]" << std::endl;
++ret;
}
}
}
}
unsigned int nm = MediaStorage::GetNumberOfModality();
unsigned int nsop = gdcm::SOPClassUIDToIOD::GetNumberOfSOPClassToIOD();
if( nm != nsop )
{
std::cerr << "Incompatible MediaStorage knows: " << nm <<
" SOP Classes while SOPClassUIDToIOD knows: " << nsop << " classes" << std::endl;
++ret;
}
return 0;
}
gdcm-3.0.22/Testing/Source/InformationObjectDefinition/Cxx/TestPatient.cxx 000664 001766 001770 00000001222 14517730450 031106 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmPatient.h"
int TestPatient(int, char *[])
{
gdcm::Patient pat;
return 0;
}
gdcm-3.0.22/Testing/Source/InformationObjectDefinition/Cxx/TestIODs.cxx 000664 001766 001770 00000001212 14517730450 030277 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmIODs.h"
int TestIODs(int, char *[])
{
gdcm::IODs iods;
return 0;
}
gdcm-3.0.22/Testing/Source/InformationObjectDefinition/Cxx/TestUsage.cxx 000664 001766 001770 00000001212 14517730450 030545 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmUsage.h"
int TestUsage(int, char *[])
{
gdcm::Usage u;
return 0;
}
gdcm-3.0.22/Testing/Source/InformationObjectDefinition/Cxx/TestModule.cxx 000664 001766 001770 00000001224 14517730450 030731 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmModule.h"
int TestModule(int , char *[])
{
gdcm::Module module;
return 0;
}
gdcm-3.0.22/Testing/Source/InformationObjectDefinition/Cxx/TestModuleEntry.cxx 000664 001766 001770 00000001373 14517730450 031760 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmModuleEntry.h"
int TestModuleEntry(int, char *[])
{
gdcm::ModuleEntry me("Image Type","1","Image identification characteristics. See C.8.3.1.1.1 for specialization.");
return 0;
}
gdcm-3.0.22/Testing/Source/InformationObjectDefinition/Cxx/TestModules.cxx 000664 001766 001770 00000001230 14517730450 031111 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmModules.h"
int TestModules(int , char *[])
{
gdcm::Modules modules;
return 0;
}
gdcm-3.0.22/Testing/Source/InformationObjectDefinition/Cxx/TestTableEntry.cxx 000664 001766 001770 00000001233 14517730450 031555 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmTableEntry.h"
int TestTableEntry(int , char *[])
{
gdcm::TableEntry te;
return 0;
}
gdcm-3.0.22/Testing/Source/InformationObjectDefinition/Cxx/TestEnumeratedValues.cxx 000664 001766 001770 00000001270 14517730450 032756 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmEnumeratedValues.h"
int TestEnumeratedValues(int, char *[])
{
gdcm::EnumeratedValues ev;
(void)ev;
return 0;
}
gdcm-3.0.22/Testing/Source/InformationObjectDefinition/Cxx/TestTable.cxx 000664 001766 001770 00000001212 14517730450 030530 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmTable.h"
int TestTable(int, char *[])
{
gdcm::Table t;
return 0;
}
gdcm-3.0.22/Testing/Source/InformationObjectDefinition/Cxx/TestIOD.cxx 000664 001766 001770 00000003227 14517730450 030124 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmIOD.h"
#include "gdcmDefs.h"
#include "gdcmGlobal.h"
#include "gdcmDicts.h"
#include "gdcmDict.h"
#include "gdcmType.h"
#include "gdcmIODs.h"
int TestIOD(int, char *[])
{
using namespace gdcm;
gdcm::Global& g = gdcm::Global::GetInstance();
if( !g.LoadResourcesFiles() )
{
std::cerr << "Could not LoadResourcesFiles" << std::endl;
return 1;
}
static const Defs &defs = g.GetDefs();
static const gdcm::Dicts &dicts = g.GetDicts();
static const IODs &iods = defs.GetIODs();
static const gdcm::Dict &pubdict = dicts.GetPublicDict();
//const IOD& iod = defs.GetIODFromFile(*F);
IODs::IODMapTypeConstIterator it = iods.Begin();
for( ; it != iods.End(); ++it )
{
const IODs::IODName &name = it->first;
(void)name;
const IOD &iod = it->second;
gdcm::Dict::ConstIterator dictit = pubdict.Begin();
for(; dictit != pubdict.End(); ++dictit)
{
const gdcm::Tag &tag = dictit->first;
gdcm::Type t = iod.GetTypeFromTag(defs, tag);
(void)t;
//std::cout << t << std::endl;
}
}
return 0;
}
gdcm-3.0.22/Testing/Source/MessageExchangeDefinition/ 000775 001766 001770 00000000000 14517731550 024774 5 ustar 00mmalaterre mmalaterre 000000 000000 gdcm-3.0.22/Testing/Source/MessageExchangeDefinition/CMakeLists.txt 000664 001766 001770 00000000026 14517730450 027530 0 ustar 00mmalaterre mmalaterre 000000 000000 add_subdirectory(Cxx)
gdcm-3.0.22/Testing/Source/MessageExchangeDefinition/Cxx/ 000775 001766 001770 00000000000 14517731550 025536 5 ustar 00mmalaterre mmalaterre 000000 000000 gdcm-3.0.22/Testing/Source/MessageExchangeDefinition/Cxx/TestSCUValidation.cxx 000664 001766 001770 00000021402 14517730450 031564 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmULConnectionManager.h"
#include "gdcmPresentationContextGenerator.h"
#include "gdcmReader.h"
#include "gdcmAttribute.h"
#include "gdcmDataSet.h"
#include "gdcmUIDGenerator.h"
#include "gdcmStringFilter.h"
#include "gdcmWriter.h"
#include "gdcmDirectory.h"
#include "gdcmImageReader.h"
#include "gdcmQueryFactory.h"
#include "gdcmGlobal.h"
static const char AETitle[] = "ANY";
static const char PeerAETitle[] = "ANY";
static const char ComputerName[] = "51.75.171.41"; // www.dicomserver.co.uk
static int port = 11112;
static gdcm::network::ULConnectionManager *GetConnectionManager(gdcm::BaseRootQuery* theQuery)
{
gdcm::PresentationContextGenerator generator;
if( !generator.GenerateFromUID( theQuery->GetAbstractSyntaxUID() ) )
{
gdcmErrorMacro( "Failed to generate pres. context." );
return nullptr;
}
gdcm::network::ULConnectionManager *theManager =
new gdcm::network::ULConnectionManager();
if (!theManager->EstablishConnection(AETitle, PeerAETitle, ComputerName, 0,
(uint16_t)port, 1000, generator.GetPresentationContexts() ))
{
throw gdcm::Exception("Failed to establish connection.");
}
return theManager;
}
#if 0
static std::vector GetPatientInfo(bool validateQuery, bool inStrictQuery)
{
std::vector theDataSets;
gdcm::BaseRootQuery* theQuery =
gdcm::QueryFactory::ProduceQuery(gdcm::ePatientRootType, gdcm::eFind,
gdcm::ePatient);
theQuery->SetSearchParameter(gdcm::Tag(0x8, 0x52), "PATIENT"); //Query/Retrieval Level
theQuery->SetSearchParameter(gdcm::Tag(0x10,0x20), ""); //Patient ID
theQuery->SetSearchParameter(gdcm::Tag(0x10,0x10), "*"); //Patient Name
if(validateQuery && !theQuery->ValidateQuery(inStrictQuery))
{
return theDataSets;
}
gdcm::network::ULConnectionManager *theManager = GetConnectionManager( theQuery );
theDataSets = theManager->SendFind( theQuery );
return theDataSets;
}
#endif
static std::vector GetStudyInfo(const char *patientID, bool validateQuery, bool inStrictQuery)
{
std::vector theDataSets;
gdcm::BaseRootQuery* theQuery =
gdcm::QueryFactory::ProduceQuery(gdcm::eStudyRootType, gdcm::eFind, gdcm::eStudy);
theQuery->SetSearchParameter(gdcm::Tag(0x8, 0x52), "STUDY"); //Query/Retrieval Level
theQuery->SetSearchParameter(gdcm::Tag(0x10,0x20), patientID); //Patient ID
theQuery->SetSearchParameter(gdcm::Tag(0x20, 0x10), ""); //Study ID
theQuery->SetSearchParameter(gdcm::Tag(0x20, 0xD), ""); //Study Instance UID
theQuery->SetSearchParameter(gdcm::Tag(0x20, 0xE), ""); //Series Instance UID
if(validateQuery && !theQuery->ValidateQuery(inStrictQuery))
{
return theDataSets;
}
gdcm::network::ULConnectionManager *theManager = GetConnectionManager( theQuery );
theDataSets = theManager->SendFind( theQuery );
return theDataSets;
}
static std::vector GetSeriesInfo(const char *patientID, const char *studyInstanceUID, bool validateQuery, bool inStrictQuery)
{
std::vector theDataSets;
gdcm::BaseRootQuery* theQuery =
gdcm::QueryFactory::ProduceQuery(gdcm::eStudyRootType, gdcm::eFind, gdcm::eSeries);
theQuery->SetSearchParameter(gdcm::Tag(0x8, 0x52), "SERIES"); //Query/Retrieval Level
theQuery->SetSearchParameter(gdcm::Tag(0x10,0x20), patientID); //Patient ID
theQuery->SetSearchParameter(gdcm::Tag(0x20, 0xD), studyInstanceUID); //Study Instance UID
theQuery->SetSearchParameter(gdcm::Tag(0x20, 0xE), ""); //Series Instance UID
if(validateQuery && !theQuery->ValidateQuery(inStrictQuery))
{
return theDataSets;
}
gdcm::network::ULConnectionManager *theManager = GetConnectionManager( theQuery );
theDataSets = theManager->SendFind( theQuery );
return theDataSets;
}
static std::vector GetImageInfo(const char *patientID,
const char *studyInstanceUID, const char *seriesInstanceUID, bool validateQuery, bool inStrictQuery)
{
std::vector theDataSets;
gdcm::BaseRootQuery* theQuery =
gdcm::QueryFactory::ProduceQuery(gdcm::eStudyRootType, gdcm::eFind, gdcm::eImage);
theQuery->SetSearchParameter(gdcm::Tag(0x8, 0x52), "SERIES"); //Query/Retrieval Level
theQuery->SetSearchParameter(gdcm::Tag(0x10,0x20), patientID); //Patient ID
theQuery->SetSearchParameter(gdcm::Tag(0x20, 0xD), studyInstanceUID); //Study Instance UID
theQuery->SetSearchParameter(gdcm::Tag(0x20, 0xE), seriesInstanceUID); //Series Instance UID
theQuery->SetSearchParameter(gdcm::Tag(0x8, 0x18), ""); //SOP Instance UID
if(validateQuery && !theQuery->ValidateQuery(inStrictQuery))
{
return theDataSets;
}
gdcm::network::ULConnectionManager *theManager = GetConnectionManager( theQuery );
theDataSets = theManager->SendFind( theQuery );
return theDataSets;
}
static void PrintDataSets(std::vector theDataSets)
{
std::vector::iterator itor;
for (itor = theDataSets.begin(); itor < theDataSets.end(); itor++)
itor->Print(std::cout);
}
int TestSCUValidation(int , char *[])
{
try
{
//set this to true to use a strict interpretation of the DICOM standard for query validation
bool theUseStrictQueries = false;
//Case 1:
//Here I want to retrieve Study Information for the known Patient.
//Here I pass the PatientID as a input and I need to reterive the StudyId,
//StudyDate and Series Instance UID.
std::vector theDataSets = GetStudyInfo("Z354998", true, theUseStrictQueries);
PrintDataSets(theDataSets);
//In the above I validated the constructed Query. This will not allow to add the
//Series Instance UID as a search parameter for the query. On the result of
//this I can't get the SeriesInstanceUID from the study level.
//Case 2:
//Here I execute the above same CFind Query with out validating.
//This will send the Query which is having the SeriesInstanceUID tag
//in search parameter to the CFind. This will executed successfully and
//returns the SeriesInsanceUID related to the given StudyUID.
theDataSets = GetStudyInfo("Z354998", false, theUseStrictQueries);
PrintDataSets(theDataSets);
//case 3:
//If I validated the Query Like case 1, I can't get the Series Instance UID from
//Study level. With out SeriesInstanceUID I can't retrieve the other series Information.
//In Series Level also I can't add the StudyInstanceUID or other study information
//as a search parameter. It allows only SeriesInstanceUID, Modality and SeriesNumber
//as a search parameter.
theDataSets = GetSeriesInfo("Z354998",
"1.2.826.0.1.3680043.4.1.19990124221049.2", true, theUseStrictQueries);
PrintDataSets(theDataSets);
//case 4:
//If I execute the above same CFind Query for Get Series with out validating
//the query, it will return the requested SeriesInstanceUID for Known Study level.
theDataSets = GetSeriesInfo("Z354998",
"1.2.826.0.1.3680043.4.1.19990124221049.2", false, theUseStrictQueries);
PrintDataSets(theDataSets);
//In StudyLevel I can't get the Series information(Ref:Case 2). In Series Level
//also I can't get the Series information for the known Study Level(Ref:Case 3).
//How should I get the Series level information for the known patient and study
//level information???
//case 5:
//For retrieve the Image Level Information (SOP Instance UID) for the known
//Patient,Study and Series level information, the Image level query is not
//allowing. It allows only SOP Instance UID and SOP Instance Number as a
//search Query.
theDataSets = GetImageInfo("Z354998",
"1.2.826.0.1.3680043.4.1.19990124221049.2",
"1.2.826.0.1.3680043.4.1.19990124221049.3", true, theUseStrictQueries);
PrintDataSets(theDataSets);
//case 6:
//Image Level retrieval also give the required information with out
//validate the generated Query.
theDataSets = GetImageInfo("Z354998",
"1.2.826.0.1.3680043.4.1.19990124221049.2",
"1.2.826.0.1.3680043.4.1.19990124221049.3", false, theUseStrictQueries);
PrintDataSets(theDataSets);
}
catch( std::exception & )
{
return 1;
}
//I want the Following things to do in CFind Query.
// 1. Reterive the Study Level Information for the known Patient.
// 2. Reterive the Series Level Information for the known Patient and Study.
// 3. Reterive the Image Level Information for the known Patient, Study and Series.
return 0;
}
gdcm-3.0.22/Testing/Source/MessageExchangeDefinition/Cxx/CMakeLists.txt 000664 001766 001770 00000004225 14517730450 030277 0 ustar 00mmalaterre mmalaterre 000000 000000 # MEXD Testing
set(MEXD_TEST_SRCS
TestPresentationContextRQ.cxx
TestQueryFactory.cxx
TestULConnectionManager.cxx
TestServiceClassUser1.cxx
TestServiceClassUser2.cxx
TestServiceClassUser3.cxx
TestSCUValidation.cxx
TestEcho.cxx
TestFind.cxx
#TestULTransitionTable.cxx # symbols are not exported, mainly used for debugging
TestFindStudyRootQuery.cxx
TestFindPatientRootQuery.cxx
)
if(GDCM_DATA_ROOT)
set(MEXD_TEST_SRCS
${MEXD_TEST_SRCS}
TestSCUFunctions.cxx
)
endif()
# Add the include paths
include_directories(
"${GDCM_BINARY_DIR}/Source/Common"
"${GDCM_SOURCE_DIR}/Source/Common"
"${GDCM_SOURCE_DIR}/Testing/Source/Data"
"${GDCM_BINARY_DIR}/Testing/Source/Data"
"${GDCM_SOURCE_DIR}/Source/DataStructureAndEncodingDefinition"
"${GDCM_SOURCE_DIR}/Source/DataDictionary"
"${GDCM_SOURCE_DIR}/Source/MediaStorageAndFileFormat"
"${GDCM_SOURCE_DIR}/Source/MessageExchangeDefinition"
)
create_test_sourcelist(MEXDTests gdcmMEXDTests.cxx ${MEXD_TEST_SRCS}
EXTRA_INCLUDE gdcmTestDriver.h
)
add_executable(gdcmMEXDTests ${MEXDTests})
target_link_libraries(gdcmMEXDTests gdcmMEXD gdcmMSFF gdcmDSED gdcmDICT gdcmCommon)
# Loop over files and create executables
foreach(name ${MEXD_TEST_SRCS})
if(${name} STREQUAL "TestSCUFunctions.cxx"
OR ${name} STREQUAL "TestServiceClassUser1.cxx"
OR ${name} STREQUAL "TestServiceClassUser2.cxx"
OR ${name} STREQUAL "TestServiceClassUser3.cxx"
)
if(GDCM_DICOM_SERVER_AETITLE)
add_test(NAME ${name} COMMAND gdcmMEXDTests ${name} ${GDCM_DICOM_CLIENT_AETITLE}
${GDCM_DICOM_SERVER_AETITLE} ${GDCM_DICOM_SERVER_PORT}
${GDCM_DICOM_CLIENT_PORT} ${GDCM_DICOM_SERVER_PEER})
endif()
else()
get_filename_component(testname ${name} NAME_WE)
add_test(NAME ${testname} COMMAND gdcmMEXDTests ${testname})
endif()
endforeach()
set(DCMQRSCP_HOSTNAME gotlib)
set(DCMQRSCP_PORT 5677)
set(DCMQRSCP_DIRECTORY ${GDCM_TEMP_DIRECTORY})
configure_file(
${GDCM_SOURCE_DIR}/CMake/dcmqrscp.cfg.in
${CMAKE_CURRENT_BINARY_DIR}/dcmqrscp.cfg
)
# execute_process(COMMAND ${DCMTK_DCMQRSCP_EXECUTABLE}
# --verbose --debug -c ${CMAKE_CURRENT_BINARY_DIR}/dcmqrscp.cfg)
gdcm-3.0.22/Testing/Source/MessageExchangeDefinition/Cxx/TestFind.cxx 000664 001766 001770 00000004073 14517730450 030004 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
*
* Copyright Insight Software Consortium
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0.txt
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*=========================================================================*/
#include "gdcmCompositeNetworkFunctions.h"
#include "gdcmTag.h"
#include "gdcmQueryFactory.h"
#include "gdcmMovePatientRootQuery.h"
int TestFind(int , char *[])
{
std::string hostname = "www.dicomserver.co.uk";
uint16_t port = 11112;
std::string callaetitle = "GDCM_ROCKS";
std::string callingaetitle = "ACME1";
gdcm::Tag theTag(0x0010, 0x0010);
std::string theName = "F*";
std::pair theTagPair =
std::make_pair(theTag, theName);
std::vector > theTags;
theTags.push_back(theTagPair);
gdcm::BaseRootQuery* theQuery = gdcm::CompositeNetworkFunctions::ConstructQuery(
gdcm::ePatientRootType, gdcm::ePatient, theTags);
if (!theQuery) {
std::cerr << "Query construction failed!" << std::endl;
return 1;
}
if (!theQuery->ValidateQuery(false))
{
std::cerr << "Find query is not valid. Please try again." << std::endl;
delete theQuery;
return 1;
}
std::vector theDataSet ;
bool b =
gdcm::CompositeNetworkFunctions::CFind(hostname.c_str(), port,
theQuery, theDataSet , callingaetitle.c_str(), callaetitle.c_str());
if( !b ) return 1;
//need to put some kind of validation of theDataSet here
return (theDataSet.empty() ? 1:0);//shouldn't be a zero-sized dataset
}
gdcm-3.0.22/Testing/Source/MessageExchangeDefinition/Cxx/TestFindPatientRootQuery.cxx 000664 001766 001770 00000020766 14517730450 033232 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmFindPatientRootQuery.h"
#include "gdcmCompositeNetworkFunctions.h"
#include "gdcmTrace.h"
/*
* STUDY:
* $ findscu --call GDCM_STORE --aetitle GDCMDASH -P server 11112 -k 8,52="PATIENT" -k 10,20="1*"
* $ findscu --call GDCM_STORE --aetitle GDCMDASH -S server 11112 -k 8,52="STUDY" -k 10,20="FOO"
*
* SERIES:
* $ findscu --call GDCM_STORE --aetitle GDCMDASH -S lirispat 11112 -k 8,52="SERIES" -k 20,d="1.2.3" -k 8,60
*/
int TestFindPatientRootQuery(int , char *[])
{
//gdcm::Trace::DebugOn();
gdcm::Trace::WarningOff();
// PATIENT:
gdcm::ERootType theRoot = gdcm::ePatientRootType;
gdcm::EQueryLevel theLevel = gdcm::ePatient;
{
std::vector< std::pair > keys;
gdcm::SmartPointer theQuery =
gdcm::CompositeNetworkFunctions::ConstructQuery(theRoot, theLevel ,keys);
if( theQuery->ValidateQuery( true ) )
{
// No key found is an error
return 1;
}
}
{
std::vector< std::pair > keys;
keys.emplace_back( gdcm::Tag(0x10,0x10), "patient" ) ;
gdcm::SmartPointer theQuery =
gdcm::CompositeNetworkFunctions::ConstructQuery(theRoot, theLevel ,keys);
if( theQuery->ValidateQuery( true ) )
{
// required key
return 1;
}
}
{
std::vector< std::pair > keys;
keys.emplace_back( gdcm::Tag(0x10,0x20), "patientid" ) ;
gdcm::SmartPointer theQuery =
gdcm::CompositeNetworkFunctions::ConstructQuery(theRoot, theLevel ,keys);
if( !theQuery->ValidateQuery( true ) )
{
// unique key
return 1;
}
}
{
std::vector< std::pair > keys;
keys.emplace_back( gdcm::Tag(0x10,0x20), "patientid" ) ;
keys.emplace_back( gdcm::Tag(0x10,0x10), "patient" ) ;
gdcm::SmartPointer theQuery =
gdcm::CompositeNetworkFunctions::ConstructQuery(theRoot, theLevel ,keys);
if( !theQuery->ValidateQuery( true ) )
{
// unique key + required
return 1;
}
}
// STUDY:
theLevel = gdcm::eStudy;
{
std::vector< std::pair > keys;
keys.emplace_back( gdcm::Tag(0x10,0x10), "PATIENT" ) ;
gdcm::SmartPointer theQuery =
gdcm::CompositeNetworkFunctions::ConstructQuery(theRoot, theLevel ,keys);
if( theQuery->ValidateQuery( true ) )
{
// Patient Id is a Required Key in Study
return 1;
}
}
{
std::vector< std::pair > keys;
keys.emplace_back( gdcm::Tag(0x20,0x10), "studyid" ) ;
gdcm::SmartPointer theQuery =
gdcm::CompositeNetworkFunctions::ConstructQuery(theRoot, theLevel ,keys);
if( theQuery->ValidateQuery( true ) )
{
// Study Id is a required tag
return 1;
}
}
{
std::vector< std::pair > keys;
keys.emplace_back( gdcm::Tag(0x8,0x90), "physician" ) ;
gdcm::SmartPointer theQuery =
gdcm::CompositeNetworkFunctions::ConstructQuery(theRoot, theLevel ,keys);
if( theQuery->ValidateQuery( true ) )
{
// ref physician's name is optional
return 1;
}
}
{
std::vector< std::pair > keys;
keys.emplace_back( gdcm::Tag(0x10,0x20), "patientid" ) ;
keys.emplace_back( gdcm::Tag(0x20,0xd), "studyuid" ) ;
gdcm::SmartPointer theQuery =
gdcm::CompositeNetworkFunctions::ConstructQuery(theRoot, theLevel ,keys);
if( !theQuery->ValidateQuery( true ) )
{
// Study UID is the unique tag
return 1;
}
}
// SERIES:
theLevel = gdcm::eSeries;
{
std::vector< std::pair > keys;
gdcm::SmartPointer theQuery =
gdcm::CompositeNetworkFunctions::ConstructQuery(theRoot, theLevel ,keys);
if( theQuery->ValidateQuery( true ) )
{
// No key found is an error
return 1;
}
}
{
std::vector< std::pair > keys;
keys.emplace_back( gdcm::Tag(0x20,0xd), "1.2.3" ) ;
gdcm::SmartPointer theQuery =
gdcm::CompositeNetworkFunctions::ConstructQuery(theRoot, theLevel ,keys);
if( theQuery->ValidateQuery( true ) )
{
// No key at level Series
return 1;
}
}
{
std::vector< std::pair > keys;
keys.emplace_back( gdcm::Tag(0x20,0xd), "1.2.3" ) ;
keys.emplace_back( gdcm::Tag(0x8,0x60), "" ) ;
gdcm::SmartPointer theQuery =
gdcm::CompositeNetworkFunctions::ConstructQuery(theRoot, theLevel ,keys);
if( theQuery->ValidateQuery( true ) )
{
// missing unique at series level
return 1;
}
}
{
std::vector< std::pair > keys;
keys.emplace_back( gdcm::Tag(0x20,0xd), "1.2.3" ) ;
keys.emplace_back( gdcm::Tag(0x20,0xe), "4.5.6" ) ;
gdcm::SmartPointer theQuery =
gdcm::CompositeNetworkFunctions::ConstructQuery(theRoot, theLevel ,keys);
if( !theQuery->ValidateQuery( true ) )
{
// all unique keys present
return 1;
}
}
{
std::vector< std::pair > keys;
keys.emplace_back( gdcm::Tag(0x20,0xd), "1.2.3" ) ;
keys.emplace_back( gdcm::Tag(0x20,0xe), "4.5.6" ) ;
keys.emplace_back( gdcm::Tag(0x8,0x60), "" ) ;
gdcm::SmartPointer theQuery =
gdcm::CompositeNetworkFunctions::ConstructQuery(theRoot, theLevel ,keys);
if( !theQuery->ValidateQuery( true ) )
{
// all unique keys present and required is correct level
return 1;
}
}
{
std::vector< std::pair > keys;
keys.emplace_back( gdcm::Tag(0x20,0xd), "1.2.3" ) ;
keys.emplace_back( gdcm::Tag(0x20,0xe), "4.5.6" ) ;
keys.emplace_back( gdcm::Tag(0x8,0x20), "" ) ;
gdcm::SmartPointer theQuery =
gdcm::CompositeNetworkFunctions::ConstructQuery(theRoot, theLevel ,keys);
if( theQuery->ValidateQuery( true ) )
{
// all unique keys present and required is incorrect level
return 1;
}
}
// IMAGES:
theLevel = gdcm::eImage;
{
std::vector< std::pair > keys;
keys.emplace_back( gdcm::Tag(0x20,0xd), "1.2.3" ) ;
keys.emplace_back( gdcm::Tag(0x20,0xe), "4.5.6" ) ;
keys.emplace_back( gdcm::Tag(0x8,0x18), "7.8.9" ) ;
gdcm::SmartPointer theQuery =
gdcm::CompositeNetworkFunctions::ConstructQuery(theRoot, theLevel ,keys);
if( !theQuery->ValidateQuery( true ) )
{
// all unique keys present
return 1;
}
}
{
std::vector< std::pair > keys;
keys.emplace_back( gdcm::Tag(0x20,0xd), "1.2.3" ) ;
keys.emplace_back( gdcm::Tag(0x20,0xe), "4.5.6" ) ;
keys.emplace_back( gdcm::Tag(0x8,0x18), "7.8.9" ) ;
keys.emplace_back( gdcm::Tag(0x20,0x13), "" ) ;
gdcm::SmartPointer theQuery =
gdcm::CompositeNetworkFunctions::ConstructQuery(theRoot, theLevel ,keys);
if( !theQuery->ValidateQuery( true ) )
{
// all unique keys present + required correct level
return 1;
}
}
{
std::vector< std::pair > keys;
keys.emplace_back( gdcm::Tag(0x20,0xd), "1.2.3" ) ;
keys.emplace_back( gdcm::Tag(0x20,0xe), "4.5.6" ) ;
keys.emplace_back( gdcm::Tag(0x8,0x18), "7.8.9" ) ;
keys.emplace_back( gdcm::Tag(0x20,0x13), "" ) ;
keys.emplace_back( gdcm::Tag(0x20,0x11), "" ) ; // series level
gdcm::SmartPointer theQuery =
gdcm::CompositeNetworkFunctions::ConstructQuery(theRoot, theLevel ,keys);
if( theQuery->ValidateQuery( true ) )
{
// all unique keys present + required correct level + one incorrect
return 1;
}
}
//std::cout << "success" << std::endl;
return 0;
}
gdcm-3.0.22/Testing/Source/MessageExchangeDefinition/Cxx/TestServiceClassUser1.cxx 000664 001766 001770 00000020316 14517730450 032430 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmServiceClassUser.h"
#include "gdcmDataEvent.h"
#include "gdcmSimpleSubjectWatcher.h"
#include "gdcmPresentationContextGenerator.h"
#include "gdcmAttribute.h"
#include "gdcmCompositeNetworkFunctions.h"
#include "gdcmTransferSyntax.h"
#include "gdcmWriter.h"
#include "gdcmTesting.h"
/*
* This small example show how the association pipeline works.
* the start association is an important step as it will define all the object
* to be send in subsequence C-operation (c-echo, c-store, c-find, c-move).
* In this example we will demonstrate how we can send a JPEG-Lossless object
* and then further on, a non-jpeg encapsulated file
*
* The test also uses the Subject/Observer API for progress report.
*/
int TestServiceClassUser1(int argc, char *argv[])
{
if( argc < 5 )
{
std::cerr << argv[0] << " aetitle call portno moveReturnPort remote" << std::endl;
return 1;
}
std::string aetitle = argv[1]; // the ae title of this computer
std::string call = argv[2]; // the ae title of the server
uint16_t portno = (uint16_t)atoi(argv[3]); // the port of the server
uint16_t moveReturnPort = (uint16_t)atoi(argv[4]); // the port over which return cstore scps are done for cmove
std::string remote = argv[5]; //the ip address of the remote server
gdcm::SmartPointer scup = new gdcm::ServiceClassUser;
gdcm::ServiceClassUser &scu = *scup;
gdcm::SimpleSubjectWatcher w( &scu, "TestServiceClassUser1" );
scu.SetHostname( remote.c_str() );
scu.SetPort( portno );
scu.SetTimeout( 1000 );
scu.SetCalledAETitle( call.c_str() );
scu.SetAETitle( aetitle.c_str() );
std::ostringstream error_log;
gdcm::Trace::SetErrorStream( error_log );
if( !scu.InitializeConnection() )
{
return 1;
}
gdcm::PresentationContextGenerator generator;
if( !generator.GenerateFromUID( gdcm::UIDs::VerificationSOPClass ) )
{
return 1;
}
// make sure to fail if no pres. contexts:
if( scu.StartAssociation() )
{
return 1;
}
scu.SetPresentationContexts( generator.GetPresentationContexts() );
if( !scu.StartAssociation() )
{
std::cerr << "Could not StartAssociation" << std::endl;
std::cerr << "Error log is:" << std::endl;
std::cerr << error_log.str() << std::endl;
return 1;
}
// C-ECHO
if( !scu.SendEcho() )
{
std::cerr << "Could not Echo" << std::endl;
std::cerr << "Error log is:" << std::endl;
std::cerr << error_log.str() << std::endl;
return 1;
}
if( !scu.StopAssociation() )
{
return 1;
}
gdcm::Directory::FilenamesType filenames;
const char *directory = gdcm::Testing::GetDataRoot();
// DEBUG:
// storescu -R -xs --call GDCM_STORE macminig4 11112 gdcmData/012345.002.050.dcm
std::string filename = std::string(directory) + "/012345.002.050.dcm";
filenames.push_back( filename );
if( !generator.GenerateFromFilenames(filenames) )
{
return 1;
}
scu.SetPresentationContexts( generator.GetPresentationContexts() );
if( !scu.StartAssociation() )
{
return 1;
}
// C-STORE MRImageStorage/JPEGLossless
if( !scu.SendStore( filename.c_str() ) )
{
std::cerr << "Could not C-Store" << std::endl;
std::cerr << "Error log is:" << std::endl;
std::cerr << error_log.str() << std::endl;
return 1;
}
if( !scu.StopAssociation() )
{
return 1;
}
//filename = std::string(directory) + "/MR-MONO2-12-an2.acr";
filename = std::string(directory) + "/MR_Spectroscopy_SIEMENS_OF.dcm";
filenames.clear();
filenames.push_back( filename );
if( !generator.GenerateFromFilenames(filenames) )
{
return 1;
}
scu.SetPresentationContexts( generator.GetPresentationContexts() );
if( !scu.StartAssociation() )
{
return 1;
}
// C-STORE MRImageStorage/LittleEndianImplicit
if( !scu.SendStore( filename.c_str() ) )
{
std::cerr << "Could not SendStore" << std::endl;
std::cerr << "Error log is:" << std::endl;
std::cerr << error_log.str() << std::endl;
return 1;
}
if( !scu.StopAssociation() )
{
return 1;
}
// customize the find query
gdcm::DataSet findds;
gdcm::Attribute<0x10,0x10> pn1 ={"ABCDEFGH^IJKLM"};
findds.Insert( pn1.GetAsDataElement() );
gdcm::Attribute<0x10,0x20> pid;
findds.Insert( pid.GetAsDataElement() );
gdcm::SmartPointer findquery =
gdcm::CompositeNetworkFunctions::ConstructQuery(
gdcm::ePatientRootType, gdcm::ePatient, findds);
// make sure the query is valid
if (!findquery->ValidateQuery())
{
return 1;
}
// Generate the PresentationContext array from the query UID:
if( !generator.GenerateFromUID( findquery->GetAbstractSyntaxUID() ) )
{
return 1;
}
scu.SetPresentationContexts( generator.GetPresentationContexts() );
if( !scu.StartAssociation() )
{
return 1;
}
// C-FIND
std::vector datasets;
if( !scu.SendFind(findquery, datasets) )
{
return 1;
}
// Need to make sure we have one dataset
if( datasets.size() != 1 )
{
std::cerr << "size: " << datasets.size() << std::endl;
return 1;
}
datasets[0].Print( std::cout );
// C-find the second patient
gdcm::Attribute<0x10,0x10> pn2 ={"XXXXXXXXXXX"};
findquery->GetQueryDataSet().Replace( pn2.GetAsDataElement() );
if( !scu.SendFind(findquery, datasets) )
{
return 1;
}
if( datasets.size() != 2 )
{
std::cerr << "size: " << datasets.size() << std::endl;
return 1;
}
std::cout << std::endl;
datasets[1].Print( std::cout );
if( !scu.StopAssociation() )
{
return 1;
}
// C-MOVE
// customize the move query
gdcm::DataSet moveds;
// use results from the c-find to construct the c-move query:
moveds.Insert( datasets[0].GetDataElement( pid.GetTag() ) );
gdcm::SmartPointer movequery =
gdcm::CompositeNetworkFunctions::ConstructQuery(
gdcm::ePatientRootType, gdcm::ePatient, moveds, gdcm::eMove);
// make sure the query is valid
if (!movequery->ValidateQuery())
{
return 1;
}
//generator.SetDefaultTransferSyntax( gdcm::TransferSyntax::JPEGLosslessProcess14_1 );
// Generate the PresentationContext array from the query UID:
if( !generator.GenerateFromUID( movequery->GetAbstractSyntaxUID() ) )
{
return 1;
}
scu.SetPresentationContexts( generator.GetPresentationContexts() );
scu.SetPortSCP( moveReturnPort );
if( !scu.StartAssociation() )
{
return 1;
}
// C-MOVE
std::vector data;
if( !scu.SendMove(movequery, data) )
{
return 1;
}
if( data.size() != 1 )
{
std::cerr << "data size: " << data.size() << std::endl;
return 1;
}
// SendMove + dataset is implicit by default:
gdcm::Writer writer;
writer.GetFile().GetHeader().SetDataSetTransferSyntax(
gdcm::TransferSyntax::ImplicitVRLittleEndian );
writer.GetFile().SetDataSet( data[0] );
const char *outfilename = "dummy.dcm";
writer.SetFileName( outfilename );
if( !writer.Write() )
{
return 1;
}
if( !gdcm::System::FileExists(outfilename) )
{
std::cerr << "FileExists: " << outfilename << std::endl;
return 1;
}
char digest_str[33];
if( !gdcm::Testing::ComputeFileMD5(outfilename, digest_str) )
{
return 1;
}
if( strcmp( digest_str, "ae1f9a1bfc617f73ae8f72f81777dc03") != 0 )
{
std::cerr << "md5: " << digest_str << std::endl;
return 1;
}
// TODO: testing of CMove + JPEG Lossless is a *lot* more difficult
// since we have to assume some behavior on the remote side (SCP) which
// we cannot query.
if( !scu.StopAssociation() )
{
return 1;
}
// scu dstor will close the connection (!= association)
return 0;
}
gdcm-3.0.22/Testing/Source/MessageExchangeDefinition/Cxx/TestFindStudyRootQuery.cxx 000664 001766 001770 00000016405 14517730450 032731 0 ustar 00mmalaterre mmalaterre 000000 000000 /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "gdcmFindStudyRootQuery.h"
#include "gdcmCompositeNetworkFunctions.h"
#include "gdcmTrace.h"
/*
* STUDY:
* $ findscu --call GDCM_STORE --aetitle GDCMDASH -P server 11112 -k 8,52="PATIENT" -k 10,20="1*"
* $ findscu --call GDCM_STORE --aetitle GDCMDASH -S server 11112 -k 8,52="STUDY" -k 10,20="FOO"
*
* SERIES:
* $ findscu --call GDCM_STORE --aetitle GDCMDASH -S lirispat 11112 -k 8,52="SERIES" -k 20,d="1.2.3" -k 8,60
*/
int TestFindStudyRootQuery(int , char *[])
{
//gdcm::Trace::DebugOn();
gdcm::Trace::WarningOff();
// STUDY:
gdcm::ERootType theRoot = gdcm::eStudyRootType;
gdcm::EQueryLevel theLevel = gdcm::eStudy;
{
std::vector< std::pair > keys;
gdcm::SmartPointer theQuery =
gdcm::CompositeNetworkFunctions::ConstructQuery(theRoot, theLevel ,keys);
if( theQuery->ValidateQuery( true ) )
{
// No key found is an error
return 1;
}
}
{
std::vector< std::pair > keys;
keys.emplace_back( gdcm::Tag(0x10,0x10), "PATIENT" ) ;
gdcm::SmartPointer theQuery =
gdcm::CompositeNetworkFunctions::ConstructQuery(theRoot, theLevel ,keys);
if( theQuery->ValidateQuery( true ) )
{
// Patient Id is a Required Key in Study
return 1;
}
}
{
std::vector< std::pair > keys;
keys.emplace_back( gdcm::Tag(0x20,0x10), "studyid" ) ;
gdcm::SmartPointer theQuery =
gdcm::CompositeNetworkFunctions::ConstructQuery(theRoot, theLevel ,keys);
if( theQuery->ValidateQuery( true ) )
{
// Study Id is a required tag
return 1;
}
}
{
std::vector< std::pair > keys;
keys.emplace_back( gdcm::Tag(0x8,0x90), "physician" ) ;
gdcm::SmartPointer theQuery =
gdcm::CompositeNetworkFunctions::ConstructQuery(theRoot, theLevel ,keys);
if( theQuery->ValidateQuery( true ) )
{
// ref physician's name is optional
return 1;
}
}
{
std::vector< std::pair > keys;
keys.emplace_back( gdcm::Tag(0x20,0xd), "studyuid" ) ;
gdcm::SmartPointer theQuery =
gdcm::CompositeNetworkFunctions::ConstructQuery(theRoot, theLevel ,keys);
if( !theQuery->ValidateQuery( true ) )
{
// Study UID is the unique tag
return 1;
}
}
// SERIES:
theLevel = gdcm::eSeries;
{
std::vector< std::pair > keys;
gdcm::SmartPointer theQuery =
gdcm::CompositeNetworkFunctions::ConstructQuery(theRoot, theLevel ,keys);
if( theQuery->ValidateQuery( true ) )
{
// No key found is an error
return 1;
}
}
{
std::vector< std::pair > keys;
keys.emplace_back( gdcm::Tag(0x20,0xd), "1.2.3" ) ;
gdcm::SmartPointer theQuery =
gdcm::CompositeNetworkFunctions::ConstructQuery(theRoot, theLevel ,keys);
if( theQuery->ValidateQuery( true ) )
{
// No key at level Series
return 1;
}
}
{
std::vector< std::pair > keys;
keys.emplace_back( gdcm::Tag(0x20,0xd), "1.2.3" ) ;
keys.emplace_back( gdcm::Tag(0x8,0x60), "" ) ;
gdcm::SmartPointer theQuery =
gdcm::CompositeNetworkFunctions::ConstructQuery(theRoot, theLevel ,keys);
if( theQuery->ValidateQuery( true ) )
{
// missing unique at series level
return 1;
}
}
{
std::vector< std::pair > keys;
keys.emplace_back( gdcm::Tag(0x20,0xd), "1.2.3" ) ;
keys.emplace_back( gdcm::Tag(0x20,0xe), "4.5.6" ) ;
gdcm::SmartPointer theQuery =
gdcm::CompositeNetworkFunctions::ConstructQuery(theRoot, theLevel ,keys);
if( !theQuery->ValidateQuery( true ) )
{
// all unique keys present
return 1;
}
}
{
std::vector< std::pair > keys;
keys.emplace_back( gdcm::Tag(0x20,0xd), "1.2.3" ) ;
keys.emplace_back( gdcm::Tag(0x20,0xe), "4.5.6" ) ;
keys.emplace_back( gdcm::Tag(0x8,0x60), "" ) ;
gdcm::SmartPointer theQuery =
gdcm::CompositeNetworkFunctions::ConstructQuery(theRoot, theLevel ,keys);
if( !theQuery->ValidateQuery( true ) )
{
// all unique keys present and required is correct level
return 1;
}
}
{
std::vector< std::pair