This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tifffile as tiff | |
from bioio import BioImage | |
img = BioImage("your_czi_file_path_here") | |
destination = "destination_folder_for_tiffs" | |
for scene_id, scene in enumerate(img.scenes): | |
img.set_scene(scene) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
# Path to {Documents}\Zemax\Glasscat | |
path = r'C:\Users\David Nguyen\Documents\Zemax\Glasscat' | |
# Initialize return array, which will contain the glass names and vendors | |
allglass = [] | |
# Dispersion formula flag |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
# Path to {Documents}\Zemax\Glasscat | |
path = r'C:\Users\David Nguyen\Documents\Zemax\Glasscat' | |
# Initialize return array, which will contain the glass names and vendors | |
allglass = [] | |
# Loop over the files in the GLASSCAT folder |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Imports | |
import numpy as np | |
import matplotlib.pyplot as plt | |
# Initializations | |
legend = [] | |
spha = [] | |
coma = [] | |
asti = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
path = getDirectory("Choose a Directory"); | |
filename = getFileList(path); | |
newDir = path + "Max Projections" + File.separator; | |
if (File.exists(newDir)) | |
exit("Destination directory already exists; remove it and then run this macro again"); | |
File.makeDirectory(newDir); | |
for (i=0; i<filename.length; i++) { | |
if(endsWith(filename[i], ".stack")) { | |
run("Raw...", "open=["+path+filename[i]+"] image=[16-bit Unsigned] width=1024 height=624 number=20000 little-endian"); | |
//run("Z Project...", "projection=[Max Intensity]"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Modules | |
import os | |
# Open the tolerancing tool | |
MyTol = TheSystem.Tools.OpenTolerancing() | |
# Set criterion to MF value | |
MyTol.Criterion = ZOSAPI.Tools.Tolerancing.Criterions.MeritFunction | |
# Perform a single run iteratively |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
surface = 0 # Saved ending surface | |
wavelength = 0 # Saved wavelength | |
field = 0 # Saved field | |
data = 0 # Total fiber coupling | |
# Retrieve the value of a POPD operand without going into the LDE | |
Total_fiber_coupling = TheSystem.MFE.GetOperandValue(ZOSAPI.Editors.MFE.MeritOperandType.POPD, | |
surface, wavelength, field, data, 0, 0, 0, 0) | |
# Print the value |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create a RayTrace analysis | |
MyRayTrace = TheSystem.Analyses.New_RayTrace() | |
# Check the settings implementation status of this analysis feature in the ZOSAPI | |
print('Does RayTrace have fully-implemented settings?', MyRayTrace.HasAnalysisSpecificSettings) | |
# Retrieve the settings | |
MyRayTraceSettings = MyRayTrace.GetSettings() | |
# Define the settings (or the ray to be traced) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from System import Enum, Int32, Double | |
# Open the BatchRayTrace tool | |
MyBatchRT = TheSystem.Tools.OpenBatchRayTrace() | |
# Add an unpolarized-raytrace | |
ToImageSurface = 3 | |
MaxRays = 1 | |
MyUnpolRT = MyBatchRT.CreateNormUnpol(MaxRays, ZOSAPI.Tools.RayTrace.RaysType.Real, ToImageSurface) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Modules | |
import matplotlib.pyplot as plt | |
# Definition from Standalone application | |
def reshape(data, x, y, transpose = False): | |
"""Converts a System.Double[,] to a 2D list for plotting or post processing | |
Parameters | |
---------- | |
data : System.Double[,] data directly from ZOS-API |
NewerOlder