-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
29 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,9 +8,9 @@ | |
"\n", | ||
"### Tom Furnival ([[email protected]](mailto:[email protected]))\n", | ||
"\n", | ||
"HyperSpy is an open-source Python library that makes signal handling and processing straightforward in Python, with a friendly API. \n", | ||
"PGURE-SVT is an algorithm designed to denoise image sequences acquired in microscopy. It exploits the correlations between consecutive frames to form low-rank matrices, which are then recovered using a technique known as nuclear norm minimization. An unbiased risk estimator for mixed Poisson-Gaussian noise is used to automate the selection of the regularization parameter, while robust noise and motion estimation maintain broad applicability to many different types of microscopy.\n", | ||
"\n", | ||
"While you can use `pguresvt.pguresvt.SVT` to denoise a numpy array directly, `pguresvt.hspysvt.HSPYSVT` can directly denoise a HyperSpy signal." | ||
"This example notebook shows how PGURE-SVT can be combined with [HyperSpy](http://hyperspy.org), which is an open-source Python library that makes signal handling and processing straightforward in Python, with a friendly API. While you can use `pguresvt.pguresvt.SVT` to denoise a numpy array directly, `pguresvt.hspysvt.HSPYSVT` can directly denoise a HyperSpy signal." | ||
] | ||
}, | ||
{ | ||
|
@@ -69,7 +69,7 @@ | |
"outputs": [], | ||
"source": [ | ||
"# Load example dataset\n", | ||
"movie = hs.load(\"../test/examplesequence.tif\")\n", | ||
"movie = hs.load(\"examplesequence.tif\")\n", | ||
"\n", | ||
"# Truncate to 25 frames, and plot the result\n", | ||
"movie = movie.inav[:25]\n", | ||
|
@@ -132,7 +132,9 @@ | |
" tol=1e-7,\n", | ||
" median=5,\n", | ||
" hotpixelthreshold=10)\n", | ||
"```" | ||
"```\n", | ||
"\n", | ||
"In this example we do not use the noise estimation procedure, and instead provide the known parameters to the algorithm directly. This information is used by the PGURE optimizer to calculate the threshold." | ||
] | ||
}, | ||
{ | ||
|
@@ -144,11 +146,12 @@ | |
}, | ||
"outputs": [], | ||
"source": [ | ||
"# Initialize with default parameters\n", | ||
"# Initialize with suggested parameters\n", | ||
"svt = hspysvt.HSPYSVT(patchsize=4,\n", | ||
" patchoverlap=2,\n", | ||
" length=15,\n", | ||
" threshold=0.5,\n", | ||
" estimatenoise=False,\n", | ||
" alpha=gain,\n", | ||
" mu=offset,\n", | ||
" sigma=sigma,\n", | ||
" tol=1e-6)" | ||
] | ||
}, | ||
|
@@ -178,19 +181,33 @@ | |
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"### 2. Time-resolved STEM image sequence\n", | ||
"### 2. Time-resolved ADF-STEM image sequence\n", | ||
"\n", | ||
"First, we load the simulated dataset using HyperSpy, and then corrupt it with a mixture of Poisson and Gaussian noise.\n" | ||
"In this example we apply PGURE-SVT to an experimental dataset of a nanoparticle acquired using ADF-STEM. Here the noise levels are not known, so a noise estimation procedure is used." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": { | ||
"collapsed": true | ||
"collapsed": false | ||
}, | ||
"outputs": [], | ||
"source": [] | ||
"source": [ | ||
"# Load example dataset\n", | ||
"expt_movie = hs.load(\"experimentalsequence.tif\")\n", | ||
"\n", | ||
"# Initialize with suggested parameters\n", | ||
"expt_svt = hspysvt.HSPYSVT(patchsize=4,\n", | ||
" patchoverlap=2, \n", | ||
" tol=1e-6)\n", | ||
"\n", | ||
"# Run the denoising\n", | ||
"denoised_movie = expt_svt.denoise(expt_movie)\n", | ||
"\n", | ||
"# Plot denoised data\n", | ||
"denoised_movie.plot()" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
|
File renamed without changes.