Skip to content

Commit

Permalink
Merge branch 'master' into 'public'
Browse files Browse the repository at this point in the history
Updates to CI scripts and readme



See merge request !5
  • Loading branch information
tomdoel committed Jun 15, 2016
2 parents 8494a9c + 286b2b0 commit 0ae822d
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 26 deletions.
10 changes: 10 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,13 @@ gift-adelie:
- matlab
- cuda

gift-skylight:
script:
- set PATH=%PATH%;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin
- "call .\\ci\\test-win.bat"
tags:
- gift-skylight
- gift-win64
- matlab
- cuda

59 changes: 40 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,23 @@ Slic-Seg is a minimally interactive online learning-based segmentation method. A
Slic-Seg was developed as part of the [GIFT-Surg][giftsurg] project. The algorithm and software were developed by Guotai Wang at the [Translational Imaging Group][tig] in the [Centre for Medical Image Computing][cmic] at [University College London (UCL)][ucl].

Algorithm and code by Guotai Wang.

If you use this software, please cite [this paper][citation].


How to cite
----------

If you use this software, please cite [this paper][citation].

Slic-Seg: A minimally interactive segmentation of the placenta from sparse and motion-corrupted fetal MRI in multiple views
Guotai Wang, Maria A. Zuluaga, Rosalind Pratt, Michael Aertsen, Tom Doel, Maria Klusmann, Anna L. David, Jan Deprest, Tom Vercauteren, Sébastien Ourselin


Disclaimer
----------

* This is PROTOTYPE software and may lead to system instability and crashes which could result in data loss.
* This is PROTOTYPE software. Due to the low-level GPU computation there is a risk of system instability and crashes which could result in data loss.


