Commit 0319d2d8 authored by Jan André Reuter's avatar Jan André Reuter

Update to Jupyter Notebook.

Signed-off-by: default avatarJan André Reuter <jan.andre.reuter@hotmail.de>
parent 5c955d23
Pipeline #25665 passed with stages
in 4 minutes and 51 seconds
......@@ -133,7 +133,8 @@ SLIXLineplotParameterGenerator -i [INPUT-TXT-FILES] -o [OUTPUT-FOLDER] [[paramet
| -------------- | --------------------------------------------------------------------------- |
| `--smoothing` | Smoothing of SLI profiles before evaluation. The smoothing is performed using a Savitzky-Golay filter with 45 sampling points and a second order polynomial. (Designed for measurements with <img src="https://render.githubusercontent.com/render/math?math=\Delta\phi"> < 5° steps to reduce the impact of irrelevant details in the fiber structure, cf. orange vs. black curve in Figure 1c in the [paper](https://github.com/3d-pli/SLIX/blob/master/paper/paper.pdf).) |
| `--with_plots` | Generates plots (png-files) showing the SLI profiles and the determined peak positions (orange dots: before correction; green crosses: after correction). |
| `--target_peak_height` | Change peak tip height used for correcting the peak positions. (Default: 6% of total signal amplitude). Only recommended for experienced users! |
| `--prominence_threshold` | Change the threshold for prominent peaks. Peaks with lower prominences will not be used for further evaluation. (Default: 8% of total signal amplitude.) Only recommended for experienced users! (default: 0.08) |
### Example
The following example demonstrates the evaluation of two SLI profiles, which can be found in the "examples" folder of the SLIX repository:
......@@ -201,8 +202,6 @@ The following example demonstrates the generation of the parameter maps, for two
<img src="https://jugit.fz-juelich.de/j.reuter/slix/-/raw/assets/Screenshot_Demo1.png" height="327">&nbsp;&nbsp;<img src="https://jugit.fz-juelich.de/j.reuter/slix/-/raw/assets/Screenshot_Demo2.png" height="327">
![](https://jugit.fz-juelich.de/j.reuter/slix/-/raw/assets/demo.gif)
#### How to run the demo yourself:
##### 1. Download the needed files:
......
......@@ -529,21 +529,19 @@
"\n",
"```python\n",
"from SLIX import toolbox, visualization, io\n",
"import nibabel\n",
"import numpy\n",
"import os\n",
"import numpy\n",
"\n",
"# loop over all SLI image stacks in the folder 'input_raw'\n",
"for file in input_raw: \n",
" filename_without_extension = os.path.splitext(os.path.basename(file))[0]\n",
" # compute unit vector maps (UnitX, UnitY)\n",
" image = io.imread(file)\n",
" peaks = toolbox.peaks(image)\n",
" prominence_full = toolbox.peak_prominence(image, peaks)\n",
" peaks[prominence_full < 0.08] = 0\n",
" peaks = toolbox.significant_peaks(image)\n",
" centroids = toolbox.centroid_correction(image, peaks)\n",
" directions = toolbox.direction(peaks, centroids)\n",
" UnitX, UnitY = visualization.unit_vectors(directions)\n",
" UnitZ = numpy.zeros(UnitX.shape)\n",
" # save unit vector maps as NIfTI images in the folder 'input_tract' (generate UnitZ filled with zeros)\n",
" io.imsave('input_tract/' + filename_without_extension + '_UnitX.nii', UnitX)\n",
" io.imsave('input_tract/' + filename_without_extension + '_UnitY.nii', UnitY)\n",
......@@ -584,4 +582,4 @@
},
"nbformat": 4,
"nbformat_minor": 1
}
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment