Skip to content

Commit 2f43d27

Browse files
committed
DOC: walkthrough starting full reproin setup from scratch in a custom location
1 parent d06179f commit 2f43d27

File tree

1 file changed

+104
-1
lines changed

1 file changed

+104
-1
lines changed

README.md

Lines changed: 104 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,109 @@ tools, any environment providing them would suffice, such as
135135
other Debian-based systems with NeuroDebian repositories configured,
136136
which would provide all necessary for ReproIn setup components.
137137

138+
## Getting started from scratch
139+
140+
### Setup environment
141+
142+
reproin script relies on having datalad, datalad-containers, and singularity
143+
available. The simplest way to get them all is to install a conda
144+
distribution, e.g. miniforge ([link for
145+
amd64](https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh)),
146+
and setup the environment with all components installed:
147+
148+
mamba create -n reproin -y datalad datalad-container singularity
149+
150+
Then make sure you have your git configured (adjust to fit your persona)
151+
152+
git config --global user.name "My Name"
153+
git config --global user.email "[email protected]"
154+
155+
and install the ReproNim/containers
156+
157+
datalad clone https://github.com/ReproNim/containers repronim-containers
158+
cd repronim-containers
159+
160+
which would clone the dataset from GitHub and auto-enable datasets.datalad.org
161+
remote to actually get annexed content of the images.
162+
Now fetch the image for the most recent version of reproin from under images/repronim, e.g.
163+
164+
datalad get images/repronim/repronim-reproin--0.13.1.sing
165+
cd ..
166+
167+
### "Install" reproin script
168+
169+
The singularity image we fetched already comes with reproin installed inside,
170+
but to "drive" conversion we need to have `reproin` available in the base
171+
environment. Because we do not have it (yet) packages for conda
172+
distribution, we will just clone this repository and gain access to the script:
173+
174+
git clone https://github.com/ReproNim/reproin
175+
176+
To avoid typing the full path to the `reproin` script, can do
177+
178+
export "PATH=$PWD/reproin/bin/:$PATH"
179+
180+
to place it in the PATH.
181+
182+
### "Configure" the reproin setup
183+
184+
Currently `reproin` script hardcodes the path to DICOMS to reside under
185+
`/inbox/DICOM` and extracted lists and converted data to reside under
186+
`/inbox/BIDS`.
187+
It is possible to overload location for BIDS via `BIDS_DIR` env variable, so
188+
we can do e.g.
189+
190+
export BIDS_DIR=$HOME/BIDS-demo
191+
192+
and then let's create the top-level datalad dataset to contain all converted
193+
data
194+
195+
datalad create -c text2git "$BIDS_DIR"
196+
197+
### Collect DICOMs listing
198+
199+
ATM reproin container has older version of the script, so to use newer version we would just bind mount our cloned script inside
200+
201+
singularity run -e -c \
202+
--env BIDS_DIR=$BIDS_DIR \
203+
-B $HOME/reproin/bin/reproin:/usr/local/bin/reproin \
204+
-B /inbox/DICOM:/inbox/DICOM:ro \
205+
-B $BIDS_DIR:$BIDS_DIR \
206+
~/repronim-containers/images/repronim/repronim-reproin--0.13.1.sing lists-update-study-shows
207+
208+
which should output summary over the studies it found under /inbox/DICOM, e.g.
209+
210+
dbic/QA: new=16 no studydir yet
211+
PI/Researcher/1110_SuperCool: new=12 no studydir yet
212+
213+
### Create target dataset
214+
215+
Now we can create "studydir" for the study of interest, e.g.
216+
217+
reproin study-create dbic/QA
218+
219+
which would
220+
221+
- create target BIDS dataset within the hierarchy
222+
- install repronim/containers borrowing the image from the `~/repronim-containers`
223+
- rerun `study-show` to output summary over the current state like
224+
225+
todo=4 done=0 /afs/.dbic.dartmouth.edu/usr/haxby/yoh/BIDS-demo/dbic/QA/.git/study-show.sh 2024-11-11
226+
227+
### Convert the dataset
228+
229+
Go to the folder of the dataset, e.g.
230+
231+
232+
cd "$BIDS_DIR/dbic/QA"
233+
234+
to see that `reproin` pre-setup everything needed to run conversion (`cat .datalad/config`).
235+
And now you should be able to run conversion for your study via "datalad-container"
236+
extension:
237+
238+
datalad containers-run -n repronim-reproin study-convert dbic/QA
239+
240+
138241
## Gotchas
139242

140243

@@ -146,7 +249,7 @@ of DICOMs and location of where to keep converted BIDS datasets.
146249
- `/inbox/DICOM/{YEAR}/{MONTH}/{DAY}/A00{ACCESSION}`
147250
- `/inbox/BIDS/{PI}/{RESEARCHER}/{ID}_{name}/`
148251

149-
### Cron job
252+
### CRON job
150253

151254
```
152255
# m h dom mon dow command

0 commit comments

Comments
 (0)