JiscMail Logo
Email discussion lists for the UK Education and Research communities

Help for FSL Archives


FSL Archives

FSL Archives


FSL@JISCMAIL.AC.UK


View:

Message:

[

First

|

Previous

|

Next

|

Last

]

By Topic:

[

First

|

Previous

|

Next

|

Last

]

By Author:

[

First

|

Previous

|

Next

|

Last

]

Font:

Proportional Font

LISTSERV Archives

LISTSERV Archives

FSL Home

FSL Home

FSL  November 2018

FSL November 2018

Options

Subscribe or Unsubscribe

Subscribe or Unsubscribe

Log In

Log In

Get Password

Get Password

Subject:

Re: Error in mat2file using Palm

From:

"Flandin, Guillaume" <[log in to unmask]>

Reply-To:

FSL - FMRIB's Software Library <[log in to unmask]>

Date:

Fri, 9 Nov 2018 12:45:18 +0000

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (1 lines)

Hi Arnold, 
 
I don't think I can understand what is going on without reproducing the 
error. You mentioned using Ubuntu 16.4 so I set up a Docker container 
with stock Octave: 
 
========= Dockerfile ========= 
FROM ubuntu:16.04 
 
RUN apt-get update && apt-get -y install \ 
 octave liboctave-dev git 
 
RUN git clone https://github.com/andersonwinkler/PALM.git \ 
 && cd /PALM/fileio/@file_array/private \ 
 && rm *.mex* *.o \ 
 && mkoctfile --mex file2mat.c \ 
 && mkoctfile --mex mat2file.c \ 
 && mkoctfile --mex init.c 
 
ENTRYPOINT ["octave"] 
============================== 
 
This contains Octave 4.0.0 and gcc 5.4.0. I run the following: 
  docker build -t palm/oct . 
  docker run -ti palm/oct 
and at the Octave prompt, I type: 
  cd /PALM/fileio; 
  dat = file_array('test.dat',[1 1],'FLOAT32-LE',352); 
  dat(1) = 1; 
  dat(1) 
 
My understanding from the email exchange with Melanni is that the code 
above triggers the error "mat2file: Can not yet write logical data." but 
it works here. Is there any difference you can think of between this and 
your current installation? 
 
