Skip to content

Commit

Permalink
Moved example data
Browse files Browse the repository at this point in the history
  • Loading branch information
tjof2 committed May 10, 2016
1 parent cef6d9a commit e29ddbd
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 12 deletions.
41 changes: 29 additions & 12 deletions examples/PGURE-SVT HyperSpy Demo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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."
]
},
{
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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."
]
},
{
Expand All @@ -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)"
]
},
Expand Down Expand Up @@ -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": {
Expand Down
File renamed without changes.

0 comments on commit e29ddbd

Please sign in to comment.