From 7526b5c05359074a4c180ad05552cc1dda5fe382 Mon Sep 17 00:00:00 2001 From: malaterre Date: Mon, 6 Oct 2003 15:32:48 +0000 Subject: [PATCH] * change GetXSpacing and GetYSpacing "%f\\%" is parsed backward. --- src/config.h | 85 +++++++++++++++++++++++++++++----------- src/config.h.in | 83 +++++++++++++++++++++++++++++---------- src/gdcmHeaderHelper.cxx | 8 ++-- 3 files changed, 129 insertions(+), 47 deletions(-) diff --git a/src/config.h b/src/config.h index 52353876..c5fdb3d4 100644 --- a/src/config.h +++ b/src/config.h @@ -1,43 +1,84 @@ -/* src/config.h. Generated automatically by configure. */ -/* src/config.h.in. Generated automatically from configure.in by autoheader. */ +/* src/config.h. Generated by configure. */ +/* src/config.h.in. Generated from configure.in by autoheader. */ -/* Define to empty if the keyword does not work. */ -/* #undef const */ +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 -/* Define to `unsigned' if doesn't define. */ -/* #undef size_t */ +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 -/* Define if you have the ANSI C header files. */ -#define STDC_HEADERS 1 +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 -/* Define if your declares struct tm. */ -/* #undef TM_IN_SYS_TIME */ +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 -/* Define if your processor stores words with the most significant - byte first (like Motorola and SPARC, unlike Intel and VAX). */ -/* #undef WORDS_BIGENDIAN */ +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Name of package */ +#define PACKAGE "gdcm" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "" -/* The number of bytes in a char. */ +/* Define to the full name of this package. */ +#define PACKAGE_NAME "" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "" + +/* The size of a `char', as computed by sizeof. */ #define SIZEOF_CHAR 1 -/* The number of bytes in a int. */ +/* The size of a `int', as computed by sizeof. */ #define SIZEOF_INT 4 -/* The number of bytes in a long. */ +/* The size of a `long', as computed by sizeof. */ #define SIZEOF_LONG 4 -/* The number of bytes in a long long. */ +/* The size of a `long long', as computed by sizeof. */ #define SIZEOF_LONG_LONG 8 -/* The number of bytes in a short. */ +/* The size of a `short', as computed by sizeof. */ #define SIZEOF_SHORT 2 -/* Define if you have the header file. */ -#define HAVE_DLFCN_H 1 +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 -/* Name of package */ -#define PACKAGE "gdcm" +/* Define to 1 if your declares `struct tm'. */ +/* #undef TM_IN_SYS_TIME */ /* Version number of package */ #define VERSION "0.3.0" +/* Define to 1 if your processor stores words with the most significant byte + first (like Motorola and SPARC, unlike Intel and VAX). */ +/* #undef WORDS_BIGENDIAN */ + +/* Define to empty if `const' does not conform to ANSI C. */ +/* #undef const */ + +/* Define to `unsigned' if does not define. */ +/* #undef size_t */ diff --git a/src/config.h.in b/src/config.h.in index 552bf6bc..5a0d619b 100644 --- a/src/config.h.in +++ b/src/config.h.in @@ -1,42 +1,83 @@ -/* src/config.h.in. Generated automatically from configure.in by autoheader. */ +/* src/config.h.in. Generated from configure.in by autoheader. */ -/* Define to empty if the keyword does not work. */ -#undef const +/* Define to 1 if you have the header file. */ +#undef HAVE_DLFCN_H -/* Define to `unsigned' if doesn't define. */ -#undef size_t +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H -/* Define if you have the ANSI C header files. */ -#undef STDC_HEADERS +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H -/* Define if your declares struct tm. */ -#undef TM_IN_SYS_TIME +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H -/* Define if your processor stores words with the most significant - byte first (like Motorola and SPARC, unlike Intel and VAX). */ -#undef WORDS_BIGENDIAN +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT -/* The number of bytes in a char. */ +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* The size of a `char', as computed by sizeof. */ #undef SIZEOF_CHAR -/* The number of bytes in a int. */ +/* The size of a `int', as computed by sizeof. */ #undef SIZEOF_INT -/* The number of bytes in a long. */ +/* The size of a `long', as computed by sizeof. */ #undef SIZEOF_LONG -/* The number of bytes in a long long. */ +/* The size of a `long long', as computed by sizeof. */ #undef SIZEOF_LONG_LONG -/* The number of bytes in a short. */ +/* The size of a `short', as computed by sizeof. */ #undef SIZEOF_SHORT -/* Define if you have the header file. */ -#undef HAVE_DLFCN_H +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS -/* Name of package */ -#undef PACKAGE +/* Define to 1 if your declares `struct tm'. */ +#undef TM_IN_SYS_TIME /* Version number of package */ #undef VERSION +/* Define to 1 if your processor stores words with the most significant byte + first (like Motorola and SPARC, unlike Intel and VAX). */ +#undef WORDS_BIGENDIAN + +/* Define to empty if `const' does not conform to ANSI C. */ +#undef const + +/* Define to `unsigned' if does not define. */ +#undef size_t diff --git a/src/gdcmHeaderHelper.cxx b/src/gdcmHeaderHelper.cxx index c6957de0..2917c573 100644 --- a/src/gdcmHeaderHelper.cxx +++ b/src/gdcmHeaderHelper.cxx @@ -1,4 +1,4 @@ -// $Header: /cvs/public/gdcm/src/Attic/gdcmHeaderHelper.cxx,v 1.11 2003/10/03 15:27:44 malaterre Exp $ +// $Header: /cvs/public/gdcm/src/Attic/gdcmHeaderHelper.cxx,v 1.12 2003/10/06 15:32:48 malaterre Exp $ #include "gdcmHeaderHelper.h" @@ -163,7 +163,7 @@ float gdcmHeaderHelper::GetXSpacing() { dbg.Verbose(0, "gdcmHeader::GetXSpacing: unfound Pixel Spacing (0028,0030)"); return 1.; } - if( sscanf( StrSpacing.c_str(), "%f\\%f", &xspacing, &yspacing) != 2) + if( sscanf( StrSpacing.c_str(), "%f\\%f", &yspacing, &xspacing) != 2) return 0.; //else return xspacing; @@ -183,12 +183,12 @@ float gdcmHeaderHelper::GetYSpacing() { dbg.Verbose(0, "gdcmHeader::GetYSpacing: unfound Pixel Spacing (0028,0030)"); return 1.; } - if( sscanf( StrSpacing.c_str(), "%f\\%f", &xspacing, &yspacing) != 2) + if( sscanf( StrSpacing.c_str(), "%f\\%f", &yspacing, &xspacing) != 2) return 0.; if (yspacing == 0.) { dbg.Verbose(0, "gdcmHeader::GetYSpacing: gdcmData/CT-MONO2-8-abdo.dcm problem"); // seems to be a bug in the header ... - sscanf( StrSpacing.c_str(), "%f\\0\\%f", &xspacing, &yspacing); + sscanf( StrSpacing.c_str(), "%f\\0\\%f", &yspacing, &xspacing); } return yspacing; } -- 2.45.1