A simple/dummy app that simulates a FreeSurfer run
Project description
Abstract
freesurfer_pp_moc.py is a dummy FreeSurfer plugin / container that is prepopulated with the results of several a priori FreeSurfer runs. For a given run, this script will simply copy elements of one of these prior runs to the output directory.
Synopsis
python freesurfer_pp_moc.py \
[-v <level>] [--verbosity <level>] \
[--version] \
[--man] \
[--meta] \
[--copySpec <copySpec>] \
[--ageSpec <ageSpec>] \
<inputDir> \
<outputDir>
Run
This plugin can be run in two modes: natively as a python package or as a containerized docker image. The PyPI mode is largely included for completeness sake and only useful if run against some pre-processed tree that exists in the filesystem.
Using PyPI
You probably do not want to run the PyPI version unless you are a developer! Mostly likely you want the docker containerized run – see the next section.
To run from PyPI, simply do a
pip install freesurfer_pp_moc
and run with
freesurfer.py --man /tmp /tmp
Using docker run
The real utility of this package is to run it containerized against bundled data that is packed into the container.
Assign an “input” directory to /incoming and an “output” directory to /outgoing. Note that the “input” directory is effectively ignored by this plugin, but is required. Make sure that the host $(pwd)/out directory is world writable!
In the simplest sense, the plugin can be run with
mkdir in out && chmod 777 out
docker run --rm -v $(pwd)/in:/incoming -v $(pwd)/out:/outgoing \
fnndsc/pl-freesurfer_pp_moc freesurfer_pp_moc.py \
/incoming /outgoing
which will copy only the internal stats directory from a 10-yr/06-mo/01-da subject to the output. By specifying a --copySpec stats,3D,sag,cor,tra several additional directories containing png image frames through parcellated sagittal, coronal, and transverse (axial) planes as well as multiple 3D images are also copied.
Examples
Check available pre-processed runs
To get a listing of the internal tree of already processed and available FreeSurfer choices:
docker run --rm -v $(pwd)/in:/incoming -v $(pwd)/out:/outgoing \
fnndsc/pl-freesurfer_pp_moc freesurfer_pp_moc.py \
-T ../preprocessed \
/incoming /outgoing
This will print a tree of the available choices of preprocessed data in a directory tree.
Copy the default for a selected pre-processed run
Select one run, say the 08-yr/07-mo/16-da and specify that to copy:
docker run --rm -v $(pwd)/in:/incoming -v $(pwd)/out:/outgoing \
fnndsc/pl-freesurfer_pp_moc freesurfer_pp_moc.py \
-a 08-07-16 \
/incoming /outgoing
Simulate a processing delay
To simulate a processing delay, specify some time in seconds:
docker run --rm -v $(pwd)/in:/incoming -v $(pwd)/out:/outgoing \
fnndsc/pl-freesurfer_pp_moc freesurfer_pp_moc.py \
-a 08-07-16 \
-P 20 \
/incoming /outgoing
Explicitly copy all the data including images from a pre-processed run
To copy all the image directories from the 10-yr/06-mo/01-da subject,
docker run --rm -v $(pwd)/in:/incoming -v $(pwd)/out:/outgoing \
fnndsc/pl-freesurfer_pp_moc freesurfer_pp_moc.py \
-a 10-06-01 \
-c stats,sag,cor,tra,3D \
/incoming /outgoing
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file freesurfer_pp_moc-2.2.2.tar.gz
.
File metadata
- Download URL: freesurfer_pp_moc-2.2.2.tar.gz
- Upload date:
- Size: 6.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c268f90f746abe077b8651f4608578c1a0269745e61379e07cc21f3b1b894672 |
|
MD5 | f22d63b0cce4fff7b0f8ef24017f7fda |
|
BLAKE2b-256 | 4f273b518abb5dcbd586655bfc403d637491e11942cde6587719bce1dd71480a |