[Freesurfer] gunzip error in load_mgh.m when file path contains spaces

2024-04-17 Thread Tyler Slouf
External Email - Use Caution

Hello FreeSurfer Developers,

I found what I believe to be a bug. Typically I can load mgz files into my 
Matlab program without any trouble. 
But if the path containing the mgz file has a space then I get an error.

When I run this very short script in Matlab calling the MRIread function 
(/Applications/freesurfer/7.4.1/matlab/MRIread.m):

filepath = char("/Users/user/Documents/folder space test/data/mri.mgz");
mri = MRIread(filepath);

I get the following error:

gunzip: can't stat: /Users/user/Documents/folder 
(/Users/user/Documents/folder.gz): No such file or directory
gunzip: can't stat: space (space.gz): No such file or directory
gunzip: can't stat: test/data/mri.mgz (test/data/mri.mgz.gz): No such file or 
directory

ERROR: problem reading fname
SWITCH expression must be a scalar or a character vector.

Error in load_mgh (line 163)
switch type

Error in MRIread (line 90)
[mri.vol, M, mr_parms, volsz] = load_mgh(fspec,[],[],headeronly);

Error in test_load_mgz (line 2)
mri = MRIread(filepath);

I traced this down to the function load_mgh.m 
(/Applications/freesurfer/7.4.1/matlab/load_mgh.m) where a file path string 
(char array) is dynamically populated with randomly generated folder names to 
unzip into. 
It's about line 69 and looks like this:
[status,msg] = unix(sprintf('gunzip -c %s > %s', fname, new_fname));

You may notice that potential spaces in the path names fname and new_fname are 
not escaped with single quotes. 
I edited the file to escape the parameterized strings like so:
[status,msg] = unix(sprintf("gunzip -c '%s' > '%s'", fname, new_fname));

This solved the problem for me.

Computer details:
OS: MacOS Sonoma (latest)
Chipset: Apple M1 (aarch64)
Calling Program: Matlab R2023b
Freesurfer: 7.4.1

Thank you for your time.

Sincerely,
Tyler Slouf___
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 Mass General Brigham 
Compliance HelpLine at https://www.massgeneralbrigham.org/complianceline 
 .
Please note that this e-mail is not secure (encrypted).  If you do not wish to 
continue communication over unencrypted e-mail, please notify the sender of 
this message immediately.  Continuing to send or respond to e-mail after 
receiving this message means you understand and accept this risk and wish to 
continue to communicate over unencrypted e-mail. 


Re: [Freesurfer] MRInormFindControlPoints

2024-04-17 Thread Fischl, Bruce R.,PHD
Hi Shahar

Can you look at the input to that step? Usually it means something prior has 
gone wrong (like the skull stripping remove the entire brain or something). And 
maybe post a couple of images of the processing (the orig.mgz, the T1.mgz, the 
brainmask.mgz, …)

Cheers
Bruce

From: freesurfer-boun...@nmr.mgh.harvard.edu 
 On Behalf Of Shahar Ben Noun
Sent: Wednesday, April 17, 2024 7:41 AM
To: Freesurfer@nmr.mgh.harvard.edu
Subject: [Freesurfer] MRInormFindControlPoints


External Email - Use Caution
Dear freesurfer team,

I am attempting to use freesurfer using fmriprep but I get the following error 
message:

error: No such file or directory
error: MRInormFindControlPoints: could not find enough control points
error: No such file or directory
error: MRInormFindControlPoints failed

I've searched the archive but couldn't find a solution.
Does anyone have any thoughts on how to trouble-shoot this one?

Also, I've attached the recon-all.log in case it's of any use.

1) FreeSurfer version: freesurfer-linux-ubuntu20_x86_64-7.3.2-20220804-6354275
2) Platform: Linux
3) PlatformVersion: 5.4.0-159-generic

#176-Ubuntu SMP Mon Aug 14 12:04:20 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Tue Apr 16 13:13:35 IDT 2024

4) recon-all.log: see attached

Best regards,
Shahar


___
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 Mass General Brigham 
Compliance HelpLine at https://www.massgeneralbrigham.org/complianceline 
 .
Please note that this e-mail is not secure (encrypted).  If you do not wish to 
continue communication over unencrypted e-mail, please notify the sender of 
this message immediately.  Continuing to send or respond to e-mail after 
receiving this message means you understand and accept this risk and wish to 
continue to communicate over unencrypted e-mail. 


Re: [Freesurfer] Freeview problems

