Skip to content

Commit

Permalink
finished plotting adjacent frames
Browse files Browse the repository at this point in the history
  • Loading branch information
drinnenb committed Feb 15, 2021
1 parent 95e3050 commit 32cc9d5
Showing 1 changed file with 41 additions and 55 deletions.
96 changes: 41 additions & 55 deletions notebooks/check_artefact_removal.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -93,66 +93,52 @@
},
{
"cell_type": "code",
"execution_count": 21,
"execution_count": 1,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"['Index',\n",
" '__add__',\n",
" '__class__',\n",
" '__contains__',\n",
" '__delattr__',\n",
" '__dir__',\n",
" '__doc__',\n",
" '__eq__',\n",
" '__format__',\n",
" '__ge__',\n",
" '__getattribute__',\n",
" '__getitem__',\n",
" '__getnewargs__',\n",
" '__gt__',\n",
" '__hash__',\n",
" '__init__',\n",
" '__init_subclass__',\n",
" '__iter__',\n",
" '__le__',\n",
" '__len__',\n",
" '__lt__',\n",
" '__module__',\n",
" '__mul__',\n",
" '__ne__',\n",
" '__new__',\n",
" '__reduce__',\n",
" '__reduce_ex__',\n",
" '__repr__',\n",
" '__rmul__',\n",
" '__setattr__',\n",
" '__sizeof__',\n",
" '__slots__',\n",
" '__str__',\n",
" '__subclasshook__',\n",
" '_asdict',\n",
" '_fields',\n",
" '_fields_defaults',\n",
" '_make',\n",
" '_replace',\n",
" 'count',\n",
" 'frame',\n",
" 'index',\n",
" 'y_max',\n",
" 'y_min',\n",
" 'z_plane']"
]
},
"execution_count": 21,
"metadata": {},
"output_type": "execute_result"
"ename": "NameError",
"evalue": "name 'artefact' is not defined",
"output_type": "error",
"traceback": [
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[1;31mNameError\u001b[0m Traceback (most recent call last)",
"\u001b[1;32m<ipython-input-1-abc95ac08ef1>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[0;32m 1\u001b[0m \u001b[0mnsamples\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;36m5\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 2\u001b[1;33m \u001b[0msamples\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0martefact\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;33m:\u001b[0m\u001b[0mnsamples\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mreset_index\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 3\u001b[0m \u001b[0mncols\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;36m6\u001b[0m\u001b[1;33m;\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 4\u001b[0m _, axes = plt.subplots(nsamples, ncols, figsize=(5*ncols, 5*nsamples), \n\u001b[0;32m 5\u001b[0m \u001b[0msharex\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;32mTrue\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0msharey\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;32mTrue\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
"\u001b[1;31mNameError\u001b[0m: name 'artefact' is not defined"
]
}
],
"source": [
"dir(s)"
"nsamples = 5\n",
"samples = artefact[:nsamples].reset_index()\n",
"ncols = 6;\n",
"_, axes = plt.subplots(nsamples, ncols, figsize=(5*ncols, 5*nsamples), \n",
" sharex=True, sharey=True,\n",
" constrained_layout=True) \n",
"\n",
"for icol, ii in enumerate(range(-1,2)):\n",
" axes[0][icol].set_title('Uncorrected: {}'.format(ii),fontsize=20)\n",
" axes[0][icol+3].set_title('Corrected: {}'.format(ii),fontsize=20)\n",
"\n",
"\n",
"for row, s in enumerate(samples.itertuples()):\n",
" axes[row][0].set_ylabel('Frame {} ,plane {}'.format(s.frame,s.z_plane), fontsize=20)\n",
" for icol,ii in enumerate(range(-1,2)):\n",
" axes[row][icol].imshow(uncorrected[s.frame+ii, s.z_plane],vmin=corrected[s.frame,s.z_plane].min(),vmax=corrected[s.frame,s.z_plane].max())\n",
" axes[row][icol].axhline(s.y_min, c='r', lw=2)\n",
" axes[row][icol].axhline(s.y_max, c='r', lw=2)\n",
" axes[row][icol+3].imshow(corrected[s.frame+ii, s.z_plane],vmin=corrected[s.frame,s.z_plane].min(),vmax=corrected[s.frame,s.z_plane].max())\n",
" axes[row][icol+3].axhline(s.y_min, c='r', lw=2)\n",
" axes[row][icol+3].axhline(s.y_max, c='r', lw=2)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"plt.imshow(uncorrected[149,1])"
]
}
],
Expand All @@ -172,7 +158,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.4"
"version": "3.7.1"
}
},
"nbformat": 4,
Expand Down

0 comments on commit 32cc9d5

Please sign in to comment.