Re: [Freesurfer] bad magic number

2015-06-10 Thread Jalmar Teeuw
Hi Jennifer,

We had the same problem with importing scans into Freesurfer that had been 
converted from PAR/REC to NIFTI using nipy. The problem only affected a subset 
of the data. When visualising the data with Fiji the brain appeared highly 
skewed. Upon closer inspection of the header data of the NIFTI file we 
discovered that there was an extra byte somewhere between the description 
fields and the magic number sequence, causing the magic number to be 
misinterpreted by Freesurfer. The extra byte was somewhere in the 
transformation matrix that is located between the description field and the 
magic number, but it's impossible to fix unless you know what the content of 
the transformation matrix is supposed to be. However, when using dcm2nii, part 
of mricron (from what I understand a newer version of mricro), to convert our 
PAR/REC files to NIFTI the problem disappeared.

Maybe you could try dcm2nii and see if that helps your case as well? It's 
available from here: 
http://www.mccauslandcenter.sc.edu/mricro/mricron/install.html

If you are on Linux or Mac OS X you could try to run the command `head -c350 
 | hexdump -Cv`, where  is the path to 
your NIFTI file. This command will print the first 350 bytes of the NIFTI file 
that contains the header (plus two extra bytes) in hexadecimal and ASCII 
format. I don't have an example available at the moment, but the header should 
end in 'ni1..' or 'n+1..' in the rightmost column. If you get 'ni1.' or 'n+1.' 
(only one dot at the end), you probably have the same problem as we 
experienced. We don't know the origin of this extra byte, but most likely it is 
a bug in the conversion software that is affecting only some of the scans.

Regards,
Jalmar

> On 09 Jun 2015, at 22:21, Kriegel, Jennifer Lynn Sarai 
>  wrote:
> 
> mricro
> 
> -Original Message-
> From: freesurfer-boun...@nmr.mgh.harvard.edu 
> [mailto:freesurfer-boun...@nmr.mgh.harvard.edu] On Behalf Of Douglas N Greve
> Sent: Tuesday, June 09, 2015 3:16 PM
> To: freesurfer@nmr.mgh.harvard.edu
> Subject: Re: [Freesurfer] bad magic number
> 
> how was it created?
> 
> On 06/09/2015 04:03 PM, Kriegel, Jennifer Lynn Sarai wrote:
>> MRIcro opens it, and so does SPM 8.
>> 
>> 
>> 
>> -Original Message-
>> From: freesurfer-boun...@nmr.mgh.harvard.edu 
>> [mailto:freesurfer-boun...@nmr.mgh.harvard.edu] On Behalf Of Bruce 
>> Fischl
>> Sent: Tuesday, June 09, 2015 3:02 PM
>> To: Freesurfer support list
>> Subject: Re: [Freesurfer] bad magic number
>> 
>> Hi Jennifer
>> 
>> can MRIcro read it? Usually that means it is corrupted Bruce
>> 
>> 
>> On Tue, 9 Jun 2015, Kriegel, Jennifer Lynn Sarai
>> wrote:
>> 
>>> Hi,
>>> 
>>> 
>>> 
>>> I’m getting a bad magic number error using mri_convert. I’m trying to 
>>> convert a .nii file to a .mgz file. I’ve searched all over and all I 
>>> can find is that you can use python in another program to delete this 
>>> number, and it is related to the file extension. I’ve tried using the
>>> .nifti1 extension, as well as .nii, as I have a .img file in the 
>>> folder as well, but then it doesn’t recognize the file extension. The 
>>> files were converted using mricro from hdr/img MPRAGE files to correct 
>>> orientation into the .nii files.
>>> 
>>> 
>>> 
>>> I also tried using the original .hdr file to convert, and it spits 
>>> out an orientation error.
>>> 
>>> 
>>> 
>>> Any help would be appreciated.
>>> 
>>> 
>>> 
>>> 
>>> 
>>> - Jennifer Lynn Sarai Kriegel
>>> 
>>> MS in Psychological Sciences, Cognition and Neuroscience Emphasis
>>> 
>>> Functional Neuroimaging of Memory Lab, Center for Vital Longevity
>>> 
>>> The University of Texas at Dallas
>>> 
>>> jlk130...@utdallas.edu
>>> 
>>> 
>>> 
>>> I am looking for a lot of men who have an infinite capacity to not 
>>> know what can't be done.
>>> 
>>> - Henry Ford
>>> 
>>> 
>>> 
>>> The important thing is not to stop questioning. Curiosity has its own 
>>> reason for existing.
>>> 
>>> - Albert Einstein
>>> 
>>> 
>>> 
>>> 
>>> 
>> ___
>> Freesurfer mailing list
>> Freesurfer@nmr.mgh.harvard.edu
>> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
>> 
>> 
> 
> --
> Douglas N. Greve, Ph.D.
> MGH-NMR Center
> gr...@nmr.mgh.harvard.edu
> Phone Number: 617-724-2358
> Fax: 617-726-7422
> 
> Bugs: surfer.nmr.mgh.harvard.edu/fswiki/BugReporting
> FileDrop: https://gate.nmr.mgh.harvard.edu/filedrop2
> www.nmr.mgh.harvard.edu/facility/filedrop/index.html
> Outgoing: ftp://surfer.nmr.mgh.harvard.edu/transfer/outgoing/flat/greve/
> 
> ___
> Freesurfer mailing list
> Freesurfer@nmr.mgh.harvard.edu
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
> 
> 
> The information in this e-mail is intended only for the person to whom it is 
> addressed. If you believe this e-mail was sent to you in error and the e-mail 
> contains patient information, please 

