Skip to content
Commits on Source (21)
......@@ -141,7 +141,7 @@ static void PrintHelp()
std::cout << " --remove-retired Remove retired tags." << std::endl;
std::cout << "Image only Options:" << std::endl;
std::cout << " -l --apply-lut Apply LUT (non-standard, advanced user only)." << std::endl;
std::cout << " --decompress-lut Decompress LUT (linearied segmented LUT)." << std::endl;
std::cout << " --decompress-lut Decompress LUT (linearize segmented LUT)." << std::endl;
std::cout << " -P --photometric-interpretation %s Change Photometric Interpretation (when possible)." << std::endl;
std::cout << " -w --raw Decompress image." << std::endl;
std::cout << " -d --deflated Compress using deflated (gzip)." << std::endl;
......@@ -168,7 +168,7 @@ static void PrintHelp()
std::cout << "JPEG Options:" << std::endl;
std::cout << " -q --quality %*f set quality." << std::endl;
std::cout << "JPEG-LS Options:" << std::endl;
std::cout << " -e --lossy-error %*i set error." << std::endl;
std::cout << " -e --allowed-error %*i set allowed error." << std::endl;
std::cout << "J2K Options:" << std::endl;
std::cout << " -r --rate %*f set rate." << std::endl;
std::cout << " -q --quality %*f set quality." << std::endl;
......
......@@ -948,7 +948,7 @@ int main (int argc, char *argv[])
gdcm::PhotometricInterpretation pi = refpi;
if( spp )
{
if( pixelspp == 3 ) pi = gdcm::PhotometricInterpretation::RGB;
if( pixelspp == 3 && !pinter ) pi = gdcm::PhotometricInterpretation::RGB;
}
rle.SetPhotometricInterpretation( pi );
......
......@@ -32,6 +32,7 @@
#include "gdcmDirectory.h"
#include "gdcmImageHelper.h"
#include "gdcmSplitMosaicFilter.h"
#include "gdcmImageChangePlanarConfiguration.h"
#ifdef GDCM_USE_SYSTEM_POPPLER
#include <poppler/poppler-config.h>
......@@ -429,6 +430,17 @@ static int ProcessOneFile( std::string const & filename, gdcm::Defs const & defs
if( md5sum )
{
char *buffer = new char[ pimage->GetBufferLength() ];
gdcm::ImageChangePlanarConfiguration icpc;
icpc.SetPlanarConfiguration( 0 );
icpc.SetInput( *pimage );
bool b = icpc.Change();
if( !b )
{
std::cerr << "Could not change the Planar Configuration: " << filename << std::endl;
return 1;
}
pimage = &icpc.GetOutput();
if( pimage->GetBuffer( buffer ) )
{
char digest[33] = {};
......
......@@ -40,7 +40,7 @@ set(GDCM_PACKAGE_CONTACT "GDCM Developers <gdcm-developers@lists.sourceforge.net
#----------------------------------------------------------------------------
set(GDCM_MAJOR_VERSION 2)
set(GDCM_MINOR_VERSION 8)
set(GDCM_BUILD_VERSION 4)
set(GDCM_BUILD_VERSION 6)
set(GDCM_VERSION
"${GDCM_MAJOR_VERSION}.${GDCM_MINOR_VERSION}.${GDCM_BUILD_VERSION}")
# let advanced user the option to define GDCM_API_VERSION:
......@@ -634,7 +634,7 @@ CHECK_INCLUDE_FILE("pthread.h" GDCM_HAVE_PTHREAD_H)
# Big endian thing:
if(GDCM_STANDALONE)
include(${CMAKE_ROOT}/Modules/TestBigEndian.cmake)
include(TestBigEndian)
TEST_BIG_ENDIAN(GDCM_WORDS_BIGENDIAN)
endif()
......
......@@ -142,13 +142,13 @@ static std::string base64_decode(std::string const& encoded_string)
size_t Base64::GetEncodeLength(const char *src, size_t slen )
{
std::string ret = base64_encode((unsigned char*)src, slen);
std::string ret = base64_encode((const unsigned char*)src, slen);
return ret.size();
}
size_t Base64::Encode( char *dst, size_t dlen, const char *src, size_t slen )
{
const std::string & ret = base64_encode((unsigned char*)src, slen);
const std::string & ret = base64_encode((const unsigned char*)src, slen);
if( ret.size() > dlen )
return 0;
memcpy( dst, ret.c_str(), ret.size() );
......
......@@ -21,7 +21,7 @@ bool Unpacker12Bits::Unpack(char *out, const char *in, size_t n)
if( n % 3 ) return false; // 3bytes are actually 2 words
// http://groups.google.com/group/comp.lang.c/msg/572bc9b085c717f3
short *q = (short*)out;
const unsigned char *p = (unsigned char*)in;
const unsigned char *p = (const unsigned char*)in;
const unsigned char *end = p+n;
unsigned char b0,b1,b2;
......@@ -40,8 +40,8 @@ bool Unpacker12Bits::Pack(char *out, const char *in, size_t n)
{
if( n % 4 ) return false; // we need an even number of 'words' so that 2 words are split in 3 bytes
unsigned char *q = (unsigned char*)out;
const unsigned short *p = (unsigned short*)in;
const unsigned short *end = (unsigned short*)(in+n);
const unsigned short *p = (const unsigned short*)in;
const unsigned short *end = (const unsigned short*)(in+n);
unsigned short b0,b1;
while(p!=end)
......
......@@ -4337,30 +4337,91 @@ static const DICT_ENTRY DICOMV3DataDict [] = {
{0x0041,0x0040,"INTEGRIS 1.0",VR::DS,VM::VM1,"Total Dose",false },
{0x0041,0x0041,"INTEGRIS 1.0",VR::US,VM::VM1,"Total Number of Frames",false },
{0x0041,0x0050,"INTEGRIS 1.0",VR::SQ,VM::VM1,"Exposure Information Sequence",false },
{0x0029,0x0010,"INTELERAD MEDICAL SYSTEMS",VR::CS,VM::VM1,"?",false },
{0x0029,0x0011,"INTELERAD MEDICAL SYSTEMS",VR::US,VM::VM1,"?",false },
{0x0029,0x0012,"INTELERAD MEDICAL SYSTEMS",VR::US,VM::VM1,"?",false },
{0x0029,0x0013,"INTELERAD MEDICAL SYSTEMS",VR::US,VM::VM1,"?",false },
{0x0029,0x0015,"INTELERAD MEDICAL SYSTEMS",VR::DS,VM::VM1,"?",false },
{0x0029,0x0016,"INTELERAD MEDICAL SYSTEMS",VR::US,VM::VM1,"?",false },
{0x0029,0x0017,"INTELERAD MEDICAL SYSTEMS",VR::US,VM::VM1,"?",false },
{0x0029,0x0020,"INTELERAD MEDICAL SYSTEMS",VR::LO,VM::VM1,"MD5Sum",false },
{0x0029,0x0021,"INTELERAD MEDICAL SYSTEMS",VR::US,VM::VM6,"?",false },
{0x0029,0x0022,"INTELERAD MEDICAL SYSTEMS",VR::US,VM::VM24,"?",false },
{0x3f01,0x0001,"INTELERAD MEDICAL SYSTEMS",VR::LO,VM::VM1,"Institution Code",false },
{0x3f01,0x0002,"INTELERAD MEDICAL SYSTEMS",VR::LO,VM::VM1,"Routed Transfer AE",false },
{0x3f01,0x0003,"INTELERAD MEDICAL SYSTEMS",VR::AE,VM::VM1,"Source AE",false },
{0x3f01,0x0004,"INTELERAD MEDICAL SYSTEMS",VR::LO,VM::VM1,"Deferred Validation",false },
{0x3f01,0x0005,"INTELERAD MEDICAL SYSTEMS",VR::AE,VM::VM1,"Series Owner",false },
{0x3f01,0x0007,"INTELERAD MEDICAL SYSTEMS",VR::LO,VM::VM1,"?",false },
{0x3f01,0x0009,"INTELERAD MEDICAL SYSTEMS",VR::LO,VM::VM1,"?",false },
{0x3f01,0x000a,"INTELERAD MEDICAL SYSTEMS",VR::DA,VM::VM1,"?",false },
{0x3f01,0x000b,"INTELERAD MEDICAL SYSTEMS",VR::TM,VM::VM1,"?",false },
// {0x3f01,0x0010,"INTELERAD MEDICAL SYSTEMS",VR::TM,VM::VM1,"?",false },
{0x3f03,0x0001,"INTELERAD MEDICAL SYSTEMS",VR::SQ,VM::VM1,"Rescale Slope Sequence",false },
{0x3f03,0x0002,"INTELERAD MEDICAL SYSTEMS",VR::DT,VM::VM1,"?",false },
{0x3f03,0x0003,"INTELERAD MEDICAL SYSTEMS",VR::LO,VM::VM1,"?",false },
{0x3f03,0x0004,"INTELERAD MEDICAL SYSTEMS",VR::LO,VM::VM1,"?",false },
{0x0029,0x0001,"INTELERAD MEDICAL SYSTEMS",VR::FD,VM::VM1,"Image Compression Fraction",false },
{0x0029,0x0002,"INTELERAD MEDICAL SYSTEMS",VR::FD,VM::VM1,"Image Quality",false },
{0x0029,0x0003,"INTELERAD MEDICAL SYSTEMS",VR::FD,VM::VM1,"Image Bytes Transferred",false },
{0x0029,0x0008,"INTELERAD MEDICAL SYSTEMS",VR::SL,VM::VM4,"Image Bounding Box",false },
{0x0029,0x0009,"INTELERAD MEDICAL SYSTEMS",VR::LO,VM::VM1,"Image Bounding Box Algorithm ID",false },
{0x0029,0x0010,"INTELERAD MEDICAL SYSTEMS",VR::SH,VM::VM1,"J2C Parameter Type",false },
{0x0029,0x0011,"INTELERAD MEDICAL SYSTEMS",VR::CS,VM::VM1,"J2C Pixel Representation",false },
{0x0029,0x0012,"INTELERAD MEDICAL SYSTEMS",VR::US,VM::VM1,"J2C Bits Allocated",false },
{0x0029,0x0013,"INTELERAD MEDICAL SYSTEMS",VR::US,VM::VM1,"J2C Pixel Shift Value",false },
{0x0029,0x0014,"INTELERAD MEDICAL SYSTEMS",VR::US,VM::VM1,"J2C Planar Configuration",false },
{0x0029,0x0015,"INTELERAD MEDICAL SYSTEMS",VR::DS,VM::VM1,"J2C Rescale Intercept",false },
{0x0029,0x0016,"INTELERAD MEDICAL SYSTEMS",VR::US,VM::VM1,"J2c Smallest Pixel Value",false },
{0x0029,0x0017,"INTELERAD MEDICAL SYSTEMS",VR::US,VM::VM1,"J2c Largest Pixel Value",false },
{0x0029,0x0020,"INTELERAD MEDICAL SYSTEMS",VR::LO,VM::VM1,"Pixel Data MD5 Sum Values",false },
{0x0029,0x0021,"INTELERAD MEDICAL SYSTEMS",VR::US,VM::VM1_n,"Pixel Data Histogram Percentiles",false },
{0x0029,0x0022,"INTELERAD MEDICAL SYSTEMS",VR::FD,VM::VM1_n,"Pixel Data Histogram Percentile Values",false },
{0x0029,0x0023,"INTELERAD MEDICAL SYSTEMS",VR::FD,VM::VM1,"VOI LUT Window Level Values",false },
{0x0029,0x0024,"INTELERAD MEDICAL SYSTEMS",VR::FD,VM::VM1,"VOI LUT Real Pixel Value Range",false },
{0x0029,0x0025,"INTELERAD MEDICAL SYSTEMS",VR::IS,VM::VM1,"VOI LUT Index",false },
{0x0029,0x0026,"INTELERAD MEDICAL SYSTEMS",VR::DS,VM::VM1,"J2C Rescale Slope",false },
{0x0029,0x0027,"INTELERAD MEDICAL SYSTEMS",VR::FD,VM::VM1,"Image Rotation Angle",true},
{0x0029,0x0028,"INTELERAD MEDICAL SYSTEMS",VR::FD,VM::VM1,"Displayed Area Top Left-Hand Corner",true},
{0x0029,0x0029,"INTELERAD MEDICAL SYSTEMS",VR::FD,VM::VM1,"Displayed Area Bottom Right-Hand Corner",true},
{0x3f01,0x0001,"INTELERAD MEDICAL SYSTEMS",VR::LO,VM::VM1,"Institution",false },
{0x3f01,0x0002,"INTELERAD MEDICAL SYSTEMS",VR::SH,VM::VM1,"AE Title Destination",false },
{0x3f01,0x0003,"INTELERAD MEDICAL SYSTEMS",VR::LO,VM::VM1,"Source AE Title",false },
{0x3f01,0x0004,"INTELERAD MEDICAL SYSTEMS",VR::SH,VM::VM1,"Deferred Validation",false },
{0x3f01,0x0005,"INTELERAD MEDICAL SYSTEMS",VR::LO,VM::VM1,"Series Owner",false },
{0x3f01,0x0006,"INTELERAD MEDICAL SYSTEMS",VR::LO,VM::VM1,"Group Number",false },
{0x3f01,0x0007,"INTELERAD MEDICAL SYSTEMS",VR::SH,VM::VM1,"Stripped Pixel Data",false },
{0x3f01,0x0008,"INTELERAD MEDICAL SYSTEMS",VR::SH,VM::VM1,"Pending Move Request",false },
{0x3f01,0x0009,"INTELERAD MEDICAL SYSTEMS",VR::LO,VM::VM1,"Dicom Premap Sites",false },
{0x3f01,0x000a,"INTELERAD MEDICAL SYSTEMS",VR::DA,VM::VM1,"Association Date",false },
{0x3f01,0x000b,"INTELERAD MEDICAL SYSTEMS",VR::TM,VM::VM1,"Association Time",false },
{0x3f01,0x000c,"INTELERAD MEDICAL SYSTEMS",VR::SH,VM::VM1,"Use Source AE",false },
{0x3f01,0x000e,"INTELERAD MEDICAL SYSTEMS",VR::SH,VM::VM1,"Relay to AE",false },
{0x3f01,0x000f,"INTELERAD MEDICAL SYSTEMS",VR::SH,VM::VM1,"ImsMoveRequestRedirectionCount",false },
{0x3f01,0x0010,"INTELERAD MEDICAL SYSTEMS",VR::LO,VM::VM1,"ImsPostFix to AccessionNumber",false },
{0x3f01,0x0011,"INTELERAD MEDICAL SYSTEMS",VR::US,VM::VM1,"Count of tags present when CTN wrote the file",false },
{0x3f01,0x0012,"INTELERAD MEDICAL SYSTEMS",VR::UL,VM::VM1,"Association Epoch In Seconds",false },
{0x3f03,0x0001,"INTELERAD MEDICAL SYSTEMS",VR::SQ,VM::VM1,"Attribute History",false },
{0x3f03,0x0002,"INTELERAD MEDICAL SYSTEMS",VR::DT,VM::VM1,"Change Timestamp",false },
{0x3f03,0x0003,"INTELERAD MEDICAL SYSTEMS",VR::LO,VM::VM1,"Change initiator",false },
{0x3f03,0x0004,"INTELERAD MEDICAL SYSTEMS",VR::ST,VM::VM1,"Change explanation",false },
{0x6001,0x0001,"INTELERAD MEDICAL SYSTEMS",VR::US,VM::VM1,"Overlay bit position",false },
{0x0071,0x0001,"INTELERAD MEDICAL SYSTEMS INTELEVIEWER",VR::LO,VM::VM1,"InteleViewer Markup Type",false },
{0x0071,0x0002,"INTELERAD MEDICAL SYSTEMS INTELEVIEWER",VR::ST,VM::VM1,"InteleViewer Markup Text",false },
{0x0071,0x0003,"INTELERAD MEDICAL SYSTEMS INTELEVIEWER",VR::FD,VM::VM1,"InteleViewer Markup Text Offset",false },
{0x0071,0x0004,"INTELERAD MEDICAL SYSTEMS INTELEVIEWER",VR::FD,VM::VM1,"InteleViewer Markup Position",false },
{0x0071,0x0005,"INTELERAD MEDICAL SYSTEMS INTELEVIEWER",VR::FD,VM::VM1,"InteleViewer Markup Half-Vector",false },
{0x0071,0x0006,"INTELERAD MEDICAL SYSTEMS INTELEVIEWER",VR::FD,VM::VM1,"InteleViewer Markup Vector 1",false },
{0x0071,0x0007,"INTELERAD MEDICAL SYSTEMS INTELEVIEWER",VR::FD,VM::VM1,"InteleViewer Markup Vector 2",false },
{0x0071,0x0008,"INTELERAD MEDICAL SYSTEMS INTELEVIEWER",VR::FD,VM::VM1,"InteleViewer Markup Orthogonal Position",false },
{0x0071,0x0009,"INTELERAD MEDICAL SYSTEMS INTELEVIEWER",VR::FD,VM::VM1,"InteleViewer Markup Orthogonal Half-Vector",false },
{0x0071,0x000a,"INTELERAD MEDICAL SYSTEMS INTELEVIEWER",VR::FD,VM::VM1,"InteleViewer Markup Minimum Length",false },
{0x0071,0x000b,"INTELERAD MEDICAL SYSTEMS INTELEVIEWER",VR::SL,VM::VM1,"InteleViewer Markup Number of Polygons",false },
{0x0071,0x000c,"INTELERAD MEDICAL SYSTEMS INTELEVIEWER",VR::SL,VM::VM1,"InteleViewer Markup Length of Polygons",false },
{0x0071,0x000d,"INTELERAD MEDICAL SYSTEMS INTELEVIEWER",VR::FD,VM::VM1,"InteleViewer Markup Points",false },
{0x0071,0x000e,"INTELERAD MEDICAL SYSTEMS INTELEVIEWER",VR::FD,VM::VM1,"InteleViewer Markup Slice Separation",false },
{0x0071,0x000f,"INTELERAD MEDICAL SYSTEMS INTELEVIEWER",VR::US,VM::VM1,"InteleViewer Markup VOI Index",false },
{0x0071,0x0010,"INTELERAD MEDICAL SYSTEMS INTELEVIEWER",VR::FD,VM::VM1,"InteleViewer Markup Sagittal Text Offset",false },
{0x0071,0x0011,"INTELERAD MEDICAL SYSTEMS INTELEVIEWER",VR::FD,VM::VM1,"InteleViewer Markup Default Text Offset",false },
{0x0071,0x0020,"INTELERAD MEDICAL SYSTEMS INTELEVIEWER",VR::LO,VM::VM1,"InteleViewer Markup Dataset Tool ID",false },
{0x0071,0x0021,"INTELERAD MEDICAL SYSTEMS INTELEVIEWER",VR::FD,VM::VM1,"InteleViewer Markup Distance Calibration",false },
{0x0071,0x0030,"INTELERAD MEDICAL SYSTEMS INTELEVIEWER",VR::FD,VM::VM1,"InteleViewer Markup Image Grid Origin",false },
{0x0071,0x0031,"INTELERAD MEDICAL SYSTEMS INTELEVIEWER",VR::FD,VM::VM1,"InteleViewer Markup Image Grid Pixel Row Vector",false },
{0x0071,0x0032,"INTELERAD MEDICAL SYSTEMS INTELEVIEWER",VR::FD,VM::VM1,"InteleViewer Markup Image Grid Pixel Column Vector",false },
{0x0071,0x0033,"INTELERAD MEDICAL SYSTEMS INTELEVIEWER",VR::CS,VM::VM1,"InteleViewer Markup Image Grid Is Calibrated",false },
{0x0071,0x0034,"INTELERAD MEDICAL SYSTEMS INTELEVIEWER",VR::FD,VM::VM1,"Image Rotation Angle",false },
{0x0071,0x0035,"INTELERAD MEDICAL SYSTEMS INTELEVIEWER",VR::FD,VM::VM1,"Displayed Area Top Left-Hand Corner",false },
{0x0071,0x0036,"INTELERAD MEDICAL SYSTEMS INTELEVIEWER",VR::FD,VM::VM1,"Displayed Area Bottom Right-Hand Corner",false },
{0x3f05,0x0001,"INTELERAD MEDICAL SYSTEMS INTELEVIEWER",VR::LO,VM::VM1,"InteleViewer Source Name",false },
{0x3f05,0x0002,"INTELERAD MEDICAL SYSTEMS INTELEVIEWER",VR::LO,VM::VM1,"Preview Image Id",false },
{0x3f0f,0x0001,"INTELERAD MEDICAL SYSTEMS INTELEVIEWER",VR::US,VM::VM1,"InteleViewer Advanced Visualization Presentation Bin Size",false },
{0x3f0f,0x0002,"INTELERAD MEDICAL SYSTEMS INTELEVIEWER",VR::SQ,VM::VM1,"InteleViewer Advanced Visualization Presentation Bin",false },
{0x3f0f,0x0003,"INTELERAD MEDICAL SYSTEMS INTELEVIEWER",VR::LO,VM::VM1,"InteleViewer Advanced Visualization RenderType",false },
{0x3f0f,0x0004,"INTELERAD MEDICAL SYSTEMS INTELEVIEWER",VR::FD,VM::VM1,"InteleViewer Advanced Visualization Row Vector",false },
{0x3f0f,0x0005,"INTELERAD MEDICAL SYSTEMS INTELEVIEWER",VR::FD,VM::VM1,"InteleViewer Advanced Visualization Column Vector",false },
{0x3f0f,0x0006,"INTELERAD MEDICAL SYSTEMS INTELEVIEWER",VR::FD,VM::VM1,"InteleViewer Advanced Visualization Slab Thickness",false },
{0x3f0f,0x0007,"INTELERAD MEDICAL SYSTEMS INTELEVIEWER",VR::LO,VM::VM1,"InteleViewer Advanced Visualization Original Dataset Series UID",false },
{0x3f0f,0x0008,"INTELERAD MEDICAL SYSTEMS INTELEVIEWER",VR::LO,VM::VM1,"InteleViewer Advanced Visualization Transfer Function Type",false },
{0x3f0f,0x0009,"INTELERAD MEDICAL SYSTEMS INTELEVIEWER",VR::LO,VM::VM1,"InteleViewer Advanced Visualization Source Dataset Sub Volume First SOP UID",false },
{0x3f0f,0x0010,"INTELERAD MEDICAL SYSTEMS INTELEVIEWER",VR::LO,VM::VM1,"InteleViewer Advanced Visualization Source Dataset Sub Volume Last SOP UID",false },
{0x3f0f,0x0011,"INTELERAD MEDICAL SYSTEMS INTELEVIEWER",VR::LO,VM::VM1,"InteleViewer Advanced Visualization Sub volume creation algorithm",false },
{0x3f0f,0x0012,"INTELERAD MEDICAL SYSTEMS INTELEVIEWER",VR::US,VM::VM1,"InteleViewer Advanced Visualization Number of images in Sub volume",false },
{0x0065,0x0011,"ISG Image",VR::UL,VM::VM1,"Length in Byte of Image",false },
{0x0029,0x0070,"ISG shadow",VR::IS,VM::VM1,"?",false },
{0x0029,0x0080,"ISG shadow",VR::IS,VM::VM1,"?",false },
......@@ -5306,7 +5367,8 @@ static const DICT_ENTRY DICOMV3DataDict [] = {
{0x2001,0x00cc,"Philips Imaging DD 001",VR::ST,VM::VM1,"?SeriesDerivationDescription",false },
{0x2001,0x00da,"Philips Imaging DD 001",VR::CS,VM::VM1,"?",false },
{0x2001,0x00f1,"Philips Imaging DD 001",VR::FL,VM::VM1_n,"Prospective Motion Correction",false },
{0x2001,0x00f2,"Philips Imaging DD 001",VR::FL,VM::VM1,"Retrospective Motion Correction",false },
{0x2001,0x00f2,"Philips Imaging DD 001",VR::FL,VM::VM1_n,"Retrospective Motion Correction",false },
{0x2001,0x00f3,"Philips Imaging DD 001",VR::CS,VM::VM1,"Unknown Tag & Data",false },
{0x2005,0x0014,"Philips Imaging DD 001",VR::CS,VM::VM1,"Diffusion",false },
{0x2005,0x0020,"Philips Imaging DD 001",VR::SL,VM::VM1,"Number of Chemical Shifts",false },
{0x2005,0x0030,"Philips Imaging DD 001",VR::FL,VM::VM1_n,"Repetition Time",false },
......@@ -5772,6 +5834,7 @@ static const DICT_ENTRY DICOMV3DataDict [] = {
{0x2005,0x0081,"Philips MR Imaging DD 004",VR::IS,VM::VM1,"MRScanoGramSurveyNumberOfImages", false },
{0x2005,0x0082,"Philips MR Imaging DD 004",VR::UL,VM::VM1,"MRNumberOfProcedureCodes", false },
{0x2005,0x0083,"Philips MR Imaging DD 004",VR::CS,VM::VM1_n,"?SortAttributes",false },
{0x2005,0x0084,"Philips MR Imaging DD 004",VR::SS,VM::VM1,"?MRNrSortAttributes",false },
{0x2005,0x0085,"Philips MR Imaging DD 004",VR::CS,VM::VM1,"?ImageDisplayDirection",false },
{0x2005,0x0086,"Philips MR Imaging DD 004",VR::CS,VM::VM1,"?InsetScanogram",false },
{0x2005,0x0087,"Philips MR Imaging DD 004",VR::SS,VM::VM1,"?MRDisplayLayoutNrColumns",false },
......@@ -5872,17 +5935,17 @@ static const DICT_ENTRY DICOMV3DataDict [] = {
{0x2005,0x0058,"Philips MR Imaging DD 006",VR::FL,VM::VM1,"MREMEG Amplitude",false },
{0x2005,0x0059,"Philips MR Imaging DD 006",VR::FL,VM::VM1,"MRE Number of Phase Delays",false },
{0x2005,0x0060,"Philips MR Imaging DD 006",VR::IS,VM::VM1,"MRE Number of Motion Cycles",false },
{0x2005,0x0061,"Philips MR Imaging DD 006",VR::UN,VM::VM1,"MRE Motion Meg Phase Delay",false },
{0x2005,0x0061,"Philips MR Imaging DD 006",VR::FL,VM::VM1,"MRE Motion Meg Phase Delay",false },
{0x2005,0x0062,"Philips MR Imaging DD 006",VR::LT,VM::VM1,"MRE Inversion Algorithm Version",false },
{0x2005,0x0063,"Philips MR Imaging DD 006",VR::CS,VM::VM1,"Sagittal Slice Order",false },
{0x2005,0x0064,"Philips MR Imaging DD 006",VR::CS,VM::VM1,"Coronal Slice Order",false },
{0x2005,0x0065,"Philips MR Imaging DD 006",VR::CS,VM::VM1,"Transversal Slice Order",false },
{0x2005,0x0066,"Philips MR Imaging DD 006",VR::CS,VM::VM1,"Series Orientation ",false },
{0x2005,0x0067,"Philips MR Imaging DD 006",VR::IS,VM::VM1,"MR Stack Reverse ",false },
{0x2005,0x0068,"Philips MR Imaging DD 006",VR::UN,VM::VM1,"MRE Phase Delay Number",false },
{0x2005,0x0068,"Philips MR Imaging DD 006",VR::IS,VM::VM1,"MRE Phase Delay Number",false },
{0x2005,0x0071,"Philips MR Imaging DD 006",VR::IS,VM::VM1,"Number Of Inversion Delays",false },
{0x2005,0x0072,"Philips MR Imaging DD 006",VR::UN,VM::VM1,"Inversion Delay Time",false },
{0x2005,0x0073,"Philips MR Imaging DD 006",VR::UN,VM::VM1,"Inversion Delay Number",false },
{0x2005,0x0072,"Philips MR Imaging DD 006",VR::FL,VM::VM1,"Inversion Delay Time",false },
{0x2005,0x0073,"Philips MR Imaging DD 006",VR::IS,VM::VM1,"Inversion Delay Number",false },
{0x2005,0x0074,"Philips MR Imaging DD 006",VR::DS,VM::VM1,"Max DB DT",false },
{0x2005,0x0075,"Philips MR Imaging DD 006",VR::DS,VM::VM1,"Max SAR",false },
{0x2005,0x0076,"Philips MR Imaging DD 006",VR::LT,VM::VM1,"SAR Type",false },
......
......@@ -365,6 +365,10 @@ DICOM_Conformance_Statement_MR_R2.6.pdf
{"1.2.840.10008.5.1.4.1.1.130", "Enhanced PET Image Storage" },
{"1.2.840.10008.5.1.4.1.1.14.1","Intravascular Optical Coherence Tomography Image Storage - For Presentation"},
{"1.2.840.10008.5.1.4.1.1.14.2","Intravascular Optical Coherence Tomography Image Storage - For Processing"},
{"1.2.840.10008.5.1.4.1.1.2.2", "Legacy Converted Enhanced CT Image Storage" },
{"1.2.840.10008.5.1.4.1.1.4.4", "Legacy Converted Enhanced MR Image Storage" },
{"1.2.840.10008.5.1.4.1.1.128.1", "Legacy Converted Enhanced PET Image Storage" },
{ 0, 0 }
};
......
......@@ -582,7 +582,7 @@ public:
assert( bv ); // That would be bad...
if( (VR::VRType)(VRToEncoding<TVR>::Mode) == VR::VRBINARY )
{
const Type* array = (Type*)bv->GetPointer();
const Type* array = (const Type*)bv->GetPointer();
if( array ) {
assert( array ); // That would be bad...
assert( Internal == 0 );
......@@ -687,7 +687,7 @@ protected:
assert( bv ); // That would be bad...
if( (VR::VRType)(VRToEncoding<TVR>::Mode) == VR::VRBINARY )
{
const Type* array = (Type*)bv->GetPointer();
const Type* array = (const Type*)bv->GetPointer();
if( array ) {
assert( array ); // That would be bad...
assert( Internal == 0 );
......
......@@ -140,6 +140,9 @@ static const char *MSStrings[] = {
"1.2.840.10008.5.1.4.1.1.13.1.2", // XRay3DCraniofacialImageStorage
"1.2.840.10008.5.1.4.1.1.14.1", // IVOCTForPresentation,
"1.2.840.10008.5.1.4.1.1.14.2", // IVCOTForProcessing,
"1.2.840.10008.5.1.4.1.1.2.2", // Legacy Converted Enhanced CT Image Storage
"1.2.840.10008.5.1.4.1.1.4.4", // Legacy Converted Enhanced MR Image Storage
"1.2.840.10008.5.1.4.1.1.128.1", // Legacy Converted Enhanced PET Image Storage
0
};
......@@ -317,11 +320,14 @@ static const MSModalityType MSModalityTypes[] = {
{"OP", 2, 0},// OphthalmicPhotography8BitImageStorage
{"OPT", 3, 0},// OphthalmicTomographyImageStorage
{"GM", 3, 0},// VLMicroscopicImageStorage
{"PT", 3, 0},//PETImageStorage,
{"PT", 3, 0},//EnhancedPETImageStorage,
{"XC", 3, 0},// VideoPhotographicImageStorage
{"DX", 3, 0},// XRay3DCraniofacialImageStorage
{"IVOCT", 3, 0},// IVOCTForPresentation,
{"IVOCT", 3, 0},// IVCOTForProcessing,
{"CT", 3, 0},//LegacyConvertedEnhancedCTImageStorage,
{"MR", 3, 0},//LegacyConvertedEnhancedMRImageStorage,
{"PT", 3, 0},//LegacyConvertedEnhancedPETImageStorage,
{NULL, 0, 0} //MS_END
};
......
......@@ -133,6 +133,9 @@ public:
XRay3DCraniofacialImageStorage,
IVOCTForPresentation,
IVOCTForProcessing,
LegacyConvertedEnhancedCTImageStorage,
LegacyConvertedEnhancedMRImageStorage,
LegacyConvertedEnhancedPETImageStorage,
MS_END
} MSType; // Media Storage Type
......
......@@ -159,7 +159,7 @@ int PDBHeader::readprotocoldatablock(const char *input, size_t inputlen, bool ve
{
(void)verbose;
// First 4 bytes are the length (again)
uint32_t len = *(uint32_t*)input;
uint32_t len = *(const uint32_t*)input;
SwapperNoOp::SwapArray(&len,1);
//if( verbose )
// std::cout << len << "," << inputlen << std::endl;
......
......@@ -30,7 +30,7 @@ Preamble::~Preamble()
std::istream &Preamble::Read(std::istream &is)
{
// \precondition: we are at beg of Preamble
assert ( !IsEmpty() /*&& is.tellg() == 0*/ );
gdcmAssertAlwaysMacro( !IsEmpty() /*&& is.tellg() == 0*/ );
if( is.read(Internal, 128+4) )
{
if( Internal[128+0] == 'D'
......
......@@ -69,10 +69,9 @@ static const char *TSStrings[] = {
"1.2.840.10008.1.2.4.100",
// Old ACR NEMA, fake a TS
"ImplicitVRBigEndianACRNEMA",
#ifdef GDCM_SUPPORT_BROKEN_IMPLEMENTATION
// Weird Papyrus
"1.2.840.10008.1.20",
#endif
// CT_private_ELE,
"1.3.46.670589.33.1.4.1",
// JPIP Referenced
"1.2.840.10008.1.2.4.94",
......
......@@ -119,6 +119,7 @@ unsigned int VM::GetLength() const
case VM::VM256:
len = VMToLength<VM::VM256>::Length;
break;
case VM::VM0:
case VM::VM1_2:
case VM::VM1_3:
case VM::VM1_4:
......
......@@ -338,6 +338,17 @@ inline unsigned int VR::GetSize() const
VRTypeTemplateCase(UT)
case VR::US_SS:
return 2;
case VR::INVALID:
case VR::OB_OW:
case VR::US_SS_OW:
case VR::VL16:
case VR::VL32:
case VR::VRASCII:
case VR::VRBINARY:
case VR::VR_VM1:
case VR::VRALL:
case VR::VR_END:
default:
assert( 0 && "should not" );
}
......
......@@ -169,6 +169,7 @@ void Bitmap::SetPlanarConfiguration(unsigned int pc)
|| ts == TransferSyntax::JPEG2000Lossless
|| ts == TransferSyntax::JPEG2000
|| ts == TransferSyntax::JPIPReferenced
|| ts == TransferSyntax::RLELossless // FIXME internally GDCM produce per-pixel output
)
{
// PS 3.6 - 2011 8.2.4 JPEG 2000 IMAGE COMPRESSION
......@@ -338,7 +339,7 @@ bool Bitmap::TryRAWCodec(char *buffer, bool &lossyflag) const
codec.SetLUT( GetLUT() );
codec.SetPixelFormat( GetPixelFormat() );
codec.SetNeedByteSwap( GetNeedByteSwap() );
codec.SetNeedOverlayCleanup( AreOverlaysInPixelData() );
codec.SetNeedOverlayCleanup( AreOverlaysInPixelData() || UnusedBitsPresentInPixelData() );
DataElement out;
//bool r = codec.Decode(PixelData, out);
bool r = codec.DecodeBytes(bv->GetPointer(), bv->GetLength(),
......@@ -426,7 +427,7 @@ bool Bitmap::TryJPEGCodec(char *buffer, bool &lossyflag) const
codec.SetPlanarConfiguration( GetPlanarConfiguration() );
codec.SetPhotometricInterpretation( GetPhotometricInterpretation() );
codec.SetPixelFormat( GetPixelFormat() );
codec.SetNeedOverlayCleanup( AreOverlaysInPixelData() );
codec.SetNeedOverlayCleanup( AreOverlaysInPixelData() || UnusedBitsPresentInPixelData() );
DataElement out;
bool r = codec.Decode(PixelData, out);
// PHILIPS_Gyroscan-12-MONO2-Jpeg_Lossless.dcm
......@@ -502,7 +503,7 @@ bool Bitmap::TryJPEGCodec2(std::ostream &os) const
codec.SetPlanarConfiguration( GetPlanarConfiguration() );
codec.SetPhotometricInterpretation( GetPhotometricInterpretation() );
codec.SetPixelFormat( GetPixelFormat() );
codec.SetNeedOverlayCleanup( AreOverlaysInPixelData() );
codec.SetNeedOverlayCleanup( AreOverlaysInPixelData() || UnusedBitsPresentInPixelData() );
DataElement out;
bool r = codec.Code(PixelData, out);
// PHILIPS_Gyroscan-12-MONO2-Jpeg_Lossless.dcm
......@@ -545,7 +546,7 @@ bool Bitmap::TryPVRGCodec(char *buffer, bool &lossyflag) const
//codec.SetNumberOfDimensions( GetNumberOfDimensions() );
codec.SetPlanarConfiguration( GetPlanarConfiguration() );
codec.SetPhotometricInterpretation( GetPhotometricInterpretation() );
codec.SetNeedOverlayCleanup( AreOverlaysInPixelData() );
codec.SetNeedOverlayCleanup( AreOverlaysInPixelData() || UnusedBitsPresentInPixelData() );
codec.SetDimensions( GetDimensions() );
DataElement out;
bool r = codec.Decode(PixelData, out);
......@@ -585,7 +586,7 @@ bool Bitmap::TryKAKADUCodec(char *buffer, bool &lossyflag) const
codec.SetNumberOfDimensions( GetNumberOfDimensions() );
codec.SetPlanarConfiguration( GetPlanarConfiguration() );
codec.SetPhotometricInterpretation( GetPhotometricInterpretation() );
codec.SetNeedOverlayCleanup( AreOverlaysInPixelData() );
codec.SetNeedOverlayCleanup( AreOverlaysInPixelData() || UnusedBitsPresentInPixelData() );
codec.SetDimensions( GetDimensions() );
DataElement out;
bool r = codec.Decode(PixelData, out);
......@@ -658,7 +659,7 @@ bool Bitmap::TryJPEGLSCodec(char *buffer, bool &lossyflag) const
codec.SetNumberOfDimensions( GetNumberOfDimensions() );
codec.SetPlanarConfiguration( GetPlanarConfiguration() );
codec.SetPhotometricInterpretation( GetPhotometricInterpretation() );
codec.SetNeedOverlayCleanup( AreOverlaysInPixelData() );
codec.SetNeedOverlayCleanup( AreOverlaysInPixelData() || UnusedBitsPresentInPixelData() );
codec.SetDimensions( GetDimensions() );
DataElement out;
bool r = codec.Decode(PixelData, out);
......@@ -775,7 +776,7 @@ bool Bitmap::TryJPEG2000Codec(char *buffer, bool &lossyflag) const
codec.SetNumberOfDimensions( GetNumberOfDimensions() );
codec.SetPlanarConfiguration( GetPlanarConfiguration() );
codec.SetPhotometricInterpretation( GetPhotometricInterpretation() );
codec.SetNeedOverlayCleanup( AreOverlaysInPixelData() );
codec.SetNeedOverlayCleanup( AreOverlaysInPixelData() || UnusedBitsPresentInPixelData() );
codec.SetDimensions( GetDimensions() );
DataElement out;
bool r = codec.Decode(PixelData, out);
......@@ -842,7 +843,7 @@ bool Bitmap::TryJPEG2000Codec2(std::ostream &os) const
codec.SetNumberOfDimensions( GetNumberOfDimensions() );
codec.SetPlanarConfiguration( GetPlanarConfiguration() );
codec.SetPhotometricInterpretation( GetPhotometricInterpretation() );
codec.SetNeedOverlayCleanup( AreOverlaysInPixelData() );
codec.SetNeedOverlayCleanup( AreOverlaysInPixelData() || UnusedBitsPresentInPixelData() );
DataElement out;
bool r = codec.Code(PixelData, out);
assert( r );
......@@ -873,7 +874,7 @@ bool Bitmap::TryRLECodec(char *buffer, bool &lossyflag ) const
codec.SetPhotometricInterpretation( GetPhotometricInterpretation() );
codec.SetPixelFormat( GetPixelFormat() );
codec.SetLUT( GetLUT() );
codec.SetNeedOverlayCleanup( AreOverlaysInPixelData() );
codec.SetNeedOverlayCleanup( AreOverlaysInPixelData() || UnusedBitsPresentInPixelData() );
codec.SetBufferLength( len );
DataElement out;
bool r = codec.Decode(PixelData, out);
......
......@@ -43,6 +43,7 @@ public:
void Print(std::ostream &) const;
virtual bool AreOverlaysInPixelData() const { return false; }
virtual bool UnusedBitsPresentInPixelData() const { return false; }
/// Return the number of dimension of the pixel data bytes; for example 2 for a 2D matrices of values
unsigned int GetNumberOfDimensions() const;
......
......@@ -78,7 +78,7 @@ public:
os << "TypeOfData :" << TypeOfData << std::endl;
os << "CurveDescription :" << CurveDescription << std::endl;
os << "DataValueRepresentation :" << DataValueRepresentation << std::endl;
unsigned short * p = (unsigned short*)&Data[0];
const unsigned short * p = (const unsigned short*)&Data[0];
for(int i = 0; i < NumberOfPoints; i+=2)
{
os << p[i] << "," << p[i+1] << std::endl;
......
......@@ -122,7 +122,7 @@ VR DataSetHelper::ComputeVR(File const &file, DataSet const &ds, const Tag& tag)
// FIXME:
// gdcmDataExtra/gdcmSampleData/ImagesPapyrus/TestImages/wristb.pap
// It's the contrary: root dataset does not have a Pixel Representation, but each SQ do...
assert( rootds.FindDataElement( pixelrep ) || ds.FindDataElement( pixelrep ) );
//assert( rootds.FindDataElement( pixelrep ) || ds.FindDataElement( pixelrep ) );
if( ds.FindDataElement( pixelrep ) )
{
at.SetFromDataElement( ds.GetDataElement( pixelrep ) );
......@@ -134,16 +134,17 @@ VR DataSetHelper::ComputeVR(File const &file, DataSet const &ds, const Tag& tag)
else
{
//throw Exception( "Unhandled" );
gdcmWarningMacro( "Unhandled" );
gdcmWarningMacro( "Unhandled" ); // Typical to PDF encapsulated with some illegal attribute
vr = VR::INVALID;
}
//assert( at.GetValue() == 0 || at.GetValue() == 1 );
if( at.GetValue() )
if( at.GetValue() == 1 )
{
vr = VR::SS;
}
else
else /*if( at.GetValue() == 0 )*/
{
// default to VR:US always (even when attribute is missing, or impossible to compute). This is much better than VR:UN anyway
vr = VR::US;
}
}
......