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?
Get T1MRI dimension
- riviere
- Site Admin
- Posts: 1361
- Joined: Tue Jan 06, 2004 12:21 pm
- Location: CEA NeuroSpin, Saint Aubin, France
- Contact:
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:
Denis
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])