Skip to content

Commit

Permalink
Merge pull request #109 from PolarizedLightFieldMicroscopy/axial_voxel
Browse files Browse the repository at this point in the history
Axial dimension of voxels can be larger
  • Loading branch information
gschlafly authored Sep 23, 2024
2 parents 06b457f + 69d4889 commit 2518d00
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 11 deletions.
4 changes: 2 additions & 2 deletions config/spicule/iter_config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"n_epochs": 10,
"n_epochs": 100,
"regularization_weight": 0.5,
"lr": 1e-3,
"lr_birefringence": 1e-3,
Expand All @@ -10,7 +10,7 @@
"datafidelity": "euler",
"regularization_fcns": [
["birefringence active L2", 10000],
["birefringence active negative penalty", 1000000]
["birefringence active negative penalty", 1000]
],
"nerf_mode": false,
"from_simulation": false,
Expand Down
4 changes: 2 additions & 2 deletions config/spicule/optical_config.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"volume_shape" : [31, 110, 110],
"axial_voxel_size_um" : 1.0,
"cube_voxels" : true,
"axial_voxel_size_um" : 6.75,
"cube_voxels" : false,
"pixels_per_ml" : 16,
"n_micro_lenses" : 94,
"n_voxels_per_ml" : 1,
Expand Down
2 changes: 1 addition & 1 deletion recon_scripts/spicule.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,6 @@ def recon_spicule(
init_vol_path = None
recon_spicule(
init_vol_path,
"debug",
"axial_voxels",
load_rays=True
)
7 changes: 3 additions & 4 deletions src/VolumeRaytraceLFM/abstract_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,8 +477,8 @@ def rays_through_vol(pixels_per_ml, naObj, nMedium, volume_ctr_um):
pixel behind each lenslet
naObj (float): numerical aperture of the objective lens
nMedium (float): refractive index of the volume
volume_ctr_um (np.array): 3D vector containing the coordinates of the center of the
volume in volume space units (um)
volume_ctr_um (np.array): 3D vector containing the coordinates of the center
of the volume in volume space units (um)
Returns:
ray_enter (np.array): (3, X, X) array where (3, i, j) gives the coordinates
within the volume ray entrance plane for which the
Expand Down Expand Up @@ -909,8 +909,7 @@ def _filter_invalid_rays(
)

def compute_ray_collisions(self, ray_enter, ray_exit, voxel_size_um, vol_shape):
"""
Computes parameters for collisions of rays with voxels.
"""Computes parameters for collisions of rays with voxels.
For each ray defined by start (ray_enter) and end (ray_exit) points,
calculates the intersected voxels and lengths of intersections within
a volume of given shape (vol_shape) and voxel size (voxel_size_um).
Expand Down
8 changes: 6 additions & 2 deletions src/VolumeRaytraceLFM/reconstructions.py
Original file line number Diff line number Diff line change
Expand Up @@ -950,8 +950,12 @@ def visualize_and_save(self, ep, fig, output_dir):
Delta_n = volume_estimation.get_delta_n().detach().unsqueeze(0)
else:
Delta_n = volume_estimation.get_delta_n().detach().unsqueeze(0)
mip_image = convert_volume_to_2d_mip(Delta_n)
mip_image_np = prepare_plot_mip(mip_image, plot=False)
vol_size_um = self.optical_info["voxel_size_um"]
rel_scaling_factor = vol_size_um[0] / vol_size_um[2]
mip_image = convert_volume_to_2d_mip(
Delta_n, scaling_factors=(1, 1, rel_scaling_factor)
)
mip_image_np = prepare_plot_mip(mip_image, plot=True)
plot_iteration_update_gridspec(
self.birefringence_mip_sim,
self.ret_img_meas,
Expand Down

0 comments on commit 2518d00

Please sign in to comment.