[MINC-users] basic volume_io question

Robert VINCENT bert@bic.mni.mcgill.ca
Fri Jan 28 16:12:15 2005


Hi Peter,

Are you building on Linux, IRIX, or elsewhere?  I've built the same code
fragment on my Linux system but I do not get the same error message.

	-bert

On Fri, 28 Jan 2005, Peter Savadjiev wrote:

> Hi,
>
> I'm trying to create a 4D volume with the following snippet of code:
>
>   Volume out;
>   STRING names[4];
>   int  sizes[4];
>   int s2[4];
>
>   sizes[0] = 90;
>   sizes[1] = 40;
>   sizes[2] = 96;
>   sizes[3] = 128;
>
>   names[0] = "time";
>   names[1] = "zspace";
>   names[2] = "yspace";
>   names[3] = "xspace";
>
>   out = create_volume( 4,names, FLOAT, FALSE,0,1);
>   set_volume_sizes(out, sizes);
>   alloc_volume_data(out);
>
>
> Apparently, everything is correct. Yet, when I run the code I get the
> following error:
>
> Error: cannot allocate array data until size specified.
>
> if I insert
>
>   get_volume_sizes(out, s2);
>   printf("%d %d %d %d\n", s2[0],s2[1],s2[2],s2[3]);
>
> between the calls to set_volume_sizes and alloc_volume_data, the sizes are
> printed correctly, which tells me that set_volume_sizes works properly.
>
> Could please anyone give me an idea what may be going wrong?
>
> Thank you very much for your help,
>
> Peter
>
>
> _______________________________________________
> MINC-users@bic.mni.mcgill.ca
> http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users
>