Skip to content

Commit

Permalink
remove unnecessary parameter no longer used
Browse files Browse the repository at this point in the history
  • Loading branch information
frisograce committed Jul 16, 2024
1 parent 4c4eb45 commit d2a3024
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def update_settings_for_use_of_model_based_volume_creator(self, global_settings)
mediprene_layer_height_mm = self.mediprene_membrane_height_mm
heavy_water_layer_height_mm = probe_size_mm - mediprene_layer_height_mm
spacing_mm = global_settings[Tags.SPACING_MM]
old_volume_height_pixels = int(global_settings[Tags.DIM_VOLUME_Z_MM] / spacing_mm)
old_volume_height_pixels = round(global_settings[Tags.DIM_VOLUME_Z_MM] / spacing_mm)

if Tags.US_GEL in volume_creator_settings and volume_creator_settings[Tags.US_GEL]:
us_gel_thickness = np.random.normal(0.4, 0.1)
Expand Down Expand Up @@ -143,12 +143,9 @@ def update_settings_for_use_of_model_based_volume_creator(self, global_settings)
for molecule in structure_dict[Tags.MOLECULE_COMPOSITION]:
old_volume_fraction = getattr(molecule, "volume_fraction")
if isinstance(old_volume_fraction, torch.Tensor):
struc_start_vox = torch.tensor(structure_dict[Tags.STRUCTURE_START_MM])
struc_end_vox = torch.tensor(structure_dict[Tags.STRUCTURE_END_MM])
structure_size = (struc_end_vox - struc_start_vox) / spacing_mm
if old_volume_fraction.shape[2] == old_volume_height_pixels:
width_shift_pixels = int(width_shift_for_structures_mm / spacing_mm)
z_shift_pixels = int(z_dim_position_shift_mm / spacing_mm)
width_shift_pixels = round(width_shift_for_structures_mm / spacing_mm)
z_shift_pixels = round(z_dim_position_shift_mm / spacing_mm)
padding_height = (z_shift_pixels, 0, 0, 0, 0, 0)
padding_width = ((width_shift_pixels, width_shift_pixels), (0, 0), (0, 0))
padded_up = F.pad(old_volume_fraction, padding_height, mode='constant', value=0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,8 @@ def create_simulation_volume(self) -> dict:
dtype=torch.float, device=self.torch_device)
max_added_fractions = torch.zeros((x_dim_px, y_dim_px, z_dim_px), dtype=torch.float, device=self.torch_device)
wavelength = self.global_settings[Tags.WAVELENGTH]
volume_size = torch.tensor([x_dim_px, y_dim_px, z_dim_px])

for structure in priority_sorted_structures(self.global_settings, self.component_settings, volume_size):
for structure in priority_sorted_structures(self.global_settings, self.component_settings):
self.logger.debug(type(structure))

structure_properties = structure.properties_for_wavelength(self.global_settings, wavelength)
Expand Down
2 changes: 1 addition & 1 deletion simpa/utils/libraries/structure_library/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
define_vessel_structure_settings


def priority_sorted_structures(settings: Settings, volume_creator_settings: dict, volume_size: torch.Tensor):
def priority_sorted_structures(settings: Settings, volume_creator_settings: dict):
"""
A generator function to lazily construct structures in descending order of priority
"""
Expand Down

0 comments on commit d2a3024

Please sign in to comment.