Re: [Freesurfer] bad magic number

2015-06-10 Thread Jalmar Teeuw
I never used Analyse HDR/IMG format before so I can't tell if the conversion 
with dcm2nii works, but it may be worth a shot.

Are you on Linux or Mac OS X? If you send me the output of the command `head 
-c350  | hexdump -Cv`, where  is the 
path to your NIFTI file, I could have a look for you if it is the same problem.

If you are on Windows, you could use a Hex Editor (I used 
http://www.hexedit.com/hex-edit-shots.htm a long time ago) to do the same in a 
graphical user interface. Open the NIFTI file in the Hex Editor and send me a 
screenshot with the contents at the start of the file.

Jalmar

> On 10 Jun 2015, at 11:46, Kriegel, Jennifer Lynn Sarai 
>  wrote:
> 
> Hi Jalmar,
> 
> Thanks, that's very helpful because the files I am working with have been 
> transformed more than once, and were originally par/rec files. I do not have 
> those original files - I only have the analyze files which I was trying to 
> convert to .nii, since the hdr file gives a different error than the bad 
> magic number from the .nii. The transformation matrix sounds like it was the 
> answer I was looking for but I wouldn't know where to find it, or what it 
> should contain.
> 
> I appreciate this information.
> 
> Best,
> Jennifer
> 
> 
> 
> -Original Message-
> From: freesurfer-boun...@nmr.mgh.harvard.edu 
> [mailto:freesurfer-boun...@nmr.mgh.harvard.edu] On Behalf Of Jalmar Teeuw
> Sent: Wednesday, June 10, 2015 4:10 AM
> To: Freesurfer support list
> Subject: Re: [Freesurfer] bad magic number
> 
> Hi Jennifer,
> 
> We had the same problem with importing scans into Freesurfer that had been 
> converted from PAR/REC to NIFTI using nipy. The problem only affected a 
> subset of the data. When visualising the data with Fiji the brain appeared 
> highly skewed. Upon closer inspection of the header data of the NIFTI file we 
> discovered that there was an extra byte somewhere between the description 
> fields and the magic number sequence, causing the magic number to be 
> misinterpreted by Freesurfer. The extra byte was somewhere in the 
> transformation matrix that is located between the description field and the 
> magic number, but it's impossible to fix unless you know what the content of 
> the transformation matrix is supposed to be. However, when using dcm2nii, 
> part of mricron (from what I understand a newer version of mricro), to 
> convert our PAR/REC files to NIFTI the problem disappeared.
> 
> Maybe you could try dcm2nii and see if that helps your case as well? It's 
> available from here: 
> http://www.mccauslandcenter.sc.edu/mricro/mricron/install.html
> 
> If you are on Linux or Mac OS X you could try to run the command `head -c350 
>  | hexdump -Cv`, where  is the path 
> to your NIFTI file. This command will print the first 350 bytes of the NIFTI 
> file that contains the header (plus two extra bytes) in hexadecimal and ASCII 
> format. I don't have an example available at the moment, but the header 
> should end in 'ni1..' or 'n+1..' in the rightmost column. If you get 'ni1.' 
> or 'n+1.' (only one dot at the end), you probably have the same problem as we 
> experienced. We don't know the origin of this extra byte, but most likely it 
> is a bug in the conversion software that is affecting only some of the scans.
> 
> Regards,
> Jalmar
> 
>> On 09 Jun 2015, at 22:21, Kriegel, Jennifer Lynn Sarai 
>>  wrote:
>> 
>> mricro
>> 
>> -Original Message-
>> From: freesurfer-boun...@nmr.mgh.harvard.edu 
>> [mailto:freesurfer-boun...@nmr.mgh.harvard.edu] On Behalf Of Douglas N 
>> Greve
>> Sent: Tuesday, June 09, 2015 3:16 PM
>> To: freesurfer@nmr.mgh.harvard.edu
>> Subject: Re: [Freesurfer] bad magic number
>> 
>> how was it created?
>> 
>> On 06/09/2015 04:03 PM, Kriegel, Jennifer Lynn Sarai wrote:
>>> MRIcro opens it, and so does SPM 8.
>>> 
>>> 
>>> 
>>> -Original Message-
>>> From: freesurfer-boun...@nmr.mgh.harvard.edu
>>> [mailto:freesurfer-boun...@nmr.mgh.harvard.edu] On Behalf Of Bruce 
>>> Fischl
>>> Sent: Tuesday, June 09, 2015 3:02 PM
>>> To: Freesurfer support list
>>> Subject: Re: [Freesurfer] bad magic number
>>> 
>>> Hi Jennifer
>>> 
>>> can MRIcro read it? Usually that means it is corrupted Bruce
>>> 
>>> 
>>> On Tue, 9 Jun 2015, Kriegel, Jennifer Lynn Sarai
>>> wrote:
>>> 
>>>> Hi,
>>>> 
>>>> 
>>>> 
>>>> I’m getting a bad magic number error using mri_convert. I’m trying 
>>>

Re: [Freesurfer] bad magic number

2015-06-11 Thread Jalmar Teeuw
Hi Matthew,

Thanks for getting back at this. We only process data for our users, so I don't 
have permission to share a sample with you. But I'll ask around to see if I can 
get a scan for you.

To be honest, we aren't quite sure if the problem is with nibabel (v1.3.0). I 
tried to reproduce the problem with one of the scan that was causing this 
problem, but the conversion worked fine for me (same data, same script, 
different platform). Although recently we had the same issue cropping up again 
for another user where only part of the data was affected by this problem. All 
we know is that the description field of the NIFTI header starts at the right 
offset, the magic number bytes are off by +one byte, and the brain looks 
skewed; hence the assumption of an extra byte in one of the transform fields.

Alternatively, we were wondering what happens if the content of the description 
field exceeded 80 characters

descr = "%s;%s;%s;%s" % (
pr_hdr.general_info['exam_name'],
pr_hdr.general_info['patient_name'],
pr_hdr.general_info['exam_date'].replace(' ',''),
pr_hdr.general_info['protocol_name'])
nhdr.structarr['descrip'] = descr[:80]

The python code neatly truncates the description to 80 characters. Could it be 
possible that an extra '\0' null byte gets written to terminate the string, 
causing the description field to be 81 bytes long?

Cheers,
Jalmar

> On 10 Jun 2015, at 18:42, Matthew Brett  wrote:
> 
> Hi,
> 
>> We had the same problem with importing scans into Freesurfer that had been
>> converted from PAR/REC to NIFTI using nipy. The problem only affected a
>> subset of the data. When visualising the data with Fiji the brain appeared
>> highly skewed. Upon closer inspection of the header data of the NIFTI file we
>> discovered that there was an extra byte somewhere between the description
>> fields and the magic number sequence, causing the magic number to be
>> misinterpreted by Freesurfer. The extra byte was somewhere in the
>> transformation matrix that is located between the description field and the
>> magic number, but it's impossible to fix unless you know what the content of
>> the transformation matrix is supposed to be. However, when using dcm2nii,
>> part of mricron (from what I understand a newer version of mricro), to
>> convert our PAR/REC files to NIFTI the problem disappeared.
> 
> I'm the maintainer of nibabel so I guess I'm responsible for this
> bug...   Can someone point me to a PAR / REC file that causes this
> problem?   Private off-list is fine, but an image I can share for
> automated testing would be even better...
> 
> Cheers,
> 
> Matthew
> ___
> Freesurfer mailing list
> Freesurfer@nmr.mgh.harvard.edu
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
> 
> 
> The information in this e-mail is intended only for the person to whom it is
> addressed. If you believe this e-mail was sent to you in error and the e-mail
> contains patient information, please contact the Partners Compliance HelpLine 
> at
> http://www.partners.org/complianceline . If the e-mail was sent to you in 
> error
> but does not contain patient information, please contact the sender and 
> properly
> dispose of the e-mail.
> 


___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


Re: [Freesurfer] bad magic number

2015-06-12 Thread Jalmar Teeuw

Hi Matthew,

I'll send you two header files of affected scans by private e-mail. I heard the 
tool is being upgraded to use nibabel v2.0, but we haven't been able to test if 
the problem is still present in the latest version.

Regards,
Jalmar

On Jun 11, 2015, at 06:47 PM, Matthew Brett  wrote:

Hi,

On Thu, Jun 11, 2015 at 2:09 AM, Jalmar Teeuw  wrote:
Hi Matthew,

Thanks for getting back at this. We only process data for our users, so I don't 
have permission to share a sample with you. But I'll ask around to see if I can 
get a scan for you.

To be honest, we aren't quite sure if the problem is with nibabel (v1.3.0). I 
tried to reproduce the problem with one of the scan that was causing this 
problem, but the conversion worked fine for me (same data, same script, 
different platform). Although recently we had the same issue cropping up again 
for another user where only part of the data was affected by this problem. All 
we know is that the description field of the NIFTI header starts at the right 
offset, the magic number bytes are off by +one byte, and the brain looks 
skewed; hence the assumption of an extra byte in one of the transform fields.

Alternatively, we were wondering what happens if the content of the description 
field exceeded 80 characters

descr = "%s;%s;%s;%s" % (
pr_hdr.general_info['exam_name'],
pr_hdr.general_info['patient_name'],
pr_hdr.general_info['exam_date'].replace(' ',''),
pr_hdr.general_info['protocol_name'])
nhdr.structarr['descrip'] = descr[:80]

The python code neatly truncates the description to 80 characters. Could it be 
possible that an extra '\0' null byte gets written to terminate the string, 
causing the description field to be 81 bytes long?

I am fairly sure that there is no way to extend the structure by 1
byte with that command. The header is effectively a C structure,
wrapped by numpy, so even if numpy allowed you to overflow the field
length, it would still only overwrite the next field, and should not
extend the structure.

So - any help you can give to debug this would be great - I don't have
any good ideas at the moment... For example - can you send a header
from an affected file?

Cheers,

Matthew

___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.

___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.


Re: [Freesurfer] Preproc-sess failed

2015-06-24 Thread Jalmar Teeuw
That sounds more like you have only the 32-bit version of the libXp installed 
when 64-bit is required. Are you using the 64-bit version of Freesurfer 5.3.0 
for CentOS 6 that is available on the downloads page?

Have you tried

  sudo yum install libXp.x86_64

on the terminal? This should install the 64-bit libraries alongside the 32-bit 
libraries of libXp.

If I recall correctly, you might also need the libXpm libraries, use

  sudo yum install libXpm.x86_64


> On 24 Jun 2015, at 04:49, Thục Trinh  wrote:
> 
> I did that, and run the command 3dvolreg.afni on Terminal to check.
> The Error still remain: 3dvolreg.afni: error while loading shared libraries: 
> libXp.so.6: wrong ELF class: ELFCLASS32
> 
> 2015-06-23 10:39 GMT+07:00 Z K :
> From reading the email thread history, it appears you may have downloaded the 
> apple OS X version of 3rvolreg.afni and overwrote the original, which is the 
> cause of the error. Please extract the original version of that binary from 
> the original tarball. If you no longer have it you can download it from this 
> page:
> 
> https://surfer.nmr.mgh.harvard.edu/fswiki/Download
> 
> -Zeke
> 
> 
> On Jun 22, 2015, at 11:29 PM, Thục Trinh  wrote:
> 
>> hello,
>> I am using CentOS release 6.4 ( final) 64bit and Freesurfer v.5.3.0.
>> I think that makes the confliction.
>> 
>> 2015-06-23 8:26 GMT+07:00 Thục Trinh :
>> Hello Douglas and ZK,
>> I set the path for shared library in my .basrch file, but it still does not 
>> work and comes up with this Error:
>> 3dvolreg.afni: error while loading shared libraries: libXp.so.6: wrong ELF 
>> class: ELFCLASS32
>> ERROR: 3dvolreg.afni
>> Invalid null command.
>> 
>> Trinh
>> 
>> 2015-06-23 3:03 GMT+07:00 Z K :
>> Trinh,
>> 
>> Attempt to determine where libXp.so.6 was installed on your system after
>> you installed it using yum. For example, on my system libXp.so.6 exists
>> in directory "/usr/lib64". Once you determine the location where the
>> library resides, add that directory to your LD_LIBRARY_PATH after you
>> source freesurfer.
>> 
>> $> source $FREESURFER_HOME/SetUpFreeSurfer.sh
>> $> export LD_LIBRARY_PATH=/usr/lib64:$LD_LIBRARY_PATH
>> $> preproc-sess -s sess01 -fsd bold -stc up -surface fsaverage lhrh
>> -fwhm 5 -per-run
>> 
>> -Zeke
>> 
>> 
>> 
>> 
>> On 06/22/2015 02:40 PM, Douglas Greve wrote:
>> > I'm not sure what to tell you. Zeke, do you have any ideas?
>> > Alternatively, you can just install afni on your machine. Once you
>> > verify that the installation works, copy 3dvolreg from the installation.
>> >
>> > On 6/21/15 3:55 PM, Thục Trinh wrote:
>> >> Hello Douglas,
>> >> I already had *3dvolreg.afni* in */freesurfer/bin/*, but I still
>> >> download the new one 3dvolreg.afni and replaced it in /freesurfer/bin.
>> >> But the Error still remain the same.
>> >> *3dvolreg.afni: error while loading shared libraries: libXp.so.6:
>> >> cannot open shared object file: No such file or directory*
>> >> *ERROR: 3dvolreg.afni*
>> >> *Invalid null command.*
>> >>
>> >>
>> >> 2015-06-19 16:04 GMT+07:00 Douglas Greve > >> >:
>> >>
>> >>
>> >> See this thread
>> >> 
>> >> http://www.mail-archive.com/freesurfer%40nmr.mgh.harvard.edu/msg37764.html
>> >>
>> >>
>> >>
>> >>
>> >> On 6/17/15 5:59 PM, Thục Trinh wrote:
>> >>> Hi freesurfer experts,
>> >>> I am practicing on the fsfast tutorial data that were given at
>> >>> Freesurfer website.
>> >>> I run the command to do the pre-processing on the sess01 <*noproc*>.
>> >>> *preproc-sess -s sess01 -fsd bold -stc up -surface fsaverage lhrh
>> >>>  -fwhm 5 -per-run*
>> >>> it was unfinished and failed with the ERROR:
>> >>> *3dvolreg.afni: error while loading shared libraries: libXp.so.6:
>> >>> cannot open shared object file: No such file or directory*
>> >>> *ERROR: 3dvolreg.afni*
>> >>> *Invalid null command.*
>> >>> so I run the command to install libXp.so.6 under root permission
>> >>> *yum install libXp.so.6 *and completely installed.
>> >>> I found the file *3dvolreg.afni *in the $FREESURFER_HOME/bin
>> >>> But the ERROR still remained unfixed.
>> >>>
>> >>> Please help me with any suggestions to finish the preproc-sesss
>> >>> Thankyou and have a nice day.
>> >>> Trinh Tran
>> >>>
>> >>>
>> >>> ___
>> >>> Freesurfer mailing list
>> >>> Freesurfer@nmr.mgh.harvard.edu  
>> >>> 
>> >>> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
>> >>
>> >>
>> >> ___
>> >> Freesurfer mailing list
>> >> Freesurfer@nmr.mgh.harvard.edu 
>> >> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
>> >>
>> >>
>> >> The information in this e-mail is intended only for the person to
>> >> whom it is
>> >> addressed. If you believe this e-mail was sent to you

Re: [Freesurfer] Preproc-sess failed

2015-06-25 Thread Jalmar Teeuw
Is still gives you the same error? I'm not certain about libXpm; I recall 
having to install certain libraries on a slimmed down version of Centos 6.5, 
libXp and libXpm were amongst those libraries.

For me, the lib files are stored in /usr/lib64

Try 

  find /usr/lib64 -type f -iname "libXp*" -print

This will search for the files.


What is the output

  uname -a

On your system?


> On 25 Jun 2015, at 09:01, Thục Trinh  wrote:
> 
> Hi,
> After complete install the suitable version of shared library as you 
> suggested, I cannot find any file name libXpm.x86_64 to set the new path for 
> shared library.
> Ps: Is there any differences between libXpm.x86_64 and libXp.x86_64
> 
> 2015-06-24 16:03 GMT+07:00 Jalmar Teeuw :
>> That sounds more like you have only the 32-bit version of the libXp 
>> installed when 64-bit is required. Are you using the 64-bit version of 
>> Freesurfer 5.3.0 for CentOS 6 that is available on the downloads page?
>> 
>> Have you tried
>> 
>>   sudo yum install libXp.x86_64
>> 
>> on the terminal? This should install the 64-bit libraries alongside the 
>> 32-bit libraries of libXp.
>> 
>> If I recall correctly, you might also need the libXpm libraries, use
>> 
>>   sudo yum install libXpm.x86_64
>> 
>> 
>> > On 24 Jun 2015, at 04:49, Thục Trinh  wrote:
>> >
>> > I did that, and run the command 3dvolreg.afni on Terminal to check.
>> > The Error still remain: 3dvolreg.afni: error while loading shared 
>> > libraries: libXp.so.6: wrong ELF class: ELFCLASS32
>> >
>> > 2015-06-23 10:39 GMT+07:00 Z K :
>> > From reading the email thread history, it appears you may have downloaded 
>> > the apple OS X version of 3rvolreg.afni and overwrote the original, which 
>> > is the cause of the error. Please extract the original version of that 
>> > binary from the original tarball. If you no longer have it you can 
>> > download it from this page:
>> >
>> > https://surfer.nmr.mgh.harvard.edu/fswiki/Download
>> >
>> > -Zeke
>> >
>> >
>> > On Jun 22, 2015, at 11:29 PM, Thục Trinh  wrote:
>> >
>> >> hello,
>> >> I am using CentOS release 6.4 ( final) 64bit and Freesurfer v.5.3.0.
>> >> I think that makes the confliction.
>> >>
>> >> 2015-06-23 8:26 GMT+07:00 Thục Trinh :
>> >> Hello Douglas and ZK,
>> >> I set the path for shared library in my .basrch file, but it still does 
>> >> not work and comes up with this Error:
>> >> 3dvolreg.afni: error while loading shared libraries: libXp.so.6: wrong 
>> >> ELF class: ELFCLASS32
>> >> ERROR: 3dvolreg.afni
>> >> Invalid null command.
>> >>
>> >> Trinh
>> >>
>> >> 2015-06-23 3:03 GMT+07:00 Z K :
>> >> Trinh,
>> >>
>> >> Attempt to determine where libXp.so.6 was installed on your system after
>> >> you installed it using yum. For example, on my system libXp.so.6 exists
>> >> in directory "/usr/lib64". Once you determine the location where the
>> >> library resides, add that directory to your LD_LIBRARY_PATH after you
>> >> source freesurfer.
>> >>
>> >> $> source $FREESURFER_HOME/SetUpFreeSurfer.sh
>> >> $> export LD_LIBRARY_PATH=/usr/lib64:$LD_LIBRARY_PATH
>> >> $> preproc-sess -s sess01 -fsd bold -stc up -surface fsaverage lhrh
>> >> -fwhm 5 -per-run
>> >>
>> >> -Zeke
>> >>
>> >>
>> >>
>> >>
>> >> On 06/22/2015 02:40 PM, Douglas Greve wrote:
>> >> > I'm not sure what to tell you. Zeke, do you have any ideas?
>> >> > Alternatively, you can just install afni on your machine. Once you
>> >> > verify that the installation works, copy 3dvolreg from the installation.
>> >> >
>> >> > On 6/21/15 3:55 PM, Thục Trinh wrote:
>> >> >> Hello Douglas,
>> >> >> I already had *3dvolreg.afni* in */freesurfer/bin/*, but I still
>> >> >> download the new one 3dvolreg.afni and replaced it in /freesurfer/bin.
>> >> >> But the Error still remain the same.
>> >> >> *3dvolreg.afni: error while loading shared libraries: libXp.so.6:
>> >> >> cannot open shared object file: No such file or directory*
>> >> >> *ERROR: 3dvolreg.afni*
>> >> >> *Invalid null command.*
>> >> >>
>> >> >&g

Re: [Freesurfer] Preproc-sess failed

2015-06-26 Thread Jalmar Teeuw
Have you tried removing the 32-bit version of the libraries?

I believe it is

  yum remove libXp.i386


What is the output of

  file $FREESURFER_HOME/bin/3dvolreg.afni

Maybe you could try locate all the libXp.so on your system and see if there is 
a local 32-bit copy

  find / -type f -iname "libXp.so*"


> On 25 Jun 2015, at 09:45, Thục Trinh  wrote:
> 
> the lib files are now in /usr/lib64, the ERROR still the same after I set a 
> new path for shared lib with this command in .bashrc file
> export LD_LIBRARY_PATH=/usr/lib64:$LD_LIBRARY_PATH
> the Error still the same. 
> 3dvolreg.afni: error while loading shared libraries: libXp.so.6: wrong ELF 
> class: ELFCLASS32
> output of uname -a on my system is:
> Linux localhost.localdomain 2.6.32-358.el6.x86_64 #1 SMP Fri Feb 22 00:31:26 
> UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
> 
> 2015-06-25 14:15 GMT+07:00 Jalmar Teeuw :
>> Is still gives you the same error? I'm not certain about libXpm; I recall 
>> having to install certain libraries on a slimmed down version of Centos 6.5, 
>> libXp and libXpm were amongst those libraries.
>> 
>> For me, the lib files are stored in /usr/lib64
>> 
>> Try 
>> 
>>   find /usr/lib64 -type f -iname "libXp*" -print
>> 
>> This will search for the files.
>> 
>> 
>> What is the output
>> 
>>   uname -a
>> 
>> On your system?
>> 
>> 
>> On 25 Jun 2015, at 09:01, Thục Trinh  wrote:
>> 
>>> Hi,
>>> After complete install the suitable version of shared library as you 
>>> suggested, I cannot find any file name libXpm.x86_64 to set the new path 
>>> for shared library.
>>> Ps: Is there any differences between libXpm.x86_64 and libXp.x86_64
>>> 
>>> 2015-06-24 16:03 GMT+07:00 Jalmar Teeuw :
>>>> That sounds more like you have only the 32-bit version of the libXp 
>>>> installed when 64-bit is required. Are you using the 64-bit version of 
>>>> Freesurfer 5.3.0 for CentOS 6 that is available on the downloads page?
>>>> 
>>>> Have you tried
>>>> 
>>>>   sudo yum install libXp.x86_64
>>>> 
>>>> on the terminal? This should install the 64-bit libraries alongside the 
>>>> 32-bit libraries of libXp.
>>>> 
>>>> If I recall correctly, you might also need the libXpm libraries, use
>>>> 
>>>>   sudo yum install libXpm.x86_64
>>>> 
>>>> 
>>>> > On 24 Jun 2015, at 04:49, Thục Trinh  wrote:
>>>> >
>>>> > I did that, and run the command 3dvolreg.afni on Terminal to check.
>>>> > The Error still remain: 3dvolreg.afni: error while loading shared 
>>>> > libraries: libXp.so.6: wrong ELF class: ELFCLASS32
>>>> >
>>>> > 2015-06-23 10:39 GMT+07:00 Z K :
>>>> > From reading the email thread history, it appears you may have 
>>>> > downloaded the apple OS X version of 3rvolreg.afni and overwrote the 
>>>> > original, which is the cause of the error. Please extract the original 
>>>> > version of that binary from the original tarball. If you no longer have 
>>>> > it you can download it from this page:
>>>> >
>>>> > https://surfer.nmr.mgh.harvard.edu/fswiki/Download
>>>> >
>>>> > -Zeke
>>>> >
>>>> >
>>>> > On Jun 22, 2015, at 11:29 PM, Thục Trinh  wrote:
>>>> >
>>>> >> hello,
>>>> >> I am using CentOS release 6.4 ( final) 64bit and Freesurfer v.5.3.0.
>>>> >> I think that makes the confliction.
>>>> >>
>>>> >> 2015-06-23 8:26 GMT+07:00 Thục Trinh :
>>>> >> Hello Douglas and ZK,
>>>> >> I set the path for shared library in my .basrch file, but it still does 
>>>> >> not work and comes up with this Error:
>>>> >> 3dvolreg.afni: error while loading shared libraries: libXp.so.6: wrong 
>>>> >> ELF class: ELFCLASS32
>>>> >> ERROR: 3dvolreg.afni
>>>> >> Invalid null command.
>>>> >>
>>>> >> Trinh
>>>> >>
>>>> >> 2015-06-23 3:03 GMT+07:00 Z K :
>>>> >> Trinh,
>>>> >>
>>>> >> Attempt to determine where libXp.so.6 was installed on your system after
>>>> >> you installed it using yum. For example, on my system libXp.so.6 exists
>>>> >> in directory "

Re: [Freesurfer] Preproc-sess failed

2015-06-29 Thread Jalmar Teeuw

Sorry, I didn't have access to my CentOS machine, the 32-bit libraries use the 
suffix i686 instead of i386, so try

  sudo yum remove libXp.i686

By removing the 32-bit version you essential ensure only the 64-bit version is 
available when the application tries to load libXp. Hope that works. My machine 
only has the 64-bit version installed. Although technically, it should not 
matter if you have both installed on the system as it should automatically pick 
the correction version.

If it doesn't work, you could try to run

  find / -type f -iname "libXp.so*" -print

to check if the libXp libraries might be installed somewhere else. It may take some 
time to scan the entire system and any mounted volumes. You can use the `file 
` command to check if the library is 32 or 64-bit, and remove any 32-bit 
or even 64-bit version outside /usr/lib64 (BEWARE: removing libraries is at risk of 
breaking functioning of other application that depend on that particular library. If 
necessary, you can always run `sudo yum install libXp.i686` to install the 32-bit 
version again)


On Jun 29, 2015, at 08:10 AM, Thục Trinh  wrote:

Hi,
"yum remove libXp.i386" command returns with
No Packages marked for removal
This is my output for:'file $FREESURFER_HOME/bin/3dvolreg.afni' 
/usr/local/freesurfer/bin/3dvolreg.afni: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), statically linked, stripped



2015-06-26 16:19 GMT+07:00 Jalmar Teeuw :

Have you tried removing the 32-bit version of the libraries?

I believe it is

  yum remove libXp.i386


What is the output of

  file $FREESURFER_HOME/bin/3dvolreg.afni

Maybe you could try locate all the libXp.so on your system and see if there is 
a local 32-bit copy

  find / -type f -iname "libXp.so*"


On 25 Jun 2015, at 09:45, Thục Trinh  wrote:

the lib files are now in /usr/lib64, the ERROR still the same after I set a new 
path for shared lib with this command in .bashrc file
export LD_LIBRARY_PATH=/usr/lib64:$LD_LIBRARY_PATH
the Error still the same. 
3dvolreg.afni: error while loading shared libraries: libXp.so.6: wrong ELF class: ELFCLASS32

output of uname -a on my system is:
Linux localhost.localdomain 2.6.32-358.el6.x86_64 #1 SMP Fri Feb 22 00:31:26 
UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

2015-06-25 14:15 GMT+07:00 Jalmar Teeuw :
Is still gives you the same error? I'm not certain about libXpm; I recall 
having to install certain libraries on a slimmed down version of Centos 6.5, 
libXp and libXpm were amongst those libraries.

For me, the lib files are stored in /usr/lib64

Try 

  find /usr/lib64 -type f -iname "libXp*" -print

This will search for the files.


What is the output

  uname -a

On your system?


On 25 Jun 2015, at 09:01, Thục Trinh  wrote:

Hi,
After complete install the suitable version of shared library as you suggested, 
I cannot find any file name libXpm.x86_64 to set the new path for shared 
library.
Ps: Is there any differences between libXpm.x86_64 and libXp.x86_64

2015-06-24 16:03 GMT+07:00 Jalmar Teeuw :
That sounds more like you have only the 32-bit version of the libXp installed 
when 64-bit is required. Are you using the 64-bit version of Freesurfer 5.3.0 
for CentOS 6 that is available on the downloads page?

Have you tried

  sudo yum install libXp.x86_64

on the terminal? This should install the 64-bit libraries alongside the 32-bit 
libraries of libXp.

If I recall correctly, you might also need the libXpm libraries, use

  sudo yum install libXpm.x86_64



On 24 Jun 2015, at 04:49, Thục Trinh  wrote:

I did that, and run the command 3dvolreg.afni on Terminal to check.
The Error still remain: 3dvolreg.afni: error while loading shared libraries: 
libXp.so.6: wrong ELF class: ELFCLASS32

2015-06-23 10:39 GMT+07:00 Z K :
From reading the email thread history, it appears you may have downloaded the 
apple OS X version of 3rvolreg.afni and overwrote the original, which is the 
cause of the error. Please extract the original version of that binary from the 
original tarball. If you no longer have it you can download it from this page:

https://surfer.nmr.mgh.harvard.edu/fswiki/Download

-Zeke


On Jun 22, 2015, at 11:29 PM, Thục Trinh  wrote:


hello,
I am using CentOS release 6.4 ( final) 64bit and Freesurfer v.5.3.0.
I think that makes the confliction.

2015-06-23 8:26 GMT+07:00 Thục Trinh :
Hello Douglas and ZK,
I set the path for shared library in my .basrch file, but it still does not 
work and comes up with this Error:
3dvolreg.afni: error while loading shared libraries: libXp.so.6: wrong ELF 
class: ELFCLASS32
ERROR: 3dvolreg.afni
Invalid null command.

Trinh

2015-06-23 3:03 GMT+07:00 Z K :
Trinh,

Attempt to determine where libXp.so.6 was installed on your system after
you installed it using yum. For example, on my system libXp.so.6 exists
in directory "/usr/lib64". Once you determine the location where the
library resides, add that directory to yo

[Freesurfer] Preproc-sess failed

2015-07-01 Thread Jalmar Teeuw

Yes, the sudo prefix is optional, but may be required otherwise you get a 'not 
authorized' message (i.e. you need administrative privileges to install 
software and libraries); note 'libXp' is case-sensitive!

  sudo yum install libXp.x86_64

The library will be installed at /usr/lib64/libXp.so.6, a symbolic link to 
/usr/lib64/libXp.so.6.2.0

And try Zeke's advice as well, just to be sure

  export LD_LIBRARY_PATH=/usr/lib64:$LD_LIBRARY_PATH

You would have to run that command at every new terminal you open, or add it to 
the configuration file of your terminal.

P.S. I removed libXp on my machine, and yes, 3dvolreg.afni complains about 
missing libXp.so.6. After installing it again with the first command, it works 
again.

On Jul 01, 2015, at 06:47 AM, Thục Trinh  wrote:

Is the command line like this:
yum install libXp.so.6.x86_64

because I did run yum install libXp.so.6 before and it did not work.

2015-07-01 11:28 GMT+07:00 Z K :
Yes, and when it is done installing, determine exactly what directory the 
libXp.so.6 file was installed into. That is the directory you want to add to 
your LD_LIBRARY_PATH environment variable. 

-Zeke


On Jun 30, 2015, at 11:39 PM, Thục Trinh  wrote:

Hi, 
I did exactly what you said, and the error still remain: 3dvolreg.afni: error while loading shared libraries: libXp.so.6: cannot open shared object file: No such file or directory

I cannot find any folder name libXp.so.6,should I re-download libXp.so.6 64 
bits ?


2015-06-29 18:15 GMT+07:00 Jalmar Teeuw :
Sorry, I didn't have access to my CentOS machine, the 32-bit libraries use the 
suffix i686 instead of i386, so try

  sudo yum remove libXp.i686

By removing the 32-bit version you essential ensure only the 64-bit version is 
available when the application tries to load libXp. Hope that works. My machine 
only has the 64-bit version installed. Although technically, it should not 
matter if you have both installed on the system as it should automatically pick 
the correction version.

If it doesn't work, you could try to run

  find / -type f -iname "libXp.so*" -print

to check if the libXp libraries might be installed somewhere else. It may take some 
time to scan the entire system and any mounted volumes. You can use the `file 
` command to check if the library is 32 or 64-bit, and remove any 32-bit 
or even 64-bit version outside /usr/lib64 (BEWARE: removing libraries is at risk of 
breaking functioning of other application that depend on that particular library. If 
necessary, you can always run `sudo yum install libXp.i686` to install the 32-bit 
version again)


On Jun 29, 2015, at 08:10 AM, Thục Trinh  wrote:

Hi,
"yum remove libXp.i386" command returns with
No Packages marked for removal
This is my output for:'file $FREESURFER_HOME/bin/3dvolreg.afni' 
/usr/local/freesurfer/bin/3dvolreg.afni: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), statically linked, stripped



2015-06-26 16:19 GMT+07:00 Jalmar Teeuw :

Have you tried removing the 32-bit version of the libraries?

I believe it is

  yum remove libXp.i386


What is the output of

  file $FREESURFER_HOME/bin/3dvolreg.afni

Maybe you could try locate all the libXp.so on your system and see if there is 
a local 32-bit copy

  find / -type f -iname "libXp.so*"


On 25 Jun 2015, at 09:45, Thục Trinh  wrote:

the lib files are now in /usr/lib64, the ERROR still the same after I set a new 
path for shared lib with this command in .bashrc file
export LD_LIBRARY_PATH=/usr/lib64:$LD_LIBRARY_PATH
the Error still the same. 
3dvolreg.afni: error while loading shared libraries: libXp.so.6: wrong ELF class: ELFCLASS32

output of uname -a on my system is:
Linux localhost.localdomain 2.6.32-358.el6.x86_64 #1 SMP Fri Feb 22 00:31:26 
UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

2015-06-25 14:15 GMT+07:00 Jalmar Teeuw :
Is still gives you the same error? I'm not certain about libXpm; I recall 
having to install certain libraries on a slimmed down version of Centos 6.5, 
libXp and libXpm were amongst those libraries.

For me, the lib files are stored in /usr/lib64

Try 

  find /usr/lib64 -type f -iname "libXp*" -print

This will search for the files.


What is the output

  uname -a

On your system?


On 25 Jun 2015, at 09:01, Thục Trinh  wrote:

Hi,
After complete install the suitable version of shared library as you suggested, 
I cannot find any file name libXpm.x86_64 to set the new path for shared 
library.
Ps: Is there any differences between libXpm.x86_64 and libXp.x86_64

2015-06-24 16:03 GMT+07:00 Jalmar Teeuw :
That sounds more like you have only the 32-bit version of the libXp installed 
when 64-bit is required. Are you using the 64-bit version of Freesurfer 5.3.0 
for CentOS 6 that is available on the downloads page?

Have you tried

  sudo yum install libXp.x86_64

on the terminal? This should install the 64-bit libraries alongside the 32-bit 
libraries o