Skip to content

Commit

Permalink
Updated test notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
antmsbrito committed Aug 9, 2023
1 parent 0f7c5c9 commit 39a60e2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 18 deletions.
16 changes: 7 additions & 9 deletions tests/notebooks/le_interpolation_catmull_rom.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,18 @@
"metadata": {},
"outputs": [],
"source": [
"import numpy as np\n",
"from nanopyx.liquid._le_interpolation_catmull_rom import ShiftAndMagnify\n",
"from nanopyx.core.generate.noise_add_simplex import get_simplex_noise\n",
"from nanopyx.core.transform.binning import rebin_2d\n",
"\n",
"M = 11\n",
"# downloader = ExampleDataManager()\n",
"# z = downloader.get_ZipTiffIterator('SMLMS2013_HDTubulinAlexa647')\n",
"#image = z[0]\n",
"M = 2\n",
"\n",
"image = get_simplex_noise(64*M, 32*M, amplitude=1000)\n",
"image = get_simplex_noise(64*M, 32*M, amplitude=1000).astype(np.float32)\n",
"imageDownsampled = rebin_2d(image, M, mode=\"mean\")\n",
"\n",
"SM = ShiftAndMagnify(testing=True)\n",
"bench_values = SM.benchmark(image, 10, -10, 4, 4)\n",
"bench_values = SM.benchmark(image, 10, 0, 2, 2)\n",
"\n",
"images = []\n",
"titles = []\n",
Expand All @@ -30,7 +28,7 @@
" run_times.append(run_time)\n",
" titles.append(title)\n",
" images.append(image[0,:,:])\n",
" \n",
" \n",
"# show images in seaborn\n",
"from matplotlib import pyplot as plt\n",
"import seaborn as sns\n",
Expand Down Expand Up @@ -73,10 +71,10 @@
"source": [
"import numpy as np\n",
"\n",
"image = np.repeat(get_simplex_noise(512, 512, amplitude=1000)[np.newaxis,:, :], 3, axis=0)\n",
"image = np.repeat(get_simplex_noise(256, 256, amplitude=1000)[np.newaxis,:, :], 3, axis=0)\n",
"\n",
"SM = ShiftAndMagnify(testing=True)\n",
"bench_values = SM.benchmark(image, 5, -5, 4, 4)\n",
"bench_values = SM.benchmark(image, 200, -200, 4, 4)\n",
"\n",
"images = []\n",
"titles = []\n",
Expand Down
15 changes: 6 additions & 9 deletions tests/notebooks/le_interpolation_nearest_neighbor.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,13 @@
},
"outputs": [],
"source": [
"import numpy as np\n",
"from nanopyx.liquid._le_interpolation_nearest_neighbor import ShiftAndMagnify\n",
"from nanopyx.core.generate.noise_add_simplex import get_simplex_noise\n",
"from nanopyx.core.transform.binning import rebin_2d\n",
"\n",
"M = 21\n",
"# downloader = ExampleDataManager()\n",
"# z = downloader.get_ZipTiffIterator('SMLMS2013_HDTubulinAlexa647')\n",
"#image = z[0]\n",
"\n",
"image = get_simplex_noise(64*M, 32*M, amplitude=1000)\n",
"M = 2\n",
"image = get_simplex_noise(64*M, 32*M, amplitude=1000).astype(np.float32)\n",
"imageDownsampled = rebin_2d(image, M, mode=\"mean\")\n",
"\n",
"SM = ShiftAndMagnify(testing=True)\n",
Expand Down Expand Up @@ -79,10 +76,10 @@
"source": [
"import numpy as np\n",
"\n",
"image = np.repeat(get_simplex_noise(512, 512, amplitude=1000)[np.newaxis,:, :], 3, axis=0)\n",
"\n",
"image = np.repeat(get_simplex_noise(256, 256, amplitude=1000)[np.newaxis,:, :], 3, axis=0)\n",
"print(image.shape)\n",
"SM = ShiftAndMagnify(testing=True)\n",
"bench_values = SM.benchmark(image, 5, -5, 4, 4)\n",
"bench_values = SM.benchmark(image, 200, -200, 4, 4)\n",
"\n",
"images = []\n",
"titles = []\n",
Expand Down

0 comments on commit 39a60e2

Please sign in to comment.