Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix regarding expected behavior of diff when finding image size #3

Open
wants to merge 501 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
501 commits
Select commit Hold shift + click to select a range
d21702c
indentation fix
Aug 16, 2016
4e1ccd9
unified vocabulary
Aug 16, 2016
065c18c
Merge pull request #183 from noahbenson/master
JWinawer Aug 16, 2016
17b3604
added a helpful error message if the system call to mri_convert fails
Aug 16, 2016
93e0a1d
added a helpful error message if the RdtClient function is not found
Aug 16, 2016
2382173
test script and function to update published tutorials
elinekupers Aug 16, 2016
c9213fd
fix typo
elinekupers Aug 16, 2016
00bcf46
add real tutorials to publish list
elinekupers Aug 16, 2016
541f0b1
removed unneeded files from publishing tutorials
JWinawer Aug 17, 2016
2f84b6e
cleaned up ernie tutorials
JWinawer Aug 17, 2016
0a29d25
new tutorial on slice timing
JWinawer Aug 17, 2016
7cbb2f1
A tutorial for reading in/plotting the Benson et al. (2014) retinotop…
Aug 17, 2016
0fd03c9
Merge pull request #184 from noahbenson/master
JWinawer Aug 17, 2016
d4e313b
Fixed a minor bug in which a bash shell is launched non-interactively…
Aug 17, 2016
23f1d22
Fixed a typo
Aug 17, 2016
a33495a
edited parameters
Aug 17, 2016
0c90833
renamed to something more intuitive
Aug 17, 2016
b42e7ac
Merge pull request #187 from noahbenson/master
JWinawer Aug 17, 2016
5ebbdd5
Merge branch 'master' into nicrop
wandell Aug 19, 2016
3693441
Comments and a little coding clarity on niftiView and niftiWrite
wandell Aug 20, 2016
67635c5
Added possibility of reading a .nii.gz file when only the base name i…
wandell Aug 20, 2016
3e0e170
Unnecessary file
wandell Aug 20, 2016
a958eef
Working on reading and writing tck files directly from disk into FG g…
francopestilli Aug 30, 2016
3dfcfcb
ENH: Added direct load of MRTRIX streamlines from disk on file (from …
francopestilli Aug 30, 2016
9c02f4e
ENH: removed parameters field from fgExtract.m might affect Quench be…
francopestilli Aug 30, 2016
5686733
ENH: fgExtract had some conflicts. Trying to resolve so to be abel to…
francopestilli Sep 1, 2016
8639a23
Merge pull request #195 from vistalab/read_write_tck
francopestilli Sep 1, 2016
3c19af5
Merge pull request #173 from vistalab/guimatlab2015
francopestilli Sep 1, 2016
182893d
Merge pull request #190 from vistalab/nicrop
wandell Sep 1, 2016
741ecec
new tutorial for making meshes from freesurfer
JWinawer Sep 14, 2016
60c9231
update freesurfer mesh tutorial to do visualization in matlab in addi…
JWinawer Sep 14, 2016
1b34514
Removed jsonlab
wandell Sep 16, 2016
5702636
Fix minor bug: strcmp command checking that the file is a nifti file
rosemary-le Sep 17, 2016
ec56ca5
Merge pull request #199 from rosemary-le/master
rosemary-le Sep 17, 2016
97ca072
Fix rmPlotCoverage to handle the case of plotting coverage of an ROI …
rosemary-le Sep 17, 2016
684a39e
Merge pull request #200 from rosemary-le/master
rosemary-le Sep 17, 2016
15f364c
Add feature to polarPlot.m and minor cleanup
rosemary-le Sep 18, 2016
0759716
Merge pull request #201 from rosemary-le/master
rosemary-le Sep 18, 2016
a3b3546
change in comments
JWinawer Sep 19, 2016
624be56
cleaned up syntax
JWinawer Sep 19, 2016
fddae69
new average tseries tutorial, as well as updates to motion correction…
JWinawer Sep 19, 2016
c1754bd
make mrvNewGraphWin consistent with newGraphWin by defining the globa…
JWinawer Sep 26, 2016
1ec9a9b
Merge branch 'master' of https://github.com/vistalab/vistasoft
JWinawer Sep 26, 2016
c924b6c
added ernie pRF tutorials
JWinawer Sep 26, 2016
2b00cdc
bug fix in converting freesurfer ribbon to nifti
JWinawer Oct 12, 2016
e4ce55b
Start of a method to convert fg data into tracts that can be visualiz…
wandell Oct 17, 2016
9b59f9e
Edited comments at the head. Still stuff left to do.
wandell Oct 17, 2016
f878845
Added color parameter
wandell Oct 17, 2016
ba9e36e
Added comments to the header
wandell Oct 23, 2016
4d4b862
Added ability for nitfiView to show one slice.
wandell Oct 24, 2016
3574507
Minor comments and fixes
wandell Oct 24, 2016
df558a8
fg2MNIObj allows visualization of fiber tracts in a browser (for Flyw…
wandell Oct 25, 2016
8832473
Comments in dwiGet/dwiPlot. Also returned estimated ADC in dwiPlot()…
wandell Oct 26, 2016
27e16d6
Handling multiple coordinate cases properly for dwiQ and dwiGet.
wandell Oct 27, 2016
e90fc00
Fix bug. Edge case when we bootstrap only once
rosemary-le Oct 27, 2016
a8394c3
Merge pull request #207 from rosemary-le/master
rosemary-le Oct 27, 2016
5e92f77
Added get a mean b=0 image
wandell Oct 28, 2016
ae0708b
Merge branch 'master' of https://github.com/vistalab/vistasoft
wandell Oct 28, 2016
8506f26
Made symbols thicker
wandell Oct 28, 2016
dfc01ba
Removed the if statement that checked if fh = mrvNewGraphWin is a str…
rosemary-le Oct 31, 2016
3626814
Add niftiMerge.m, a function that takes in a list of niftis and retur…
Nov 10, 2016
eb2c53a
Merge pull request #209 from rosemary-le/master
rosemary-le Nov 11, 2016
1666471
Add isgraphics() to check the output of mrvNewGraphWin in the dtiChec…
Nov 11, 2016
3ead303
Add the option s0image back into dwiGet. s0image is synonymous with t…
Nov 13, 2016
5d8ef9b
Merge pull request #210 from rosemary-le/master
rosemary-le Nov 13, 2016
0d7e1a6
Updated the gifti reader. Still not working, though. Perhaps becaus…
wandell Nov 15, 2016
25bea42
Added comments. No code changed
wandell Nov 16, 2016
cdccb95
various bug fixes and new tutorial
JWinawer Nov 18, 2016
1f11d92
Merge branch 'master' into jonTutorials
JWinawer Nov 21, 2016
a7d34ae
change fuction minmax to mrvMinmax to avoid conflict with matlab func…
JWinawer Nov 30, 2016
67dd10c
Merge branch 'master' into jonTutorials
JWinawer Nov 30, 2016
0293a4f
Comments
wandell Dec 3, 2016
8e6c13d
Eliminate <OLD GLM> and <OLD Contrasts> from GLM menu bar
JWinawer Dec 3, 2016
fb5e088
Merge branch 'master' of https://github.com/vistalab/vistasoft into j…
JWinawer Dec 3, 2016
a45dee4
replace dataDir with dFolder since dataDir is used as a variable but …
JWinawer Dec 3, 2016
31a5adb
Eliminate <OLD GLM> and <OLD Contrasts> from GLM menu bar
JWinawer Dec 3, 2016
4ee8d84
Merge branch 'master' into jonTutorials
JWinawer Dec 4, 2016
bedcfde
add compatibility to load niftis as parameter maps in gray view
JWinawer Dec 4, 2016
75077e9
bug fix for case when ROIs is a vector of integers
JWinawer Dec 4, 2016
8c9d951
fix export of volumetric data as niftis
JWinawer Dec 4, 2016
6571321
fix export of volumetric data as niftis
JWinawer Dec 4, 2016
df20119
show colorbar for map view even range is undefined. otherwise we lose…
JWinawer Dec 4, 2016
f6f354c
tutorial update
JWinawer Dec 4, 2016
1f9d065
tutorial update
JWinawer Dec 4, 2016
88d0b36
revert
JWinawer Dec 5, 2016
f8c0e7d
clean up tutorial
JWinawer Dec 5, 2016
d8c5a35
Merge pull request #214 from vistalab/jonTutorials
JWinawer Dec 5, 2016
e3d819c
bug fixes
JWinawer Dec 29, 2016
2ed0fb5
Updated to the newer (faster) jsonlab code. Supposed to be backwards…
wandell Dec 30, 2016
b80f5e2
Continued update of jsonlab
wandell Dec 30, 2016
33be3c2
clean up the figure windows at end of atlas tutorial
JWinawer Jan 23, 2017
924519b
updates to get nifti datatype from niftiGet rather than writing it in…
JWinawer Jan 23, 2017
e826e0d
Change niftiWrite so that it is a wrapper to the mex file writeFileNifti
JWinawer Jan 24, 2017
8298abc
eliminate the call to add dataType field to niftiStruct. This value i…
JWinawer Jan 24, 2017
ca5cac7
Merge pull request #218 from vistalab/nifti
JWinawer Jan 28, 2017
fcfb29f
Return files in a cell array regarless of length.
lmperry Feb 3, 2017
2a4db22
RF and BW jittering colors and converting to MNI OBJ format in the ne…
wandell Feb 17, 2017
5ae000b
fix jitter
Feb 17, 2017
348d281
fixed the correction factor relating the computation of mean squared …
JWinawer Mar 1, 2017
2f58ea9
new validation test to ensure that nifti export works properly
JWinawer Mar 3, 2017
71c7323
First draft, not tested, of rendering multiple fiber groups as MNI OB…
wandell Mar 7, 2017
a40501a
Added subsample to make the file size reasonable for Flywheel
wandell Mar 7, 2017
d3d8eb9
nice choice of 20 color samples. This routine will evolve
wandell Mar 8, 2017
f4e65e1
The fg2MNIObj now handles the fg array
wandell Mar 8, 2017
fa3a89b
use viewGet and viewSet rather than directly reading and writing to v…
JWinawer Mar 21, 2017
7a37e39
exit without error if subject selects cancel in dialog box
JWinawer Mar 21, 2017
6a2703a
account for possibilty that ROI name does not include .mat extension
JWinawer Mar 21, 2017
3f1b7c7
remove obsoletedocstring
Mar 31, 2017
c4fde0c
Fix loadParameterMap.m so that the UI displays correctly when a nifti…
rosemary-le Apr 17, 2017
f232512
Merge pull request #225 from rosemary-le/master
JWinawer Apr 17, 2017
2129845
minor change to comments
JWinawer Apr 23, 2017
a411a68
update to earlist level of Matlab supported, now up to 9.1.1
JWinawer Apr 23, 2017
d62435a
Added comments that specified ROI drawing options
rosemary-le Apr 24, 2017
b943ff0
Merge pull request #228 from rosemary-le/master
rosemary-le Apr 24, 2017
007284b
Update README.md
JWinawer Apr 25, 2017
3217f17
ENH: Improved 3D figure handling. Fixed bug for which if 3D figure ha…
francopestilli Apr 25, 2017
9c3e3f5
Changes that will compile readFileNifti default to requiring gz suppo…
j-ales Apr 26, 2017
9e1e02d
updated mex function for 64 bit mac readFileNifti
JWinawer Apr 26, 2017
42901be
Merge branch 'readFileNiftiGzSupportFix' of https://github.com/vistal…
JWinawer Apr 26, 2017
3ecc63b
Added some comments explaining using options in mrvCompile
j-ales Apr 27, 2017
608120f
changed the function call <display> to <disp> at Matlabs suggestion
JWinawer Apr 27, 2017
80f58c0
minor syntax fixes
JWinawer Apr 27, 2017
2e8e3d4
minor fixt to mrInit: make sure func.name is defined in the case that…
JWinawer Apr 27, 2017
b33c97c
fix to viewGetVolume: when parameter classFile is called without a he…
JWinawer Apr 27, 2017
dac1e84
recompiled the mexmaci64 version of writeFileNifti for compatibility …
JWinawer Apr 27, 2017
003fcd2
mrFlatMesh still needs this - can we make it a warning rather than di…
wadelab Apr 27, 2017
b259194
I think this was just a bug - the point of isfield is that you don't …
wadelab Apr 27, 2017
35a4f10
Slight tweaks to deal with matlab's stricter type checking on ui elem…
wadelab Apr 27, 2017
ba82e71
Comments corrected in niftiRead.
wandell Apr 28, 2017
237b82b
Exit gracefully (issue a warning instead of an error message) when us…
rosemary-le Apr 28, 2017
702c115
Merge pull request #232 from rosemary-le/master
rosemary-le Apr 28, 2017
c56ceb8
dtiInit will now write out a scan to scan motion file
jyeatman May 12, 2017
8541e80
Merge pull request #234 from jyeatman/motioncheck
jyeatman May 16, 2017
8e27a8b
dwiGet for adcdataimage needed to account for the case when there are…
wandell May 28, 2017
36dee91
Comments mainly, though I added a small utility (wmCreate) to create …
wandell May 28, 2017
1cae7ec
Added a new file to export fibers to MRTRIX format
francopestilli Jun 9, 2017
5580c32
Added option to save to disk a .tck (mrtrix) file.
francopestilli Jun 9, 2017
66c8848
One function using nifti ROIs in endpoint to segment tract
htakemur Jun 13, 2017
ab9db03
Minor changes in variable names, and add more documentation
htakemur Jun 13, 2017
441e846
freesurfer updates for compatibility with freesurfer 6
JWinawer Jun 21, 2017
1a44b5e
Made change for nearpoints to compile
wandell Jun 21, 2017
a03d86d
Merge pull request #237 from vistalab/nifti_fg
htakemur Jun 25, 2017
0cdc3d8
Update dtiExportFibersMrtrix.m
kitchell Jun 29, 2017
ef01c72
Merge pull request #243 from kitchell/master
francopestilli Jun 29, 2017
41734ca
update dtiExportFibersMrtrix
kitchell Jun 29, 2017
44a0732
Merge pull request #244 from kitchell/patch-1
francopestilli Jul 11, 2017
bdbbd83
ENH: Added option to pimport MRTrix fibers directly from the menu: Fi…
francopestilli Jul 11, 2017
dcc2387
Robustness for .tck files with corrupted header
francopestilli Jul 12, 2017
0138365
Added option to save TrckVis format
francopestilli Jul 12, 2017
9861e05
Merge pull request #236 from vistalab/francopestilli-write-tck
francopestilli Jul 12, 2017
2ff0778
Merge pull request #249 from vistalab/fgRead_TRK
francopestilli Jul 12, 2017
66b1c14
updated mrtInstallSampleData to allow user to specify file type - pre…
JWinawer Jul 13, 2017
3020886
update to code converting vAnatomy.dat to nifti, which was previously…
JWinawer Jul 13, 2017
a1fe8a4
new test routine to ensure that conversion from vAnatomy.dat to nifti…
JWinawer Jul 13, 2017
14970b0
minor update: add HOMEDIR to path when loading tseries to avoid ambig…
JWinawer Jul 13, 2017
1150f92
typos fiex in comments
JWinawer Jul 13, 2017
20fab65
fix to the way the max is computed when using the max method to map d…
JWinawer Jul 13, 2017
c882495
merge with branch nojasonlab
JWinawer Jul 13, 2017
88dbd28
Change to viewGet for case <mesh> - now, allows user to input optiona…
JWinawer Jul 16, 2017
b264b7f
new function, meshImportFreesurferSurfaces, which grabs white, pial, …
JWinawer Jul 16, 2017
dff9e11
ensure tutorial runs even if user has not run previous ernie tutorials
JWinawer Jul 16, 2017
7ab5fc4
new test function to check whether meshBuild, meshSmooth, and meshCol…
JWinawer Jul 16, 2017
0d086e7
fix to Ccode for nearpoints to compile successfully with both Matlab2…
JWinawer Jul 21, 2017
fb46831
Merge pull request #251 from vistalab/nearpoints
JWinawer Jul 21, 2017
8f924ea
All calls to waitbar have been replaced by mrvWaitbar. This is a new …
JWinawer Jul 22, 2017
d924095
Merge pull request #231 from vistalab/readFileNiftiGzSupportFix
JWinawer Jul 22, 2017
b07ad2f
Revert "Changes that will compile readFileNifti default to requiring …
JWinawer Jul 22, 2017
0228c90
Merge pull request #253 from vistalab/revert-231-readFileNiftiGzSuppo…
JWinawer Jul 22, 2017
b3a8110
Revert "Revert "Changes that will compile readFileNifti default to re…
JWinawer Jul 22, 2017
44c5528
Merge pull request #254 from vistalab/revert-253-revert-231-readFileN…
JWinawer Jul 22, 2017
a3f227a
Revert "Merge pull request #251 from vistalab/nearpoints"
JWinawer Jul 22, 2017
3e60e29
swithed test_exportNiftiParameterMap to use hidden inplane rather tha…
JWinawer Jul 22, 2017
5fa4a69
new test function for installing gray. also an update to cleanGray an…
JWinawer Jul 22, 2017
5808033
Merge branch 'master' of https://github.com/vistalab/vistasoft
JWinawer Jul 22, 2017
5f9661d
fix to new test function, test_installSegmentation.m
JWinawer Jul 22, 2017
b3f0996
fix to nearpoints c code and mex file compiled for mexmaci64
JWinawer Jul 22, 2017
318a019
new validation function to test mesh visualization
JWinawer Jul 23, 2017
153f00b
Merge pull request #252 from vistalab/waitbar
JWinawer Jul 25, 2017
c35c545
for cleanGray and cleanVolume, first check whether folders exist befo…
JWinawer Jul 25, 2017
b951a6e
updates to fix the 4th column of the transform matrix of inplane nift…
JWinawer Jul 25, 2017
324456a
Merge pull request #256 from vistalab/fixInplaneXformMatrix
JWinawer Jul 28, 2017
8363fe7
Cast dims as mwSize rather than int in readFileNifti.c
JWinawer Jul 29, 2017
53dc40d
updated versions of niftilib and newly compiled mex file for readFile…
JWinawer Jul 30, 2017
a20e4be
fixed a bug accidentally introduced a few months ago: <r> => <fileName>
JWinawer Aug 8, 2017
3f46f3f
Merge pull request #258 from vistalab/readFileNiftiFix
JWinawer Aug 18, 2017
e811384
variables <mn> and <sd> were used before being defined. that is now f…
JWinawer Sep 1, 2017
17bb4c7
Trying support with a tricky back compatibility issue due to changes …
francopestilli Sep 21, 2017
c2a655c
added the ability to compute a median of values along fiber groups ra…
Oct 5, 2017
45d85e4
Merge branch 'master' into compmedian
Oct 5, 2017
06f478f
Merge pull request #262 from jyeatman/compmedian
jyeatman Nov 3, 2017
89ac723
When loading a nifti file into a paramter map, treat the 4th dimensio…
JWinawer Jan 10, 2018
2ff4d90
minor formatting changes to various functions
rosemary-le Jan 19, 2018
9e979f5
Merge branch 'master' of https://github.com/vistalab/vistasoft
rosemary-le Jan 19, 2018
6073bb4
Add an additional case of predicting the rmTSeries for the css model
rosemary-le Jan 20, 2018
91eadae
getTSeriesROI can take some time with large ROIs. Code now prints out…
rosemary-le Jan 23, 2018
80b4da5
rmPredictedTSeries works for the css model
rosemary-le Jan 23, 2018
d8f1129
updated most support to Matlab 9.2.1
JWinawer Jan 25, 2018
eae8b5b
new tutorial to show ROI usage
JWinawer Jan 25, 2018
bd3bd9d
minor cleanup
JWinawer Jan 25, 2018
c99d8b6
minor cleanup
JWinawer Jan 25, 2018
d4229fd
update to check4file to better handle non-.mat file types
JWinawer Jan 25, 2018
ed2e1ee
append nifti file extension to output roi
lmperry Feb 7, 2018
04536c2
allow for plotting single cycles when there are not an integer number…
JWinawer Feb 27, 2018
8619558
replaced <contains> with <strfind> since contains does not exist prio…
JWinawer Mar 7, 2018
83b4538
replaced <view> with <vw> and various minor syntax updates
JWinawer Mar 7, 2018
ed567b5
added support up to Matlab 9.3.1
JWinawer Mar 7, 2018
52e1314
added dataOverlay as optional output to meshColorOverlay
JWinawer Mar 7, 2018
9c6aeb2
moved a line to avoid an error arising from calling a variable before…
JWinawer Mar 7, 2018
081447e
removed dependency on view structure from the function to import free…
JWinawer Mar 7, 2018
a44d421
Update README.md
JWinawer Mar 8, 2018
8e1cba6
check whether VISTA preferences exist before calling getpref
JWinawer Apr 3, 2018
1769550
Grab the exponent value first because effective sigma depends on the …
rosemary-le Apr 11, 2018
ed575e7
add a colormap
rosemary-le Apr 11, 2018
dd0deef
Merge pull request #285 from rosemary-le/master
rosemary-le Apr 11, 2018
b447c48
add an additional output to the rmCoordsGet.m function, to help keep …
rosemary-le Apr 11, 2018
365bc9e
add the css case for predicted tseries
rosemary-le Apr 11, 2018
0c4a5b9
Add a branch
rosemary-le Apr 11, 2018
07bcf64
Merge pull request #286 from rosemary-le/crossModelValidation
rosemary-le Apr 11, 2018
d232a58
removed check for spm2 which uses function that breaks in
soichih Apr 12, 2018
7c3f0ab
minor syntax updates
JWinawer Apr 19, 2018
20d4436
have the rmCoordsGet function return additional arguments pertaining …
rosemary-le Apr 20, 2018
8f3ae00
Merge pull request #288 from rosemary-le/master
rosemary-le Apr 20, 2018
4ee050a
Fixed capitalization errors in rmSearchFit that was preventing ovals …
rosemary-le Apr 20, 2018
fcd98fa
Merge pull request #289 from rosemary-le/master
rosemary-le Apr 20, 2018
acfd3ee
Update dtiImportFibersMrtrix.m
May 18, 2018
b882e0b
Merge pull request #291 from bacaron/patch-2
francopestilli May 18, 2018
a78ed21
added abs on false(sz)
DanNBullock May 18, 2018
b55cda4
Update dtiRoiToImg.m
May 18, 2018
d7ae410
Merge pull request #287 from soichih/master
wandell May 22, 2018
de3d740
Fixed as per Issue #293, roeysc
wandell May 22, 2018
8c402f9
Merge pull request #292 from bacaron/patch-3
jyeatman May 28, 2018
ae2b8ac
Comment formatting.
wandell Jun 29, 2018
390233d
Quality of life utility. Need to add a Config routine
wandell Jun 30, 2018
be17925
Some comments on the test related stuff.
wandell Jul 3, 2018
7e2eb74
Comments
wandell Jul 3, 2018
a2de292
Moved the good stuff into the main t_gift.
wandell Jul 5, 2018
b627301
Split t_gifti into simpler bits. Added information about how to down…
wandell Jul 5, 2018
dde359c
Removed big file that was replaced by shorter versions
wandell Jul 5, 2018
7e4a5c5
Data management
wandell Jul 5, 2018
8bea0b7
Retain full path when nii.gz extension is not provided
rokers Jul 13, 2018
cf75f1a
Merge branch 'master' of https://github.com/vistalab/vistasoft
rokers Jul 13, 2018
c029ecf
Script for Silson et al. error
wandell Sep 26, 2018
f8ffcb2
Comments and new validation routine
wandell Sep 26, 2018
5cea972
added live script <*.mlx* versions of several tutorials
JWinawer Oct 3, 2018
757465e
minor: change in comments to fix file name in example
JWinawer Oct 3, 2018
d075a66
update of syntax, eg view->vw
JWinawer Oct 3, 2018
e6aa4c7
added ./ to beginning of paths to avoid path ambuguity
JWinawer Oct 3, 2018
da83033
added matlab live script versions of ernie tutorials
JWinawer Oct 8, 2018
cab4b57
removed previous fix, added new one above
DanNBullock Nov 26, 2018
1f11941
Merge branch 'master' into master
francopestilli Dec 10, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
*~
*.m~
*.asv
*.DS_Store
*.swp

wiki
41 changes: 34 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@

VISTASOFT is the main software repository of the [Vista lab](http://vistalab.stanford.edu) at [Stanford University](http://stanford.edu). It contains Matlab code to perform a variety of analysis on MRI data, including functional MRI and diffusion MRI.

It has the following modules:
### License

(c) Vista lab, Stanford University.

Unless otherwise noted, all our code is released under the [GPL](http://www.gnu.org/copyleft/gpl.html)

### Modules
Vistasoft contains the following modules:

- mrAlign : Aligning functional and anatomical data
- mrAnatomy: Handling anatomical MRI data.
Expand All @@ -16,23 +23,43 @@ And in addition:
- utilities
- setup
- tutorials
- external: functions written by others that we use as dependencies (see optional software).
- external: functions written by others that we use as dependencies (see optional packages).

External dependencies:
### External dependencies
Vistasoft depends on the following packages:
- [Matlab](http://mathworks.com)
- The code has been validated for Matlab 2014b (8.4) - Matlab 2017b (9.3)
- [SPM](http://www.fil.ion.ucl.ac.uk/spm/)

Optional packages:
### Optional Packages
- [Freesurfer](https://surfer.nmr.mgh.harvard.edu/fswiki/DownloadAndInstall)
- [FSL](http://fsl.fmrib.ox.ac.uk/fsl/fslwiki/)
- [MRTrix](http://www.nitrc.org/projects/mrtrix/)
- [JSONLab](http://iso2mesh.sourceforge.net/cgi-bin/index.cgi?jsonlab)
- [RemoteDataToolbox](https://github.com/isetbio/RemoteDataToolbox)

### Documentation
For detailed documentation, please visit the [VISTA lab wiki](http://vistalab.stanford.edu/wiki).

### Installation

For help with the new mrInit intialization method, please see the [Initialization Page](http://white.stanford.edu/newlm/index.php/Initialization#mrInit).
To install Vistasoft:

(c) Vista lab, Stanford University.
1. Clone the Vistasoft repository on your local machine; for example:

```sh
> cd ~/matlab
> git clone https://github.com/vistalab/vistasoft

```

2. Start Matlab and Add the Vistasoft repository's base directory to your Matlab path:

```matlab
addpath(genpath('~/matlab/vistasoft'));
```

Note that if you have installed additional Matlab packages (such as the RemoteDataToolbox), you will have to ensure that these packages are on your path as well.

For help with the new mrInit intialization method, please see the [Initialization Page](http://white.stanford.edu/newlm/index.php/Initialization#mrInit).

Unless otherwise noted, all our code is released under the [GPL](http://www.gnu.org/copyleft/gpl.html)
121 changes: 121 additions & 0 deletions external/brainbrowser/fg2MNIObj.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
function [coords, lineList, startPoints] = fg2MNIObj(fg,varargin)
% FG2MNIOBJ - Convert array of fg to MNI Obj file for visualization
%
% Required Inputs
% fg: An array of vistasoft fiber groups
% Optional inputs
% fname: Full path to output file name
% overwrite: Overwrite existing file
% jitter: Jitter the RGB colors by this random amount (0,1)
%
% You can view the MNI OBJ data in brainbrowser by loading the file to
% this site: https://brainbrowser.cbrain.mcgill.ca/surface-viewer#dti
%
% See also: obj<> files. Perhaps this should be grouped with those, but I
% am not sure this format is viewable by meshlab.app, and a legitimate OBJ
% file.
%
%
% RF/BW, Vistasoft Team 2016

%% Parse file name and other parameters that may arise
p = inputParser;

p.addRequired('fg');
p.addParameter('fname','test.mni.obj',@ischar); % Output file
p.addParameter('overwrite',false); % Forces overwrite
p.addParameter('jitter', 0.1); % Jitter the colors

p.parse(fg,varargin{:});
fname = p.Results.fname;
overwrite = p.Results.overwrite;
jitter = p.Results.jitter;

%%
nFibers = 0;
nGroups = length(fg);
for ii=1:nGroups, nFibers = nFibers + length(fg(ii).fibers); end

color = zeros(nFibers,4); % Initialize a color for each group
nPoints = zeros(nFibers,1); % How many points in each fiber?

kk = 0;
for ff = 1:nGroups
for jj=1:length(fg(ff).fibers)
kk = kk + 1;
color(kk,:) = [fg(ff).colorRgb/255,1];
nPoints(kk) = size(fg(ff).fibers{jj},2);
end
end

fgAll = fg(1);
for ff = 2:nGroups
fgAll = fgMerge(fgAll,fg(ff),'all');
end

%% Store the coords and list of points in each line
coords = zeros(sum(nPoints),3);
startPoints = [0; cumsum(nPoints)];
lineList = cell(1,nFibers);
for ii=1:nFibers
lineList{ii} = (startPoints(ii)+1):startPoints(ii+1);
coords(lineList{ii},:) = fgAll.fibers{ii}';
end

%% Open the file for writing

if exist(fname,'file') && ~overwrite
disp('The file already exists. Press space bar to over-write');
pause
end

% We should probably test if the file exists already!
fileID = fopen(fname,'w');
fprintf(fileID,'L 1 %d\n', size(coords,1));

% Write out the coords
fprintf(fileID,'%.4f %.4f %.4f\n',coords');

% Write the color of all the lines.
% We need to figure out how to do each line, or ...
% And this should become a parameter
% And we should figure out what the 0 at the front means. Renzo knows, and
% it is important.
% The others are R G B alpha
nLines = length(lineList);
fprintf(fileID,'\n%d\n',nLines);

% Jitter the color for each line
% Make some random numbers to add to the color
randColors = color;
if jitter > 0
theseColors = randColors(:,1:3);
scale = mean(theseColors,2);
randFactor = 1 + randn(size(scale))*jitter;
theseColors = diag(randFactor)*theseColors ;
randColors = [theseColors,ones(nFibers,1)];
randColors = min(randColors,1);
randColors = max(randColors,0);
end

fprintf(fileID,'1\n');
for ii=1:nLines
fprintf(fileID,'%.2f %.2f %.2f %.2f\n',...
randColors(ii, 1),randColors(ii, 2),randColors(ii, 3),randColors(ii, 4));
end
% In principle, we could have '2\n' and then a color per vertex

% Now a list that counts the number of points in each fiber.
fprintf(fileID,'%d ',startPoints(2:end));
fprintf(fileID,'\n\n');

% Write out the lineLists (points in each line)
for ii=1:nFibers
fprintf(fileID,'%d ',lineList{ii}-1);
fprintf(fileID,'\n');
end

% Close the file and go home
fclose(fileID);

end
202 changes: 202 additions & 0 deletions external/dirwalk/dirwalk.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,202 @@
function varargout = dirwalk(topPath, visitor, varargin)
%DIRWALK Generate the file names in a directory tree by walking the tree
%
% Description:
% Function DIRWALK generates the file names in a directory tree by walking the tree
% top-down. For each directory in the tree rooted at directory topPath.
% For each directory of tree you can call "Visitor Function" for files processing.
%
%
% Using:
% [pathNames, dirNames, fileNames] = dirwalk(topPath)
% dirwalk(topPath, visitor)
% dirwalk(topPath, visitor, varargin)
% varargout = dirwalk(topPath, visitor, varargin)
% [visitorOutput1, visitorOutput2, ..., visitorOutputN] = dirwalk(topPath, visitor)
% [...] = dirwalk(topPath, visitor, visitorInput1, visitorInput2, ..., visitorInputN)
% [...] = dirwalk(topPath, visitor, varargin)
%
%
% Input:
% topPath -- (Required) Top path name (Root path name)
%
% visitor -- (Optional) Function handle. The function will be called
% when visiting each directory of tree.
%
% Signatures of visitor function:
% visitor(pathName, DirListing)
% visitor(pathName, DirListing, in1, in2, ..., inN)
% visitor(pathName, DirListing, varargin)
% varargout = visitor(...)
% [out1, out2, ..., outN] = visitor(...)
%
% Input arguments:
% pathName -- (Required) Path to visited directory. String.
% (passed within DIRWALK)
%
% DirListing -- (Required) Visited directory listing.
% Array of structs output of function DIR.
% (passed within DIRWALK)
%
% varargin -- (Optional) Other input arguments. (Passed outside)
%
%
% Output:
% dirPaths -- (Default visitor output) Visited path names. Cell array of strings.
% dirNames -- (Default visitor output) Directory names in visited paths (without '.' and '..'). Cell array of cell arrays.
% fileNames -- (Default visitor output) File names in visited paths. Cell array of cell arrays.
% visitorOutputs -- Visitor function outputs
%
%
% Examples:
% topPath = fullfile(matlabroot, 'toolbox', 'matlab', 'demos');
%
% [pathNames, dirNames, fileNames] = dirwalk(topPath);
%
% dirwalk(topPath, @(y,x) disp(strcat(y, filesep, {x.name}')))
%
%
% See Also DIR, LS
%

% -------------------------------------------------------------------------
% Version : 1.1
% Author : Evgeny Pr aka iroln <[email protected]>
% Created : 10.10.10
% Updated : 03.07.11
%
% Copyright : Evgeny Prilepin (c) 2010-2011
% -------------------------------------------------------------------------

error(nargchk(1, Inf, nargin));

if (nargin < 2)
error(nargoutchk(0, 3, nargout));

visitor = @default_visitor;
visitorNumOutputs = 3;
isUseDefaultVisitor = true;
else
visitorNumOutputs = nargout;
isUseDefaultVisitor = false;
end

validateattributes(topPath, {'char'}, {'row'}, ...
mfilename('fullpath'), '"Top Path Name"', 1)

if ~isempty(visitor)
validateattributes(visitor, {'function_handle'}, {'scalar'}, ...
mfilename('fullpath'), '"Visitor Function Handle"', 2)
end

varargout = dir_tree_helper(topPath, ...
visitor, visitorNumOutputs, isUseDefaultVisitor, varargin{:});
%--------------------------------------------------------------------------

%==========================================================================
function visitorOutputs = dir_tree_helper(topPath, visitorHandle, ...
visitorNumOutputs, isUseDefaultVisitor, varargin)
%DIR_TREE_HELPER Helper function for get directory tree

% Allocate memory for tree listing
preallocDirItems = 100000;
outputs = cell(preallocDirItems, visitorNumOutputs);
counter = 1;

% Get tree listing
[counter, outputs] = dir_tree_listing(topPath, counter, outputs, ...
visitorHandle, visitorNumOutputs, isUseDefaultVisitor, varargin{:});

% Remove extra
if (counter < preallocDirItems)
outputs(counter+1:end, :) = [];
end

% Construct visitor function outputs
visitorOutputs = cell(1, visitorNumOutputs);
for i = 1:visitorNumOutputs
visitorOutputs(i) = {outputs(:,i)};
end
%--------------------------------------------------------------------------

%==========================================================================
function [counter, outputs] = dir_tree_listing(topPath, counter, outputs, ...
visitorHandle, visitorNumOutputs, isUseDefaultVisitor, varargin)
%DIR_TREE_LISTING Generate dir tree listing

% Get listing of current directory
Listing = dir(topPath);

% Call Visitor function
visitorOutputs = visitor_call_helper(topPath, Listing, ...
visitorHandle, visitorNumOutputs, varargin{:});

if isUseDefaultVisitor
dirNames = visitorOutputs{2};
else
dirNames = get_dir_file_names(Listing);
end

if (visitorNumOutputs > 0)
outputs(counter,:) = visitorOutputs;
end

% Recursive walking directories in current directory
for i = 1:length(dirNames)
nextRootPath = fullfile(topPath, dirNames{i});

[counter, outputs] = dir_tree_listing(nextRootPath, counter+1, outputs, ...
visitorHandle, visitorNumOutputs, isUseDefaultVisitor, varargin{:});
end
%--------------------------------------------------------------------------

%==========================================================================
function visitorOutputs = visitor_call_helper(topPath, Listing, ...
visitor, numOutputs, varargin)
%VISITOR_CALL_HELPER Helper function for call visitor function

if (numOutputs == 0)
% Visitor function without output arguments
visitorOutputs = {};
visitor(topPath, Listing, varargin{:});
else
% Construct eval command for call visitor function with any number output arguments
outputNumbers = num2cell(1:numOutputs);

%FIXME: It is not recommended, but otherwise doesn't work
outputArgs = deblank(sprintf('outputs{%d} ', outputNumbers{:}));
visitorCalling = sprintf('[%s] = visitor(topPath, Listing, varargin{:});', outputArgs);
eval(visitorCalling);

visitorOutputs = outputs;
end
%--------------------------------------------------------------------------

%==========================================================================
function [pathName, dirNames, fileNames] = default_visitor(rootPath, Listing)
%DEFAULT_VISITOR Default Visitor function
%
% Default visitor function return 3 output arguments:
% pathNames -- visited paths names
% dirNames -- Directories names in visited directories
% fileNames -- Files names in visited directories
%

pathName = rootPath;
[dirNames, fileNames] = get_dir_file_names(Listing);
%--------------------------------------------------------------------------

%==========================================================================
function [dirNames, fileNames] = get_dir_file_names(Listing)
%GET_DIR_FILE_NAMES

names = {Listing.name}';
isDirs = [Listing.isdir];
dirNames = names(isDirs);
fileNames = names(~isDirs);

% Exclude special directories '.' and '..'
inds = ~strcmp(dirNames, '.') & ~strcmp(dirNames, '..');
dirNames = dirNames(inds);
%--------------------------------------------------------------------------

Loading