Skip to content

Commit

Permalink
update tutorial 4
Browse files Browse the repository at this point in the history
  • Loading branch information
rutgerfick committed Feb 1, 2018
1 parent 4af324a commit 79278d6
Showing 1 changed file with 19 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,15 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Now to make our first multi-compartment model! Don't worry, we start with a simple Ball & Stick model, and the procedure will be very simple and similar as before. First, we instantiate the models we want:"
"To make our first multi-compartment model, we instantiate the models we want to include:"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"stick = cylinder_models.C1Stick()\n",
Expand All @@ -52,7 +54,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Next, we combine them into one model using PartialVolumeCombinedMicrostructureModel. \n",
"Next, we combine them into one model using MultiCompartmentModel. \n",
"Our new model will now be $E = vf_0 * E_{Ball} + vf_1 * E_{Stick}$ where $vf_0$ and $vf_1$ are volume fractions and add up to one."
]
},
Expand All @@ -69,7 +71,9 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"That it! We can again figure out the required parameter names using parameter_cardinality. As we are combining models, the parameter names now have the corresponding model prepended to it."
"The MultiCompartmentModel automatically joins the parameters and other properties of the models that are given as input.\n",
"\n",
"We can again figure out the required parameter names using parameter_cardinality. As you can see, the parameter names now have the corresponding model prepended to it."
]
},
{
Expand Down Expand Up @@ -106,7 +110,9 @@
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"mu = (np.pi / 2., np.pi / 2.)\n",
Expand Down Expand Up @@ -142,9 +148,9 @@
"output_type": "stream",
"text": [
"Using parallel processing with 8 workers.\n",
"Setup brute2fine optimizer in 0.408539056778 seconds\n",
"Fitting of 1 voxels complete in 0.0619370937347 seconds.\n",
"Average of 0.0619370937347 seconds per voxel.\n"
"Setup brute2fine optimizer in 0.418382883072 seconds\n",
"Fitting of 1 voxels complete in 0.292662143707 seconds.\n",
"Average of 0.292662143707 seconds per voxel.\n"
]
}
],
Expand All @@ -160,11 +166,11 @@
{
"data": {
"text/plain": [
"{'C1Stick_1_lambda_par': array([ 1.70004007e-09]),\n",
" 'C1Stick_1_mu': array([ 1.57079729, -1.57078812]),\n",
" 'G1Ball_1_lambda_iso': array([ 3.00000000e-09]),\n",
" 'partial_volume_0': array([ 0.49999748]),\n",
" 'partial_volume_1': array([ 0.50000252])}"
"{'C1Stick_1_lambda_par': array([[ 1.70004007e-09]]),\n",
" 'C1Stick_1_mu': array([[ 1.57079729, -1.57078812]]),\n",
" 'G1Ball_1_lambda_iso': array([[ 3.00000000e-09]]),\n",
" 'partial_volume_0': array([[ 0.49999748]]),\n",
" 'partial_volume_1': array([[ 0.50000252]])}"
]
},
"execution_count": 7,
Expand Down

0 comments on commit 79278d6

Please sign in to comment.