[MINC-users] miopen_volume not opening file

Thomas Funck thomas.funck at mail.mcgill.ca
Thu Mar 17 15:09:24 EDT 2011


Hi,

So this is my second problem of the day. I'm writing a program that requires reading .mnc files. However when I try to use miopen_volume it returns -1. I even tried running the first mini-program included in the MINC2 tutorials (code included below) and miopen_volume did not work here either. I'm assuming the code from the tutorial is correct and that there is some underlying problem with HDF5 or MINC2. I just reinstalled the latest versions of MINC2 (version 2.1) and HDF5 (version 1.8.6) on my Ubuntu system. I also ran "make check" on both before installing and they passed all the tests, so both libraries seem to be happy with the system. I really can't figure out what's going on because the programs and code should both be okay. Any ideas?

Best,

Thomas





#include <minc2.h>
#include <stdio.h>
 
int main(int argc, char **argv) {
  mihandle_t    minc_volume;
  double        voxel;
  int           result;
  unsigned long location[3];
 
  /* open the volume - first and only command line argument */
  result = miopen_volume(argv[1], MI2_OPEN_READ, &minc_volume);
  /* check for error on opening */
  if (result != MI_NOERROR) {
    fprintf(stderr, "Error opening input file: %d.\n", result);
  }
 
  return(0);
}

________________________________________
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: Thursday, March 17, 2011 12:00 PM
To: minc-users at bic.mni.mcgill.ca
Subject: MINC-users Digest, Vol 68, Issue 18

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. HDF5 errors (Alex Zijdenbos)
   2. Re: build almost everything minc Makefile and git repository
      for EZminc (Luis Concha)
   3. Re: HDF5 errors (Andrew Janke)
   4. ecattominc and scale factors (Thomas Funck)


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

Message: 1
Date: Wed, 16 Mar 2011 17:06:25 +0100
From: Alex Zijdenbos <zijdenbos at gmail.com>
Subject: [MINC-users] HDF5 errors
To: MINC users mailing list <minc-users at bic.mni.mcgill.ca>
Message-ID:
        <AANLkTikhjesHfwYnxHAjd74kQhrMFkAqMzY28gZ53Nvi at mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

Hello all,

I just stumbled across a bunch of HDF5 runtime errors (see below). As
best I can tell these are due to a bogged-down NFS server; the files
the process needs are definitely there, but may take a while to get.
If I restart the exact same process, chances are high it completes
without error. I have so far only come across these only in xfmconcat
(with nonlinear deformations) and minc_displacement.

The main problem is that the errors are not caught; the process exits
gracefully and leaves a seemingly good output MINC file behind;
however upon inspection, the file is only partially written. The only
way to actually find the error is to catch it during some explicit
verification, or by grepping for 'HDF5' in the log files.

Does anybody have any thoughts about this or has seen this before? I
would say the the MINC library (miicv_get?) should catch this somehow
and throw an error causing the process to fail, but clearly that is
currently not happening.

These are locally-built executables based on MINC 2.1, HDF5 1.8.5.

-- Alex

HDF5-DIAG: Error detected in HDF5 (1.8.5-patch1) thread 0:
  #000: H5Dio.c line 174 in H5Dread(): can't read data
    major: Dataset
    minor: Read failed
  #001: H5Dio.c line 404 in H5D_read(): can't read data
    major: Dataset
    minor: Read failed
  #002: H5Dchunk.c line 1724 in H5D_chunk_read(): unable to read raw data chunk
    major: Low-level I/O
    minor: Read failed
  #003: H5Dchunk.c line 2737 in H5D_chunk_lock(): data pipeline read failed
    major: Data filters
    minor: Filter operation failed
  #004: H5Z.c line 1116 in H5Z_pipeline(): filter returned failure during read
    major: Data filters
    minor: Read failed
  #005: H5Zdeflate.c line 122 in H5Z_filter_deflate(): inflate() failed
    major: Data filters
    minor: Unable to initialize object
(from miicv_get): Can't read dataset /minc-2.0/image/0/image


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

Message: 2
Date: Wed, 16 Mar 2011 13:46:29 -0600
From: Luis Concha <lconcha at gmail.com>
Subject: Re: [MINC-users] build almost everything minc Makefile and
        git repository for EZminc
To: minc-users at bic.mni.mcgill.ca
Message-ID:
        <AANLkTi=2k6ALGfBEA8k9pSGsg_9eO+9ESXu2Zsntr6_=@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

