Skip to content

Commit

Permalink
remove old powerspectrum normalization
Browse files Browse the repository at this point in the history
  • Loading branch information
DSilva27 committed Aug 15, 2024
1 parent 072c1ae commit ddb19f9
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 43 deletions.
4 changes: 0 additions & 4 deletions src/cryo_challenge/_preprocessing/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,3 @@
downsample_volume as downsample_volume,
downsample_submission as downsample_submission,
)
from .normalize import (
compute_power_spectrum as compute_power_spectrum,
normalize_power_spectrum as normalize_power_spectrum,
)
24 changes: 0 additions & 24 deletions src/cryo_challenge/_svd/svd_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@
load_volumes,
load_ref_vols,
remove_mean_volumes,
normalize_power_spectrum_sub,
)
from ..data._validation.config_validators import validate_config_svd
from .._preprocessing.normalize import compute_power_spectrum, normalize_power_spectrum


def run_svd_with_ref(
Expand Down Expand Up @@ -127,13 +125,6 @@ def run_all_vs_all_pipeline(config: dict):
dtype=dtype,
)

volumes = normalize_power_spectrum_sub(
volumes,
metadata,
config["power_spectrum_normalization"]["ref_vol_key"],
config["power_spectrum_normalization"]["ref_vol_index"],
)

volumes, mean_volumes = remove_mean_volumes(volumes, metadata)

U, S, V, coeffs = run_svd_all_vs_all(volumes=volumes)
Expand Down Expand Up @@ -203,21 +194,6 @@ def run_all_vs_ref_pipeline(config: dict):
dtype=dtype,
)

# Normalize Power spectrums
idx_ref_vol = (
metadata[config["power_spectrum_normalization"]["ref_vol_key"]]["indices"][0]
+ config["power_spectrum_normalization"]["ref_vol_index"]
)
ref_power_spectrum = compute_power_spectrum(volumes[idx_ref_vol])
ref_volumes = normalize_power_spectrum(ref_volumes, ref_power_spectrum)

volumes = normalize_power_spectrum_sub(
volumes,
metadata,
config["power_spectrum_normalization"]["ref_vol_key"],
config["power_spectrum_normalization"]["ref_vol_index"],
)

# Remove mean volumes
volumes, mean_volumes = remove_mean_volumes(volumes, metadata)
ref_volumes, mean_volume = remove_mean_volumes(ref_volumes)
Expand Down
15 changes: 0 additions & 15 deletions src/cryo_challenge/data/_io/svd_io_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from typing import Tuple

from ..._preprocessing.fourier_utils import downsample_volume
from ..._preprocessing.normalize import compute_power_spectrum, normalize_power_spectrum


def _remove_mean_volumes_sub(volumes, metadata):
Expand Down Expand Up @@ -33,20 +32,6 @@ def remove_mean_volumes(volumes, metadata=None):
return volumes, mean_volumes


def normalize_power_spectrum_sub(volumes, metadata, ref_vol_key, ref_vol_index):
volumes = volumes.clone()
idx_ref_vol = metadata[ref_vol_key]["indices"][0] + ref_vol_index
ref_power_spectrum = compute_power_spectrum(volumes[idx_ref_vol])

for key in metadata.keys():
indices = metadata[key]["indices"]
volumes[indices[0] : indices[1]] = normalize_power_spectrum(
volumes[indices[0] : indices[1]], ref_power_spectrum
)

return volumes


def load_volumes(
box_size_ds: float,
submission_list: list,
Expand Down

0 comments on commit ddb19f9

Please sign in to comment.