Skip to content

Commit b40d1fa

Browse files
authored
Merge pull request #40 from neuroscout/output
Separate output dir, add LICENSE
2 parents 10eb826 + 7a22cd3 commit b40d1fa

File tree

5 files changed

+45
-17
lines changed

5 files changed

+45
-17
lines changed

Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ FROM poldracklab/fitlins
44
# Set user back to root
55
USER root
66
RUN chown -R root /src /work
7+
RUN mkdir /data
78

89
# Install neurodebian/datalad
910
ARG DEBIAN_FRONTEND=noninteractive
@@ -15,10 +16,10 @@ RUN git config --global user.email "[email protected]"
1516

1617
# Install additional neuroscout + dependencies
1718
RUN /bin/bash -c "source activate neuro \
18-
&& pip install -q --no-cache-dir -e /src/fitlins[all]" \
19+
&& pip install -q --no-cache-dir -e git+https://github.com/poldracklab/fitlins.git@cceba1a46#egg=fitlins" \
1920
&& sync
2021

21-
# Copy the current directory contents into the container at /app (using COPY instead of ADD to keep it lighter)
22+
# Copy the current directory contents into the container
2223
COPY [".", "/src/neuroscout"]
2324

2425
RUN /bin/bash -c "source activate neuro \
@@ -29,8 +30,7 @@ RUN /bin/bash -c "source activate neuro \
2930
&& pip install -q --no-cache-dir --upgrade -r /src/neuroscout/requirements.txt" \
3031
&& sync
3132

32-
33-
WORKDIR /work
33+
WORKDIR /data
3434

3535
# Change entrypoint to neuroscout
3636
ENTRYPOINT ["/neurodocker/startup.sh", "neuroscout"]

LICENSE

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
BSD 3-Clause License
2+
3+
Copyright (c) 2018, neuroscout
4+
All rights reserved.
5+
6+
Redistribution and use in source and binary forms, with or without
7+
modification, are permitted provided that the following conditions are met:
8+
9+
* Redistributions of source code must retain the above copyright notice, this
10+
list of conditions and the following disclaimer.
11+
12+
* Redistributions in binary form must reproduce the above copyright notice,
13+
this list of conditions and the following disclaimer in the documentation
14+
and/or other materials provided with the distribution.
15+
16+
* Neither the name of the copyright holder nor the names of its
17+
contributors may be used to endorse or promote products derived from
18+
this software without specific prior written permission.
19+
20+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,14 @@ The easiest way to get Neuroscout running is using Docker. Just pull it from Doc
1313
Neuroscout is easy to use. Assuming you've already created an analysis on neuroscout.org, and have its analysis id (e.g.: `5xH937f`) you can run it in one line:
1414

1515
docker run -it neuroscout/neuroscout-cli run 5xH937f
16-
16+
1717
Neuroscout will download the necessary images, analysis bundle, and fit your model.
1818

19-
It's probably best to mount a local volume to the work dir, to access the outputs, and cache any downloaded MRI images:
19+
To cache the downloaded data, and output the results to a separate folder, mount the appropriate volumes:
2020

21-
docker run -it -v /local/dir:/work neuroscout/neuroscout-cli run 5xH937f
22-
21+
docker run -it -v /local/datadir:/data -v /local/outdir:/out neuroscout/neuroscout-cli run 5xH937f -o /out
2322

24-
See the output of `neuroscout --help` for more informations:
23+
See the output of `neuroscout --help` for more information:
2524

2625
```
2726
Usage:

neuroscout_cli/commands/install.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,23 +62,21 @@ def download_data(self):
6262
remote_files = self.resources['func_paths'] + self.resources['mask_paths']
6363
remote_path = self.resources['preproc_address']
6464

65-
deriv_dir = Path(self.dataset_dir) / 'derivatives'
65+
preproc_dir = Path(self.dataset_dir) / 'derivatives' / 'fmriprep'
6666

6767
try:
68-
if not (deriv_dir / 'fmriprep').exists():
68+
if not preproc_dir.exists():
6969
# Use datalad to install the raw BIDS dataset
7070
install(source=remote_path,
71-
path=(deriv_dir / 'fmriprep').as_posix())
72-
73-
preproc_dir = deriv_dir / 'fmriprep' / 'fmriprep'
74-
get([(preproc_dir / f).as_posix() for f in remote_files])
71+
path=str(preproc_dir))
72+
if (preproc_dir / 'fmriprep').exists():
73+
get([str(preproc_dir / 'fmriprep' / f) for f in remote_files])
7574
except Exception as e:
7675
message = e.failed[0]['message']
77-
if 'Failed to clone data from any candidate source URL' not in message[0]:
76+
if 'Failed to clone data from any candidate' not in message[0]:
7877
raise ValueError("Datalad failed. Reason: {}".format(message))
7978

8079
logging.info("Attempting HTTP download...")
81-
preproc_dir = deriv_dir / 'fmriprep'
8280
for i, resource in enumerate(remote_files):
8381
filename = preproc_dir / resource
8482
logging.info("{}/{}: {}".format(i+1, len(remote_files), resource))

neuroscout_cli/commands/run.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ def run(self):
1818
out_dir = self.options.pop('-o')
1919
if out_dir == "bundle_dir":
2020
out_dir = (install_command.bundle_dir).absolute()
21+
else:
22+
out_dir = Path(out_dir)
2123

2224
tmp_out = mkdtemp()
2325

0 commit comments

Comments
 (0)