Software links
Expand Down Expand Up @@ -45,6 +55,34 @@ The current version of Slic-Seg requries:
* A Matlab-supported C++ compiler installed and configured to work with mex files [see here](http://uk.mathworks.com/help/matlab/matlab_external/what-you-need-to-build-mex-files.html)
* [The CUDA toolkit](https://developer.nvidia.com/cuda-toolkit) to be installed and configured to work with Matlab

Please note that there are cross-dependencies between Matlab, CUDA, C++ and the OS. Please see below for the platforms and versions we have tested against.


Supported Platforms
-----------------------------

Slic-Seg is a cross-platform Matlab/C++ library. We have tested Slic-Seg on the following platforms:

- Linux
- Ubuntu Desktop 14.04.3 LTS 64-bit
- NVIDIA 12GB GTX TITAN X
- CUDA 7.5
- Matlab R2015b

- MacOS X
- OS X Yosemite 10.10.5
- NVIDIA GeForce GT 750M 1024 MB
- XCode 7.2.1
- CUDA 7.5
- Matlab 2015b 64-bit

- Windows
- Windows 10 Professional 64-bit (NOTE: Matlab does not support GPU operations on 32-bit Windows)
- 2GB NVIDIA Quadro 4000
- Visual Studio 2013 Community Edition (NOTE: CUDA does not support Visual Studio 2015 or gcc)
- CUDA 7.5
- Matlab 2015b 64-bit


How to use
------------
Expand Down Expand Up @@ -102,25 +140,8 @@ This work was supported through an Innovative Engineering for Health award by th



Supported Platforms
-----------------------------

Slic-Seg is a cross-platform Matlab/C++ library. We have tested Slic-Seg on the following platforms:

- Linux
- Ubuntu Desktop 14.04.3 LTS 64-bit
- NVIDIA 12GB GTX TITAN X
- CUDA 7.5
- Matlab R2015b

- MacOS X
- OS X Yosemite 10.10.5
- NVIDIA GeForce GT 750M 1024 MB
- XCode 7.2.1
- CUDA 7.5

- Windows
- Not yet tested



Please note that NVIDA CUDA drivers and Matlab have specific compatibility requirements regarding C++ compilers
Expand Down
4 changes: 2 additions & 2 deletions ci/test-win.bat
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
echo Running Windows build and testscript %~dp0%\matlab\CIBuildAndTest.m
call "C:\Program Files\MATLAB\R2015b\bin\matlab.exe" -wait -nodisplay -nosplash -nodesktop -r "try, run('%~dp0%\matlab\CIBuildAndTest.m'), catch ex, disp(['Exception during CIBuildAndTest.m: ' ex.message]), exit(1), end, exit(0);"
echo Running Windows build and testscript %~dp0..\matlab\CIBuildAndTest.m
call "C:\Program Files\MATLAB\R2015b\bin\matlab.exe" -wait -nodisplay -nosplash -nodesktop -r "try, run('%~dp0..\matlab\CIBuildAndTest.m'), catch ex, disp(['Exception during CIBuildAndTest.m: ' ex.message]), exit(1), end, exit(0);"

if not "%ERRORLEVEL%" == "0" (
echo Exit Code = %ERRORLEVEL%
Expand Down
10 changes: 7 additions & 3 deletions matlab/library/OnlineRandomForest/ORForest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,17 +81,21 @@ void ORForest::Train(const double *i_trainData, int i_Ns,int i_Nfp1)
}
}

void ORForest::Predict(const double *i_testData, int i_Ns, int i_Nf, double *o_predict)
void ORForest::Predict(const double *i_testData, const int i_Ns, const int i_Nf, double *o_predict)
{
double tempPredict[i_Ns];
for(int i=0;i<treeNumber;i++)
double *tempPredict;
tempPredict = new double[i_Ns];

for(int i=0;i<treeNumber;i++)
{
tree[i].Predict(i_testData, i_Ns, i_Nf,tempPredict);
for(int i=0;i<i_Ns;i++)
{
o_predict[i]+=tempPredict[i];
}
}
delete [] tempPredict;

for(int i=0;i<i_Ns;i++)
{
o_predict[i]=o_predict[i]/treeNumber;
Expand Down
2 changes: 1 addition & 1 deletion matlab/library/OnlineRandomForest/ORForest.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class ORForest
~ ORForest();
void Init(int Ntree, int treeDepth, int leastNsampleForSplit);
void Train(const double *i_trainData, int i_Ns,int i_Nfp1);
void Predict(const double *i_testData, int i_Ns, int i_Nf, double *o_predict);
void Predict(const double *i_testData, const int i_Ns, const int i_Nf, double *o_predict);
void ConvertTreeToList(int * io_left, int * io_right,
int *io_splitFeature, double *io_splitValue,
int maxNodeNumber);
Expand Down
1 change: 1 addition & 0 deletions matlab/library/coremat/MexCompile/CoreCompileMexFiles.m
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ function CheckMexFiles(mex_files_to_compile, cached_mex_file_info, output_direct
cuda_compiler = TryToFindCudaCompilerPc(fullfile(getenv('ProgramFiles(x86)'), 'NVIDIA GPU Computing Toolkit', 'CUDA'));
end
end
cuda_compiler = CoreTextUtilities.RemoveNonprintableCharacters(cuda_compiler);
else
[status, cuda_compiler] = system('which nvcc');

Expand Down
2 changes: 1 addition & 1 deletion matlab/library/coremat/MexCompile/CoreCudaCompile.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

methods (Static)
function mex_result = Compile(compiler, mex_file, src_fullfile, output_directory)
compile_arguments = [compiler ' -ptx --output-directory ' output_directory ' ' src_fullfile, ' ' mex_file.OtherCompilerFiles];
compile_arguments = ['"' compiler '" -ptx --output-directory ' output_directory ' ' src_fullfile, ' ' mex_file.OtherCompilerFiles];
mex_result = system(compile_arguments);
end
end
Expand Down

0 comments on commit 0ae822d

Please sign in to comment.