[MINC-users] volume_io

Andrew Janke a.janke at gmail.com
Tue Aug 4 01:39:29 EDT 2009


Hi Anthonin,

Don't think I replied to this so here goes.

On Sat, Jul 11, 2009 at 04:38, Anthonin
REILHAC<anthonin at bic.mni.mcgill.ca> wrote:

> I would like to read a whole minc file (time,z,y,x) in one shot (using
> input_volume) and save it back in one shot using ouput_volume().
> When I do this, the min/max values per xy-slice the original file
> contains are lost, and replaced by min/max values for the whole 4D volume.
>
> Is there a way to fix this?

In short no. Your best bet is if you really really want to retain
precision to this degree is to first convert the volume to float or
double (either before you read in your volume or in your code). Once
you have done this then slice scaling and max and min values become
irrelevant.

> Also, I am trying a variant: I load the whole volume with
> input_volume in a Volume variable and
> save the same volume back (using the same Volume variable) in a new file,
> xy-slice wise (using loops over time and z), with
> output_volume_to_minc_file_position() function. But this does not work.
> In this last variant, should the Volume passed to
> output_volume_to_minc_file_position be of the dimension of the subset of
> the whole volume we want to write on disk(of a xy-slice?) or
> can it be of the dimension of the whole volume and we specify the part we
> want to write with volumes_counts and file_start?

I am not quite sure what you mean here. Perhaps post some code and I
might be able to figure out exactly what you mean.


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


More information about the MINC-users mailing list