Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
b631503
Fixed some stupid bugs. Thanks Mike for finding them! And also deprec…
rcwelsh Mar 23, 2012
e304fe7
initial skeleton of som_batch matlab wrapper
mangstad Mar 9, 2012
5670cef
added initial testing skeleton of som_batch_mc_central -- very prelim…
mangstad Mar 12, 2012
76d6140
incremental updates to both template and central -- still very prelim…
mangstad Mar 13, 2012
36d6c23
updated mc_central and mc_template
mangstad Mar 26, 2012
071aba3
fixed commenting
mangstad Mar 27, 2012
50a3638
Fixed small bug in writing of zmaps to local directory instead of par…
rcwelsh Mar 29, 2012
1e9e088
Merge remote-tracking branch 'rcwelsh/som_fixes' into som_batch
mangstad Mar 27, 2012
54677ed
fixed some typos/bugs
mangstad Mar 27, 2012
4e392f9
updated SOM_CreateMask to work with .nii images and SPM8
mangstad Mar 28, 2012
b2f9c82
bugfixes on SOM functions
mangstad Mar 28, 2012
b81a2e8
updated mc_central/mc_template - still just testing versions
mangstad Mar 28, 2012
4c55da0
Merge remote-tracking branch 'mike_verse/som_batch' into som_fixes
rcwelsh Mar 29, 2012
9afc994
getting som_mc_central ready to test matrix
mangstad Mar 29, 2012
53fa3b2
Fixed issues with SOM_PreProcessData that would have broken the conca…
rcwelsh Mar 29, 2012
eb76db8
Modification of the API, move .epi, .gray, .white, .csf into paramete…
rcwelsh Apr 3, 2012
7acb407
Added SOM_MakeGrid and fixed some small comments and output messages
rcwelsh Apr 4, 2012
20c8011
Fixed small bug when a person specifies an empty array for a masking …
rcwelsh Apr 6, 2012
66982ba
updated template
mangstad Apr 5, 2012
1a9b1ec
Merge remote-tracking branch 'rcwelsh/som_cleanup' into som_batch_test2
mangstad Apr 12, 2012
32b0812
updating template
mangstad Apr 12, 2012
96490b5
Merge remote-tracking branch 'heffjos/mc_GenPath_Template_stdize' int…
mangstad Apr 12, 2012
7602c2b
fixed typos in PreprocessFirstLevel_central
mangstad Apr 12, 2012
6b1190f
some more tweaks to template/central for som_batch
mangstad Apr 17, 2012
f067827
first release candidate of som_batch template and central
mangstad Apr 17, 2012
e85582a
added a quick function to get the bounding box from an image, pulled …
mangstad Apr 17, 2012
6cf5888
template / central in beta test state
mangstad Apr 23, 2012
0d46680
template update
mangstad Apr 24, 2012
b5b6694
quick format change for image output names
mangstad Apr 24, 2012
e0eecd7
fixed 124 in CheckDataStructure
mangstad May 8, 2012
a93ecb5
fixed clearing of parameters variable for each subject
mangstad May 17, 2012
41017c7
Fixed small bug with reading a header in SOM_CheckDataStructure.m and…
rcwelsh Jun 12, 2012
e21aa55
fixed bug in NumScan calculation for missing runs
mangstad Jul 3, 2012
dc0e9df
Merge remote-tracking branch 'github/rcwelsh/som_cleanup' into exp
dankessler Jul 12, 2012
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 30 additions & 7 deletions .deploy/DeploymentREADME
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,36 @@ degree of localization, as they usually don't know where they've been cloned to.
you'll find some scripts and hooks in this directory. Follow the following instructions to enable
this support.

1. Copy post-checkout to .git/hooks
2. If this clone is an active deployment (i.e. you expect users to copy templates out of this
directory before doing work on them, and it's very unlikely that commits will ever occur from this
clone), then touch a regular file named .local/deployment. This will influence the behavior of
deploy.sh which is called from the post-checkout hook.
If this is a development repository, consider running
setup_developer.sh. At present, this will just copy the hook from
.deploy/src/post-checkout to .git/hooks/.

That's it!
If this is a deployment repository, run setup_deployment.sh

