Skip to content

Commit

Permalink
Remove contrast enhancement
Browse files Browse the repository at this point in the history
  • Loading branch information
lauraporta committed Jul 4, 2024
1 parent 02e4a95 commit 7c8dcec
Showing 1 changed file with 0 additions and 40 deletions.
40 changes: 0 additions & 40 deletions derotation/analysis/full_rotation_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ def __call__(self):
- adding a circular mask to the rotated image stack
- saving the masked image stack
"""
# self.contrast_enhancement()
self.process_analog_signals()
rotated_images = self.rotate_frames_line_by_line()
masked = self.add_circle_mask(rotated_images, self.mask_diameter)
Expand Down Expand Up @@ -172,45 +171,6 @@ def load_data(self):
logging.info(f"Dataset {self.filename_raw} loaded")
logging.info(f"Filename: {self.filename}")

# def contrast_enhancement(self):
# """Applies contrast enhancement to the image stack.
# It is useful to visualize the image stack before derotation.
# """
# logging.info("Applying contrast enhancement...")

# self.image_stack = np.array(
# [
# self.contrast_enhancement_single_image(
# img, self.config["contrast_enhancement"]
# )
# for img in self.image_stack
# ]
# )

# @staticmethod
# def contrast_enhancement_single_image(
# img: np.ndarray, saturated_percentage=0.35
# ) -> np.ndarray:
# """Applies contrast enhancement to a single image.
# It is useful to visualize the image stack before derotation.

# Parameters
# ----------
# img : np.ndarray
# The image to enhance.
# saturated_percentage : float, optional
# The percentage of saturated pixels, by default 0.35

# Returns
# -------
# np.ndarray
# The enhanced image.
# """
# v_min, v_max = np.percentile(
# img, (saturated_percentage, 100 - saturated_percentage)
# )
# return rescale_intensity(img, in_range=(v_min, v_max))

def process_analog_signals(self):
"""From the analog signals (frame clock, line clock, full rotation,
rotation ticks) calculates the rotation angles by line and frame.
Expand Down

0 comments on commit 7c8dcec

Please sign in to comment.