Best regards, 
Guillaume. 
 
 
On 08/11/2018 20:38, Arnold Evia wrote: 
> Hello Guillaume and Melanni, 
>  
> I already had liboctave-dev installed.  
> I reinstalled it and ran the commands, and still have the same issue. 
>  
> Best, 
> -Arnold 
>  
> On Tue, Nov 6, 2018 at 6:28 AM Flandin, Guillaume <[log in to unmask] 
> <mailto:[log in to unmask]>> wrote: 
>  
>     Hi Arnold and Melanni, 
>  
>     I still cannot make sense of the errors you report. In order to compile 
>     MEX files for Octave, you indeed need to install liboctave-dev, which 
>     will provide the mkoctfile command. 
>  
>     In a terminal (not within Octave), do the following: 
>     * cd PALM/fileio/@file_array/private/ 
>     * rm *.mex* 
>     * mkoctfile --mex file2mat.c 
>       mkoctfile --mex mat2file.c 
>       mkoctfile --mex init.c 
>     This should have created three files with a .mex extension. 
>  
>     Run Octave/PALM and let us know what happens. 
>  
>     Best regards, 
>     Guillaume. 
>  
>  
>     On 01/11/2018 18:50, melanni nanni wrote: 
>     > Hi Arnold, 
>     > 
>     > I also observed that it was a mkoctfile dependent on the version 
>     of gcc 
>     > in my case, I installed liboctave-dev, then compile it from terminal. 
>     > 
>     > Best, 
>     > 
>     > Melanni 
>     > 
>     > 
>     ------------------------------------------------------------------------ 
>     > *De:* FSL - FMRIB's Software Library <[log in to unmask] 
>     <mailto:[log in to unmask]>> en nombre de 
>     > Arnold Evia <[log in to unmask] <mailto:[log in to unmask]>> 
>     > *Enviado:* jueves, 1 de noviembre de 2018 07:19 p. m. 
>     > *Para:* [log in to unmask] <mailto:[log in to unmask]> 
>     > *Asunto:* Re: [FSL] Error in mat2file using Palm 
>     >   
>     > I am compiling for Octave on Ubuntu 16.04. When I compiled the 
>     file for 
>     > Octave in the terminal, compilation completed with no errors or 
>     > warnings, and I still had the problem. 
>     > I also tried compiling without the 'platform=octave' tag, hoping 
>     to get 
>     > some information on what could be going wrong. 
>     > 
>     > -Arnold 
>     > 
>     > 
>     > On Thu, Nov 1, 2018 at 7:28 AM Flandin, Guillaume 
>     <[log in to unmask] <mailto:[log in to unmask]> 
>     > <mailto:[log in to unmask] <mailto:[log in to unmask]>>> wrote: 
>     > 
>     >     Hi Arnold, 
>     > 
>     >     Are you compiling for MATLAB or Octave? The issue observed by 
>     Melanni 
>     >     was with Octave. Here you are compiling with mex from the 
>     terminal, so 
>     >     it is aiming at compiling for MATLAB (*.mexa64). 
>     >     Also, which version of Ubuntu are you using? 
>     > 
>     >     Best regards, 
>     >     Guillaume. 
>     > 
>     > 
>     >     On 31/10/2018 19:59, Arnold Evia wrote: 
>     >     > Compiling the file using terminal didn't make a difference. 
>     >     > Still observe the same behavior. 
>     >     > 
>     >     > I tried compiling without the platform tags, and  got the 
>     >     following result: 
>     >     > 
>     >     > rm -f file2mat.mexa64 mat2file.mexa64 init.mexa64 
>     >     > mex -O -largeArrayDims file2mat.c 
>     >     > Building with 'gcc'. 
>     >     > Warning: You are using gcc version '5.5.0'. The version of 
>     gcc is not 
>     >     > supported. The version currently supported with MEX is 
>     '6.3.x'. For a 
>     >     > list of currently supported compilers see: 
>     >     > https://www.mathworks.com/support/compilers/current_release 
>     >    
>      <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.mathworks.com%2Fsupport%2Fcompilers%2Fcurrent_release&data=02%7C01%7C%7C9bbc52f66f2b4b02446108d640268c98%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636766931638843783&sdata=Ox1tpl%2BJnhPz9imCFSqVX0Vi%2BSeP%2B6xdkc6cdZabFdM%3D&reserved=0>. 
>     >     > MEX completed successfully. 
>     >     > mex -O -largeArrayDims mat2file.c 
>     >     > Building with 'gcc'. 
>     >     > Warning: You are using gcc version '5.5.0'. The version of 
>     gcc is not 
>     >     > supported. The version currently supported with MEX is 
>     '6.3.x'. For a 
>     >     > list of currently supported compilers see: 
>     >     > https://www.mathworks.com/support/compilers/current_release 
>     >    
>      <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.mathworks.com%2Fsupport%2Fcompilers%2Fcurrent_release&data=02%7C01%7C%7C9bbc52f66f2b4b02446108d640268c98%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636766931638843783&sdata=Ox1tpl%2BJnhPz9imCFSqVX0Vi%2BSeP%2B6xdkc6cdZabFdM%3D&reserved=0>. 
>     >     > MEX completed successfully. 
>     >     > mex -O -largeArrayDims init.c 
>     >     > Building with 'gcc'. 
>     >     > Warning: You are using gcc version '5.5.0'. The version of 
>     gcc is not 
>     >     > supported. The version currently supported with MEX is 
>     '6.3.x'. For a 
>     >     > list of currently supported compilers see: 
>     >     > https://www.mathworks.com/support/compilers/current_release 
>     >    
>      <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.mathworks.com%2Fsupport%2Fcompilers%2Fcurrent_release&data=02%7C01%7C%7C9bbc52f66f2b4b02446108d640268c98%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636766931638843783&sdata=Ox1tpl%2BJnhPz9imCFSqVX0Vi%2BSeP%2B6xdkc6cdZabFdM%3D&reserved=0>. 
>     >     > MEX completed successfully. 
>     >     > 
>     >     > Is mkoctfile dependent on the version of gcc? 
>     >     > If so, then I will try again after updating gcc. 
>     >     > 
>     >     > Arnold M. Evia, Ph.D. 
>     >     > Senior Research Associate 
>     >     > Department of Biomedical Engineering 
>     >     > Medical Imaging Research Center 
>     >     > Illinois Institute of Technology 
>     >     > http://www.iit.edu/~mri/ 
>     >    
>      <https://nam04.safelinks.protection.outlook.com/?url=http:%2F%2Fwww.iit.edu%2F~mri%2F&data=02%7C01%7C%7C9bbc52f66f2b4b02446108d640268c98%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636766931638843783&sdata=JhxZ6Y0BLpowwAZsauK6yOmJj%2FfMD2wWCPDUhPQYxvY%3D&reserved=0> 
>     >     > 
>     >     > 
>     >     > On Wed, Oct 31, 2018 at 7:37 AM Flandin, Guillaume 
>     >     <[log in to unmask] <mailto:[log in to unmask]> 
>     <mailto:[log in to unmask] <mailto:[log in to unmask]>> 
>     >     > <mailto:[log in to unmask] <mailto:[log in to unmask]> 
>     <mailto:[log in to unmask] <mailto:[log in to unmask]>>>> wrote: 
>     >     > 
>     >     >     Hi Arnold, 
>     >     > 
>     >     >     Thanks, we went down the same road with Melanni last week, 
>     >     and, while I 
>     >     >     am still trying to understand what the problem is (somehow 
>     >     related to 
>     >     >     memory alignment), the issue was disappearing if the MEX 
>     file were 
>     >     >     compiled from a terminal: 
>     >     >       mkoctfile --mex mat2file.c 
>     >     >     instead of invoking mex() within octave: 
>     >     >       mex mat2file.c 
>     >     >     It shouldn't make any difference (check the source code of 
>     >     mex.m) but 
>     >     >     apparently it does... I would be curious if you can 
>     reproduce 
>     >     the same 
>     >     >     phenomenon. 
>     >     > 
>     >     >     Best regards, 
>     >     >     Guillaume. 
>     >     > 
>     >     > 
>     >     >     On 30/10/2018 21:33, Arnold Evia wrote: 
>     >     >     > Hello Guillaume and Melanni, 
>     >     >     > 
>     >     >     > I am also having the same issue as Melanni using PALM 
>     in Ubuntu. 
>     >     >     > I tried the commands that you suggested, and got the 
>     same output 
>     >     >     as Melanni. 
>     >     >     > 
>     >     >     > After some debugging, I may have found a clue as to what's 
>     >     happening. 
>     >     >     > In mat2file.c, I placed a few print statements for some 
>     >     variables 
>     >     >     right before the error message (line 252): 
>     >     >     > 
>     >     >     >     printf("code = %d\n",map->dtype->code); 
>     >     >     >     printf("bits = %d\n",map->dtype->bits); 
>     >     >     >     printf("channels = %d\n",map->dtype->channels); 
>     >     >     > 
>     >     >     >     if (map->dtype == NULL)        
>     mexErrMsgTxt("Unrecognised 
>     >     >     'dtype' value."); 
>     >     >     >     if (map->dtype->bits % 8)      mexErrMsgTxt("Can 
>     not yet 
>     >     write 
>     >     >     logical data."); 
>     >     >     >     if (map->dtype->channels != 1) mexErrMsgTxt("Can 
>     not yet 
>     >     write 
>     >     >     complex data."); 
>     >     >     > 
>     >     >     > The program returned unusual numbers: 
>     >     >     > 
>     >     >     > code = 16 
>     >     >     > bits = 32726 
>     >     >     > channels = 7 
>     >     >     > Error using subsasgn>subfun 
>     >     >    
>     >    
>       ([log in to unmask]:168) 
>     >     >     > mat2file: Can not yet write logical data. 
>     >     >     > 
>     >     >     > Running the program again with the same parameters, 
>     values for 
>     >     >     code and channels stays constant, but the value for bits 
>     would 
>     >     change: 
>     >     >     > 
>     >     >     > code = 16 
>     >     >     > bits = 32696 
>     >     >     > channels = 7 
>     >     >     > Error using subsasgn>subfun 
>     >     >    
>     >    
>       ([log in to unmask]:168) 
>     >     >     > mat2file: Can not yet write complex data. 
>     >     >     > 
>     >     >     > As you can see, sometimes bits will be divisible by 8, 
>     and the 
>     >     >     program returns a different error. 
>     >     >     > There is a table in the script that defines the values 
>     for bits, 
>     >     >     and channels for a specific code. 
>     >     >     > In this case, bits should be 32, and channels should be 1. 
>     >     >     > I don't know why bits and channels are being set to 
>     incorrect 
>     >     >     values, and I hope this sheds some light. 
>     >     >     > 
>     >     >     > -Arnold Evia 
>     >     >     > 
>     >     > 
>     >     >     -- 
>     >     >     Guillaume Flandin, PhD 
>     >     >     Wellcome Centre for Human Neuroimaging 
>     >     >     UCL Queen Square Institute of Neurology 
>     >     >     London WC1N 3BG 
>     >     > 
>     > 
>     >     -- 
>     >     Guillaume Flandin, PhD 
>     >     Wellcome Centre for Human Neuroimaging 
>     >     UCL Queen Square Institute of Neurology 
>     >     London WC1N 3BG 
>     > 
>     > 
>     > 
>     ------------------------------------------------------------------------ 
>     > 
>     > To unsubscribe from the FSL list, click the following link: 
>     > https://www.jiscmail.ac.uk/cgi-bin/webadmin?SUBED1=FSL&A=1 
>     > 
>     <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.jiscmail.ac.uk%2Fcgi-bin%2Fwebadmin%3FSUBED1%3DFSL%26A%3D1&data=02%7C01%7C%7C9bbc52f66f2b4b02446108d640268c98%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636766931638843783&sdata=ks03dYN%2Bj1P45qMWUDiuI4h3JMCJzp8vk2Gpn3HWI9o%3D&reserved=0> 
>     > 
>     > 
>     > 
>     > 
>     ------------------------------------------------------------------------ 
>     > 
>     > To unsubscribe from the FSL list, click the following link: 
>     > https://www.jiscmail.ac.uk/cgi-bin/webadmin?SUBED1=FSL&A=1 
>     > 
>  
>     --  
>     Guillaume Flandin, PhD 
>     Wellcome Centre for Human Neuroimaging 
>     UCL Queen Square Institute of Neurology 
>     London WC1N 3BG 
>  
>     ######################################################################## 
>  
>     To unsubscribe from the FSL list, click the following link: 
>     https://www.jiscmail.ac.uk/cgi-bin/webadmin?SUBED1=FSL&A=1 
>  
>  
> ------------------------------------------------------------------------ 
>  
> To unsubscribe from the FSL list, click the following link: 
> https://www.jiscmail.ac.uk/cgi-bin/webadmin?SUBED1=FSL&A=1 
>  
 
--  
Guillaume Flandin, PhD 
Wellcome Centre for Human Neuroimaging 
UCL Queen Square Institute of Neurology 
London WC1N 3BG 
 
######################################################################## 
 
To unsubscribe from the FSL list, click the following link: 
https://www.jiscmail.ac.uk/cgi-bin/webadmin?SUBED1=FSL&A=1 

Top of Message | Previous Page | Permalink

JiscMail Tools


RSS Feeds and Sharing


Advanced Options


Archives

November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
2006
2005
2004
2003
2002
2001


JiscMail is a Jisc service.

View our service policies at https://www.jiscmail.ac.uk/policyandsecurity/ and Jisc's privacy policy at https://www.jisc.ac.uk/website/privacy-notice

Secured by F-Secure Anti-Virus CataList Email List Search Powered by the LISTSERV Email List Manager