Simulate polarized optical microscopy(POM) image from director field.
- Route 1:
- Generate [ regular-gird director file ] by ansatz-generate.py
- Route 2:
- Read the director information from .vtk file and write a [ .csv ] file by Paraview.
- Convert the [ .csv ] file to the [ original director file ] by director-to-Q.py
- Interpolate [ original director file ] to [ regular-grid director file ] by mesh-to-grid.py
- Route 3:
- Output [ original director file (Q.out) ] file directly from simulation.
- Interpolate [ original director file ] to [ regular-grid director file ] by mesh-to-grid.py
- Route 4 (not recommended)
- Read the director information from .vtk file and convert to [ original director file ] by Read_vtk.py. (This function is not robust)
- Interpolate [ original director file ] to [ regular-grid director file ] by mesh-to-grid.py
This function has limited applicability to parse a .vtk file directly to a coordinate file.
- input: .vtk file
- output: Frame-#-Coordinates.txt and Frame-#-Directors.txt
The interpolation of director field from .vtk outputs work better for Q tensor than director field. This file transforms director to Q tensor assuming that Q is locally uniaxial.
This function uses interpolation to create director field on a regular grid ready to be read by pom-image.py. This file also takes care of rotation by specifiying the Eurler angles. input: The Q tensor profile in the folder Original_Director_Field in .csv format (output from Paraview) or .out file where the first block (n_nodes lines) are coordinates and the second block (n_node lines) are the five independent Q tensor entries (q11, q12, q13, q22, q23) output: [interpolated-directors].txt such as "radial-16p75-rot-x0y0z0-interpolated-directors.txt"
[ regular-grid director file ] fname = "interpolated-directors.txt" X = np.loadtxt(fname,dtype = np.float32);
# the header two lines
[Nx, Ny, Nz] = np.asarray (X[0, :3], dtype = np.int32)
[dx, dy, dz] = X[0, 3:]
[x_min, x_max, y_min, y_max, z_min, z_max] = X[1]
# the actual data
rr = X[2:,:3]; nn = X[2:,3:]
Computes the polarized image with various options. The script will try to load parameters from params.py. If it doesn't exist, user will be prompted to enter parameters manually.
- Input mode:
- single image
- batch processing (specified by file names)
- batch processing (specified by frames)
- Polarizer angle: 0-180 degrees
- Color mode:
- Single wave length
- Simplified color
- Full spectrum color