-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNotes.txt
110 lines (82 loc) · 4.36 KB
/
Notes.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
Organization of Light Field Ray Trace Python Code
----------------------------------------------------
LFRayTraceVoxParams.py
Holds the Input parameters for both generating (run LFRayTraceVoxGenerate) and
projecting (run LFRayTraceVoxProjection):
voxPitch and # of uLenses
also creates angles, camPix, Entrance and Exit coordinates arrays.
LFRayTraceVoxSpace.py
Calculates spatial coordinates and dimensions
siddon2.py
The Siddon algorithm.
LFRayTraceVoxGenerate.py
Generates LFRTvox, a mapping of the rays passing through all the voxels in
the working space to the sensor plane.
Saves this array to a file (see Directories for data output below.)
LFRayTraceVoxProjection.py
The samples to be projected are specified, or it can run projections on all the
files in the samples/ folder.
It creates the light field image by projecting all rays from the sample voxels.
From the light field image it then generates a 16x16 array of perspective images.
(see Directories for data output below.)
(Currently, for testing...
voxPitches is a list of voxPitch values, e.g. [(26 / 15) * 3, (26 / 15) * 1, (26 / 15) / 3, (26 / 15) / 5]
or [5.2, 1.73, 0.57, 0.346]
ulenseses a list of # of uLenses, e.g. [9, 15, 33, 65, 115]
LFRayTraceVoxGenerate.__main__
iteratively calls generateLFRTvoxels(ulenses, voxPitch)
LFRayTraceVoxProjection.__main__
iteratively calls projectSamples(ulenses, voxPitch)
)
-- Directories for data output:
Data is written to separate directories, depending on the ulenses and voxPitch parameters
with this pattern:
- LFRTVoxel files are saved as:
lfrtvox/[uLenses]/[voxPitch]/lfvox_[uLenses]_[voxPitch].npy
(e.g. lfrtvox/24/0_578/lfvox_24_0_578.npy)
- Light field images are saved as:
lfimages/[uLenses]/[voxPitch]/[name]_[parms].plm.tiff
(e.g. lfimages/24/0_578/Tripod_1B_[0, 0, 0].plm.tiff)
- Perspective images, the same directory as lightfield images, with [name]_[parms].plm.psv.tiff
(e.g. (e.g. lfimages/24/0_578/Tripod_1B_[0, 0, 0].plm.psv.tiff)
samples.py
Creates test samples
-- Simple Sample Objects For Testing (in samples.py)
Lines in the x, y and z directions, a diagonal line, and a block,
all with the value = 1 in the occupied voxels.
These object can be displaced within the object space by changing
offsets = [x, y, z] in the runProjection function.
Sample Input Data in samples/ directory
Imports sample objects in .txt formats (from Mathematica)
Test Samples include:
cylindrical objects (bundles) that have all a cylinder diameter of 6 voxPitch and a length of 30 µLensPitch.
The first bundle (bundle1_0_0.txt) is oriented parallel to the Y-axis, hence perpendicular to the optical axis.
The second bundle (bundle2_45_45.txt) is first rotated by 45 degree around the X-axis and then rotated out of the Y-Z plane by 45 degree.
The third bundle (bundle3_0_90.txt) is parallel to the X-axis.
The bundles are all rasterized with a voxelPitch of 0.865µm.
==============================================================================================
Notes:
-- Orientation of Axes, Coordinated
I've choosen to consistently display results using an origin (0,0) at lower left.
When an array is plotted as an image in matplotlib, this can be specified by
plot.imshow(array, origin='lower')
For tiff files, the array can be flipped vertically like this:
tifffile.imsave(filename, np.flipud(array))
-- Display LF Image with gamma <> 1
You can specify gamma when matplotlib images are plotted to show low vales.
Perspective Images
Generates (uLenses x uLenses) array of (16 x 16) perspective images
helpful for validation, seeing geometry of sample.
Next steps
--------------------------------------------------------
Compute largest space, highest resolution map
110 uLenses
Testing and Validation of results, geometry, etc.
If many occupied voxels, accum intensity goes nuts...
Image Data Management
Add Metadata in tiff file
ImageNavigator Ideas...
Handle .plm files
Pairs of lenslet and perspective images. Same name_parms
name_parms.plm.tiff
name_parms.plm.psv.tiff