Skip to content

Commit

Permalink
Add example test run with results and update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
bishesh committed Mar 26, 2017
1 parent 3c68d2e commit 7e1ce47
Show file tree
Hide file tree
Showing 13 changed files with 55 additions and 2 deletions.
Binary file added basicExample/bMask1.mha
Binary file not shown.
Binary file added basicExample/bTest1.mha
Binary file not shown.
Binary file added basicExample/basicTest_ComposedField.nii.gz
Binary file not shown.
Binary file added basicExample/basicTest_T1AtrophyModified.nii.gz
Binary file not shown.
Binary file added basicExample/basicTest_T1div.nii.gz
Binary file not shown.
Binary file added basicExample/basicTest_T1vel.nii.gz
Binary file not shown.
Binary file added basicExample/basicTest_T2AtrophyModified.nii.gz
Binary file not shown.
Binary file added basicExample/basicTest_T2div.nii.gz
Binary file not shown.
Binary file added basicExample/basicTest_T2vel.nii.gz
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added basicExample/test1Atrophy1.mha
Binary file not shown.
57 changes: 55 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,60 @@ This should install the software to your machine.
The main simulator executable is `build/src/simul_atrophy`.
Run with `-h` option to see in detail how to use it.

Otherwise, there is also a python script at 'simul-atrophy/scripts/simul_atrophy.py' which you can use.
Once again, use `-h` option to see the details.
### A basic example
One very basic example of how to use simul@trophy is shown below on a relative small image so that this can be run quickly on a normal laptop/desktop.
Note that if your image sizes are too large, usually greater than 120^3 you must use cluster computing for running the model due to memory limitations on normal desktops.
Here I have used a dummy object instead of brain, but you can create your own test set by downsampling brain images too.
Any file format readable by ITK will work; the example here uses `.mha` format.

The input files and the results of this basic example can be found at the directory `basicExample`.

There are three main input files:

1. Input atrophy map: `test1Atrophy1.mha`

1. Input segmentation file: `bMask.mha`

1. Input image file: `bTest1.mha`

The input parameters $\mu$ and $\lambda$ are set to 1 for both tissue and CSF regions.

The example is run for two steps.

```
$build/src/simul_atrophy -parameters 1,1,1,1 -boundary_condition dirichlet_at_skull --relax_ic_in_csf -atrophyFile basicExample/test1Atrophy1.mha -maskFile basicExample/bMask1.mha -imageFile basicExample/bTest1.mha --invert_field_to_warp -numOfTimeSteps 2 -resPath ./basicExample/ -resultsFilenamesPrefix basicTest1_
```

If everything is all right you should be getting the following output in your display terminal:
```
Model will be run for 2 time steps
dmda of size: (21,41,21)
grid with the spacings hx, hy, hz: (1.000000,1.000000,1.000000)
dirichlet_at_skull=>Skull velocity = 0.
Incompressibility constraint relaxed where brain mask has label 1
Incompressibility constraint relaxation coefficient: 1/lambda.
solver uses discretization for constant viscosity case!
muBrain=1.000000, muCsf=1.000000, lambdaBrain=1.000000, lambdaCsf=1.000000
First Lame Parameter (lambda) is a scalar.
RHS will be taken as (mu + lambda)grad(a), i.e. with Lame parameters.
computing the operator for linear solve with 8 point stencil for divergence
Relax IC with div(u) + kp = 0 on relax cells
Displacement field inversion: tolerance not reached in 0 voxels
Displacement field inversion: tolerance not reached in 0 voxels
```

The output files created will be placed in the folder `basicExample`.
The repository already contains the results of same example with prefix `basicTest_`.
Now, after running this example you should get new files with the prefix `basicTest1_`.


Instead of using the `simul_atrophy` executable directly, you can also a run the model by using the python script at 'simul-atrophy/scripts/simul_atrophy.py'.
Please see `-h` option to see the details of the script.


0 comments on commit 7e1ce47

Please sign in to comment.