2024-04-17 Thread fsbuild
External Email - Use Caution

You can check the post (quoted below) to verify the setup for the 7.4..1 
release.  Instead of running the freeview command as listed in the post, 
you can run the mri_info command with no arguments to get the help info about 
the command line options. If mri_diff runs and prints out the help 
output, then the issue is likely your command line arguments.
- R..
bash-3.2$ mri_info
USAGE: mri_info fname1 fname2 options

 --conformed : print whether a volume is conformed stdout
 --conformed-to-min : print whether a volume is conformed-to-min 
stdout
 rest of output deleted

SETUP ENVIRONMENT
https://secure-web.cisco.com/1-xQ9e5Z3VTlXilKkcSpNfmxzfXMzCk-PG0p40zknkFsd-OPflitvKnVBlbPqmZOOFVb9VAQ0M1PT82eJ-TQA5l5vXu3cxmiGQ_qMXFYiU6W_jXNSmGaqA3RbGU1beyO26DOuGjlunX7l_t7p3sBnlGCA8WPnPy5fmpsoKV4dY4ITrs3S59UCZ3IberbbCAyXNGPIhR261f_R6V7uFYU-YpjHa3r0hv9PElrVro7lKsGm-JNW6TmXBe6o5armcI5hCwbyu-rAezm9TjIL9J1eeRnkdiZvqDGt6oWMD0j9ILzFiiHj3UZbJHfsC8hr3mZDxdqSJlibJW8p2rTBT4emBQ/https%3A%2F%2Fwww.mail-archive.com%2Ffreesurfer%40nmr.mgh.harvard.edu%2Fmsg76743.html

If you setup the Freesurfer environment ... here using bash and not zsh ...
hostname ~ bash
$ export FREESURFER_HOME=/Applications/freesurfer/7.4.1$source 
$FREESURFER_HOME/SetUpFreeSurfer.shfreesurfer-macOS-darwin_x86_64-7.4.1-20230614-7eb8460
 Setting up environment for FreeSurfer/FS-FAST (and 
FSL)FREESURFER_HOME /Applications/freesurfer/7.4.1FSFAST_HOME 
  /Applications/freesurfer/7.4.1/fsfastFSF_OUTPUT_FORMAT 
nii.gzSUBJECTS_DIR   
/Applications/freesurfer/7.4.1/subjectsMNI_DIR
 /Applications/freesurfer/7.4.1/mni
 and point FS_LICENSE to your license.txt file, e.g., in your $HOME 
directory 
$ cd$ pwd/Users/myuserid$ ls license.txtlicense.txt$ export 
FS_LICENSE=license.txt$ head -1 license.txt...@somewhere.com  
email you used to register
 then try running from the command line ...
$ freeview$SUBJECTS_DIR/bert/mri/T1.mgz
Please keep in mind you will need to change SUBJECTS_DIR to some other path, 
e.g., $HOME/subjects
$ mkdir -p $HOME/subjects$ export SUBJECTS_DIR=$HOME/subjects
 and put files there if you want to write /modify subject files and data 
since /Applications/freesurfer/7.4.1/subjects is read only by default (not 
intended to be used to write data).
___
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 Mass General Brigham 
Compliance HelpLine at https://www.massgeneralbrigham.org/complianceline 
 .
Please note that this e-mail is not secure (encrypted).  If you do not wish to 
continue communication over unencrypted e-mail, please notify the sender of 
this message immediately.  Continuing to send or respond to e-mail after 
receiving this message means you understand and accept this risk and wish to 
continue to communicate over unencrypted e-mail. 


Re: [Freesurfer] Freeview problems

2024-04-17 Thread Savoia, Alice (Stud. FPN)
External Email - Use Caution

The thing is that I am specifying the image. I am using the latest version of 
freesurfer

Inviato da Outlook per 
Android

From: freesurfer-boun...@nmr.mgh.harvard.edu 
 on behalf of Huang, Yujing 

Sent: Monday, April 15, 2024 5:27:35 PM
To: Freesurfer support list 
Subject: Re: [Freesurfer] Freeview problems


I don’t think you pass the arguments correctly to mri_info. You need to specify 
an input image – ‘mri_info input.mgz --voxel 0 0 0’.



