[MINC-development] MINC1 & MINC2

Anthonin Reilhac anthonin at biospective.com
Mon May 10 22:27:44 EDT 2010


Hi All,

I have the following code that I like to be able to read minc1 and minc2
file using the minc1 API.


-----------------------------------------------------------------------------------------------------------
#include <minc.h>
#include <volume_io.h>

[...]

 /* Open the minc file */
  unc_infile = expand_filename(infile);
  if((fd = miopen(unc_infile, NC_NOWRITE)) == MI_ERROR) {
    fprintf(stderr, "Cannot open file %s.\n", unc_infile);
    return(NULL);
  }
  free(unc_infile);


    /* Get information about the image dimensions*/
  if((vid = ncvarid(fd, MIimage)) == MI_ERROR) {
    fprintf(stderr, "Cannot find variable MIimage in minc file.\n");
    return NULL;
  }

[...]
-----------------------------------------------------------------------------------------------------------------
I compiled it and linked it with libminc2, libvolume_io2, libnetcdf &
libhdf5

It works fine with minc1 file but fails with minc2 files -> ncvarid: ncid
67108864: Not a netCDF id

Interestingly enough this code also generates an output file (through the
volume_io2 API though) which is in minc2.
I understood from previous comments that the minc1 API should deal with
minc2 files.

Any clue^^

Thx. Anthonin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.bic.mni.mcgill.ca/pipermail/minc-development/attachments/20100510/0085c81d/attachment.htm>


More information about the MINC-development mailing list