Commit e5150590 authored by Will Langford's avatar Will Langford

add ctviz

parent 1ed4bb8c
_data/
\ No newline at end of file
_data/
_output/
\ No newline at end of file
{
"cells": [
{
"cell_type": "markdown",
"source": [
"## CTVisualizer\n",
"\nVisualization using [iPyVolume](https://ipyvolume.readthedocs.io/en/latest/)"
],
"metadata": {}
},
{
"cell_type": "code",
"source": [
"import numpy as np\n",
"import ipyvolume as ipv"
],
"outputs": [],
"execution_count": 1,
"metadata": {}
},
{
"cell_type": "code",
"source": [
"# load previously reconstructed volume data (as numpy array)\n",
"data = np.load(\"_output/reconstruction_data.npy\")\n",
"ipv.figure()\n",
"print(np.shape(data))\n",
"vol = ipv.volshow(data)\n",
"ipv.show()"
],
"outputs": [],
"execution_count": 5,
"metadata": {}
}
],
"metadata": {
"kernel_info": {
"name": "python3"
},
"kernelspec": {
"name": "python3",
"language": "python",
"display_name": "Python 3"
},
"language_info": {
"name": "python",
"version": "3.6.4",
"mimetype": "text/x-python",
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"pygments_lexer": "ipython3",
"nbconvert_exporter": "python",
"file_extension": ".py"
},
"nteract": {
"version": "0.12.2"
}
},
"nbformat": 4,
"nbformat_minor": 1
}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -32,7 +32,7 @@ if __name__ == '__main__':
proj = np.load("projection_data.npy")
else:
print("loading angle data...")
ctdata = np.loadtxt("test_scan_250/_ctdata.txt",skiprows=3)
ctdata = np.loadtxt("_data/test_scan_250/_ctdata.txt",skiprows=3)
theta = np.deg2rad(ctdata[:,1])
fname = '_data/test_scan_250/test scan 250_0001.tif'
......@@ -44,11 +44,11 @@ if __name__ == '__main__':
# downsample and minus log
print("downsampling and taking minus log...")
proj = tomopy.minus_log(data[::1,::8,::8])
proj = tomopy.minus_log(data[::1,::4,::4])
print(np.shape(proj))
print("saving projection data...")
np.save('projection_data',proj)
np.save('_output/projection_data',proj)
rot_center = proj.shape[2]/2
......@@ -71,7 +71,7 @@ if __name__ == '__main__':
rec = tomopy.circ_mask(rec, axis=0, ratio=0.75)
print("saving data to reconstruction_data.npy...")
np.save('reconstruction_data',rec)
np.save('_output/reconstruction_data',rec)
# use jupyter notebook to visualize results
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment