[MINC-users] voxel_loop problem

Maxime Descoteaux mdesco@cim.mcgill.ca
Sat, 13 Dec 2003 16:08:24 -0500 (EST)


Hi,

I now understand how to set things up but I get weird things happening. 
If I construct the simplest example possible, I copy an existing file to
another using voxel_loop.

 char *in_files[] = {"image.mnc"};
 char *out_files[] = {"out.mnc"};
 int num_in = 1;
 int num_out = 1;

 voxel_loop(num_in, in_files, num_out, out_files, NULL, NULL,
	    identity_function, NULL);


void identity_function(...)
{
  long ivox, num_values;
  num_values = num_voxels * input_vector_length;

  for(ivox = 0; ivox < num_values; ivox++) {
    output_data[0][ivox] = input_data[0][ivox];

print("%f\n", output_data[0][ivox]);
  }
}

Problem:
The printout of the values is all over the place... I get values of order
1.27e+308.  Anyways, the values are not at all matching the image.mnc
values.  However, if I display out.mnc, both image are the same????

What is going on here?  YOu can easily imagine that when I try to do
anything interesting with the values things BLOW up.

Can you help me?

Maxime


-- 
Maxime Descoteaux                            phone: (514) 989-8670
Centre for Intelligent Machines              phone: (514) 398-5606
Masters in Computer Science
McGill University
http://www.cim.mcgill.ca/~mdesco