diff --git a/demos/gfactor-demo/gfactor-demo-real_data.ipynb b/demos/gfactor-demo/gfactor-demo-real_data.ipynb index cbf6da4..fa08e81 100644 --- a/demos/gfactor-demo/gfactor-demo-real_data.ipynb +++ b/demos/gfactor-demo/gfactor-demo-real_data.ipynb @@ -36,7 +36,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "import numpy as np\n", @@ -53,6 +55,22 @@ "rcParams['figure.figsize'] = 7, 7" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Running BART commands in Python\n", + "As of v0.4.03, BART commands are run with the python module under `bart/python/bart.py`. This module writes data to disk with `cfl.writecfl`, runs a bart command in the shell, and then loads the result with `cfl.readcfl`. This leads to large writes to disk, which can be slow. It is suggested to make a RAM disk to speed this up.\n", + "\n", + "Alternatively, the master branch has an experimental interface called `pyBART`, which does not write to disk. However, it is not yet in a finished state.\n", + "\n", + "After importing bart, commands are run like this:\n", + "```python\n", + "out1, out2, out3 = bart(3, 'command -x arg1 -y arg2 -z arg3', input1, input2)\n", + "```\n", + "Here, the first argument tells bart that three outputs are returned. The second argument is the actual command. The later arguments are the numpy files that the command will use. When running the commands, output will be seen in the terminal/notebook shell." + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -64,7 +82,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "print('loading data')\n", @@ -105,7 +125,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "noise_flat = np.reshape(noise, (-1, nc))\n", @@ -152,7 +174,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "assert np.linalg.norm(mask - (np.linalg.norm(ksp, axis=2) != 0)) < 1E-5, 'mask does not match data!'\n", @@ -175,7 +199,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "reco = bart(1, 'pics -S -i 150', ksp[:,:,None,:], sens[:,:,None,:])\n", @@ -221,6 +247,7 @@ "cell_type": "code", "execution_count": null, "metadata": { + "collapsed": true, "scrolled": true }, "outputs": [], @@ -253,7 +280,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "recons_noise = np.zeros((nx, ny, n_mc), dtype=np.complex)\n", @@ -279,7 +308,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "recons_std = np.std(recons.real, axis=2)\n",