[Freesurfer] deployed (compiled) MATLAB scripts path manipulation

2014-10-09 Thread slehar
I have been following the directions on this site to deploy (compile) my
MATLAB script so as to be able to run it on launchpad without worrying
about MATLAB licenses.

https://nmr.mgh.harvard.edu/martinos/itgroup/deploytool.html

They say that the deployed script cannot do path manipulations such as
addpath() or path(path,xxx), so the script should use isdeployed to make
sure that such path commands are only executed if isdeployed == 0.


% Only add path if not deployed
if isdeployed==0;
  addpath ~nummenma/matlab/work/connectome/HCP_preproc_tools;
end

but then I need to add the path back in again so it can access the
functions on that path. In the deploytool GUI I click Settings (the little
gear icon), and in the upper window Additional Parameters passed to MCC:
I inserted

==[ Additional Parameters passed to MCC: ]==
-I ~nummenma/matlab/work/connectome/HCP_preproc_tools
mris_gradient_nonlin__unwarp_volume__batchmode_HCPS.m


(A web site I found said you need a path to the m-file itself, not just to
the directory that contains it, and you separate the path and file)

Then I found I had to circumvent more path(path,xxx) commands in my
startup.m file too

==[ startup.m ]==
% If script is not deployed add paths
if isdeployed==0;
  % FreeSurfer -%
  fshome = getenv('FREESURFER_HOME');
  fsmatlab = sprintf('%s/matlab',fshome);
  if (exist(fsmatlab) == 7)
  path(path,fsmatlab);
  end
  clear fshome fsmatlab;
  %-%

  % FreeSurfer FAST %
  fsfasthome = getenv('FSFAST_HOME');
  fsfasttoolbox = sprintf('%s/toolbox',fsfasthome);
  if (exist(fsfasttoolbox) == 7)
  path(path,fsfasttoolbox);
  end
  clear fsfasthome fsfasttoolbox;
  %-%
end
=

Now at least it compiles without error. But when I run it I get this:

Set up FreeSurfer environment
 freesurfer-Linux-centos6_x86_64-stable-v5.3.0-20130514 
Setting up environment for FreeSurfer/FS-FAST (and FSL)
FREESURFER_HOME   /usr/local/freesurfer/stable5_3_0
FSFAST_HOME   /usr/local/freesurfer/stable5_3_0/fsfast
FSF_OUTPUT_FORMAT nii.gz
SUBJECTS_DIR  /space/ficus/4/users/SNEF_subjects
MNI_DIR   /usr/local/freesurfer/stable5_3_0/mni
FSL_DIR   /usr/pubsw/packages/fsl/current
./run_unwarpone.sh
/cluster/matlab/8.2
/space/ficus/4/users/SLOTS_sessions_Step/SLOTS010/aahscout/001/001.mgz
/space/ficus/4/users/SLOTS_sessions_unwarp/SLOTS010/aahscout/001/001.mgz
/space/ficus/4/users/SLOTS_sessions_Step/SLOTS010/unwarpscout001.log
--
Setting up environment variables
---
LD_LIBRARY_PATH is
.:/cluster/matlab/8.2/runtime/glnxa64:/cluster/matlab/8.2/bin/glnxa64:/cluster/matlab/8.2/sys/os/glnxa64
The file
   '/usr/local/freesurfer/stable5_3_0/matlab/load_nifti.m'
   is not in the application's expanded CTF archive at
'/homes/6/slehar/.mcrCache8.2/unwarp2'.
This is typically caused by calls to ADDPATH in your startup.m or
matlabrc.m files. Please see the compiler documentation and use the
ISDEPLOYED function to ensure ADDPATH commands are not executed by
deployed applications.
An error occurred while trying to determine whether load_nifti is a
function name.

MATLAB:err_while_looking_up_function
Error:An error occurred while trying to determine whether load_nifti is
a function name.
Error:Error in mclFreeStackTrace.

Any idea what the problem is now? load_nifti is presumably a FreeSurfer
function -- do I now have a problem with my paths to FreeSurfer? I
searched my script code and found no explicit call to load_nifti, I
presume that is called deep inside some other function. Should I add the
FreeSurfer paths also through the deploytool GUI and not call nmrenv?

(from my .cshrc file...
alias nmrenv 'source /usr/local/freesurfer/nmr-stable53-env'
)

___
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] Defacing with mri_deface

2013-05-29 Thread slehar
The script mri_deface which is called by recon-all with the -deface flag,
requires the existence of two files

/usr/local/freesurfer/stable5/average/face.gca
/usr/local/freesurfer/stable5/average/talairach_mixed_with_skull.gca

The former exists where it should, the latter does not exist at that
location, although it can be downloaded from

  http://surfer.nmr.mgh.harvard.edu/fswiki/MiscellaneousDownloads

and gunzipped. When I copy it into a directory and call mri_deface
directly, it works OK because it can find that image locally. But when I
call recon-all with the -deface flag, it looks for the file where it does
not exist, i.e.

/usr/local/freesurfer/stable5/average/talairach_mixed_with_skull.gca

Could someone with the appropriate permissions please copy that file to
where recon-all expects to find it?

Second question: If I call recon-all with the -deface flag, does it deface
ALL the images in my SUBJECTS_DIR/$subjid/mri directory, or does it only
deface a copy of orig.mgz to orig_defaced.mgz?


___
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.