Hello all.

Replying to my own post is far from exciting, but I'm doing it so that
the solution I found to my compilation problem is of help to anyone in
the same situation.

The solution to compile everything using Vlad's big Makefile was to
install ActiveState Perl in my own directories, and adding it to the
PATH before the system's built in perl installation (using the
install.sh from the ActiveState Perl distribution). After that, make
all compiled everything without any further problems.

Minc tools on the cluster, here I go.

Thanks to all for helping out!

Luis


On Wed, Mar 16, 2011 at 10:00 AM,  <minc-users-request at bic.mni.mcgill.ca> wrote:
> 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. Re: build almost everything minc Makefile and git repository
> ? ? ?for EZminc (Luis Concha)
>
>
> ---------- Forwarded message ----------
> From:?Luis Concha <lconcha at gmail.com>
> To:?minc-users at bic.mni.mcgill.ca
> Date:?Tue, 15 Mar 2011 13:40:32 -0600
> Subject:?Re: [MINC-users] build almost everything minc Makefile and git repository for EZminc
> Hi Andrew and all.
>
>> I think you will need to add PREFIX to the perl install. In the
>> Andrew Janke
>
> Thanks for the suggestion. I have tried it and I am still getting the
> same error. I believe the root of it is how Makefile.PL is written,
> which seems to be made by lib/ExtUtils/MakeMaker.pm. Of course, this
> seems to depend on the perl version installed (5.8 in my case) and
> only root can modify makemaker.pm.
>
> I see that Makefile.PL sends out a few arguments to generate a
> Makefile, After reading the Makefile, I see several calls to
> /usr/lib64/perl5... (CCDLFLAGS, SITELIBEXP, SITEARCHEXP,
> VENDORARCHEXP, VENDORLIBEXP, etc). I was wondering if I can overrride
> these by sending the appropriate arguments through Makefile.PL. If
> possible, then my ignorance will shine, as I have no clue what I
> should provide instead.
>
> Alternatively, should I compile my own version of perl from source, so
> I have more control over MakeMaker.pm?
>
> Thanks again.
>
> Luis
>
>
> _______________________________________________
> MINC-users mailing list
> MINC-users at bic.mni.mcgill.ca
> http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users
>
>


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

Message: 3
Date: Thu, 17 Mar 2011 21:02:53 +1000
From: Andrew Janke <a.janke at gmail.com>
Subject: Re: [MINC-users] HDF5 errors
To: MINC users mailing list <minc-users at bic.mni.mcgill.ca>
Message-ID:
        <AANLkTikv-LMj-fEDPW3+3W3w4vcBaRAweOQ-NKFJsRsK at mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

> I just stumbled across a bunch of HDF5 runtime errors (see below). As
> best I can tell these are due to a bogged-down NFS server; the files
> the process needs are definitely there, but may take a while to get.
> If I restart the exact same process, chances are high it completes
> without error. I have so far only come across these only in xfmconcat
> (with nonlinear deformations) and minc_displacement.

Does nfsstat show an error count during this?  If so I think your
problems are a bit more deep-seated than just MINC.



--
Andrew Janke
(a.janke at gmail.com || http://a.janke.googlepages.com/)
Brisbane->Australia    +61 (402) 700 883


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

Message: 4
Date: Thu, 17 Mar 2011 14:09:20 +0000
From: Thomas Funck <thomas.funck at mail.mcgill.ca>
Subject: [MINC-users] ecattominc and scale factors
To: "minc-users at bic.mni.mcgill.ca" <minc-users at bic.mni.mcgill.ca>
Message-ID:
        <53F3FD0032C9CC4BA836E8F0FC289065C160 at EXMBX2010-2.campus.MCGILL.CA>
Content-Type: text/plain; charset="us-ascii"

Hi,

I am a grad student working the Jewish General for Dr. Thiel. When I convert ECAT7 files to MINC, the values of the MINC file do not match the original values of the ECAT7 file. I saw in the ECAT header that there are scale factors that are applied to the values of the ECAT file. However even when I multiply the values in the MINC file by the corresponding scale factors (using mincmath), the two files still don't match. Is there something I am doing wrong? Thanks for the help!

Best,

Thomas


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

_______________________________________________
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 68, Issue 18
******************************************


More information about the MINC-users mailing list