[MINC-users] MINC-users Digest, Vol 131, Issue 14

Thomas Funck, Mr thomas.funck at mail.mcgill.ca
Thu Jul 28 22:18:48 EDT 2016


Compiling ZLIB before the rest didn't work, but I found a rather hacky workaround.


In the following files the path to libz.a has to be moved to be behind the path to libznz.a.


./minctools/conversion/CMakeFiles/nii2mnc.dir/link.txt
./minctools/conversion/CMakeFiles/mnc2nii.dir/link.txt

After that the compilation works.

Thomas


________________________________
From: minc-users-bounces at bic.mni.mcgill.ca <minc-users-bounces at bic.mni.mcgill.ca> on behalf of minc-users-request at bic.mni.mcgill.ca <minc-users-request at bic.mni.mcgill.ca>
Sent: Wednesday, July 27, 2016 12:00:01 PM
To: minc-users at bic.mni.mcgill.ca
Subject: MINC-users Digest, Vol 131, Issue 14

Send MINC-users mailing list submissions to
        minc-users at bic.mni.mcgill.ca

To subscribe or unsubscribe via the World Wide Web, visit
        http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users
or, via email, send a message with subject or body 'help' to
        minc-users-request at bic.mni.mcgill.ca

You can reach the person managing the list at
        minc-users-owner at bic.mni.mcgill.ca

When replying, please edit your Subject line so it is more specific
than "Re: Contents of MINC-users digest..."


Today's Topics:

   1. dcm2mnc error regarding PatientAge (Daniel Marchand)
   2. Problem with ZLIB when compiling minc-toolkit-v2
      (Thomas Funck, Mr)
   3. Re: Problem with ZLIB when compiling minc-toolkit-v2
      (vladimir.fonov at gmail.com)
   4. Re: dcm2mnc error regarding PatientAge (Robert D. Vincent)


----------------------------------------------------------------------

Message: 1
Date: Tue, 26 Jul 2016 13:05:35 -0400
From: Daniel Marchand <daniel at biospective.com>
To: minc-users at bic.mni.mcgill.ca
Subject: [MINC-users] dcm2mnc error regarding PatientAge
Message-ID:
        <CALZEBsYNOnpxS-opkovO6mJFu1Xf-a1BeHjHNYbdPxNPLdz0Uw at mail.gmail.com>
Content-Type: text/plain; charset=UTF-8

Hi,

I'm having trouble converting a dicom file including the line:
(0010,1010) AS [0000]                                   #   4, 1 PatientAge

which throws the error:
Age units (0000) unknown

