Skip to content

Commit

Permalink
Fixed bug where selected file was not loading
Browse files Browse the repository at this point in the history
  • Loading branch information
elainehoml committed Aug 29, 2020
1 parent b4f7f64 commit f550499
Showing 1 changed file with 65 additions and 61 deletions.
126 changes: 65 additions & 61 deletions CorView-dev.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"outputs": [],
"source": [
"# Set up, only needs to be run once at beginning\n",
"!conda activate 3DXRH_Vis\n",
"!conda activate CorView\n",
"\n",
"import os, sys, time\n",
"import numpy as np\n",
Expand All @@ -42,18 +42,18 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "06fadf2bf94a456583a09a4979e0ec1d",
"model_id": "0a7f1fc077074dccb305642816a90f94",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"FileChooser(path='C:\\Users\\emlh1n13\\OneDrive - University of Southampton\\Data\\2019-20\\3DXRH_Vis', filename='',…"
"FileChooser(path='C:\\Users\\emlh1n13\\OneDrive - University of Southampton\\Projects\\Aim2\\CorView', filename='', "
]
},
"metadata": {},
Expand All @@ -62,7 +62,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "1fb93178296d4354827e2891a1a4aaac",
"model_id": "7d17ae1cc2c04265b88ea316b587fc8a",
"version_major": 2,
"version_minor": 0
},
Expand All @@ -76,7 +76,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "94686072edfa487395ecf427035cd5af",
"model_id": "10b323681ea84feea98c8fc91047ea58",
"version_major": 2,
"version_minor": 0
},
Expand Down Expand Up @@ -104,7 +104,7 @@
" self.out.clear_output()\n",
" with self.out:\n",
" print(\"Importing image {}, please wait...\".format(self.select_file.selected_filename))\n",
" img_import = io.imread(self.select_file.selected_filename, plugin=\"pil\")\n",
" img_import = io.imread(self.select_file.selected, plugin=\"pil\")\n",
" \n",
" # Is the image a 3D stack?\n",
" if len(img_import.shape) != 3:\n",
Expand Down Expand Up @@ -138,25 +138,25 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 4,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"HN2_test.tif\n"
"HN1_test.tif\n"
]
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "b14396de30884ac7b1fb4106f9a37871",
"model_id": "ec7ae3ff83e54e04ba4c5f087e73b5c3",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"interactive(children=(IntSlider(value=0, description='Slice number', max=304), Output()), _dom_classes=('widge…"
"interactive(children=(IntSlider(value=0, description='Slice number', max=239), Output()), _dom_classes=('widge…"
]
},
"metadata": {},
Expand Down Expand Up @@ -197,7 +197,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -219,7 +219,7 @@
" def _on_load_button_clicked(self, change):\n",
" self.out.clear_output()\n",
" with self.out:\n",
" print(\"Importing image {}, please wait...\".format(self.select_file.selected_filename))\n",
" print(\"Importing image {}, please wait...\".format(self.select_file.selected))\n",
" img_import = io.imread(self.select_file.selected, plugin='pil')\n",
" if len(img_import.shape) != 3:\n",
" raise ValueError(\"Image is not 2D, please choose a 2D image\")\n",
Expand Down Expand Up @@ -292,13 +292,13 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 7,
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "d5838d45bdeb469786e744e134d9200e",
"model_id": "6854bfdd28604f2180bec3f3a3daedb7",
"version_major": 2,
"version_minor": 0
},
Expand All @@ -311,51 +311,55 @@
},
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>Key</th>\n",
" <th>Filenames</th>\n",
" <th>Positions</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>05/12/20183901</td>\n",
" <td>HN2_059_test.tif</td>\n",
" <td>59</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>05/12/20183916</td>\n",
" <td>HN2_124_test.tif</td>\n",
" <td>124</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"application/vnd.jupyter.widget-view+json": {
"model_id": "5cd443ba7a43441882c275b85686a7fe",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"FileChooser(path='C:\\Users\\emlh1n13\\OneDrive - University of Southampton\\Projects\\Aim2\\CorView', filename='', …"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "e24945f20b1048f98c26ce0f09c774bf",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"BoundedFloatText(value=0.0, description='Position of 2D image', max=239.0, step=1.0)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "115322a383044c9badb678ff6e9c1a3f",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
" Key Filenames Positions\n",
"0 05/12/20183901 HN2_059_test.tif 59\n",
"1 05/12/20183916 HN2_124_test.tif 124"
"Button(description='Load image', style=ButtonStyle())"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "01d967cf428b43eb936c4af74e659acd",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"Output()"
]
},
"metadata": {},
Expand All @@ -382,7 +386,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "d4c7a11fab5d430bad38d308dbcf49c0",
"model_id": "b866c42591a04370a672af8b577068c7",
"version_major": 2,
"version_minor": 0
},
Expand Down Expand Up @@ -579,7 +583,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.2"
"version": "3.7.8"
}
},
"nbformat": 4,
Expand Down

0 comments on commit f550499

Please sign in to comment.