How does AimsFIleConvert support nifti files ?

AIMS library and commands usage

Moderators: riviere, denghien

User avatar
Melanie PELEGRINI
Posts: 39
Joined: Tue Mar 23, 2004 4:20 pm
Location: U678 Inserm, Paris

How does AimsFIleConvert support nifti files ?

Postby Melanie PELEGRINI » Mon Feb 01, 2010 4:45 pm

Hi all,

I would like to use AimsFileInfo in a pipeline of routines outside BrainVISA.

I would like to convert a Nifti file xxxx.nii to Analyze format xxxx.img/.hdr.

If I run
. "PathTo/brainvisa32/bin/cartopack.sh"
PathTo/brainvisa32/bin/command-links/AimsFileConvert -i xxxx.nii -o xxxx.img
it works.

Now if I put PathTo/brainvisa32/bin/command-links/AimsFileConvert in a separate directory DIR, together with its dependencies (shared librairies found with 'ldd' command : libaimsdata.so.3.2, libgraph.so.3.2, libcartodata.so.3.2, libcartobase.so.3.2, libcartobase_1.so.3.2, libcartobase_0.so.3.2, and others that are system libraries)
and then I use
export LD_LIBRARY_PATH=DIR:$LD_LIBRARY_PATH
DIR/AimsFileConvert -i xxxx.nii -o xxxx.img
I get an error
./AimsFileConvert: xxxx.nii : invalid format (not handled)

So what am I missing and where does AimsFileConvert get the information about supporting nifti files ?

Thanks a lot for your help

Melanie

User avatar
riviere
Site Admin
Posts: 1358
Joined: Tue Jan 06, 2004 12:21 pm
Location: CEA NeuroSpin, Saint Aubin, France
Contact:

Re: How does AimsFIleConvert support nifti files ?

Postby riviere » Tue Feb 02, 2010 2:16 am

Hi Mélanie,
If I understand well, you moved a part of the binary package to another place. That's OK but there are several environment variables to setup before everything runs well. That's what the cartopack.sh script does. Normally if you run PathTo/brainvisa32/bin/AimsFileConvert instead of PathTo/brainvisa32/bin/command-links/AimsFileConvert, the script should be called and everything should be OK.
If you insist on setting the variables yourself, there are several of them:

Code: Select all

LD_LIBRARY_PATH=PathTo/brainvisa32/lib:"$LD_LIBRARY_PATH"
PYTHONPATH=PathTo/brainvisa32/python:"$PYTHONPATH"
PYTHONHOME=PathTo/brainvisa32
BRAINVISA_SHARE=PathTo/brainvisa32/share
DCMDICTPATH=PathTo/brainvisa32/lib/dicom.dic

If some variables are not set correctly (BRAINVISA_SHARE, typically), the plugins list will not be found, or plugin libraries will not be loaded, and the nifti plugin will not be available. I guess it is what happens to you...

Otherwise, are you really really sure you need to use Analyze format ? It is strongly advised to avoid it because of its orientation ambiguities, this format is obsolete and has been dropped by all the communauty for very good reasons, and we might remove support for it one day just because this format is "too dangerous"...

Denis

User avatar
Melanie PELEGRINI
Posts: 39
Joined: Tue Mar 23, 2004 4:20 pm
Location: U678 Inserm, Paris

Re: How does AimsFIleConvert support nifti files ?

Postby Melanie PELEGRINI » Tue Feb 02, 2010 10:14 am

It's just temporary, but I need Analyze format to run old programs :-( that will be adapted for nifti eventually.

Thanks for your reply !


Return to “AIMS”

Who is online

Users browsing this forum: No registered users and 1 guest