It seems that the cause of the error is
inside of conversion/dcm2mnc/minc_file.c :

    if (strlen(general_info->patient.age) > 0) {
        string_t temp;
        int i;
        double age;

        strncpy(temp, general_info->patient.age, STRING_T_LEN - 1);
        while (temp[i] != 0 && !isdigit(temp[i]))
          i++;
        if (temp[i] == 0) {
          fprintf(stderr, "ERROR: Age was not numeric!!\n");
          exit(-1);
        }
        age = atof(&temp[i]);
        while (temp[i] != 0 && isdigit(temp[i]))
          i++;
        if (temp[i] == 'M')     /* age is in months */
          age /= 12.0;
        else if (temp[i] == 'W')   /* age is in weeks */
          age /= 52.0;
        else if (temp[i] == 'D')   /* age is in days */
          age /= 365.0;
        else if (temp[i] != 'Y') { /* age is in years */
          fprintf(stderr, "ERROR: Age units (%s) unknown.\n", temp);
          exit(-1);
        }
        miattputdbl(mincid, varid, MIage, age);

I would appear that perhaps a new option could be added where
dcm2mnc doesn't crash if the age is written as [0000]?

Best,

Daniel


------------------------------

Message: 2
Date: Tue, 26 Jul 2016 18:36:14 +0000
From: "Thomas Funck, Mr" <thomas.funck at mail.mcgill.ca>
To: "minc-users at bic.mni.mcgill.ca" <minc-users at bic.mni.mcgill.ca>
Subject: [MINC-users] Problem with ZLIB when compiling minc-toolkit-v2
Message-ID:
        <BN3PR03MB1445BC1E1A497B51E9AB82E1A60E0 at BN3PR03MB1445.namprd03.prod.outlook.com>

Content-Type: text/plain; charset="iso-8859-1"

Hi,

I'm trying to compile minc-toolkit-v2, but ran into the following problem. I'm trying to compile on Ubuntu 16.04.1 LTS and with USE_SYSTEM_ZLIB=OFF. I also tried minc-toolkit but ran into the same error.

Thanks for any help,

Thomas

Scanning dependencies of target nii2mnc
[ 23%] Building C object minctools/conversion/CMakeFiles/nii2mnc.dir/nifti1/nii2mnc.c.o
[ 23%] Linking C executable nii2mnc
../../external//usr/local/minc/lib/libznz.a(znzlib.o): In function `znzopen':
znzlib.c:(.text+0x4a): undefined reference to `gzopen'
../../external//usr/local/minc/lib/libznz.a(znzlib.o): In function `znzdopen':
znzlib.c:(.text+0x102): undefined reference to `gzdopen'
../../external//usr/local/minc/lib/libznz.a(znzlib.o): In function `Xznzclose':
znzlib.c:(.text+0x166): undefined reference to `gzclose'
../../external//usr/local/minc/lib/libznz.a(znzlib.o): In function `znzread':
znzlib.c:(.text+0x220): undefined reference to `gzread'
../../external//usr/local/minc/lib/libznz.a(znzlib.o): In function `znzwrite':
znzlib.c:(.text+0x320): undefined reference to `gzwrite'
../../external//usr/local/minc/lib/libznz.a(znzlib.o): In function `znzseek':
znzlib.c:(.text+0x3db): undefined reference to `gzseek'
../../external//usr/local/minc/lib/libznz.a(znzlib.o): In function `znzrewind':
znzlib.c:(.text+0x447): undefined reference to `gzseek'
../../external//usr/local/minc/lib/libznz.a(znzlib.o): In function `znztell':
znzlib.c:(.text+0x4a3): undefined reference to `gztell'
../../external//usr/local/minc/lib/libznz.a(znzlib.o): In function `znzputs':
znzlib.c:(.text+0x4f7): undefined reference to `gzputs'
../../external//usr/local/minc/lib/libznz.a(znzlib.o): In function `znzgets':
znzlib.c:(.text+0x55b): undefined reference to `gzgets'
../../external//usr/local/minc/lib/libznz.a(znzlib.o): In function `znzflush':
znzlib.c:(.text+0x5c5): undefined reference to `gzflush'
../../external//usr/local/minc/lib/libznz.a(znzlib.o): In function `znzeof':
znzlib.c:(.text+0x623): undefined reference to `gzeof'
../../external//usr/local/minc/lib/libznz.a(znzlib.o): In function `znzputc':
znzlib.c:(.text+0x677): undefined reference to `gzputc'
../../external//usr/local/minc/lib/libznz.a(znzlib.o): In function `znzgetc':
znzlib.c:(.text+0x6f5): undefined reference to `gzgetc'
../../external//usr/local/minc/lib/libznz.a(znzlib.o): In function `znzprintf':
znzlib.c:(.text+0x798): undefined reference to `gzprintf'
collect2: error: ld returned 1 exit status
minctools/conversion/CMakeFiles/nii2mnc.dir/build.make:105: recipe for target 'minctools/conversion/nii2mnc' failed
make[2]: *** [minctools/conversion/nii2mnc] Error 1
CMakeFiles/Makefile2:5017: recipe for target 'minctools/conversion/CMakeFiles/nii2mnc.dir/all' failed
make[1]: *** [minctools/conversion/CMakeFiles/nii2mnc.dir/all] Error 2
Makefile:160: recipe for target 'all' failed
make: *** [all] Error 2



------------------------------

Message: 3
Date: Tue, 26 Jul 2016 14:43:17 -0400
From: vladimir.fonov at gmail.com
To: MINC list <minc-users at bic.mni.mcgill.ca>
Subject: Re: [MINC-users] Problem with ZLIB when compiling
        minc-toolkit-v2
Message-ID: <64C52D64-4ED0-4241-A956-8952D5B37DF9 at gmail.com>
Content-Type: text/plain; charset=utf-8

Can you try running ?make ZLIB? first , and then ?make nii2mnc? ?


> On Jul 26, 2016, at 14:36, Thomas Funck, Mr <thomas.funck at mail.mcgill.ca> wrote:
>
> Hi,
>
> I'm trying to compile minc-toolkit-v2, but ran into the following problem. I'm trying to compile on Ubuntu 16.04.1 LTS and with USE_SYSTEM_ZLIB=OFF. I also tried minc-toolkit but ran into the same error.
>
> Thanks for any help,
>
> Thomas
>
> Scanning dependencies of target nii2mnc
> [ 23%] Building C object minctools/conversion/CMakeFiles/nii2mnc.dir/nifti1/nii2mnc.c.o
> [ 23%] Linking C executable nii2mnc
> ../../external//usr/local/minc/lib/libznz.a(znzlib.o): In function `znzopen':
> znzlib.c:(.text+0x4a): undefined reference to `gzopen'
> ../../external//usr/local/minc/lib/libznz.a(znzlib.o): In function `znzdopen':
> znzlib.c:(.text+0x102): undefined reference to `gzdopen'
> ../../external//usr/local/minc/lib/libznz.a(znzlib.o): In function `Xznzclose':
> znzlib.c:(.text+0x166): undefined reference to `gzclose'
> ../../external//usr/local/minc/lib/libznz.a(znzlib.o): In function `znzread':
> znzlib.c:(.text+0x220): undefined reference to `gzread'
> ../../external//usr/local/minc/lib/libznz.a(znzlib.o): In function `znzwrite':
> znzlib.c:(.text+0x320): undefined reference to `gzwrite'
> ../../external//usr/local/minc/lib/libznz.a(znzlib.o): In function `znzseek':
> znzlib.c:(.text+0x3db): undefined reference to `gzseek'
> ../../external//usr/local/minc/lib/libznz.a(znzlib.o): In function `znzrewind':
> znzlib.c:(.text+0x447): undefined reference to `gzseek'
> ../../external//usr/local/minc/lib/libznz.a(znzlib.o): In function `znztell':
> znzlib.c:(.text+0x4a3): undefined reference to `gztell'
> ../../external//usr/local/minc/lib/libznz.a(znzlib.o): In function `znzputs':
> znzlib.c:(.text+0x4f7): undefined reference to `gzputs'
> ../../external//usr/local/minc/lib/libznz.a(znzlib.o): In function `znzgets':
> znzlib.c:(.text+0x55b): undefined reference to `gzgets'
> ../../external//usr/local/minc/lib/libznz.a(znzlib.o): In function `znzflush':
> znzlib.c:(.text+0x5c5): undefined reference to `gzflush'
> ../../external//usr/local/minc/lib/libznz.a(znzlib.o): In function `znzeof':
> znzlib.c:(.text+0x623): undefined reference to `gzeof'
> ../../external//usr/local/minc/lib/libznz.a(znzlib.o): In function `znzputc':
> znzlib.c:(.text+0x677): undefined reference to `gzputc'
> ../../external//usr/local/minc/lib/libznz.a(znzlib.o): In function `znzgetc':
> znzlib.c:(.text+0x6f5): undefined reference to `gzgetc'
> ../../external//usr/local/minc/lib/libznz.a(znzlib.o): In function `znzprintf':
> znzlib.c:(.text+0x798): undefined reference to `gzprintf'
> collect2: error: ld returned 1 exit status
> minctools/conversion/CMakeFiles/nii2mnc.dir/build.make:105: recipe for target 'minctools/conversion/nii2mnc' failed
> make[2]: *** [minctools/conversion/nii2mnc] Error 1
> CMakeFiles/Makefile2:5017: recipe for target 'minctools/conversion/CMakeFiles/nii2mnc.dir/all' failed
> make[1]: *** [minctools/conversion/CMakeFiles/nii2mnc.dir/all] Error 2
> Makefile:160: recipe for target 'all' failed
> make: *** [all] Error 2
>
> _______________________________________________
> MINC-users at bic.mni.mcgill.ca
> http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users

Best regards, Vladimir S. FONOV ~ v.s.fonov <at> ilmarin.info






------------------------------

Message: 4
Date: Tue, 26 Jul 2016 23:36:34 -0400
From: "Robert D. Vincent" <robert.d.vincent at mcgill.ca>
To: MINC users mailing list <minc-users at bic.mni.mcgill.ca>
Subject: Re: [MINC-users] dcm2mnc error regarding PatientAge
Message-ID:
        <CAAd5DeQz2bmP8UkREuQeOA3WJDxoyLnhcW59JiycLpoV-YFNSw at mail.gmail.com>
Content-Type: text/plain; charset="UTF-8"

Hi,

I'll relax the test and make it a warning. But the AS VR does not permit a
field value of 0000.

    -bert

On Tue, Jul 26, 2016 at 1:05 PM, Daniel Marchand <daniel at biospective.com>
wrote:

> Hi,
>
> I'm having trouble converting a dicom file including the line:
> (0010,1010) AS [0000]                                   #   4, 1 PatientAge
>
> which throws the error:
> Age units (0000) unknown
>
> It seems that the cause of the error is
> inside of conversion/dcm2mnc/minc_file.c :
>
>     if (strlen(general_info->patient.age) > 0) {
>         string_t temp;
>         int i;
>         double age;
>
>         strncpy(temp, general_info->patient.age, STRING_T_LEN - 1);
>         while (temp[i] != 0 && !isdigit(temp[i]))
>           i++;
>         if (temp[i] == 0) {
>           fprintf(stderr, "ERROR: Age was not numeric!!\n");
>           exit(-1);
>         }
>         age = atof(&temp[i]);
>         while (temp[i] != 0 && isdigit(temp[i]))
>           i++;
>         if (temp[i] == 'M')     /* age is in months */
>           age /= 12.0;
>         else if (temp[i] == 'W')   /* age is in weeks */
>           age /= 52.0;
>         else if (temp[i] == 'D')   /* age is in days */
>           age /= 365.0;
>         else if (temp[i] != 'Y') { /* age is in years */
>           fprintf(stderr, "ERROR: Age units (%s) unknown.\n", temp);
>           exit(-1);
>         }
>         miattputdbl(mincid, varid, MIage, age);
>
> I would appear that perhaps a new option could be added where
> dcm2mnc doesn't crash if the age is written as [0000]?
>
> Best,
>
> Daniel
> _______________________________________________
> MINC-users at bic.mni.mcgill.ca
> http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users
>


------------------------------

_______________________________________________
MINC-users mailing list
MINC-users at bic.mni.mcgill.ca
http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users


End of MINC-users Digest, Vol 131, Issue 14
*******************************************


More information about the MINC-users mailing list