Page 1 of 1

file Info with Python

Posted: Wed Mar 24, 2004 3:26 pm
by Olivier Coulon
Hello all,
I was wondering if it is possible to obtain file info such as dimX, dimY, sizeX or sizeY within a Brainvisa module. I can't find any module within which this is done.
Thanks in advance,

Olivier

Posted: Thu Mar 25, 2004 12:03 am
by Jean-Francois Mangin
Have a look in anatomy/triangulation/AnaGetSphericalCorticalSurface,
I think I used it there.
Jeff

Posted: Mon Mar 29, 2004 1:52 am
by riviere
The best way is to use aimsVolumeAttributes() in the module shfjGlobals:

Code: Select all

import shfjGlobals
attributes = shfjGlobals.aimsVolumeAttributes( self.volume )
dims = attributes.get( 'volume_dimension' )
It only works for volume formats supported by the Aims library (it uses AimsFileInfo command to get attributes).
Alternately you can directly query disk items attributes from BrainVISA cache but in some cases attributes will not be up-to-date (if the volume has just been written by a previous step for instance, attributes created at write time, like dimensions, will not be known):

Code: Select all

dims = self.volume.get( 'volume_dimension' )
Denis