Skip to content

Commit

Permalink
Merge branch 'release'
Browse files Browse the repository at this point in the history
  • Loading branch information
malaterre committed Oct 30, 2023
2 parents bcf4103 + f72c480 commit a1d03ce
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
14 changes: 7 additions & 7 deletions Source/DataDictionary/gdcmPrivateDefaultDicts.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ static const DICT_ENTRY DICOMV3DataDict [] = {
{0x0019,0x00f0,"CANON_MEC_MR3^10",VR::SL,VM::VM1,"?",false },
{0x0019,0x00f1,"CANON_MEC_MR3^10",VR::FL,VM::VM1,"?",false },
{0x0019,0x00f1,"CANON_MEC_MR3^12",VR::LO,VM::VM1,"?",false },
{0x0019,0x00f1,"CANON_MEC_MR3^11",VR::SL,VM::VM3,"?",false },
{0x0019,0x00f1,"CANON_MEC_MR3^11",VR::SL,VM::VM3,"Diffusion b-value x Toshiba Orientation",false },
{0x0019,0x00f2,"CANON_MEC_MR3^10",VR::FL,VM::VM1,"?",false },
{0x0019,0x00f2,"CANON_MEC_MR3^11",VR::FL,VM::VM3,"?",false },
{0x0019,0x00f3,"CANON_MEC_MR3^10",VR::SL,VM::VM1,"?",false },
Expand Down Expand Up @@ -521,7 +521,7 @@ static const DICT_ENTRY DICOMV3DataDict [] = {
{0x0021,0x001f,"CANON_MEC_MR3^10",VR::US,VM::VM1,"?",false },
{0x0021,0x0022,"CANON_MEC_MR3^10",VR::US,VM::VM1,"?",false },
{0x0021,0x0023,"CANON_MEC_MR3^10",VR::SS,VM::VM1,"?",false },
{0x0029,0x0001,"CANON_MEC_MR3^10",VR::SL,VM::VM1,"?",false },
{0x0029,0x0001,"CANON_MEC_MR3^10",VR::SL,VM::VM3,"Diffusion Gradient Orientation / Toshiba Orientation",false },
{0x0029,0x0005,"CANON_MEC_MR3^10",VR::SQ,VM::VM1,"?",false },
{0x0029,0x0006,"CANON_MEC_MR3^10",VR::FL,VM::VM1,"?",false },
{0x0029,0x0007,"CANON_MEC_MR3^10",VR::FL,VM::VM1,"?",false },
Expand All @@ -532,7 +532,7 @@ static const DICT_ENTRY DICOMV3DataDict [] = {
{0x0029,0x0051,"CANON_MEC_MR3^10",VR::LO,VM::VM1,"?",false },
{0x0029,0x0052,"CANON_MEC_MR3^10",VR::LO,VM::VM1,"?",false },
{0x0029,0x0054,"CANON_MEC_MR3^10",VR::LO,VM::VM1,"?",false },
{0x0029,0x0067,"CANON_MEC_MR3^10",VR::FD,VM::VM4,"?",false },
{0x0029,0x0067,"CANON_MEC_MR3^10",VR::FD,VM::VM4,"Series Diffusion Info (b-value,x,y,z)",false },
{0x0029,0x0068,"CANON_MEC_MR3^10",VR::SS,VM::VM1,"?",false },
{0x0029,0x006e,"CANON_MEC_MR3^10",VR::OB,VM::VM1,"?",false },
{0x0029,0x0001,"CANON_MEC_MR3",VR::SQ,VM::VM1,"Other Private Data",false },
Expand Down Expand Up @@ -1025,7 +1025,7 @@ static const DICT_ENTRY DICOMV3DataDict [] = {
{0x0019,0x00f0,"TOSHIBA_MEC_MR3^11",VR::SL,VM::VM4,"?",false },
{0x0019,0x00f1,"TOSHIBA_MEC_MR3^10",VR::FL,VM::VM1,"?",false },
{0x0019,0x00f1,"TOSHIBA_MEC_MR3^12",VR::LO,VM::VM1,"?",false },
{0x0019,0x00f1,"TOSHIBA_MEC_MR3^11",VR::SL,VM::VM3,"?",false },
{0x0019,0x00f1,"TOSHIBA_MEC_MR3^11",VR::SL,VM::VM3,"Diffusion b-value x Toshiba Orientation",false },
{0x0019,0x00f2,"TOSHIBA_MEC_MR3^10",VR::FL,VM::VM1,"?",false },
{0x0019,0x00f2,"TOSHIBA_MEC_MR3^11",VR::FL,VM::VM3,"?",false },
{0x0019,0x00f3,"TOSHIBA_MEC_MR3^10",VR::SL,VM::VM1,"?",false },
Expand Down Expand Up @@ -1077,7 +1077,7 @@ static const DICT_ENTRY DICOMV3DataDict [] = {
{0x0021,0x001f,"TOSHIBA_MEC_MR3^10",VR::US,VM::VM1,"?",false },
{0x0021,0x0022,"TOSHIBA_MEC_MR3^10",VR::US,VM::VM1,"?",false },
{0x0021,0x0023,"TOSHIBA_MEC_MR3^10",VR::SS,VM::VM1,"?",false },
{0x0029,0x0001,"TOSHIBA_MEC_MR3^10",VR::SL,VM::VM1,"?",false },
{0x0029,0x0001,"TOSHIBA_MEC_MR3^10",VR::SL,VM::VM3,"Diffusion Gradient Orientation / Toshiba Orientation",false },
{0x0029,0x0005,"TOSHIBA_MEC_MR3^10",VR::SQ,VM::VM1,"?",false },
{0x0029,0x0006,"TOSHIBA_MEC_MR3^10",VR::FL,VM::VM1,"?",false },
{0x0029,0x0007,"TOSHIBA_MEC_MR3^10",VR::FL,VM::VM1,"?",false },
Expand All @@ -1088,7 +1088,7 @@ static const DICT_ENTRY DICOMV3DataDict [] = {
{0x0029,0x0051,"TOSHIBA_MEC_MR3^10",VR::LO,VM::VM1,"?",false },
{0x0029,0x0052,"TOSHIBA_MEC_MR3^10",VR::LO,VM::VM1,"?",false },
{0x0029,0x0054,"TOSHIBA_MEC_MR3^10",VR::LO,VM::VM1,"?",false },
{0x0029,0x0067,"TOSHIBA_MEC_MR3^10",VR::FD,VM::VM4,"?",false },
{0x0029,0x0067,"TOSHIBA_MEC_MR3^10",VR::FD,VM::VM4,"Series Diffusion Info (b-value,x,y,z)",false },
{0x0029,0x0068,"TOSHIBA_MEC_MR3^10",VR::SS,VM::VM1,"?",false },
{0x0029,0x006e,"TOSHIBA_MEC_MR3^10",VR::OB,VM::VM1,"?",false },
{0x0029,0x0089,"TOSHIBA_MEC_MR3",VR::LO,VM::VM1,"?",false },
Expand Down Expand Up @@ -1772,7 +1772,7 @@ static const DICT_ENTRY DICOMV3DataDict [] = {
{0x0021,0x001a,"PMTF INFORMATION DATA^10",VR::US,VM::VM1,"?num2?",false },
{0x0021,0x001d,"PMTF INFORMATION DATA^10",VR::IS,VM::VM1,"?num3?",false },
{0x0021,0x001f,"PMTF INFORMATION DATA^10",VR::US,VM::VM1,"?num?",false },
{0x0029,0x0001,"PMTF INFORMATION DATA^10",VR::SL,VM::VM3,"Diffusion Gradient Orientation / Toshiba Orientation ",false },
{0x0029,0x0001,"PMTF INFORMATION DATA^10",VR::SL,VM::VM3,"Diffusion Gradient Orientation / Toshiba Orientation",false },
{0x0029,0x0005,"PMTF INFORMATION DATA^10",VR::SQ,VM::VM1,"?seq?",false },
{0x0029,0x0006,"PMTF INFORMATION DATA^10",VR::FL,VM::VM1,"?num?",false },
{0x0029,0x0007,"PMTF INFORMATION DATA^10",VR::FL,VM::VM1,"?num?",false },
Expand Down
16 changes: 11 additions & 5 deletions Utilities/gdcmext/mec_mr3_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,13 @@
#include <stdlib.h>
#include <string.h>

#ifndef _MSC_VER
#if defined(_MSC_VER) || defined(__OpenBSD__)
#define GDCM_HAS_ICONV 0
#else
#define GDCM_HAS_ICONV 1
#endif

#if GDCM_HAS_ICONV
#include <iconv.h>
#endif
#if defined(_MSC_VER) && (_MSC_VER < 1900)
Expand Down Expand Up @@ -54,15 +60,15 @@ static size_t stream_read(void *ptr, size_t size, size_t nmemb,

struct app {
struct stream *in;
#ifndef _MSC_VER
#if GDCM_HAS_ICONV
iconv_t conv;
#endif
void *shift_jis_buffer;
};

static struct app *create_app(struct app *self, struct stream *in) {
self->in = in;
#ifndef _MSC_VER
#if GDCM_HAS_ICONV
self->conv = iconv_open("utf-8", "shift-jis");
assert(self->conv != (iconv_t)-1);
#endif
Expand Down Expand Up @@ -358,7 +364,7 @@ static char *shift_jis_to_utf8(char *str, size_t len, struct app *self) {
const size_t guesstimate = len < 128 ? 128 : len * 2;
self->shift_jis_buffer = realloc(self->shift_jis_buffer, guesstimate);
char *dest_str = self->shift_jis_buffer;
#ifndef _MSC_VER
#if GDCM_HAS_ICONV
char *in_str = str;
char *out_str = dest_str;
size_t inbytes = len;
Expand Down Expand Up @@ -842,7 +848,7 @@ bool mec_mr3_print(const void *input, size_t len) {
#else
free(data.buffer);
#endif
#ifndef _MSC_VER
#if GDCM_HAS_ICONV
iconv_close(self->conv);
#endif
free(self->shift_jis_buffer);
Expand Down

0 comments on commit a1d03ce

Please sign in to comment.