[MINC-development] using milist_grp_next

Soren Christensen sorench at gmail.com
Wed Apr 15 04:07:59 EDT 2009


Hi Leila,
 Thanks very much for your help, good to know the code is ok.
I used the HDF in the tgz folder with the other sources.
That has not given any problems with the core tools so far (eg
mincinfo and resample work fine). Can the 1.6.1 be the issue despite
that?

I installed HDF 1.6.5 but now get a warning that Headers are 1.6.1,
library is 1.6.5.
I am not sure what the problem here is?
Is it because MINC is build with HDF 1.6.1 in a static build?  I am
trying to make sure that the 1.6.1 headers are not used when I compile
the test program (1.6.1 is not in /usr/local/lib but in a seperate
folder):

Cheers
Soren

compiling:
gcc -o prog -I/usr/local/hdf5-1.6.5/include
-L/usr/local/hdf5-1.6.5/lib -L/usr/local/mni2/lib
-I/usr/local/mni2/include/ minc2.c -lminc2 -lhdf5 -lnetcdf

env
LD_LIBRARY_PATH=/usr/local/hdf5-1.6.5/lib

Libraries used are 1.6.5
ldd prog
	linux-gate.so.1 =>  (0x008ac000)
	libhdf5.so.0 => /usr/local/hdf5-1.6.5/lib/libhdf5.so.0 (0x0014b000)
	libc.so.6 => /lib/libc.so.6 (0x006a6000)
	libm.so.6 => /lib/libm.so.6 (0x0081c000)
	libz.so.1 => /lib/libz.so.1 (0x00888000)
	/lib/ld-linux.so.2 (0x0067d000)



On Wed, Apr 15, 2009 at 12:34 AM, Leila Baghdadi
<baghdadi at phenogenomics.ca> wrote:
> soren,
>
> the code seems to be fine, but you are using hdf5 1.6.1 last I checked
> we were using 1.6.5 unless Andrew has rolled up his sleeves and made all
> necessary changes for the new hdf5 (which I think are too many),
>
> Leila
>
> On Tue, 2009-04-14 at 22:42 +1000, Soren Christensen wrote:
>> Hi all,
>> Please let me know if this belongs in minc-users rather than here.
>>  I am trying to learn how to use the minc2 api but got stuck
>> attempting to iterate through the groups and attributes of a minc2
>> file. Admitted my C skills need a little work too, that may well be
>> the problem.
>> I am building on one of the tutorials and get an error from the below code:
>>
>> #include <minc2.h>
>> #include <stdio.h>
>>
>> int main(int argc, char **argv) {
>>   mihandle_t    minc_volume;
>>   milisthandle_t milisthandle;
>>   int           result;
>>   char          mystr[255];
>>   int           maxpath;
>>
>>   result = miopen_volume(argv[1], MI2_OPEN_READ, &minc_volume);
>>
>>   if (result != MI_NOERROR) {
>>     fprintf(stderr, "Error opening input file: %d.\n", result);
>>   }
>>
>>   result = milist_start ( minc_volume,"/",1,&milisthandle);
>>
>>   if (result != MI_NOERROR) {
>>     fprintf(stderr, "Error querying input file: %d.\n", result);
>>   }
>>
>>   result = milist_grp_next  (milisthandle, mystr,maxpath);
>>
>>   if (result != MI_NOERROR) {
>>     fprintf(stderr, "Error in reading group: %d.\n", result);
>>   }
>>
>>
>>
>>   return(0);
>> }
>>
>>
>>
>> ./prog minc2.mnc
>>
>> gives:
>> HDF5-DIAG: Error detected in HDF5 library version: 1.6.1 thread 0.
>> Back trace follows.
>>   #000: H5G.c line 296 in H5Gopen(): unable to open group
>>     major(10): Symbol table layer
>>     minor(52): Can't open object
>>   #001: H5G.c line 1888 in H5G_open(): not found
>>     major(10): Symbol table layer
>>     minor(40): Object not found
>>   #002: H5G.c line 1945 in H5G_open_oid(): not a group
>>     major(10): Symbol table layer
>>     minor(52): Can't open object
>>   #003: H5O.c line 1467 in H5O_read(): unable to load object header
>>     major(12): Object header layer
>>     minor(22): Read failed
>>   #004: H5O.c line 1528 in H5O_read_real(): unable to find message in
>> object header
>>     major(12): Object header layer
>>     minor(40): Object not found
>>   #005: H5O.c line 1609 in H5O_find_in_ohdr(): unable to find object
>> header message
>>     major(12): Object header layer
>>     minor(40): Object not found
>>
>>
>>
>> Could someone give me a hint as to what I am doing wrong? From what I
>> can see in the unit test the syntax seems much the same.
>>
>>
>> Thanks in advance,
>> Soren
>>
>>
>> The file should be ok btw:
>> h5dump -H minc2.mnc  | grep 'GROUP\|DATASET'
>> GROUP "/" {
>>    GROUP "minc-2.0" {
>>       GROUP "dimensions" {
>>          DATASET "xspace" {
>>          DATASET "yspace" {
>>          DATASET "zspace" {
>>       GROUP "image" {
>>          GROUP "0" {
>>             DATASET "image" {
>>             DATASET "image-max" {
>>             DATASET "image-min" {
>>       GROUP "info" {
>>          DATASET "dicom_0x0002" {
>>          DATASET "dicom_0x0008" {
>>          DATASET "dicom_0x0010" {
>>          DATASET "dicom_0x0018" {
>>          DATASET "dicom_0x0019" {
>>          DATASET "dicom_0x0020" {
>>          DATASET "dicom_0x0028" {
>>          DATASET "dicom_0x0040" {
>>          DATASET "study" {
>> _______________________________________________
>> MINC-development mailing list
>> MINC-development at bic.mni.mcgill.ca
>> http://www2.bic.mni.mcgill.ca/mailman/listinfo/minc-development
>
> _______________________________________________
> MINC-development mailing list
> MINC-development at bic.mni.mcgill.ca
> http://www2.bic.mni.mcgill.ca/mailman/listinfo/minc-development
>



More information about the MINC-development mailing list