Intensity Correction

cloudreg.scripts.correct_raw_data.correct_raw_data(raw_data_path, channel, subsample_factor=2, log_s3_path=None, background_correction=True)[source]

Correct vignetting artifact in raw data

  • raw_data_path (str) – Path to raw data

  • channel (int) – Channel number to prcess

  • subsample_factor (int, optional) – Factor to subsample the raw data by to compute vignetting correction. Defaults to 2.

  • log_s3_path (str, optional) – S3 path to store intermediates at. Defaults to None.

  • background_correction (bool, optional) – If True, subtract estimated background value from all tiles. Defaults to True.

cloudreg.scripts.correct_raw_data.correct_tile(raw_tile_path, bias, background_value=None)[source]

Apply vignetting corrrection to single tile

  • raw_tile_path (str) – Path to raw data image

  • bias (np.ndarray) – Vignetting correction that is multiplied by image

  • background_value (float, optional) – Background value. Defaults to None.

cloudreg.scripts.correct_raw_data.correct_tiles(tiles, bias, background_value=None)[source]

Correct a list of tiles

  • tiles (list of str) – Paths to raw data images to correct

  • bias (np.ndarray) – Vignetting correction to multiply by raw data

  • background_value (float, optional) – Background value to subtract from raw data. Defaults to None.


Estimate background value for COLM data


raw_data_path (str) – Path to raw data


Estimated value of background in image

Return type:



Sum the images in files together


files (list of str) – Local Paths to images to sum


Sum of the images in files

Return type:


cloudreg.scripts.correct_stitched_data.correct_stitched_data(data_s3_path, out_s3_path, resolution=15, num_procs=12)[source]

Correct illumination inhomogeneity in stitched precomputed data on S3 and upload result back to S3 as precomputed

  • data_s3_path (str) – S3 path to precomputed volume that needs to be illumination corrected

  • out_s3_path (str) – S3 path to store corrected precomputed volume

  • resolution (int, optional) – Resolution in microns at which illumination correction is computed. Defaults to 15.

  • num_procs (int, optional) – Number of proceses to use when uploading data to S3. Defaults to 12.

cloudreg.scripts.correct_stitched_data.process_slice(bias_slice, z, data_orig_path, data_bc_path)[source]

Correct and upload a single slice of data

  • bias_slice (sitk.Image) – Slice of illumination correction

  • z (int) – Z slice of data to apply correction to

  • data_orig_path (str) – S3 path to source data that needs to be corrected

  • data_bc_path (str) – S3 path where corrected data will be stored