Get T1MRI dimension

Questions about BrainVisa usage and installation

Moderators: denghien, riviere

Post Reply
quere
Posts: 54
Joined: Mon Mar 28, 2005 10:50 pm

Get T1MRI dimension

Post by quere »

Hi!!

I would like to get the dimension of a T1MRI, so which function I have to use.
I have ever right this:

signature = Signature('anat', ReadDiskItem("T1 MRI", shfjGlobals.anatomistVolumeFormats))

def initialization(self)
pass

def execution(self, context)
dims = self.anat.get('volume_dimension', '1,1,1,1')

So is it right!!!
Somebody could help me?
User avatar
riviere
Site Admin
Posts: 1361
Joined: Tue Jan 06, 2004 12:21 pm
Location: CEA NeuroSpin, Saint Aubin, France
Contact:

Post by riviere »

Hi,

Yes I guess it's more or less OK, except:
- here you provide '1,1,1,1' is a default value if the actual dimensions cannot be accessed. Is it what you want ? If yes, you should rather write [1,1,1,1] (a list instead of a string)
- I think if the image you are working on is not in BrainVisa database, its dimensions may not have been read at the time you execute the process (this needs to be checked, I'm too lazy to do it right now). In this case it's safer to force re-reading header attributes:

Code: Select all

attribs = shfjGlobals.aimsVolumeAttributes( self.anat )
dims = attribs.get('volume_dimension', [1,1,1,1])
Denis
quere
Posts: 54
Joined: Mon Mar 28, 2005 10:50 pm

Post by quere »

thank you for your answer!!
it is exactly that which I needed

:lol: Aurélie
Post Reply