Codebase list gdcm / 8d6ed31
Merge tag 'upstream/2.6.5' Upstream version 2.6.5 Gert Wollny 7 years ago
42 changed file(s) with 758 addition(s) and 192 deletion(s). Raw diff Collapse all Expand all
2424 - CFLAGS="-g -O2"
2525 - CXXFLAGS="-g -O2"
2626 - B_NAME=default
27 - CPACK_NAME=Linux
2728 - compiler: gcc
2829 os: linux
2930 addons: {apt: {packages: [default-jdk, mono-devel, swig, libcharls-dev, libvtk5-dev, libopenjpeg-dev, libexpat-dev, libz-dev, uuid-dev, python-all-dev, libpoppler-dev, xsltproc, docbook-xsl, dcmtk]}}
3233 - CXXFLAGS="-Wall -Wextra -m64"
3334 - 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=ON -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"
3435 - B_NAME=system
36 - CPACK_NAME=Linux
3537 - compiler: clang
3638 os: linux
3739 env:
3840 - CFLAGS="-g -O0 -Wall -Wextra -m64 -fsanitize=address,undefined,shift"
3941 - CXXFLAGS="-g -O0 -Wall -Wextra -m64 -fsanitize=address,undefined,shift"
4042 - B_NAME=fsanitize
43 - CPACK_NAME=Linux
4144 - compiler: clang
4245 os: osx
4346 env:
4447 - CFLAGS="-Wall -Wextra" # -m64 -fsanitize=address,undefined
4548 - CXXFLAGS="-Wall -Wextra" # -m64 -fsanitize=address,undefined
4649 - B_NAME=default
50 - CPACK_NAME=Darwin
4751
4852 before_install:
4953 #- env
7983 api_key:
8084 secure: R5+dbibdcgPHq6cAPC8uepifDuS3yjZu2dBB2oSeQtBZTAeN1VIfJMrF8TeQDqj2GC28RHxXm4BHwdJ2FUpBXjOS2eUE6Mto1Rbbvfi63MREnFPIAWkNyLtR2Jxq/Gzb8X05PbCWGwCNvX9eeo+qcWTpczuQvJ+/bds7MyRsk45+sUc+j7rglAbxewgijsXebCkObwaXmhqTYJwrvf2lyEnA2Jo1gL2WmK6iPjHvTOVS9JfBMqVRmlk7j8efnqag8fMCzNp1Ess5wBy5Jf58qvVs7RuuBi16s7vOOBtb9xVjcDB1KaAxc/dDQGQhRkrveBtH18ZpFrArOj6DBPbupS3+xuU4ywdYbCuGnvdpRFafBc+iNU4M81crkFUDmSPEQChBnL4wwpaYaQ1LlgdlF0r9/Rlu2/iqKe4t7rdZnkQqQ/3SNNf+x4AKnGmaSGasV/VUXstTGVrtl7hsDMzSdrVCXODao0SRv5tPSI3BgAZi7NzCJ/xv5LgA1EQVkGdTQN0ZpKZCQYfifL5K6oYDI+WlAFU0OcH+9dy4KNqF+QnzMh9iPwP0zR6BN9yE0w6ydnyNt0CkIUaxgaTtr+pHPXsmmtgXzQScESC8B9JHGocOXjT6MtyUmoP/ewlPz2G6x114PnAL7LlZ07jPqAASJwW/ZiXtBcVxv50hPhC7L80=
8185 file:
82 - GDCM-$VTAG-Linux-x86_64.tar.gz
83 - GDCM-$VTAG-Linux-x86_64.tar.bz2
86 - GDCM-$VTAG-$CPACK_NAME-x86_64.tar.gz
87 - GDCM-$VTAG-$CPACK_NAME-x86_64.tar.bz2
8488 skip_cleanup: true
8589 on:
8690 repo: malaterre/GDCM
141141 std::cout << " -C --sop-class-uid SOP Class UID (name or value)." << std::endl;
142142 std::cout << " -T --study-uid Study UID." << std::endl;
143143 std::cout << " -S --series-uid Series UID." << std::endl;
144 std::cout << " --template DICOM template." << std::endl;
145 std::cout << " --keep-meta Keep meta info from template file (advanced users only)." << std::endl;
144146 std::cout << " --root-uid Root UID." << std::endl;
145147 std::cout << "Fill Options:" << std::endl;
146148 std::cout << " -R --region %d,%d Region." << std::endl;
413415 gdcm::Filename filename;
414416 gdcm::Directory::FilenamesType filenames;
415417 gdcm::Filename outfilename;
418 gdcm::Filename templatefilename;
416419 unsigned int region[6] = {}; // Rows & Columns are VR=US anyway...
417420 unsigned int color = 0;
418421 int bregion = 0;
422425 int pconf = 0; // planar configuration
423426 int studyuid = 0;
424427 int seriesuid = 0;
428 int templated = 0;
429 int keepmeta = 0;
425430 unsigned int size[3] = {0,0,0};
426431 unsigned int ndimension = 2;
427432 int depth = 0;
472477 {"pi", 1, &pinter, 1}, //
473478 {"pf", 1, &pformat, 1}, //
474479 {"offset", 1, &poffset, 1}, //
480 {"template", 1, &templated, 1},
481 {"keep-meta", 0, &keepmeta, 1}, // by default we do not want to keep
475482
476483 // General options !
477484 {"verbose", 0, &verbose, 1},
585592 assert( strcmp(s, "offset") == 0 );
586593 poffset = 1;
587594 start_pos = (size_t)atoll(optarg);
595 }
596 else if( option_index == 17 ) /* template */
597 {
598 assert( strcmp(s, "template") == 0 );
599 templated = 1;
600 templatefilename = optarg;
588601 }
589602 //printf (" with arg %s", optarg);
590603 }
830843 //if( !inputextension || !outputextension ) return 1;
831844 if( inputextension )
832845 {
846 gdcm::Reader reader;
847 if( templated )
848 {
849 reader.SetFileName( templatefilename );
850 if( !reader.Read() )
851 {
852 std::cerr << "Failed to read: " << templatefilename << std::endl;
853 return 1;
854 }
855 }
833856 if( gdcm::System::StrCaseCmp(inputextension,".raw") == 0 // watch out that .raw for kakadu means big-endian
834857 || gdcm::System::StrCaseCmp(inputextension,".rawl") == 0 // kakadu convention for raw little endian
835858 || gdcm::System::StrCaseCmp(inputextension,".gray") == 0 // imagemagick convention
843866 }
844867 gdcm::RAWCodec raw;
845868 gdcm::PixmapWriter writer;
869 writer.SetCheckFileMetaInformation( (keepmeta > 0 ? false : true) );
870 writer.SetFile( reader.GetFile() );
846871 // Because the RAW stream is not self sufficient, we need to pass in some extra
847872 // user info:
848873 unsigned int dims[3] = {};
908933 }
909934 gdcm::RLECodec rle;
910935 gdcm::PixmapWriter writer;
936 writer.SetCheckFileMetaInformation( (keepmeta > 0 ? false : true) );
937 writer.SetFile( reader.GetFile() );
911938 // Because the RLE stream is not self sufficient, we need to pass in some extra
912939 // user info:
913940 unsigned int dims[3] = {};
946973 if( !GetPixelFormat( pf, depth, bpp, sign, pixelsign ) ) return 1;
947974 pnm.SetPixelFormat( pf );
948975 gdcm::PixmapWriter writer;
976 writer.SetCheckFileMetaInformation( (keepmeta > 0 ? false : true) );
977 writer.SetFile( reader.GetFile() );
949978 if( !Populate( writer, pnm, filenames ) ) return 1;
950979 // populate will guess pixel format and photometric inter from file, need
951980 // to override after calling Populate:
9761005 {
9771006 gdcm::PGXCodec pnm;
9781007 gdcm::PixmapWriter writer;
1008 writer.SetCheckFileMetaInformation( (keepmeta > 0 ? false : true) );
1009 writer.SetFile( reader.GetFile() );
9791010 if( !Populate( writer, pnm, filenames ) ) return 1;
9801011 if( !AddUIDs(sopclassuid, sopclass, study_uid, series_uid, writer ) ) return 1;
9811012
9921023 {
9931024 gdcm::JPEGLSCodec jpeg;
9941025 gdcm::PixmapWriter writer;
1026 writer.SetCheckFileMetaInformation( (keepmeta > 0 ? false : true) );
1027 writer.SetFile( reader.GetFile() );
9951028 if( !Populate( writer, jpeg, filenames ) ) return 1;
9961029 if( !AddUIDs(sopclassuid, sopclass, study_uid, series_uid, writer ) ) return 1;
9971030
10171050 */
10181051 gdcm::JPEG2000Codec jpeg;
10191052 gdcm::PixmapWriter writer;
1053 writer.SetCheckFileMetaInformation( (keepmeta > 0 ? false : true) );
1054 writer.SetFile( reader.GetFile() );
10201055 if( !Populate( writer, jpeg, filenames ) ) return 1;
10211056 if( !AddUIDs(sopclassuid, sopclass, study_uid, series_uid, writer ) ) return 1;
10221057
10411076 if( !GetPixelFormat( pf, depth, bpp, sign, pixelsign ) ) return 1;
10421077 jpeg.SetPixelFormat( pf );
10431078 gdcm::PixmapWriter writer;
1079 writer.SetCheckFileMetaInformation( (keepmeta > 0 ? false : true) );
1080 writer.SetFile( reader.GetFile() );
10441081 if( !Populate( writer, jpeg, filenames ) ) return 1;
10451082 if( !AddUIDs(sopclassuid, sopclass, study_uid, series_uid, writer ) ) return 1;
10461083
1717 # (To distribute this file outside of CMake, substitute the full
1818 # License text for the above reference.)
1919
20 # Try first to locate a cmake config file
20 # Try with pkg-config first
21 find_package(PkgConfig)
22 pkg_check_modules(OPENJPEG libopenjpeg1)
23 if(OPENJPEG_FOUND)
24 set(OPENJPEG_MAJOR_VERSION 1)
25 set(OPENJPEG_INCLUDE_DIR ${OPENJPEG_INCLUDE_DIRS})
26 set(OPENJPEG_LIBRARIES ${OPENJPEG_LDFLAGS})
27 else()
28 # Try to locate a cmake config file
2129 find_package(OpenJPEG QUIET NO_MODULE)
2230 mark_as_advanced(OpenJPEG_DIR)
2331
5159 OPENJPEG_INCLUDE_DIR
5260 )
5361 endif()
62 endif()
3131 #----------------------------------------------------------------------------
3232 set(GDCM_MAJOR_VERSION 2)
3333 set(GDCM_MINOR_VERSION 6)
34 set(GDCM_BUILD_VERSION 4)
34 set(GDCM_BUILD_VERSION 5)
3535 set(GDCM_VERSION
3636 "${GDCM_MAJOR_VERSION}.${GDCM_MINOR_VERSION}.${GDCM_BUILD_VERSION}")
3737 # let advanced user the option to define GDCM_API_VERSION:
2525 FileStreaming
2626 FileChangeTS
2727 FileChangeTSLossy
28 DumpCSA
2829 )
2930
3031 if(BUILD_TESTING)
0 /*=========================================================================
1
2 Program: GDCM (Grassroots DICOM). A DICOM library
3
4 Copyright (c) 2006-2011 Mathieu Malaterre
5 All rights reserved.
6 See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
7
8 This software is distributed WITHOUT ANY WARRANTY; without even
9 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
10 PURPOSE. See the above copyright notice for more information.
11
12 =========================================================================*/
13
14 /*
15 * Usage:
16 * $ bin/DumpCSA.exe input.dcm
17 */
18 using System;
19 using gdcm;
20
21 public class DumpCSA
22 {
23 public static int Main(string[] args)
24 {
25 string filename = args[0];
26
27 gdcm.Reader reader = new gdcm.Reader();
28 reader.SetFileName( filename );
29 if (!reader.Read()) return 1;
30
31 gdcm.File f = reader.GetFile();
32 gdcm.DataSet ds = f.GetDataSet();
33
34 string[] expectedSiemensTags = new string[] { "B_value" , "AcquisitionMatrixText" };
35 using (PrivateTag gtag = CSAHeader.GetCSAImageHeaderInfoTag())
36 {
37 if (ds.FindDataElement(gtag))
38 {
39 using (DataElement de = ds.GetDataElement(gtag))
40 {
41 if (de != null && !de.IsEmpty())
42 {
43 using (CSAHeader csa = new CSAHeader())
44 {
45 if (csa.LoadFromDataElement(de))
46 {
47 foreach (string str in expectedSiemensTags)
48 {
49 if (csa.FindCSAElementByName(str))
50 {
51 using (CSAElement elem = csa.GetCSAElementByName(str))
52 {
53 if (elem != null)
54 {
55 System.Console.WriteLine( elem.toString() );
56 }
57 }
58 }
59 }
60 }
61 }
62 }
63 }
64 }
65 }
66
67
68 return 0;
69 }
70 }
0 find_package(Java REQUIRED) # javac, jar
0 find_package(Java ${GDCM_DEFAULT_JAVA_VERSION} REQUIRED) # javac, jar
11 find_package(JNI REQUIRED)
22 include_directories(
33 #${JNI_INCLUDE_PATH}
322322 { 0,"D_CLUNIE_VL4_RLE.dcm" },
323323 { 0,"D_CLUNIE_RG1_RLE.dcm" },
324324 { 1,"JDDICOM_Sample2.dcm" },
325 {0,"AMIInvalidPrivateDefinedLengthSQasUN.dcm" },
325 { 0,"AMIInvalidPrivateDefinedLengthSQasUN.dcm" },
326326 { 0,"SIEMENS_MAGNETOM-12-MONO2-FileSeq3.dcm" },
327327 { 0,"CT-MONO2-8-abdo.dcm" },
328328 { 0,"D_CLUNIE_SC1_RLE.dcm" },
415415 { 1,"multiframegrayscalewordscis.dcm" },
416416 { 1,"multiframesinglebitscis.dcm" },
417417 { 1,"multiframetruecolorscis.dcm" },
418 { 1, "SinglePrecisionSC.dcm" },
419 { 0, "signedtruecoloroldsc.dcm" },
420 { 0, "o.dcm" },
421 { 0, "UnexpectedSequenceDelimiterInFixedLengthSequence.dcm" },
422 { 0, "IM-0001-0066.CommandTag00.dcm" },
423 { 0, "NM_Kakadu44_SOTmarkerincons.dcm" },
424 { 0, "GDCMJ2K_TextGBR.dcm" },
425 { 0, "PhilipsInteraSeqTermInvLen.dcm" },
426 { 0, "LIBIDO-24-ACR_NEMA-Rectangle.dcm" },
427 { 0, "TOSHIBA_J2K_SIZ1_PixRep0.dcm" },
428 { 0, "TOSHIBA_J2K_SIZ0_PixRep1.dcm" },
429 { 0, "TOSHIBA_J2K_OpenJPEGv2Regression.dcm" },
430 { 0, "NM-PAL-16-PixRep1.dcm" },
431 { 0, "MEDILABInvalidCP246_EVRLESQasUN.dcm" },
432 { 0, "JPEGInvalidSecondFrag.dcm" },
433 { 0, "SC16BitsAllocated_8BitsStoredJ2K.dcm" },
434 { 0, "SC16BitsAllocated_8BitsStoredJPEG.dcm" },
435 { 0, "SIEMENS_SYNGO-12-MONO2-LUTWrongLength512.dcm" },
418 { 1,"SinglePrecisionSC.dcm" },
419 { 0,"signedtruecoloroldsc.dcm" },
420 { 0,"o.dcm" },
421 { 0,"UnexpectedSequenceDelimiterInFixedLengthSequence.dcm" },
422 { 0,"IM-0001-0066.CommandTag00.dcm" },
423 { 0,"NM_Kakadu44_SOTmarkerincons.dcm" },
424 { 0,"GDCMJ2K_TextGBR.dcm" },
425 { 0,"PhilipsInteraSeqTermInvLen.dcm" },
426 { 0,"LIBIDO-24-ACR_NEMA-Rectangle.dcm" },
427 { 0,"TOSHIBA_J2K_SIZ1_PixRep0.dcm" },
428 { 0,"TOSHIBA_J2K_SIZ0_PixRep1.dcm" },
429 { 0,"TOSHIBA_J2K_OpenJPEGv2Regression.dcm" },
430 { 0,"NM-PAL-16-PixRep1.dcm" },
431 { 0,"MEDILABInvalidCP246_EVRLESQasUN.dcm" },
432 { 0,"JPEGInvalidSecondFrag.dcm" },
433 { 0,"SC16BitsAllocated_8BitsStoredJ2K.dcm" },
434 { 0,"SC16BitsAllocated_8BitsStoredJPEG.dcm" },
435 { 0,"SIEMENS_SYNGO-12-MONO2-LUTWrongLength512.dcm" },
436 { 0,"JPEGLS_CharLS_10742.dcm" },
437 { 1,"JPEGLosslessYBR_FULL_422.dcm" },
438 { 1,"JPEGNote_empty.dcm" },
439 { 1,"JPEGNote_missing.dcm" },
440 { 1,"JPEGNote_bogus.dcm" },
441 { 0,"RLEDebianBug816607Orig.dcm" },
442 { 0,"IllegalGroup2ImplicitTS.dcm" },
436443 { 0, NULL }
437444 };
438445
777777 }
778778 }
779779 // Now is a good time to find out the dataset transfer syntax
780 try {
780781 ComputeDataSetTransferSyntax();
782 } catch( gdcm::Exception & ex ) {
783 // We were able to read some of the Meta Header, but failed to compute the DataSetTS
784 // technically GDCM is able to cope with any value here. But be kind and try to have a good guess:
785
786 gdcmWarningMacro( "Meta Header is bogus. Guessing DataSet TS." );
787 Tag t;
788 if( !t.Read<SwapperNoOp>(is) )
789 {
790 throw Exception( "Cannot read very first tag" );
791 }
792
793 char vr_str[3];
794 is.read(vr_str, 2);
795 vr_str[2] = '\0';
796 VR::VRType vr = VR::GetVRType(vr_str);
797 if( vr != VR::VR_END )
798 {
799 DataSetTS = TransferSyntax::ExplicitVRLittleEndian;
800 }
801 else
802 {
803 DataSetTS = TransferSyntax::ImplicitVRLittleEndian;
804 }
805 is.seekg(-6, std::ios::cur); // Seek back
806
807 }
781808 }
782809 }
783810 // else
8383 protected:
8484 std::ostream *Stream;
8585 std::ofstream *Ofstream;
86 bool GetCheckFileMetaInformation() const { return CheckFileMetaInformation; }
8687
8788 private:
8889 SmartPointer<File> F;
9595 {
9696 assert( NumberOfDimensions );
9797 //assert( Dimensions.empty() );
98 #if 0
9899 Dimensions = std::vector<unsigned int>(dims,
99100 dims+NumberOfDimensions);
101 #else
102 assert( Dimensions.size() == 3 );
103 Dimensions[0] = dims[0];
104 Dimensions[1] = dims[1];
105 if( NumberOfDimensions == 2 )
106 Dimensions[2] = 1;
107 else
108 Dimensions[2] = dims[2];
109 #endif
100110 }
101111
102112 void Bitmap::SetDimension(unsigned int idx, unsigned int dim)
395405 i->SetPixelFormat( codec.GetPixelFormat() );
396406 }
397407 #endif
408 if( GetDimensions()[0] != codec.GetDimensions()[0]
409 || GetDimensions()[1] != codec.GetDimensions()[1] )
410 {
411 gdcmWarningMacro( "dimension mismatch for JPEG" );
412 ((Bitmap*)this)->SetDimensions( codec.GetDimensions() ); //JPEGNote_bogus.dcm
413 }
398414
399415 return true;
400416 }
2323 class ImageRegionReaderInternals;
2424 /**
2525 * \brief ImageRegionReader
26 * This class is able to read a region from a DICOM file containing an image. This implementation
27 * requires that the information stored in the DICOM header are consistent with what is in the
28 * encapsulated Pixel Data. This is technically not required by DICOM standard, which makes
29 * this implementation illegal with regards to the famous JPEG note:
30 * http://dicom.nema.org/medical/dicom/current/output/chtml/part05/sect_8.2.html\#para_4bcb841e-c6bf-4e26-82a5-3fad3c942da0
2631 * \see ImageReader
2732 */
2833 class GDCM_EXPORT ImageRegionReader : public ImageReader
3535
3636 namespace gdcm
3737 {
38
39 /* Part 1 Table A.2 List of markers and marker segments */
40 typedef enum {
41 FF30 = 0xFF30,
42 FF31 = 0xFF31,
43 FF32 = 0xFF32,
44 FF33 = 0xFF33,
45 FF34 = 0xFF34,
46 FF35 = 0xFF35,
47 FF36 = 0xFF36,
48 FF37 = 0xFF37,
49 FF38 = 0xFF38,
50 FF39 = 0xFF39,
51 FF3A = 0xFF3A,
52 FF3B = 0xFF3B,
53 FF3C = 0xFF3C,
54 FF3D = 0xFF3D,
55 FF3E = 0xFF3E,
56 FF3F = 0xFF3F,
57 SOC = 0xFF4F,
58 CAP = 0xFF50,
59 SIZ = 0xFF51,
60 COD = 0xFF52,
61 COC = 0xFF53,
62 TLM = 0xFF55,
63 PLM = 0XFF57,
64 PLT = 0XFF58,
65 QCD = 0xFF5C,
66 QCC = 0xFF5D,
67 RGN = 0xFF5E,
68 POC = 0xFF5F,
69 PPM = 0XFF60,
70 PPT = 0XFF61,
71 CRG = 0xFF63,
72 COM = 0xFF64,
73 SOT = 0xFF90,
74 SOP = 0xFF91,
75 EPH = 0XFF92,
76 SOD = 0xFF93,
77 EOC = 0XFFD9 /* EOI in old jpeg */
78 } MarkerType;
79
80 typedef enum {
81 JP = 0x6a502020,
82 FTYP = 0x66747970,
83 JP2H = 0x6a703268,
84 JP2C = 0x6a703263,
85 JP2 = 0x6a703220,
86 IHDR = 0x69686472,
87 COLR = 0x636f6c72,
88 XML = 0x786d6c20,
89 CDEF = 0x63646566,
90 CMAP = 0x636D6170,
91 PCLR = 0x70636c72,
92 RES = 0x72657320,
93 } OtherType;
94
95 static inline bool hasnolength( uint_fast16_t marker )
96 {
97 switch( marker )
98 {
99 case FF30:
100 case FF31:
101 case FF32:
102 case FF33:
103 case FF34:
104 case FF35:
105 case FF36:
106 case FF37:
107 case FF38:
108 case FF39:
109 case FF3A:
110 case FF3B:
111 case FF3C:
112 case FF3D:
113 case FF3E:
114 case FF3F:
115 case SOC:
116 case SOD:
117 case EOC:
118 case EPH:
119 return true;
120 }
121 return false;
122 }
123
124
125 static inline bool read16(const char ** input, size_t * len, uint16_t * ret)
126 {
127 if( *len >= 2 )
128 {
129 union { uint16_t v; char bytes[2]; } u;
130 memcpy(u.bytes, *input, 2);
131 *ret = SwapperDoOp::Swap(u.v);
132 *input += 2; *len -= 2;
133 return true;
134 }
135 return false;
136 }
137
138
139 static inline bool read32(const char ** input, size_t * len, uint32_t * ret)
140 {
141 if( *len >= 4 )
142 {
143 union { uint32_t v; char bytes[4]; } u;
144 memcpy(u.bytes, *input, 4);
145 *ret = SwapperDoOp::Swap(u.v);
146 *input += 4; *len -= 4;
147 return true;
148 }
149 return false;
150 }
151
152 static inline bool read64(const char ** input, size_t * len, uint64_t * ret)
153 {
154 if( *len >= 8 )
155 {
156 union { uint64_t v; char bytes[8]; } u;
157 memcpy(u.bytes, *input, 8);
158 *ret = SwapperDoOp::Swap(u.v);
159 *input += 8; *len -= 8;
160 return true;
161 }
162 return false;
163 }
164
165
166 static bool parsej2k_imp( const char * const stream, const size_t file_size, bool * lossless )
167 {
168 uint16_t marker;
169 uintmax_t sotlen = 0;
170 size_t lenmarker;
171 const char * cur = stream;
172 size_t cur_size = file_size;
173 *lossless = false; // default init
174 while( read16(&cur, &cur_size, &marker) )
175 {
176 if ( !hasnolength( marker ) )
177 {
178 uint16_t l;
179 bool r = read16( &cur, &cur_size, &l );
180 if( !r || l < 2 )
181 break;
182 lenmarker = (size_t)l - 2;
183
184 if( marker == COD )
185 {
186 const uint8_t Transformation = *(cur+9);
187 if( Transformation == 0x0 ) { *lossless = false; return true; }
188 else if( Transformation == 0x1 ) *lossless = true;
189 else return false;
190 }
191 cur += lenmarker; cur_size -= lenmarker;
192 }
193 else if( marker == SOD )
194 return true;
195 }
196 return false;
197 }
198
199 static bool parsejp2_imp( const char * const stream, const size_t file_size, bool * lossless )
200 {
201 uint32_t marker;
202 uint64_t len64; /* ref */
203 uint32_t len32; /* local 32bits op */
204 const char * cur = stream;
205 size_t cur_size = file_size;
206
207 while( read32(&cur, &cur_size, &len32) )
208 {
209 bool b = read32(&cur, &cur_size, &marker);
210 if( !b ) break;
211 len64 = len32;
212 if( len32 == 1 ) /* 64bits ? */
213 {
214 bool b = read64(&cur, &cur_size, &len64);
215 assert( b );
216 len64 -= 8;
217 }
218 if( marker == JP2C )
219 {
220 const size_t start = cur - stream;
221 if( !len64 )
222 {
223 len64 = (size_t)(file_size - start + 8);
224 }
225 assert( len64 >= 8 );
226 return parsej2k_imp( cur, len64 - 8, lossless );
227 }
228 const size_t lenmarker = len64 - 8;
229 cur += lenmarker;
230 }
231
232 return false;
233 }
234
38235
39236 /**
40237 sample error callback expecting a FILE* client object
93290
94291 void gdcm_error_callback(const char* msg, void* f)
95292 {
293 #if 0
96294 if( strcmp( msg, "Cannot read data with no size known, giving up\n" ) == 0 )
97295 {
98296 OPJ_UINT32 **s = (OPJ_UINT32**)f;
99297 *s[1] = *s[0];
100298 gdcmWarningMacro( "Recovering from odd J2K file" );
101 }
102 // else
103 // {
104 // fprintf( stderr, msg );
105 // }
106 }
107
108
109 OPJ_UINT32 opj_read_from_memory(void * p_buffer, OPJ_UINT32 p_nb_bytes, myfile* p_file)
299 assert(0);
300 }
301 else
302 #endif
303 {
304 fprintf( stderr, msg );
305 }
306 }
307
308
309 OPJ_SIZE_T opj_read_from_memory(void * p_buffer, OPJ_SIZE_T p_nb_bytes, myfile* p_file)
110310 {
111311 //OPJ_UINT32 l_nb_read = fread(p_buffer,1,p_nb_bytes,p_file);
112 OPJ_UINT32 l_nb_read;
113 if( p_file->cur + p_nb_bytes < p_file->mem + p_file->len )
312 OPJ_SIZE_T l_nb_read;
313 if( p_file->cur + p_nb_bytes <= p_file->mem + p_file->len )
114314 {
115315 l_nb_read = 1*p_nb_bytes;
116316 }
117317 else
118318 {
119 l_nb_read = (OPJ_UINT32)(p_file->mem + p_file->len - p_file->cur);
319 l_nb_read = (OPJ_SIZE_T)(p_file->mem + p_file->len - p_file->cur);
120320 assert( l_nb_read < p_nb_bytes );
121321 }
122322 memcpy(p_buffer,p_file->cur,l_nb_read);
123323 p_file->cur += l_nb_read;
124324 assert( p_file->cur <= p_file->mem + p_file->len );
125325 //std::cout << "l_nb_read: " << l_nb_read << std::endl;
126 return l_nb_read ? l_nb_read : ((OPJ_UINT32)-1);
127 }
128
129 OPJ_UINT32 opj_write_from_memory (void * p_buffer, OPJ_UINT32 p_nb_bytes, myfile* p_file)
326 return l_nb_read ? l_nb_read : ((OPJ_SIZE_T)-1);
327 }
328
329 OPJ_SIZE_T opj_write_from_memory (void * p_buffer, OPJ_SIZE_T p_nb_bytes, myfile* p_file)
130330 {
131331 //return fwrite(p_buffer,1,p_nb_bytes,p_file);
132 OPJ_UINT32 l_nb_write;
332 OPJ_SIZE_T l_nb_write;
133333 //if( p_file->cur + p_nb_bytes < p_file->mem + p_file->len )
134334 // {
135335 l_nb_write = 1*p_nb_bytes;
147347 //return p_nb_bytes;
148348 }
149349
150 OPJ_SIZE_T opj_skip_from_memory (OPJ_SIZE_T p_nb_bytes, myfile * p_file)
350 OPJ_OFF_T opj_skip_from_memory (OPJ_OFF_T p_nb_bytes, myfile * p_file)
151351 {
152352 //if (fseek(p_user_data,p_nb_bytes,SEEK_CUR))
153353 // {
154354 // return -1;
155355 // }
156 if( p_file->cur + p_nb_bytes < p_file->mem + p_file->len )
356 if( p_file->cur + p_nb_bytes <= p_file->mem + p_file->len )
157357 {
158358 p_file->cur += p_nb_bytes;
159359 return p_nb_bytes;
160360 }
161361
162362 p_file->cur = p_file->mem + p_file->len;
163 return (OPJ_SIZE_T)-1;
164 }
165
166 bool opj_seek_from_memory (OPJ_SIZE_T p_nb_bytes, myfile * p_file)
363 return -1;
364 }
365
366 OPJ_BOOL opj_seek_from_memory (OPJ_OFF_T p_nb_bytes, myfile * p_file)
167367 {
168368 //if (fseek(p_user_data,p_nb_bytes,SEEK_SET))
169369 // {
170370 // return false;
171371 // }
172372 //return true;
173 if( p_file->cur + p_nb_bytes < p_file->mem + p_file->len )
174 {
175 p_file->cur += p_nb_bytes;
176 return true;
177 }
373 if( p_nb_bytes <= p_file->len )
374 {
375 p_file->cur = p_file->mem + p_nb_bytes;
376 return OPJ_TRUE;
377 }
378
178379 p_file->cur = p_file->mem + p_file->len;
179 return false;
180 }
181
182 opj_stream_t* OPJ_CALLCONV opj_stream_create_memory_stream (myfile* p_mem,OPJ_UINT32 p_size,bool p_is_read_stream)
380 return OPJ_FALSE;
381 }
382
383 opj_stream_t* OPJ_CALLCONV opj_stream_create_memory_stream (myfile* p_mem,OPJ_SIZE_T p_size,bool p_is_read_stream)
183384 {
184385 opj_stream_t* l_stream = 00;
185386 if
198399 opj_stream_set_write_function(l_stream, (opj_stream_write_fn) opj_write_from_memory);
199400 opj_stream_set_skip_function(l_stream, (opj_stream_skip_fn) opj_skip_from_memory);
200401 opj_stream_set_seek_function(l_stream, (opj_stream_seek_fn) opj_seek_from_memory);
402 opj_stream_set_user_data_length(l_stream, p_mem->len /* p_size*/); /* important to avoid an assert() */
201403 return l_stream;
202404 }
203405
537739 s[1] = 0;
538740 opj_set_error_handler(dinfo, gdcm_error_callback, s);
539741
540 #ifdef OPJ_J2K_STREAM_CHUNK_SIZE
541742 cio = opj_stream_create_memory_stream(fsrc,OPJ_J2K_STREAM_CHUNK_SIZE, true);
542 #else
543 cio = opj_stream_create_memory_stream(fsrc,J2K_STREAM_CHUNK_SIZE, true);
544 #endif
545743
546744 /* setup the decoder decoding parameters using user parameters */
547 opj_setup_decoder(dinfo, &parameters);
548745 bool bResult;
746 bResult = opj_setup_decoder(dinfo, &parameters);
747 assert( bResult );
549748 OPJ_INT32 l_tile_x0,l_tile_y0;
550749 OPJ_UINT32 l_tile_width,l_tile_height,l_nb_tiles_x,l_nb_tiles_y;
551750 #if 0
567766 #endif
568767 assert( bResult );
569768
570 #if OPENJPEG_MAJOR_VERSION == 1
571 #else
572769 #if 0
573 // needs to be before call to opj_decode...
574 reversible = opj_get_reversible(dinfo, &parameters );
575 assert( reversible == 0 || reversible == 1 );
576 #else
577 reversible = 0;
578 #endif
770 /* Optional if you want decode the entire image */
771 opj_set_decode_area(dinfo, image, (OPJ_INT32)parameters.DA_x0,
772 (OPJ_INT32)parameters.DA_y0, (OPJ_INT32)parameters.DA_x1, (OPJ_INT32)parameters.DA_y1);
579773 #endif
580774
581775 bResult = opj_decode(dinfo, cio,image);
631825 gdcmErrorMacro( "Impossible happen" );
632826 return std::make_pair<char*,size_t>(0,0);
633827 }
828 #else
829 bool b = false;
830 bool lossless;
831 if( parameters.decod_format == JP2_CFMT )
832 b = parsejp2_imp( dummy_buffer, buf_size, &lossless);
833 else if( parameters.decod_format == J2K_CFMT )
834 b = parsej2k_imp( dummy_buffer, buf_size, &lossless);
835
836 reversible = 0;
837 if( b )
838 reversible = lossless;
634839 #endif // OPENJPEG_MAJOR_VERSION == 1
635840 LossyFlag = !reversible;
636841
9801185 }
9811186
9821187 if(parameters.cp_comment == NULL) {
983 const char comment[] = "Created by GDCM/OpenJPEG version 2.0";
1188 #if OPENJPEG_MAJOR_VERSION == 1
1189 const char comment[] = "Created by GDCM/OpenJPEG version 1.4.0";
9841190 parameters.cp_comment = (char*)malloc(strlen(comment) + 1);
9851191 strcpy(parameters.cp_comment, comment);
1192 #else
1193 const char comment[] = "Created by GDCM/OpenJPEG version %s";
1194 const char * vers = opj_version();
1195 parameters.cp_comment = (char*)malloc(strlen(comment) + 10);
1196 snprintf( parameters.cp_comment, strlen(comment) + 10, comment, vers );
1197 #endif
9861198 /* no need to delete parameters.cp_comment on exit */
9871199 //delete_comment = false;
9881200 }
10641276 myfile *fsrc = &mysrc;
10651277 char *buffer_j2k = new char[inputlength]; // overallocated
10661278 fsrc->mem = fsrc->cur = buffer_j2k;
1067 fsrc->len = 0;
1279 fsrc->len = 0; //inputlength;
10681280
10691281 /* open a byte stream for writing */
10701282 /* allocate memory for all tiles */
13621574 // FIXME
13631575 assert( mct == 0 || mct == 1 );
13641576 #else
1577 bool b = false;
1578 bool lossless;
1579 if( parameters.decod_format == JP2_CFMT )
1580 b = parsejp2_imp( dummy_buffer, buf_size, &lossless);
1581 else if( parameters.decod_format == J2K_CFMT )
1582 b = parsej2k_imp( dummy_buffer, buf_size, &lossless);
1583
13651584 reversible = 0;
1585 if( b )
1586 reversible = lossless;
13661587 #endif
13671588 #endif // OPENJPEG_MAJOR_VERSION == 1
13681589 LossyFlag = !reversible;
550550 || cinfo.Y_density != 1
551551 )
552552 {
553 gdcmErrorMacro( "Pixel Density from JFIF Marker is not supported (for now)" );
553 gdcmWarningMacro( "Pixel Density from JFIF Marker is not supported (for now)" );
554554 //return false;
555555 }
556556
792792 if( cinfo.image_width != dims[0]
793793 || cinfo.image_height != dims[1] )
794794 {
795 gdcmErrorMacro( "Unhandled: dimension mismatch. JPEG is " <<
795 gdcmWarningMacro( "dimension mismatch. JPEG is " <<
796796 cinfo.image_width << "," << cinfo.image_height << " while DICOM " << dims[0] <<
797 "," << dims[1] ); // FIXME is this ok by standard ?
797 "," << dims[1] );
798 //this->Dimensions[0] = cinfo.image_width;
799 //this->Dimensions[1] = cinfo.image_height;
800 /*
801 * Long story short, the real issue is that class such as ImageRegionReader expect to read the
802 * image information without ever touching the JPEG codestream...
803 */
798804 return false;
799805 }
800806 assert( cinfo.image_width == dims[0] );
261261 //assert( Internal->BitPosition >= 12 );
262262 if( ds.FindDataElement( Tag(0x7fe0,0x0010) ) )
263263 {
264 gdcmErrorMacro("Could not find Pixel Data. Cannot extract Overlay." );
264 gdcmWarningMacro("Could not find Pixel Data. Cannot extract Overlay." );
265265 return false;
266266 }
267267 const DataElement &pixeldata = ds.GetDataElement( Tag(0x7fe0,0x0010) );
572572 }
573573 else
574574 {
575 assert( ds.FindDataElement( at1.GetTag() ) );
576 //assert( ds.FindDataElement( at3.GetTag() ) );
577 at1.Set( ds );
578 assert( atoi(at1.GetValue().c_str()) == 1 );
575 if( ds.FindDataElement( at1.GetTag() ) ) {
576 //assert( ds.FindDataElement( at3.GetTag() ) );
577 at1.Set( ds );
578 if( atoi(at1.GetValue().c_str()) != 1 ) {
579 gdcmWarningMacro( "Invalid value for LossyImageCompression" );
580 }
581 } else {
582 gdcmWarningMacro( "Missing attribute for LossyImageCompression" );
583 }
579584 }
580585 }
581586
756761 }
757762
758763 FileMetaInformation &fmi = file.GetHeader();
759 fmi.Clear();
760 //assert( ts == TransferSyntax::ImplicitVRLittleEndian );
761 {
762 const char *tsuid = TransferSyntax::GetTSString( ts );
763 DataElement de( Tag(0x0002,0x0010) );
764 VL::Type strlenTSUID = (VL::Type)strlen(tsuid);
765 de.SetByteValue( tsuid, strlenTSUID );
766 de.SetVR( Attribute<0x0002, 0x0010>::GetVR() );
767 fmi.Replace( de );
768 fmi.SetDataSetTransferSyntax(ts);
769 }
770 fmi.FillFromDataSet( ds );
764 if( GetCheckFileMetaInformation() )
765 {
766 fmi.Clear();
767 //assert( ts == TransferSyntax::ImplicitVRLittleEndian );
768 {
769 const char *tsuid = TransferSyntax::GetTSString( ts );
770 DataElement de( Tag(0x0002,0x0010) );
771 VL::Type strlenTSUID = (VL::Type)strlen(tsuid);
772 de.SetByteValue( tsuid, strlenTSUID );
773 de.SetVR( Attribute<0x0002, 0x0010>::GetVR() );
774 fmi.Replace( de );
775 fmi.SetDataSetTransferSyntax(ts);
776 }
777 fmi.FillFromDataSet( ds );
778 }
779 else
780 {
781 Attribute<0x0002,0x0010> at;
782 at.SetFromDataSet( fmi );
783 const char *tsuid = TransferSyntax::GetTSString( ts );
784 UIComp tsui = at.GetValue();
785 if( tsui != tsuid )
786 {
787 gdcmErrorMacro( "Incompatible TransferSyntax." );
788 return false;
789 }
790 }
771791
772792
773793 return true;
228228 { "027faefc8031768dad1afc100f7aee27" , "SC16BitsAllocated_8BitsStoredJ2K.dcm" },
229229 { "f7c4fbb93b0347101e21e36f223b4d46" , "SC16BitsAllocated_8BitsStoredJPEG.dcm" },
230230 { "af580e6202a240005a5a05adc5c691f2" , "SIEMENS_SYNGO-12-MONO2-LUTWrongLength512.dcm" },
231 { "236713383dd9d315415f3a5957707ad1" , "JPEGNote_empty.dcm" },
232 { "5b6f7f59dbefd679aa29e9082f100ff5" , "JPEGLS_CharLS_10742.dcm" },
233 { "66fe7d517941802364e7ad8dee7149e7" , "JPEGLosslessYBR_FULL_422.dcm" },
234 { "dcb4b29b7e0f0da441ab3e5cdcb506b4" , "JPEGNote_missing.dcm" },
235 { "2c30e74ee3db1895027932bb0566f54e" , "JPEGNote_bogus.dcm" },
236 { "c71a2cf95325395264c4dc6e15a898bd" , "RLEDebianBug816607Orig.dcm" },
237 { "e49c403278663d9739014ad1d57c276f" , "IllegalGroup2ImplicitTS.dcm" },
238 { "299df0175ea4d3ab1f02651f88ffe9f3" , "JPEG_LS_InvalidEscapeSequence_COM_padding.dcm" },
239 { "9add5fd3c83cc0946633e792f448f732" , "LengthOfItemLarger.dcm" },
231240
232241 { NULL, NULL}
233242 };
227227 { "d17a34f8ae066048442ab5b110d43c412472ea7e" , "SC16BitsAllocated_8BitsStoredJ2K.dcm" },
228228 { "71517fce6c32625f1051b72085cfceeee58bd164" , "SC16BitsAllocated_8BitsStoredJPEG.dcm" },
229229 { "0d19e4a98265afc3c782db02bc64bd32124ed2f6" , "SIEMENS_SYNGO-12-MONO2-LUTWrongLength512.dcm" },
230 { "5cb6c554e80b552ea68cad05409dce4fe92b6dd7" , "IllegalGroup2ImplicitTS.dcm" },
231 { "031f8cb2cbbe7b5e524b1f79aef6674a66e7f390" , "JPEGLosslessYBR_FULL_422.dcm" },
232 { "4710e6cfd86c0d349c61b60ae69a684b246db3ff" , "JPEGNote_bogus.dcm" },
233 { "197e47b5afeeeb75eccafe04e5a1bb0af1a7957a" , "JPEGNote_empty.dcm" },
234 { "08828e913a7a1ebbc0129c42974b64ce702814b6" , "JPEGNote_missing.dcm" },
235 { "99c169688190a66100b61319eaeefb3db1936125" , "RLEDebianBug816607Orig.dcm" },
230236
231237 { NULL, NULL}
232238 };
6363 MR-MONO2-12-angio-an1.acr
6464 # Openjpeg / Part 2:
6565 lena512_rot90.j2k.dcm
66 # Remove this one for now:
67 LengthOfItemLarger.dcm
68 # Need CharLS 1.1
69 JPEG_LS_InvalidEscapeSequence_COM_padding.dcm
70 # something wrong with OPJ 1.4
71 JPEGLS_CharLS_10742.dcm
6672 )
6773 if(NOT GDCM_USE_PVRG)
6874 set(BLACK_LIST_READER
688688
689689 { "4a5d8549791432b29948dd8ff63e2534" , "SIEMENS_SYNGO-12-MONO2-LUTWrongLength512.dcm" },
690690
691 { "2c8630ae1bff925b258d98e742dfc632" , "JPEGLS_CharLS_10742.dcm" },
692 { "f666a95dde9ddfdec0cf9574a7985ae3" , "IllegalGroup2ImplicitTS.dcm" },
693
694 { "b85686dd3169b99725149abb00181254" , "RLEDebianBug816607Orig.dcm" },
695 { "464960d948dff0ded72b0380080f18a3" , "JPEGNote_empty.dcm" },
696 { "cdfb5dd0c999d88badeb00a16f96554f" , "JPEGLosslessYBR_FULL_422.dcm" },
697 { "464960d948dff0ded72b0380080f18a3" , "JPEGNote_missing.dcm" },
698 { "161e9fd986ea87adf2596e8e16641f11" , "JPEGNote_bogus.dcm" },
699
700
691701
692702 /* Stopping condition */
693703 { 0 ,0 }
238238 { "SC16BitsAllocated_8BitsStoredJPEG.dcm" , "1.2.840.10008.5.1.4.1.1.7" },
239239 { "SC16BitsAllocated_8BitsStoredJ2K.dcm" , "1.2.840.10008.5.1.4.1.1.7" },
240240 { "SIEMENS_SYNGO-12-MONO2-LUTWrongLength512.dcm" , "1.2.840.10008.5.1.4.1.1.4" },
241 { "JPEGNote_empty.dcm" , "1.2.840.10008.5.1.4.1.1.7" },
242 { "JPEGLS_CharLS_10742.dcm" , "1.2.840.10008.5.1.4.1.1.7" },
243 { "JPEGLosslessYBR_FULL_422.dcm" , "1.2.840.10008.5.1.4.1.1.7" },
244 { "JPEGNote_missing.dcm" , "1.2.840.10008.5.1.4.1.1.7" },
245 { "JPEGNote_bogus.dcm" , "1.2.840.10008.5.1.4.1.1.7" },
246 { "RLEDebianBug816607Orig.dcm" , "1.2.840.10008.5.1.4.1.1.7" },
247 { "IllegalGroup2ImplicitTS.dcm" , "1.2.840.10008.5.1.4.1.1.1" },
248 { "JPEG_LS_InvalidEscapeSequence_COM_padding.dcm" , "1.2.840.10008.5.1.4.1.1.7" },
249 { "LengthOfItemLarger.dcm" , "1.2.840.10008.5.1.4.1.1.4" },
241250
242251 /* Stopping condition */
243252 { 0 ,0 }
220220 { "PHILIPS_Gyroscan-12-Jpeg_Extended_Process_2_4.dcm",1314},
221221 { "SIEMENS_SYNGO-12-MONO2-LUTWrongLength512.dcm", 1596 },
222222 { "00191113.dcm",536 },
223 { "JPEGNote_empty.dcm", 482 },
224 { "JPEGLS_CharLS_10742.dcm", 532 },
225 { "JPEGLosslessYBR_FULL_422.dcm", 534 },
226 { "JPEGNote_missing.dcm", 406 },
227 { "JPEGNote_bogus.dcm", 482 },
228 { "RLEDebianBug816607Orig.dcm", 534 },
229 { "IllegalGroup2ImplicitTS.dcm", 1088 },
230 { "JPEG_LS_InvalidEscapeSequence_COM_padding.dcm", 534 },
231 { "LengthOfItemLarger.dcm", 1044 },
223232 { "dicomdir_With_embedded_icons",7125212 },
224233 { "dicomdir_Pms_WithVisit_WithPrivate_WithStudyComponents",37218 },
225234 { "dicomdir_Acusson_WithPrivate_WithSR",3826 },
222222 { "ELSCINT1_PMSCT_RLE1_priv.dcm",298002 },
223223 { "00191113.dcm",922 },
224224 { "SIEMENS_SYNGO-12-MONO2-LUTWrongLength512.dcm", 48714 },
225 { "JPEGNote_empty.dcm", 704 },
226 { "JPEGLS_CharLS_10742.dcm", 748 },
227 { "JPEGLosslessYBR_FULL_422.dcm", 802 },
228 { "JPEGNote_missing.dcm", 596 },
229 { "JPEGNote_bogus.dcm", 722 },
230 { "RLEDebianBug816607Orig.dcm", 768 },
231 { "IllegalGroup2ImplicitTS.dcm", 2264 },
232 { "JPEG_LS_InvalidEscapeSequence_COM_padding.dcm", 752 },
233 { "LengthOfItemLarger.dcm", 12748 },
225234 { "dicomdir_Acusson_WithPrivate_WithSR",3826 },
226235 { "dicomdir_Pms_WithVisit_WithPrivate_WithStudyComponents",37218 },
227236 { "dicomdir_Pms_With_heavy_embedded_sequence",3003414 },
227227 { "SC16BitsAllocated_8BitsStoredJ2K.dcm", 764 },
228228 { "SC16BitsAllocated_8BitsStoredJPEG.dcm", 958 },
229229 { "SIEMENS_SYNGO-12-MONO2-LUTWrongLength512.dcm", 48726 },
230
230 { "JPEGNote_empty.dcm", 716 },
231 { "JPEGLS_CharLS_10742.dcm", 760 },
232 { "JPEGLosslessYBR_FULL_422.dcm", 814 },
233 { "JPEGNote_missing.dcm", 608 },
234 { "JPEGNote_bogus.dcm", 734 },
235 { "RLEDebianBug816607Orig.dcm", 780 },
236 { "IllegalGroup2ImplicitTS.dcm", 2272 },
237 { "JPEG_LS_InvalidEscapeSequence_COM_padding.dcm", 764 },
238 { "LengthOfItemLarger.dcm", 12748 },
231239
232240 /* Stopping condition */
233241 { 0 ,0 },
4040 ret = 0;
4141 }
4242 // This is not an error if you are in the black list:
43 if( strcmp(name, "BuggedDicomWorksImage_Hopeless.dcm" ) != 0
44 || strcmp(name, "Philips_Wrong_Terminator_XX_0277" ) != 0
45 || strcmp(name, "DICOMDIR_noPATIENT_noSTUDY" ) != 0
46 || strcmp(name, "JpegLosslessMultiframePapyrus.pap" ) != 0
47 || strcmp(name, "Fish-1.img" ) != 0
48 || strcmp(name, "NM_FromJulius_Caesar.dcm" ) != 0
49 || strcmp(name, "Siemens-leonardo-bugged.dcm" ) != 0
50 || strcmp(name, "illegal_UN_stands_for_OB.dcm" ) != 0
51 || strcmp(name, "MR_PHILIPS_LargePreamble.dcm" ) != 0
52 || strcmp(name, "illegal_UN_stands_for_OB.dcm.secu" ) != 0 )
43 if( strcmp(name, "BuggedDicomWorksImage_Hopeless.dcm" ) == 0
44 || strcmp(name, "Philips_Wrong_Terminator_XX_0277" ) == 0
45 || strcmp(name, "DICOMDIR_noPATIENT_noSTUDY" ) == 0
46 || strcmp(name, "JpegLosslessMultiframePapyrus.pap" ) == 0
47 || strcmp(name, "Fish-1.img" ) == 0
48 || strcmp(name, "NM_FromJulius_Caesar.dcm" ) == 0
49 || strcmp(name, "Siemens-leonardo-bugged.dcm" ) == 0
50 || strcmp(name, "illegal_UN_stands_for_OB.dcm" ) == 0
51 || strcmp(name, "MR_PHILIPS_LargePreamble.dcm" ) == 0
52 || strcmp(name, "illegal_UN_stands_for_OB.dcm.secu" ) == 0 )
5353 {
5454 ret = 0;
5555 }
33 )
44
55 # Do not change anything after here:
6 find_package(Java REQUIRED) # javac, jar
6 find_package(Java ${GDCM_DEFAULT_JAVA_VERSION} REQUIRED) # javac, jar
77 find_package(JNI REQUIRED)
88 include_directories(
99 ${JNI_INCLUDE_PATH}
4444 {
4545 checktemplate = true;
4646 }
47 if( strcmp(name, "JPEGNote_empty.dcm" ) == 0
48 || strcmp(name, "JPEGNote_missing.dcm" ) == 0 )
49 {
50 // cannot read dims from DICOM header...
51 return 0;
52 }
4753
4854 gdcm::ImageRegionReader irr;
4955 irr.SetFileName( filename );
8389
8490 const gdcm::Tag pixeldata(0x7fe0,0x0010);
8591
86 bool b;
92 bool b = true;
93 if( strcmp(name, "libido1.0-vol.acr" ) != 0 ) // use Planes instead of Number of Frames
94 {
8795 b = fs.CheckDataElement( pixeldata ); // will be checking file size
96 }
8897 if( !b )
8998 {
9099 std::cerr << "Failed to CheckDataElement: " << outfilename << std::endl;
2929 // attribute is (b500,b700) which make ReadUpToTag(7fe0,0010) fails...
3030 if( strcmp(fn.GetName(), "DMCPACS_ExplicitImplicit_BogusIOP.dcm" ) == 0
3131 || strcmp(fn.GetName(), "SC16BitsAllocated_8BitsStoredJ2K.dcm" ) == 0 // mismatch pixel format in JPEG 200 vs DICOM
32 || strcmp(fn.GetName(), "PHILIPS_Gyroscan-12-Jpeg_Extended_Process_2_4.dcm" ) == 0 ) // bogus JPEG cannot be streamed
32 || strcmp(fn.GetName(), "PHILIPS_Gyroscan-12-Jpeg_Extended_Process_2_4.dcm" ) == 0 // bogus JPEG cannot be streamed
33
34 // FIXME: we should be able to handle those at some point:
35 || strcmp(fn.GetName(), "JPEGNote_empty.dcm" ) == 0
36 || strcmp(fn.GetName(), "JPEGNote_missing.dcm" ) == 0
37 || strcmp(fn.GetName(), "JPEGNote_bogus.dcm" ) == 0
38 )
3339 {
3440 std::cerr << "Skipping impossible file: " << filename << std::endl;
3541 return 0;
2929 // attribute is (b500,b700) which make ReadUpToTag(7fe0,0010) fails...
3030 if( strcmp(fn.GetName(), "DMCPACS_ExplicitImplicit_BogusIOP.dcm" ) == 0
3131 || strcmp(fn.GetName(), "SC16BitsAllocated_8BitsStoredJ2K.dcm" ) == 0 // mismatch pixel format in JPEG 200 vs DICOM
32 || strcmp(fn.GetName(), "PHILIPS_Gyroscan-12-Jpeg_Extended_Process_2_4.dcm" ) == 0 ) // bogus JPEG cannot be streamed
32 || strcmp(fn.GetName(), "PHILIPS_Gyroscan-12-Jpeg_Extended_Process_2_4.dcm" ) == 0 // bogus JPEG cannot be streamed
33
34 // FIXME: we should be able to handle those at some point:
35 || strcmp(fn.GetName(), "JPEGNote_empty.dcm" ) == 0
36 || strcmp(fn.GetName(), "JPEGNote_missing.dcm" ) == 0
37 || strcmp(fn.GetName(), "JPEGNote_bogus.dcm" ) == 0
38 )
3339 {
3440 std::cerr << "Skipping impossible file: " << filename << std::endl;
3541 return 0;
3131 // attribute is (b500,b700) which make ReadUpToTag(7fe0,0010) fails...
3232 if( strcmp(fn.GetName(), "DMCPACS_ExplicitImplicit_BogusIOP.dcm" ) == 0
3333 || strcmp(fn.GetName(), "SC16BitsAllocated_8BitsStoredJ2K.dcm" ) == 0 // mismatch pixel format in JPEG 200 vs DICOM
34 || strcmp(fn.GetName(), "PHILIPS_Gyroscan-12-Jpeg_Extended_Process_2_4.dcm" ) == 0 ) // bogus JPEG cannot be streamed
34 || strcmp(fn.GetName(), "PHILIPS_Gyroscan-12-Jpeg_Extended_Process_2_4.dcm" ) == 0 // bogus JPEG cannot be streamed
35
36 // FIXME: we should be able to handle those at some point:
37 || strcmp(fn.GetName(), "JPEGNote_empty.dcm" ) == 0
38 || strcmp(fn.GetName(), "JPEGNote_missing.dcm" ) == 0
39 || strcmp(fn.GetName(), "JPEGNote_bogus.dcm" ) == 0
40 )
3541 {
3642 std::cerr << "Skipping impossible file: " << filename << std::endl;
3743 return 0;
2323 // GetValueAsSQ to solve that issue.
2424 static const char * const printmd5[][2] = {
2525 { "a19bffac370df32acbf6b4991d1cbafe" , "00191113.dcm" } ,
26 { "2e7d47d86dc6b541fccfa928c2ee05e8" , "012345.002.050.dcm" } ,
26 { "a5b2cb7d27bf0565296ae0391c07dd54" , "012345.002.050.dcm" } ,
2727 { "94f8c6ab090bdc11e61625bfc2dd39b7" , "05115014-mr-siemens-avanto-syngo-with-palette-icone.dcm" } ,
2828 { "20c11831c616eb121a405cd73de5cba2" , "05148044-mr-siemens-avanto-syngo.dcm" } ,
2929 { "ec10dcbf1b13ace8a6c0cc5b24c6c870" , "3E768EB7.dcm" } ,
3030 { "fde1da68a1707dcc687ddffd57e6b3c3" , "ACUSON-24-YBR_FULL-RLE-b.dcm" } ,
3131 { "a27c6628d6379783a3be223481d5cba4" , "ACUSON-24-YBR_FULL-RLE.dcm" } ,
3232 { "9f3aa114b955a812942f815b6b456eaf" , "ALOKA_SSD-8-MONO2-RLE-SQ.dcm" } ,
33 { "8b9bca2a22732c6165eba2fd3114d323" , "AMIInvalidPrivateDefinedLengthSQasUN.dcm" } ,
34 { "0df5a880b1973062f1e3850c27ee9568" , "BugGDCM2_UndefItemWrongVL.dcm" } ,
33 { "6c18a8fdd766660fbb475c05d0611634" , "AMIInvalidPrivateDefinedLengthSQasUN.dcm" } ,
34 { "9ddd03e5fd29f92bd02c3d3812b4e93e" , "BugGDCM2_UndefItemWrongVL.dcm" } ,
3535 { "6d2af85d2af299c223b684538d42d9e5" , "CR-MONO1-10-chest.dcm" } ,
3636 { "820d45cefd528e011921ea129bec9084" , "CT_16b_signed-UsedBits13.dcm" } ,
3737 { "fcf2ca019aa3138188edb18552983733" , "CT-MONO2-12-lomb-an2.acr" } ,
5454 { "b770b1ca257d7c1c885f69a5a1b58808" , "D_CLUNIE_MR2_JPLL.dcm" } ,
5555 { "da74aefef4e8ac49dbe1a4dd3b1dcb26" , "D_CLUNIE_MR2_JPLY.dcm" } ,
5656 { "023eb2a9ecbfd3c04bb148ec339865f0" , "D_CLUNIE_MR2_RLE.dcm" } ,
57 { "dca2414a88e95ef5ed59c088d20021b8" , "D_CLUNIE_MR3_JPLL.dcm" } ,
58 { "73c16bde7114f03b976009cba63c5f65" , "D_CLUNIE_MR3_JPLY.dcm" } ,
59 { "d1c358c3f79a5fc5592abe2b4b4a3571" , "D_CLUNIE_MR3_RLE.dcm" } ,
57 { "4ac28edcc53e3c5a2b14cee29ac4b350" , "D_CLUNIE_MR3_JPLL.dcm" } ,
58 { "1279c4aaacd1a058fc4b101cbfebec54" , "D_CLUNIE_MR3_JPLY.dcm" } ,
59 { "d6ca154c96d206995023f7349f6ca861" , "D_CLUNIE_MR3_RLE.dcm" } ,
6060 { "1646ec013060ef3f261849db705f80f3" , "D_CLUNIE_MR4_JPLL.dcm" } ,
6161 { "fbbfe4caab2179641bd0de5d8ccf79ae" , "D_CLUNIE_MR4_JPLY.dcm" } ,
6262 { "fafdb8499580e59c2f6d9047894272ea" , "D_CLUNIE_MR4_RLE.dcm" } ,
9999 { "3493bf0e698798529fde6ef488289879" , "ELSCINT1_JP2vsJ2K.dcm" } ,
100100 { "8f5581be656bd6f1ab6c9ec94f302284" , "ELSCINT1_LOSSLESS_RICE.dcm" } ,
101101 { "54f138a1aa6819ec1560a7ed344cde1a" , "ELSCINT1_PMSCT_RLE1.dcm" } ,
102 { "ff2965f3ca39bc0795df9850aa25467e" , "ExplicitVRforPublicElementsImplicitVRforShadowElements.dcm" } ,
102 { "d576bf8e8b2ca71fd543d29698807e85" , "ExplicitVRforPublicElementsImplicitVRforShadowElements.dcm" } ,
103103 { "3199cd21166043d619209d7a2073fb56" , "fffc0000UN.dcm" } ,
104104 { "9b426b02521cbc2f3ee25ab383ca835e" , "FUJI-10-MONO1-ACR_NEMA_2.dcm" } ,
105105 { "2aba3dacd00a0bc14a06e2d7142b916a" , "gdcm-ACR-LibIDO.acr" } ,
115115 { "9e126a24f81534e1cd653f16739a6192" , "GE_DLX-8-MONO2-Multiframe.dcm" } ,
116116 { "6b66f8c38fe96db805e7dedd9a997811" , "GE_DLX-8-MONO2-Multiframe-Jpeg_Lossless.dcm" } ,
117117 { "61ca6c5115e6f74565f6f2ca06647444" , "GE_DLX-8-MONO2-PrivateSyntax.dcm" } ,
118 { "459247061fb21a9cbf0bbb359a0af160" , "GE_GENESIS-16-MONO2-Uncompressed-UnusualVR.dcm" } ,
118 { "7920bf7f1269ba54dd8d0e0d375dc4b9" , "GE_GENESIS-16-MONO2-Uncompressed-UnusualVR.dcm" } ,
119119 { "8d398fce426d3a248d8c3f7582e3751d" , "GE_GENESIS-16-MONO2-WrongLengthItem.dcm" } ,
120120 { "bb5d500a0391a399b035968496b6fd5d" , "GE_LOGIQBook-8-RGB-HugePreview.dcm" } ,
121 { "7aad71b9c70060c0a39a73b2f489d68f" , "GE_MR_0025xx1bProtocolDataBlock.dcm" } ,
121 { "1ad963ca1e91932bb1ac58f3dddd981f" , "GE_MR_0025xx1bProtocolDataBlock.dcm" } ,
122122 { "d5efa34d8091e1ad04683eefb41f33c7" , "GE_RHAPSODE-16-MONO2-JPEG-Fragments.dcm" } ,
123123 { "d41d8cd98f00b204e9800998ecf8427e" , "IM-0001-0066.dcm" } ,
124124 { "cd085d783924d8a7fa2270ff40c6dc3e" , "ITK_GDCM124_MultiframeSecondaryCaptureInvalid.dcm" } ,
149149 { "497d6ea45b8f3f7f6a3bf8125dcc43b1" , "MR16BitsAllocated_8BitsStored.dcm" } ,
150150 { "5b23ccf10ad6358b253a7ec185deb2a9" , "MR-Brucker-CineTagging-NonSquarePixels.dcm" } ,
151151 { "31246836410a24124acf6bea5a36a942" , "MR_ELSCINT1_00e1_1042_SQ_feff_00e0_Item.dcm" } ,
152 { "285433f0db3a7aae20a4734644fc959d" , "MR_GE_with_Private_Compressed_Icon_0009_1110.dcm" } ,
152 { "7a61574251f8788a11cfe06ddc109bd9" , "MR_GE_with_Private_Compressed_Icon_0009_1110.dcm" } ,
153153 { "8419613dfb8d4b190ef8a988f8927bce" , "MR-MONO2-12-an2.acr" } ,
154154 { "b4058b67ec1eb3d3d3acde27d51eb24a" , "MR-MONO2-12-angio-an1.acr" } ,
155155 { "f782f6ea25928310bd69c3ca5c6a97d2" , "MR-MONO2-12-shoulder.dcm" } ,
156156 { "7f6bccb00b34a7d277eacaffd2bb0362" , "MR-MONO2-16-head.dcm" } ,
157157 { "9bd4d79cc59c66b19c21577e12cd6226" , "MR-MONO2-8-16x-heart.dcm" } ,
158158 { "cd623ac04602182dc66adb505c516341" , "MR_Philips-Intera_BreaksNOSHADOW.dcm" } ,
159 { "f295d87a398e0bcd96c5dfa20d96a419" , "MR_Philips_Intera_No_PrivateSequenceImplicitVR.dcm" } ,
160 { "af3c49db53cfb30aa438e7369dba117b" , "MR_Philips_Intera_PrivateSequenceExplicitVR_in_SQ_2001_e05f_item_wrong_lgt_use_NOSHADOWSEQ.dcm" } ,
161 { "d7019c1822870140965fa3345b53886c" , "MR_Philips_Intera_PrivateSequenceImplicitVR.dcm" } ,
162 { "69ccce1a3bb1c481d90a1df109acf3b7" , "MR_Philips_Intera_SwitchIndianess_noLgtSQItem_in_trueLgtSeq.dcm" } ,
159 { "ced145431248f1e00e9bdc23b0c61674" , "MR_Philips_Intera_No_PrivateSequenceImplicitVR.dcm" } ,
160 { "8eab7fcf9c53d06968dde33f6b3a8918" , "MR_Philips_Intera_PrivateSequenceExplicitVR_in_SQ_2001_e05f_item_wrong_lgt_use_NOSHADOWSEQ.dcm" } ,
161 { "3d24233b19788d349f64b7b267723186" , "MR_Philips_Intera_PrivateSequenceImplicitVR.dcm" } ,
162 { "1693399bc1edb7cdc494095a27201eab" , "MR_Philips_Intera_SwitchIndianess_noLgtSQItem_in_trueLgtSeq.dcm" } ,
163163 { "5797c9dfe94e4a4bccfbf81ab0aaa957" , "MR-SIEMENS-DICOM-WithOverlays.dcm" } ,
164164 { "df28467760104edc923d0625a0e2a778" , "MR-SIEMENS-DICOM-WithOverlays-extracted-overlays.dcm" } ,
165165 { "bf324a1c91d3a09d9136f54f5910e570" , "MR_SIEMENS_forceLoad29-1010_29-1020.dcm" } ,
170170 { "7f4cddc9a88f8c5147b89f769eb1cae7" , "OT-PAL-8-face.dcm" } ,
171171 { "5fce2728bd9457d4fc1224a374829e2f" , "PET-cardio-Multiframe-Papyrus.dcm" } ,
172172 { "071b840050588d14fde61646e058e1c6" , "PHILIPS_Brilliance_ExtraBytesInOverlay.dcm" } ,
173 { "244e8beb3151f9a26dd8c0650a4adede" , "PHILIPS_GDCM12xBug2.dcm" } ,
174 { "3d7cc6eaf1c2f065290c50473bc8001a" , "PHILIPS_GDCM12xBug.dcm" } ,
173 { "a7eb66c4f66784ad456d060b7123ea15" , "PHILIPS_GDCM12xBug2.dcm" } ,
174 { "48203ef1f45cb1f7f919de53062db5d0" , "PHILIPS_GDCM12xBug.dcm" } ,
175175 { "c38ad661c6a14f8bd88b304755e7ba7b" , "PHILIPS_Gyroscan-12-Jpeg_Extended_Process_2_4.dcm" } ,
176176 { "e0a690636c608f312ca550908d4b551f" , "PHILIPS_Gyroscan-12-MONO2-Jpeg_Lossless.dcm" } ,
177177 { "03d88060c3bd820b96840599c0099470" , "PHILIPS_Gyroscan-8-MONO2-Odd_Sequence.dcm" } ,
178 { "1caa6b627fa7dc0995efc2a36765055e" , "PHILIPS_Intera-16-MONO2-Uncompress.dcm" } ,
178 { "1f198bdb09f5e52dc3f9ad1dfced8a4d" , "PHILIPS_Intera-16-MONO2-Uncompress.dcm" } ,
179179 { "4f34474ed72e6a5960fc4691e588f8e0" , "PICKER-16-MONO2-Nested_icon.dcm" } ,
180180 { "629da04611e097e2cc532d6fe5e6454d" , "PICKER-16-MONO2-No_DicomV3_Preamble.dcm" } ,
181181 { "3aaca1826b4a4deb9e41ebf2af4fa6b2" , "PrivateGEImplicitVRBigEndianTransferSyntax16Bits.dcm" } ,
205205 { "cbd59e416dd82dc14df251ea6fccb55b" , "test.acr" } ,
206206 { "0c2c475f6d21ae0aeadbf16565dcdbc4" , "TG18-CH-2k-01.dcm" } ,
207207 { "e8cc7ed19eedf9bed9ab60683f3dbfa1" , "THERALYS-12-MONO2-Uncompressed-Even_Length_Tag.dcm" } ,
208 { "463888b21317e5816584541c7243e124" , "TheralysGDCM120Bug.dcm" } ,
208 { "aa708d3b15e451c8367e7909257d9346" , "TheralysGDCM120Bug.dcm" } ,
209209 { "e8819809884c214fe78ee2b227417e5c" , "TOSHIBA_MRT150-16-MONO2-ACR_NEMA_2.dcm" } ,
210 { "9fcf7924fef1b48977b8c4b9a84caa87" , "undefined_length_un_vr.dcm" } ,
210 { "fafc22cde1c9092cb188982ecee8da9b" , "undefined_length_un_vr.dcm" } ,
211211 { "787ca80c8dd1aa619d5f85610862380b" , "US-GE-4AICL142.dcm" } ,
212212 { "f1e9c893391e1d458cffa2a1e0904160" , "US-IRAD-NoPreambleStartWith0003.dcm" } ,
213213 { "d1d9be67c9d066fabc8e1c4ae124f9a0" , "US-IRAD-NoPreambleStartWith0005.dcm" } ,
220220 { "d2cb6962750eb8f92c480e6cc2f4d104" , "GDCMJ2K_TextGBR.dcm" },
221221 { "2e039bbc7520f809963e051ff5144ccf" , "UnexpectedSequenceDelimiterInFixedLengthSequence.dcm" },
222222 { "0a90894370ba84dbe31acd1290ff9999" , "NM_Kakadu44_SOTmarkerincons.dcm" },
223 { "bcadb7b0f72d2ea3d4e910b885f07087" , "PhilipsInteraSeqTermInvLen.dcm" },
223 { "fdd8a53915712a924ac74c26ec4d1051" , "PhilipsInteraSeqTermInvLen.dcm" },
224224 { "2940bd46f097f79012d24f47504c3c8c" , "TOSHIBA_J2K_OpenJPEGv2Regression.dcm" },
225225 { "696917fea41e83b9980bad82b609162c" , "TOSHIBA_J2K_SIZ0_PixRep1.dcm" },
226226 { "7ef3da46c43e51cfe2eb82e4d23dd623" , "TOSHIBA_J2K_SIZ1_PixRep0.dcm" },
230230 { "4be7f56f11ce6090b7139879c4fdc71f" , "SC16BitsAllocated_8BitsStoredJPEG.dcm" },
231231 { "1060ff4eb8731d4b2152db83fed2eedd" , "SC16BitsAllocated_8BitsStoredJ2K.dcm" },
232232 { "7dc0a8ffffc8fb441dbd4129111eaf8b" , "SIEMENS_SYNGO-12-MONO2-LUTWrongLength512.dcm" },
233 { "41d1baead629d878d09d6c1037faf47a" , "JPEGNote_empty.dcm" },
234 { "3cb9917c468226c265ef637aac5f4b61" , "JPEGLS_CharLS_10742.dcm" },
235 { "8381875d83ce321955a064e40d047dde" , "JPEGLosslessYBR_FULL_422.dcm" },
236 { "67f7b36ad6e54889b4a2581baa41afdf" , "JPEGNote_missing.dcm" },
237 { "807bf2aef3bc1885217c8a12d2d2bc19" , "JPEGNote_bogus.dcm" },
238 { "669cc0e807673ebe57124739a1874f35" , "RLEDebianBug816607Orig.dcm" },
239 { "1daa9bb53a8ce090041472f528248686" , "IllegalGroup2ImplicitTS.dcm" },
240
233241
234242 { 0 ,0 }
235243 };
0 GDCM binaries have moved !
1 --------------------------
2
3 They are now automatically uploaded to github:
4
5 [github release](https://github.com/malaterre/GDCM/releases)
6
7 They are build using travis and appveyor automatically
8
9 As a side note the old zip (source) file is not available anymore on sf.net,
10 please see instead on github.
125125 # https://sourceforge.net/project/admin/explorer.php?group_id=137895
126126 # https://sourceforge.net/projects/gdcm/files/gdcm%202.x/#folder-create
127127
128 # Update default version:
129 #https://sourceforge.net/p/forge/documentation/Using%20the%20Release%20API/
130 exit 1
128131 rsync -e ssh GDCM-$version-Linux-x86_64.tar.gz "malat,gdcm@frs.sourceforge.net:/home/frs/project/g/gd/gdcm/gdcm\ 2.x/GDCM\ $version"
129132 check_exit_value $? "rsync did not return properly" || exit 1
130133 rsync -e ssh GDCM-$version-Linux-x86_64.tar.bz2 "malat,gdcm@frs.sourceforge.net:/home/frs/project/g/gd/gdcm/gdcm\ 2.x/GDCM\ $version"
635635
636636 if(GDCM_WRAP_JAVA)
637637 if(VTK_WRAP_JAVA)
638 find_package(Java 1.5 REQUIRED) # javac, jar
638 find_package(Java ${GDCM_DEFAULT_JAVA_VERSION} REQUIRED) # javac, jar
639639 find_package(JNI REQUIRED)
640640 include_directories(${JNI_INCLUDE_DIRS})
641641 set(VTK_WRAP_JAVA3_INIT_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
651651 # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=533193
652652 set(GDCM_VTK_JAVA_JAR ${VTK_JAVA_JAR})
653653 else()
654 # http://bugs.debian.org/834493
654655 find_file(VTK_JAVA_JAR NAMES vtk.jar vtk6.jar vtk5.jar
655 PATHS ${vtkWrappingJava_RUNTIME_LIBRARY_DIRS})
656 PATHS ${vtkWrappingJava_RUNTIME_LIBRARY_DIRS} /usr/share/java)
656657 set(GDCM_VTK_JAVA_JAR ${VTK_JAVA_JAR})
657658 endif()
658659 if(EXISTS /usr/lib/jni/libvtkCommonJava.so)
221221 { "SC16BitsAllocated_8BitsStoredJPEG.dcm","c9f9d07783496fa9a9e5b28a90603a70", "c164a73ba18ab4e88977921ffc7c3a65" },
222222 { "SC16BitsAllocated_8BitsStoredJ2K.dcm","96639bac776d875b02f6aa9b35ee2db7", "dbf83984984741c98205d77a947b442c" },
223223 { "SIEMENS_SYNGO-12-MONO2-LUTWrongLength512.dcm","81f79e2fcb3caec752e55be8077441dc", "4a5d8549791432b29948dd8ff63e2534" },
224 { "IllegalGroup2ImplicitTS.dcm","7c922536b5cf4143ce931ff5f552f588", "f666a95dde9ddfdec0cf9574a7985ae3" },
225 { "JPEGLosslessYBR_FULL_422.dcm","90a95c01f320809e3f6b6c720e78d457", "cdfb5dd0c999d88badeb00a16f96554f" },
226 { "JPEGNote_bogus.dcm","eeb1028e53ef4dcfc6b4100f8525be41", "161e9fd986ea87adf2596e8e16641f11" },
227 { "JPEGNote_empty.dcm","e6add795da6e0ccd4ed02f5689a61260", "464960d948dff0ded72b0380080f18a3" },
228 { "JPEGNote_missing.dcm","dce9f8853a528d423efc95a9bafee938", "464960d948dff0ded72b0380080f18a3" },
229 { "RLEDebianBug816607Orig.dcm","bb7bb73068f494c3cf947d2375af3501", "b85686dd3169b99725149abb00181254" },
224230
225231
226232 /* Stopping condition */
269269 string(REGEX MATCH "^.*systemIdStartString=\"http://docbook.sourceforge.net/release/xsl-ns/\".*" out1 ${line})
270270 string(REGEX REPLACE "^.*systemIdStartString=\"http://docbook.sourceforge.net/release/xsl-ns/\".*\"([A-Za-z ]*)\".*" "\\1" output_variable ${line})
271271 if(out1)
272 message("Your docbook install was found here :${output_variable}")
272 message(STATUS "Your docbook install was found here :${output_variable}")
273273 set(DOCBOOK_REWRITE_PREFIX_FOUND TRUE)
274274 endif()
275275 endforeach()
168168 <para>convert GDCM 1.2.0 broken UN-2-bytes fields, </para>
169169 </listitem>
170170 <listitem>
171 <para>&amp;... </para>
171 <para>... </para>
172172 </listitem>
173173 <listitem>
174174 <para>All other broken files listed in the supported refsection.</para>
100100 </literallayout></para>
101101
102102 <para><literallayout># Dicom-File-Format
103 \&amp;...
103 ...
104104 (0008,0000) ?? (UL) 434 # 4,1 Generic Group Length
105105 (0008,0005) ?? (CS) [ISO_IR 100] # 10,1-n Specific Character Set
106106 (0008,0008) ?? (CS) [ORIGINAL\\PRIMARY\\SINGLE PLANE ] # 30,2-n Image Type
114114 (0008,0031) ?? (TM) [101229.000] # 10,1 Series Time
115115 (0008,0032) ?? (TM) [102653.000] # 10,1 Acquisition Time
116116 (0008,0033) ?? (TM) [102653.000] # 10,1 Content Time
117 \&amp;...
117 ...
118118 </literallayout></para>
119119 </refsection>
120120 <refsection xml:id="gdcmdump_1private_attribute">
125125 <para><literallayout>$ gdcmdump 012345.002.050.dcm
126126 </literallayout></para>
127127
128 <para><literallayout>\&amp;...
128 <para><literallayout>...
129129 (0009,0010) LO [GEMS_IDEN_01] # 12,1 Private Creator
130130 (0009,1001) LO [GE_GENESIS_FF ] # 14,1 Full fidelity
131131 (0009,1002) SH [MRCV] # 4,1 Suite id
137137 (0009,10e6) SH [08] # 2,1 Genesis Version - now
138138 (0009,10e7) UL 2757786872 # 4,1 Exam Record checksum
139139 (0009,10e9) SL 985968523 # 4,1 Actual series data time stamp
140 \&amp;...
140 ...
141141 (0019,0000) UL 1208 # 4,1 Generic Group Length
142142 (0019,0010) LO [GEMS_ACQU_01] # 12,1 Private Creator
143143 (0019,100f) DS [424.399994] # 10,1 Horiz. Frame of ref.
144144 (0019,1011) SS 0 # 2,1 Series contrast
145 \&amp;...
145 ...
146146 (0019,10e0) DS [0.000000] # 8,1 User data 24 {# DTI Diffusion Dir., release 10.0 &amp; above}
147147 (0019,10e2) DS [0.000000] # 8,1 Velocity Encode Scale
148148 (0019,10f2) SS 0 # 2,1 Fast phases
149149 (0019,10f9) DS [98] # 2,1 Transmit gain
150 \&amp;...
150 ...
151151 (0021,0000) UL 372 # 4,1 Generic Group Length
152152 (0021,0010) LO [GEMS_RELA_01] # 12,1 Private Creator
153153 (0021,1003) SS 0 # 2,1 Series from which Prescribed
154 \&amp;...
154 ...
155155 </literallayout></para>
156156 </refsection>
157157 <refsection xml:id="gdcmdump_1siemens_csa">
176176 6 - &apos;B_value&apos; VM 1, VR IS, SyngoDT 6, NoOfItems 6, Data &apos;0 &apos;
177177 7 - &apos;Filter1&apos; VM 1, VR IS, SyngoDT 6, NoOfItems 0, Data
178178 8 - &apos;Filter2&apos; VM 1, VR IS, SyngoDT 6, NoOfItems 0, Data
179 \&amp;...
179 ...
180180 </literallayout></para>
181181 </refsection>
182182 <refsection xml:id="gdcmdump_1gems_pdb">
205205 TRICKSIMG &quot;1&quot;
206206 TAG_SPACE &quot;7&quot;
207207 TAG_TYPE &quot;None&quot;
208 \&amp;...
208 ...
209209 </literallayout></para>
210210 </refsection>
211211 <refsection xml:id="gdcmdump_1elscint_pi">
240240 ACS-learn-allowed [no]
241241 ACS-water-radius [-1.000000]
242242 ACS-water-radius-scan [-1]
243 \&amp;...
243 ...
244244 </literallayout></para>
245245 </refsection>
246246 <refsection xml:id="gdcmdump_1vepro_pi">
301301 <para><literallayout>$ gdcmdump --sds PMS_SeriesDataStorage.dcm
302302 </literallayout></para>
303303
304 <para><literallayout>\&amp;...
304 <para><literallayout>...
305305 PMS/Item name: [PDF_CONTROL_GEN_PARS/IEEE_PDF/Y ]
306 \&amp;...
306 ...
307307 PMS/Item name: [PDF_CONTROL_PREP_PARS /IEEE_PDF/Y ]
308 \&amp;...
308 ...
309309 PMS/Item name: [PDF_CONTROL_RECON_PARS/IEEE_PDF/Y ]
310 \&amp;...
310 ...
311311 PMS/Item name: [PDF_CONTROL_SCAN_PARS /IEEE_PDF/Y ]
312 \&amp;...
312 ...
313313 PMS/Item name: [PDF_EXAM_PARS /IEEE_PDF/Y ]
314 \&amp;...
314 ...
315315 PMS/Item name: [PDF_HARDWARE_PARS /IEEE_PDF/Y ]
316 \&amp;...
316 ...
317317 PMS/Item name: [PDF_PREP_PARS /IEEE_PDF/Y ]
318 \&amp;...
318 ...
319319 PMS/Item name: [PDF_SPT_PARS/IEEE_PDF/Y ]
320320 SP_scan_resol [256\256] # 2
321321 SP_pda_profiles [0\0] # 2
339339 SP_rg_result [0] # 1
340340 SP_dc_result [0] # 1
341341 SP_ph_result [0] # 1
342 \&amp;...
342 ...
343343 </literallayout></para>
344344 </refsection>
345345 <refsection xml:id="gdcmdump_1asn1">
350350 <para><literallayout>$ gdcmdump encrypted.dcm
351351 </literallayout></para>
352352
353 <para><literallayout>\&amp;...
353 <para><literallayout>...
354354 (0400,0500) SQ # u/l,1 Encrypted Attributes Sequence
355355 (fffe,e000) na (Item with undefined length)
356356 (0400,0510) UI [1.2.840.10008.1.2] # 18,1 Encrypted Content Transfer Syntax UID
357357 (0400,0520) OB 30\\82\\03\\ba\\06\\09\\2a\\86\\48\\55\\04\\08\\13 # 958,1 Encrypted Content
358358 (fffe,e00d)
359359 (fffe,e0dd)
360 \&amp;...
360 ...
361361 </literallayout></para>
362362
363363 <para><literallayout>$ gdcmdump --asn1 encrypted.dcm
6363 -C --sop-class-uid SOP Class UID (name or value).
6464 -T --study-uid Study UID.
6565 -S --series-uid Series UID.
66 --template Template DICOM file.
6667 --root-uid Root UID.
6768 </literallayout></para>
6869 </refsection>
220221 <para><literallayout>$ gdcmimg --sop-class-uid 1.2.840.10008.5.1.4.1.1.77.1.4 input.jpg output.dcm
221222 </literallayout></para>
222223 </refsection>
224 <refsection xml:id="gdcmimg_1template">
225 <title>Specifying a template DICOM file</title>
226
227 <para>Instead of the default Secondary Capture Image Storage, generated with default values, one may want to specify a DICOM file that will serve as template to fill in the DICOM attributes.</para>
228
229 <para><literallayout>$ gdcmimg --sign 1 --template template.dcm input.jpg output.dcm
230 </literallayout></para>
231 <para>Pay attention that any values from template.dcm that are not consistent with what is found inside the reference image will be overriden (eg. image size). On particular case should be of concern: the Pixel Representation for the JPEG family.</para>
232
233 </refsection>
223234 </refsection>
224235 <refsection xml:id="gdcmimg_1multiple_files">
225236 <title>Multiple Files</title>
103103 <para><literallayout>$ gdcmdump D_CLUNIE_CT1_J2KR.dcm
104104 </literallayout></para>
105105
106 <para><literallayout>\&amp;...
106 <para><literallayout>...
107107 (7fe0,0010) OB # u/l,1 Pixel Data
108108 (fffe,e000) ?? [] # 0,1 Item
109109 (fffe,e000) ?? ff\\4f\\ff\\51\\00\\29\\00\\00\\00\\00\\02\\00\\00\\00\\02\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\02\\00\\00\\00\\02\\00 # 65536,1 Item
168168 <para><literallayout>$ gdcmdump 00191113.dcm
169169 </literallayout></para>
170170
171 <para><literallayout>\&amp;...
171 <para><literallayout>...
172172 (7fe0,0010) OB # u/l,1 Pixel Data
173173 (fffe,e000) ?? 00\\00\\00\\00\\6b\\38\\01\\00\\10\\77\\02\\00\\37\\b6\\03\\00\\a7\\f4\\04\\00 # 20,1 Item
174174 (fffe,e000) ?? ff\\d8\\ff\\c3\\00\\0b\\08\\02\\00\\02\\00\\01\\00\\11\\00\\ff\\c4\\00\\1b\\00\\01\\01\\01\\01\\01\\01\\01\\01\\00\\00\\00\\00 # 79970,1 Item
8686 TransferSyntax is 1.2.840.10008.1.2.1 [Explicit VR Little Endian]
8787 NumberOfDimensions: 2
8888 Dimensions: (384,384,1)
89 \&amp;...
89 ...
9090 </literallayout></para>
9191
9292 <para><literallayout>$ gdcmtar --mosaic -i MR-sonata-3D-as-Tile.dcm -o mosaic --pattern %03d.dcm
134134 TransferSyntax is 1.2.840.10008.1.2.1 [Explicit VR Little Endian]
135135 NumberOfDimensions: 2
136136 Dimensions: (64,64,1)
137 \&amp;...
137 ...
138138 </literallayout></para>
139139 </refsection>
140140 </refsection>
53525352 // File: classgdcm_1_1ImageRegionReader.xml
53535353 %feature("docstring") gdcm::ImageRegionReader "
53545354
5355 ImageRegionReader.
5355 ImageRegionReader This class is able to read a region from a DICOM
5356 file containing an image. This implementation requires that the
5357 information stored in the DICOM header are consistent with what is in
5358 the encapsulated Pixel Data. This is technically not required by DICOM
5359 standard, which makes this implementation illegal with regards to the
5360 famous JPEG
5361 note:http://dicom.nema.org/medical/dicom/current/output/chtml/part05/sect_8.2.html
5362 #para_4bcb841e-c6bf-4e26-82a5-3fad3c942da0.
53565363
53575364 See: ImageReader
53585365
56965703 http://gdcm.sourceforge.net/wiki/index.php/Imager_Pixel_Spacing
56975704
56985705 Bug There are currently a couple of bugs in this implementation:
5706
56995707 Gantry Tilt is not considered (always an error)
57005708
57015709 Application programmer should only sort valid DataSet (eg.
87128720 gdcm::PythonFilter::ToPyObject(const Tag &t) const ";
87138721
87148722 %feature("docstring") gdcm::PythonFilter::UseDictAlways "void
8715 gdcm::PythonFilter::UseDictAlways(bool use) ";
8723 gdcm::PythonFilter::UseDictAlways(bool) ";
87168724
87178725
87188726 // File: classgdcm_1_1QueryBase.xml
1504415052 // File: bug.xml
1504515053
1504615054
15047 // File: dir_48be02fb937e08881437e02515417ab2.xml
15048
15049
15050 // File: dir_dbdfee04788ce02e68d05e06d5e6d98f.xml
15051
15052
15053 // File: dir_422e8974cbd0b7203ed9c70ede735192.xml
15054
15055
15056 // File: dir_fc2dbd93ff698b14d78f486017ee822b.xml
15057
15058
15059 // File: dir_63e84970519399936bea68aa0151439e.xml
15060
15061
15062 // File: dir_a3a231e2bd7f702d85036607d7d87964.xml
15063
15064
15065 // File: dir_bfc3201f3b82d7ccf14c524caa3c389b.xml
15066
15067
15068 // File: dir_9a6580727919559370fc2250dcaca6b8.xml
15069
15070
15071 // File: dir_087222ad62d2f517f4e0198672951648.xml
15072
15073
15074 // File: dir_2a74275ceded0a5f3b0fb2e9bd792825.xml
15075
15076
15077 // File: dir_acafdc7d686494cf0735517ddc7a7669.xml
15078
15079
15080 // File: dir_d2ab22b73e3ee89be3a207288d7a9056.xml
15055 // File: dir_041d54874d9fecec94d9cb4ae010b51e.xml
15056
15057
15058 // File: dir_8021392154ea27d3da33100afd5b42a1.xml
15059
15060
15061 // File: dir_83a82e6a2bc4a0f6429532cb237ca746.xml
15062
15063
15064 // File: dir_9760e222fce508c3b7270d68e6523d76.xml
15065
15066
15067 // File: dir_90174c188c639015dd869d1a853f914f.xml
15068
15069
15070 // File: dir_aceed280bd27dc60f64c2cb4efae4f90.xml
15071
15072
15073 // File: dir_5aab2906425e8d9a7aa9fea4f8d0a2fa.xml
15074
15075
15076 // File: dir_5daaa9a41ac240f7de3019ff61b11839.xml
15077
15078
15079 // File: dir_b138abe427a068e1da5116454e79caa4.xml
15080
15081
15082 // File: dir_6b1a62c3f439db8dff4e3363f340e91f.xml
15083
15084
15085 // File: dir_776c231028699256e0cc13f46def7474.xml
15086
15087
15088 // File: dir_6285418b2babf39982c6f35dbd05cbb5.xml
1508115089
1508215090
1508315091 // File: AWTMedical3_8java-example.xml