Sign inSign up

amiklos/roast

By amiklos

Updated over 8 years ago

This docker implements the roast Matlab program by Yu Huang and Lucas Parra: parralab.org/roast/

Image
2

297

amiklos/roast repository overview

Example: new version: docker run -it --rm -v /where/is/your/subject1.nii:/input:ro -v /where/will/be/your/output:output amiklos/roast:1.1105 /input/subject1.nii /output F7 1 F8 -1 25

old version: docker run -it --rm -v /where/is/your/subject1.nii:/input:ro -v /where/will/be/your/output:output amiklos/roast:1.1101 /input/subject1.nii /output F7 1 F8 -1

Right now this docker implements only two electrodes (since it was problematic to give compiled matlab program a cell array as an argument, but I am open to recommendations). electrode names should be according to the 10-20 EEG system nomenclature. Right after the electrode names there are the currents in mA. In this case it is 1 and -1 mA respectively. (They should add up to zero). The last argument in the new version is the radius of a circular electrode.

Implementation details: It is running in v85 MCR in the docker. I had to divide the compilation of roast.m into three parts, since spm_jobman.m cannot be easily deployed: reason is that it creates .m files on the fly, so I could not figure out how. But thankfully spm has a program, that you can easily make an spm with toolboxes standalone: config/spm_make_standalone. So:

  1. run compiled roast_segment_batch_gen.m , which is the very first step of roast, where it makes a batch file for spm_jobman for segmentation; output is job.mat batchfile for segmentation;
  2. run the generated job.mat with complied spm, with toolbox in the original roast: spm_exec
  3. run the rest of the roast: here however there is a solution, which is not elegant: a. first run the rest of the roast, however it will try to find the D_74.mat in the cache, but it will not find, so will give an error b. we then copy the D_74.mat to the cache (cannot do it earlier, since cache is not there until 3a is run c. rerun the rest of the roast, this time, it will run flawlessly Of course this is all wrapped in the run.sh, so you do not have to deal with the steps, but you will see error messages in the middle: you should disregard, everything will run without problem. I acknowledge this is not elegant, but I am open to suggestions.

Here is my Dockerfile (v1.1105):

FROM ubuntu:trusty MAINTAINER Miklos Argyelan [email protected]

RUN apt-get update &&
apt-get install -y unzip xorg wget &&
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

ENV MATLAB_VERSION R2015a ENV MCR_VERSION v85

RUN mkdir /opt/mcr_install &&
mkdir /opt/mcr &&
wget -P /opt/mcr_install http://www.mathworks.com/supportfiles/downloads/${MATLAB_VERSION}/deployment_files/${MATLAB_VERSION}/installers/glnxa64/MCR_${MATLAB_VERSION}_glnxa64_installer.zip &&
unzip -q /opt/mcr_install/MCR_${MATLAB_VERSION}_glnxa64_installer.zip -d /opt/mcr_install &&
/opt/mcr_install/install -destinationFolder /opt/mcr -agreeToLicense yes -mode silent &&
rm -rf /opt/mcr_install /tmp/*

RUN mkdir /opt/roast &&
mkdir -p /nethome/amiklos

COPY roastV1.1_MA_1 /nethome/amiklos/roastV1.1_MA_1

RUN wget https://cran.rstudio.com/src/base/R-3/R-3.2.2.tar.gz && \ tar xvf R-3.2.2.tar.gz &&
cd R-3.2.2 &&
apt-get update &&
apt-get install -y gcc fort77 aptitude software-properties-common debconf-utils make &&
aptitude install -y g++ xorg-dev libreadline-dev gfortran &&
./configure &&
add-apt-repository ppa:webupd8team/java -y &&
apt-get update &&
echo "oracle-java8-installer shared/accepted-oracle-license-v1-1 select true" | debconf-set-selections &&
apt-get install -y oracle-java8-installer oracle-java8-set-default &&
./configure --enable-R-shli &&
make &&
make install

RUN R -e "install.packages('neurobase',dependencies=TRUE, repos='http://cran.rstudio.com/')" RUN R -e "install.packages('R.matlab',dependencies=TRUE, repos='http://cran.rstudio.com/')"

COPY ./transform.R /transform.R RUN chmod 755 /transform.R

COPY ./run2.sh /run.sh RUN chmod 755 /run.sh

ENTRYPOINT ["/bin/bash", "/run.sh"]

####################################################

OLD Dockerfile v 1.1101

#################################################### FROM ubuntu:trusty MAINTAINER Miklos Argyelan [email protected]

RUN apt-get update &&
apt-get install -y unzip xorg wget &&
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

#Install MATLAB MCR in /opt/mcr/

ENV MATLAB_VERSION R2015a ENV MCR_VERSION v85

RUN mkdir /opt/mcr_install &&
mkdir /opt/mcr &&
wget -P /opt/mcr_install http://www.mathworks.com/supportfiles/downloads/${MATLAB_VERSION}/deployment_files/${MATLAB_VERSION}/installers/glnxa64/MCR_${MATLAB_VERSION}_glnxa64_installer.zip &&
unzip -q /opt/mcr_install/MCR_${MATLAB_VERSION}_glnxa64_installer.zip -d /opt/mcr_install &&
/opt/mcr_install/install -destinationFolder /opt/mcr -agreeToLicense yes -mode silent &&
rm -rf /opt/mcr_install /tmp/*

RUN mkdir /opt/roast &&
mkdir -p /nethome/amiklos

COPY roastV1.1_MA_1 /nethome/amiklos/roastV1.1_MA_1

COPY ./run2.sh /run.sh RUN chmod 755 /run.sh

ENTRYPOINT ["/bin/bash", "/run.sh"]

Tag summary

Content type

Image

Digest

Size

2.3 GB

Last updated

over 8 years ago

docker pull amiklos/roast:1.1105