This should be done after you have sourced Freesurfer environment correctly. 
Here are the instructions to setup your environment on Mac 
https://secure-web.cisco.com/1rDKNPfMnebEaPcslhVYc4x92ni2r-ZJVCYbzp7uAEUT-O0YTBClVlYZf0bHYMegbIlGHWaTIdnfTJ42kdx-8UKR_HIGpdFRxAmDuSl7tkkBbXHeD9iEISP8SYN9uLpCgJI5uXtjejWvgnCrZvqkFIrkSuIpD81J0gSUEp3DSBhDTc97ropCSJd3bR3T35KTGXjnLVjmieSllKI66mLpk7szdHpYmUpLZKWBMXKjfxT9AfO6yg2gh2WiQql7AVXjLNLH9JftKI_kPbHrnatXGyQ2VhI0Pu8xuE47UpXhcfQQMlTTEbLeuSfOry1ftLKNNC2SNGqguPewxh5hKzqAimw/https%3A%2F%2Fsurfer.nmr.mgh.harvard.edu%2Ffswiki%2FSetupConfiguration_Mac



Also, which version of Freesurfer you are using?



Best,



Yujing



From: freesurfer-boun...@nmr.mgh.harvard.edu 
 On Behalf Of Savoia, Alice (Stud. FPN)
Sent: Monday, April 15, 2024 11:12 AM
To: Freesurfer support list 
Subject: Re: [Freesurfer] Freeview problems



External Email - Use Caution

Ok I tried again and when I inserted the mri_info... the output was "mri_info: 
could not parse extension from 0"



From: 
freesurfer-boun...@nmr.mgh.harvard.edu
 
mailto:freesurfer-boun...@nmr.mgh.harvard.edu>>
 on behalf of Huang, Yujing 
mailto:yhuan...@mgh.harvard.edu>>
Sent: Monday, April 15, 2024 4:44 PM
To: Freesurfer support list 
mailto:freesurfer@nmr.mgh.harvard.edu>>
Subject: Re: [Freesurfer] Freeview problems



Can you try ‘mri_info  --voxel 0 0 0’?   Just wanted to make sure 
the license file is read properly.



Best,



Yujing



From: 
freesurfer-boun...@nmr.mgh.harvard.edu
 
mailto:freesurfer-boun...@nmr.mgh.harvard.edu>>
 On Behalf Of Savoia, Alice (Stud. FPN)
Sent: Monday, April 15, 2024 10:42 AM
To: Freesurfer support list 
mailto:freesurfer@nmr.mgh.harvard.edu>>
Subject: Re: [Freesurfer] Freeview problems



External Email - Use Caution

Is in the freesurfer directory



From: 
freesurfer-boun...@nmr.mgh.harvard.edu
 
mailto:freesurfer-boun...@nmr.mgh.harvard.edu>>
 on behalf of Wang, Ruopeng 
mailto:rwa...@mgh.harvard.edu>>
Sent: Monday, April 15, 2024 4:40 PM
To: Freesurfer support list 
mailto:freesurfer@nmr.mgh.harvard.edu>>
Subject: Re: [Freesurfer] Freeview problems



Can you confirm where your license file is?



Ruopeng



On Apr 15, 2024, at 10:36 AM, Savoia, Alice (Stud. FPN) 
mailto:a.sav...@student.maastrichtuniversity.nl>>
 wrote:



External Email - Use Caution

To whom it may concern,

I am using freesurfer package on a MacBook Pro (macOS Sonoma, Version 14.1), 
but freeview shuts down immediately when I try to open any file. The license is 
in the correct place.

Thank you for your help,

Best regards.

___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
MailScanner has detected a possible fraud attempt from "secure-web.cisco.com" 
claiming to be 
https://secure-web.cisco.com/1XiK9iIDyiyxnVIxS_tbwQMQmXBqvWqTREAzVFiEqbHPRrjfqPBEIvgRJuVPdpVAD_ksCh5VbDuNzKCTvX52qCzBvZmyCdI7ll-7PrUSqsIgDPHwFhAFaiA9gzKzA0MjHU2fSPXoa2C5z1k2SASI1z6pT7CCYbjjgHaz21CRbtS05HcS3up9A_9XokIKmI4vK_C_frsX5fwKHjddmYFR5FUHDQ_gEfojLeUw_7NSgyjnBKiZ07BZsMdIkz1XMksq4PMGF0a1FAzTfX1gFogKvqNb0jtbBV3j8evg4VeC2RF4_pjNRsXp2JRDoad0LzX1mbKgO9Yc8DF9byYp7tvf8Dg/https%3A%2F%2Fmail.nmr.mgh.harvard.edu%2Fmailman%2Flistinfo%2Ffreesurfer


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