8000 Write out config file needed to run sample script from bash by gdoubleyew · Pull Request #42 · brainiak/brainiak-aperture · GitHub
[go: up one dir, main page]

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions notebooks/real-time/rtcloud_notebook.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"\n",
"We will begin wrapping the sample.py script within the rtcloud projectInterface. In a normal deployment the projectInterface (and sample.py) would then run in the cloud and the scanner images would be sent to the cloud where our sample.py script would build the classifier model and do classification. The projectInterface handles remote file communication for reading the scanner images and providing the classification results. It also has a web-based user interface for viewing and controlling the experiment and changing settings. In this notebook the different process all run on the the computer that jupyter is running on.\n",
"\n",
"In the steps below, we will first start the projectInterface which will watch for dicom files to process. We will then start the synthetic data generator which will generate a new dicom image every 2 seconds. And finally we will start a web browser within this notebook for controlling the experiment. Once you start the web interface you can click the 'Run' button to start the sample.py script watching for and processing images via the projectInterface. (You can also open the web interface on a different tab in your browser, http://localhost:8888.)\n",
"In the steps below, we will first start the projectInterface which will watch for dicom files to process. We will then start the synthetic data generator which will generate a new dicom image every 2 seconds. And finally we will start a web browser within this notebook for controlling the experiment. Once you start the web interface you can click the 'Run' button to start the sample.py script watching for and processing images via the projectInterface. (You can also open the web interface on a different tab in your browser, http://localhost:8889.)\n",
"\n",
"## Annotated Bibliography\n",
"\n",
Expand Down Expand Up @@ -77,6 +77,7 @@
"import sys\n",
"import threading\n",
"import argparse\n",
"import toml\n",
"\n",
"#---- Load important brainiak modules\n",
"import brainiak.utils.fmrisim_real_time_generator as sim\n",
Expand All @@ -101,6 +102,7 @@
"scriptToRun = os.path.join(path_to_notebook, 'sample.py')\n",
"initScript = os.path.join(path_to_notebook, 'initialize.py')\n",
"finalizeScript = os.path.join(path_to_notebook, 'finalize.py')\n",
"configFile = os.path.join(path_to_notebook, 'sample-config.toml') \n",
"\n",
"#---- Declare the total number of TRs (timepoints) you want to generate, and how many should be training\n",
"num_TRs = 200\n",
Expand Down Expand Up @@ -156,6 +158,9 @@
" 'minExpectedDicomSize' : 200000, # expected size for the dicom data\n",
"})\n",
"\n",
"with open(configFile, 'w') as fp:\n",
" toml.dump(config, fp)\n",
"\n",
"args = argparse.Namespace()\n",
"args.projectName = 'sample'\n",
"args.projectDir = path_to_notebook\n",
Expand Down Expand Up @@ -304,8 +309,7 @@
"outputs": [],
"source": [
"# Run the classification script from the command line instead of from the browser interface\n",
"!python -u /Users/gwallace/src/github/brainiak-aperture/notebooks/real-time/sample.py \\\n",
"-c /Users/gwallace/src/github/brainiak/rt-cloud/web/conf/cfg_sub001_synthetic_day1_run1.toml"
"!python -u $scriptToRun -c $configFile"
]
},
{
Expand Down
0