33
44% %% Formatting
55\def \< #1>{\texttt {#1 }}
6- \setlength {\parskip }{1em}
7-
6+ \setlength {\parskip }{1em}
87% %%%%%%%%%%%%%%%%%%%%%%%%%%%FILE%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
98\begin {document }
109
@@ -19,15 +18,17 @@ \section{Overview}
1918
2019 \texttt {biacpype } serves as a pipeline for converting raw fMRI data from Brain Imaging \& Analysis Center
2120 \href {https://www.biac.duke.edu/}{(BIAC)} at Duke University to the new standard Brain Imaging Data Structure
22- \href {http://bids.neuroimaging.io/}{(BIDS)} format, and supporting furthur analysis. The main parts of
23- \texttt {biacpype } contains:
21+ \href {http://bids.neuroimaging.io/}{(BIDS)} format. The main parts of \texttt {biacpype } contains:
2422
2523 \begin {itemize }
26- \item \texttt {util }: BIAC dataset validation, logging
24+ \item \texttt {util }: BIAC dataset validation
2725 \item \texttt {biac2bids }: conversion from BIAC to BIDS
28- \item ...
26+ \item \texttt { helper }: helper scripts
2927 \end {itemize }
3028
29+ In a nutshell, \< biacpype> serves as an adapter to the \< bxh2bids> code developed by John Graner from LaBar
30+ lab. This is the core of the conversion; all kudos to John!
31+
3132 The structure of this repository is: \par \vspace {.2in}
3233
3334 \ begin{lstlisting}
@@ -42,19 +43,25 @@ \section{Overview}
4243| |_ ...
4344|-tutorial // a tutorial notebook
4445|
45- |-docs // documentation (under construction)
46+ |-docs // documentation
4647 |_ ...
4748 \end {lstlisting }
4849
4950 To install dependencies of this repo, run
50- \[ \text {\< pip install -r requirements.txt>}\]
51+ \ begin{lstlisting} [xleftmargin=.25\textwidth, xrightmargin=.25\textwidth, backgroundcolor=\color{lightgray}, framexleftmargin=1em, framexrightmargin=1em]
52+ pip install -r requirements.txt
53+ \end {lstlisting }
5154
5255 The following section will introduce main modules of \texttt {biacpype }, and the corresponding scripts for using
53- the pipelines. All scripts are described in \textbf { Scripts } subsections. \par
56+ the pipelines.
5457
55- If you have any questions, please email Preston Jiang at
58+ If you have any questions, please email Preston at
5659 \href {mailto:linxing.jiang@duke.edu}{linxing.jiang@duke.edu}
57- or \href {mailto:prestonj@cs.washington.edu}{prestonj@cs.washington.edu} \par
60+ or \href {mailto:prestonj@cs.washington.edu}{prestonj@cs.washington.edu}. \par
61+
62+ You can also go to
63+ \href {https://gitter.im/MotivatedMemoryLab/biacpype}{Gitter Chatroom: https://gitter.im/MotivatedMemoryLab/biacpype} to ask for help!
64+ You will need to log in with your GitHub account.
5865
5966\newpage
6067% %%%% section: util
@@ -116,10 +123,8 @@ \subsection{Dataset Structure}
116123 Note:
117124 \begin {itemize }
118125 \item The values must be \textbf {tab } separated.
119- \item The first column serves as the primary key (they must be unique)
120- \item Task numbers in the first column \textbf {\em {must} } match that in the imaging files. For example, a `` 4''
121- in \< translation\_ file> and a `` 004'' in the imaging file will result in an error.
122- \item The first column must be task code, and the second column must be the task name. There can only be two columns
126+ \item The first column serves as the primary key (they must be unique).
127+ \item The first column must be task code, and the second column must be the task name. There can only be two columns.
123128 \item If you have fmap data task code, be sure to name the translation \textbf {`` fmap'' } exactly. In this way, the data
124129 will be put in \< fmap> folder after BIDS conversion, not \< anat> folder.
125130 \end {itemize }
@@ -144,37 +149,44 @@ \subsection{Dataset Structure}
144149 \item If your experiment does not have multiple sessions, you can ignore the \< Session> column
145150 \end {itemize }
146151
147- % %%%% Validaiton
148- \subsection {Validation }
149-
150- The requirements the module validates are:
151- \begin {enumerate }
152- \item Basic structure: check folder has \< Data>, \< biac\_ id\_ mapping.tsv>, Data has \< Anat>, \< Func>,
153- both \< Anat> and \< Func> contain the same folders, and each of these folders contains \< series\_ order\_ note.tsv>
154- \item \< biac\_ id\_ mapping\_ file>: check \< biac\_ id\_ mapping.tsv> is valid
155- \item \< all\_ series\_ order\_ note\_ files>: check all of the \< series\_ order\_ note.tsv> files in each subfolder is valid
156- \item Data matching: check each \< .bxh> file is matched with \< .nii.gz> file, and has valid task code
157- translation which can be found in \< series\_ order\_ note.tsv>
158- \end {enumerate }
159-
160152 % %%%% script
161153 \subsection {Scripts }
162- The script associated with this module is \< scripts/validate\_ biac\_ study\_ folder.py>. The only thing you
163- need to change is the \< STUDY\_ PATH>. \par
154+ The script associated with this module is \< scripts/validate\_ biac\_ study\_ folder.py>. You need one
155+ command line input, \< STUDY\_ PATH>. \par
164156
165- If there are errors, they will be printed out to console after validation finishes. Otherwise, you will
166- see the following printed out:
167- \[ \text {\< Your study path passed validation! You are now ready for conversion>}\]
157+ Run
158+ \ begin{lstlisting} [xleftmargin=.15\textwidth, xrightmargin=.15\textwidth, backgroundcolor=\color{lightgray}, framexleftmargin=1em, framexrightmargin=1em]
159+ python scripts/validate_biac_study_folder.py -h
160+ \end {lstlisting }
161+ to see help messages. \par
162+
163+ Run
164+ \ begin{lstlisting} [xleftmargin=.1\textwidth, xrightmargin=.1\textwidth, backgroundcolor=\color{lightgray}, framexleftmargin=1em, framexrightmargin=1em]
165+ python scripts/validate_biac_study_folder.py STUDY_PATH
166+ \end {lstlisting }
167+ to validate your dataset. \par
168+
169+ If there are errors, they will be printed out to console like this:
170+ \ begin{lstlisting} [xleftmargin=.2\textwidth, xrightmargin=.2\textwidth]
171+
172+ ### Following erros happend: ###
173+ ...
174+
175+
176+ \end {lstlisting }
177+
178+ All the error logs are saved in \< biacpype/logs/validation.log>. If there are no errors,
179+ you should see the following printed out:
180+ \begin {center }\< Your study path passed validation! You are now ready for conversion>\end {center }
168181
169- You can also check out all the logs produced under \< biacpype/logs/validation.log>
170182
171-
172183
173184% %%%% section: biac2bids
174185\section {\texttt {biac2bids } }
175186
176187 \texttt {biac2bids } module is the pipeline for converting raw data from BIAC in forms of \texttt {bxh } and
177- \texttt {nifti } to BIDS format. The workflow is as follows:
188+ \texttt {nifti } to BIDS format. It wraps the \< bxh2bids> code developed by John with validation,
189+ automatic Json file generation, and naming clean-up. The workflow is as follows:
178190
179191 \begin {figure }[h]
180192 \begin {mybox }
@@ -197,21 +209,43 @@ \section{\texttt{biac2bids}}
197209 % %%%% subsection: Scripts
198210 \subsection {Scripts }
199211 The script associated with this module is \< scripts/convert\_ to\_ bids.py>. There are four
200- parameters the user has to toggle . They are:
212+ parameters the user has to give to command line . They are:
201213 \begin {itemize }
202214 \item \< STUDY\_ PATH>: the path to your study file (which contains \< Data> and \< bids\_ id\_ mapping.csv>)
203215 \item \< JSON\_ OUTPUT\_ PATH>: the path where the user wants the json files to be saved
204216 \item \< BIDS\_ PATH>: the path where the user wants the new BIDS format data to be saved
205217 \item \< LOG\_ PATH>: the path where the user wants the logs to be saved
206218 \end {itemize }
207219
220+ Run
221+ \ begin{lstlisting} [xleftmargin=.22\textwidth, xrightmargin=.22\textwidth, backgroundcolor=\color{lightgray}]
222+ python scripts/convert_to_bids.py -h
223+ \end {lstlisting }
224+ to see help messages. \par
225+
226+ Run
227+ \ begin{lstlisting} [backgroundcolor=\color{lightgray}]
228+ python scripts/convert_to_bids.py STUDY_PATH JSON_PATH BIDS_PATH LOG_PATH
229+ \end {lstlisting }
230+ to convert your dataset. \par
231+
208232 % %%%% common errors
209- \subsection {Common Errors }
210- \begin {enumerate }
233+ \subsection {Common Errors During Conversion }
234+ \begin {enumerate }[itemsep=5pt]
235+ \item \< Log file already exists!? They should be time-stamped down to the minute!> \par
236+ This is because you run the conversion too frequently! \par
237+ \color {red}Quick solution: \color {black}delete all your logs and run it again.
238+
211239 \item \< Error:root:scan description not found in template file!> \par
212- This is because the scan description (printed out next line) is not saved in template file.
213- To fix this, add the description to \< biacpype/biac2bids/bxh2bids/info\_ field\_ files/psd\_ types.json> following
214- its format.
240+ This is because the scan description (printed out next line) is not saved in template file. \par
241+ \color {red}Quick solution: \color {black}add the description to the scan description file following
242+ its format. \par
243+ For an example, please refer to the tutorial notebook and the slides!
244+
245+ \item \< Output file already exists: ...> \par
246+ This is because some bids files already exist at the BIDS path! (often because the conversion stopped in
247+ the middle) \par
248+ \color {red}Quick solution: \color {black}delete the existing bids files.
215249 \end {enumerate }
216250
217251
0 commit comments