This will
1. Add a remote called github/universe to point to the
UMPsychMethodsCore/MethodsCore repo on github
2. Copy the post-checkout hook up to where it will be active
3. Make a .local directory in your repo (this is ignored by a
.gitignore file)
4. Create a file called deployment in .local (this affects behavior of
the hook)
5. Generate a keypair for you in .local called deploy and deploy.pub
6. Create a file in .local called branch, and echo "public" into it

After you run this, you need to

1. Grab the content of .local/deploy.pub and add it as a deployment
key at Github.
2. Edit .local/branch to contain the content of the branch that you
want this repository to automatically update to
3. Run at regular intervals, or schedule with cron, the process
.deploy/src/self_update.sh which will automatically pull the latest
version of the file specified in .local/branch from universe, update
your working tree, and then run the hook to clean paths up for users.


###Here is what the hook does###

Once you've done this, you'll get the following behavior everytime you perform a checkout.

Expand All @@ -36,4 +59,4 @@ string "*_mc_template*". It will the loop over these files and do the following

This tool might get fancier in the future (e.g. strip off any leading comment characters in lines
that contain the search string described in 2 or 3 to give you more flexibility in your use of
wildcards, but for now this is all that is supported.
wildcards, but for now this is all that is supported.
11 changes: 0 additions & 11 deletions .deploy/post-checkout

This file was deleted.

23 changes: 23 additions & 0 deletions .deploy/setup_deployment.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/sh

thisdir=`dirname $0`


# Add universe remote
git remote add github/universe git@github.com:UMPsychMethodsCore/MethodsCore

# Copy hooks
cp $thisdir/src/post-checkout $thisdir/../.git/hooks


#Make .local directory if it doesn't exist, and add deployment
mkdir -p ${thisdir}/../.local

#Mark this as a deployment
touch $thisdir/../.local/deployment

#Add file to indicate which branch should be updated by self-checkout
echo public > $thisdir/../.local/branch

#Make keyfiles
ssh-keygen -f $thisdir/../.local/deploy -N ""
6 changes: 6 additions & 0 deletions .deploy/setup_developer.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh

thisdir=`dirname $0`

#Copy hooks
cp $thisdir/src/post-checkout $thisdir/../.git/hooks
1 change: 0 additions & 1 deletion .deploy/deploy.sh → .deploy/src/checkout.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#Grab Current Root
mcRoot=`pwd`

#Make sure .local directory exists
mkdir -p .local

#Identify Current Version
Expand Down
7 changes: 7 additions & 0 deletions .deploy/src/git_ssh.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh

thisdir=`dirname $0`

idfile=$thisdir/../../.local/deploy

ssh -i ${idfile} $@
7 changes: 7 additions & 0 deletions .deploy/src/post-checkout
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh
#

#Run your checkout script
if [ -f .deploy/src/checkout.sh ]; then
.deploy/src/checkout.sh
fi
21 changes: 21 additions & 0 deletions .deploy/src/self_update.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/sh



thisdir=`dirname $0`

origdir=`pwd`
cd $thisdir
harddir=`pwd`
cd $origdir

export GIT_SSH=${harddir}/git_ssh.sh

branch=`cat $thisdir/../../.local/branch`

git reset HEAD --hard

git pull github/universe $branch:$branch

git checkout $branch

4 changes: 2 additions & 2 deletions FirstLevel/PreprocessFirstLevel_central.m
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@
end
normsource = ['mean' b c];

ImageDirCheck = struct('Template',ImageTmeplate,...
ImageDirCheck = struct('Template',ImageTemplate,...
'mode','check');
ImageDir=mc_GenPath(ImageDirCheck);

Expand All @@ -559,7 +559,7 @@

%job{6}.spm.util.defs.comp{1}.def = {fullfile(subjdir,anatdir,['y_r' hires '.' imagetype])};

[HiResPath HiResName]=fileparts(HiResTemplate);
[HiResPath HiResName]=fileparts(HiresTemplate);

job{6}.spm.util.defs.comp{1}.def = {fullfile(HiResPath,['y_r' HiResName '.nii'])}; %%%Mike needs to check this
job{6}.spm.util.defs.fnames = wscan;
Expand Down
45 changes: 45 additions & 0 deletions matlabScripts/mc_Error.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
function mc_Error(errorString,varargin)
% A utility function to make error handling and logging more compact
% A single call to mc_Error will log the error to the global mc_LogName,
% bring up an error dialog box with your error message, and actually throw
% an exception with the Matlab error function.
%
% FORMAT mc_Error(errorString,other variable arguments)
%
% errorString This is a string message that will be displayed
% to the user. This can either be a simple string,
% or it can take the format of an sprintf
% formatting string using % format specifiers (see
% sprintf documentation for more information about
% these format strings).
%
% other variables If you are using the sprintf format string, you
% need to pass in the other variables that need to
% appear in the formatted string.
%
% EXAMPLES
% mc_Error('File does not exist.');
% mc_Error('File %s does not exist.',filename);
% mc_Error('File %s does not exist at path %s.',filename, folder);
% mc_Error('You specified %d images but I found %d.\nPlease double
% check subject %s folder %s for images.',NumScan(iRun),
% size(P,1),subjDir,RunDir{iRun});

if (~isempty(varargin))
formatcount = size(strfind(errorString,'%'),2);
if (formatcount == size(varargin,2))
errormsg = sprintf(errorString,varargin{:});
else
mc_Error('Found %d format specifiers but %d other variables were provided.\n\nError String: %s\n',formatcount,size(varargin,2),errorString);

end
else
errormsg = errorString;
end

%add future code to call mc_Logger with loglevel Error

errordlg(errormsg);
error(errormsg);


21 changes: 21 additions & 0 deletions matlabScripts/mc_GetBoundingBox.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function bb = mc_GetBoundingBox(V)
% world-bb -- get bounding box in world (mm) coordinates

d = V.dim(1:3);
% corners in voxel-space
c = [ 1 1 1 1
1 1 d(3) 1
1 d(2) 1 1
1 d(2) d(3) 1
d(1) 1 1 1
d(1) 1 d(3) 1
d(1) d(2) 1 1
d(1) d(2) d(3) 1 ]';
% corners in world-space
tc = V.mat(1:3,1:4)*c;

% bounding box (world) min and max
mn = min(tc,[],2)';
mx = max(tc,[],2)';
bb = [mn; mx];
8 changes: 4 additions & 4 deletions som/SOM_CalculateCorrelationImages.m
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
results = [];

rMap = zeros(size(D0,1),1);
rMapVol = zeros(parameters.maskHdr.dim(1:3));
rMapVol = zeros(parameters.maskHdr.dim(1:3)); %this fails if user specified no masking %% This should now be fixed with change in SOM_PreProcessData - 2012-03-29 - RCWelsh

for iROI = 1 : parameters.rois.nroisRequested

Expand Down Expand Up @@ -63,7 +63,7 @@

clear rMapHdr;

rMapHdr.fname = fullfile(parameters.Output.directory,sprintf('rmap_%s_%03d.nii',parameters.Output.name,iROI));
rMapHdr.fname = fullfile(parameters.Output.directory,sprintf('rmap_%s_%04d.nii',parameters.Output.name,iROI));
rMapHdr.mat = parameters.maskHdr.mat;

% Make sure we write out float32.....
Expand All @@ -75,7 +75,7 @@
% Now the probability map.

pMapHdr = rMapHdr;
pMapHdr.fname = fullfile(parameters.Output.directory,sprintf('pmap_%s_%03d.nii',parameters.Output.name,iROI));
pMapHdr.fname = fullfile(parameters.Output.directory,sprintf('pmap_%s_%04d.nii',parameters.Output.name,iROI));

spm_write_vol(rMapHdr,rMapVol);
spm_write_vol(pMapHdr,pMapVol);
Expand All @@ -85,7 +85,7 @@
if exist(rMapHdr.fname) == 2
clear Vo
Vi = spm_vol(rMapHdr.fname);
Vo.fname = sprintf('zmap_%s_%03d.nii',parameters.Output.name,iROI);
Vo.fname = fullfile(parameters.Output.directory,sprintf('zmap_%s_%04d.nii',parameters.Output.name,iROI));
Vo.mat = Vi.mat;
Vo.dim = Vi.dim;
Vo.dt = [16 0];
Expand Down
109 changes: 0 additions & 109 deletions som/SOM_CalculateCorrelationImagesSlow.m

This file was deleted.

Loading