Registration

cloudreg.scripts.run_registration_ec2.run_registration(ssh_key_path, instance_id, instance_type, input_s3_path, atlas_s3_path, parcellation_s3_path, atlas_orientation, output_s3_path, log_s3_path, initial_translation, initial_rotation, orientation, fixed_scale, missing_data_correction, grid_correction, bias_correction, sigma_regularization, num_iterations, registration_resolution)[source]

Run EM-LDDMM registration on an AWS EC2 instance

Parameters:
  • ssh_key_path (str) – Local path to ssh key for this server

  • instance_id (str) – ID of EC2 instance to use

  • instance_type (str) – AWS EC2 instance type. Recommended is r5.8xlarge

  • input_s3_path (str) – S3 path to precomputed data to be registered

  • atlas_s3_path (str) – S3 path to atlas data to register to

  • parcellation_s3_path (str) – S3 path to corresponding atlas parcellations

  • output_s3_path (str) – S3 path to store precomputed volume of atlas transformed to input data

  • log_s3_path (str) – S3 path to store intermediates at

  • initial_translation (list of float) – Initial translations in x,y,z of input data

  • initial_rotation (list) – Initial rotation in x,y,z for input data

  • orientation (str) – 3-letter orientation of input data

  • fixed_scale (float) – Isotropic scale factor on input data

  • missing_data_correction (bool) – Perform missing data correction to ignore zeros in image

  • grid_correction (bool) – Perform grid correction (for COLM data)

  • bias_correction (bool) – Perform illumination correction

  • sigma_regularization (float) – Regularization constat in cost function. Higher regularization constant means less regularization

  • num_iterations (int) – Number of iterations of EM-LDDMM to run

  • registration_resolution (int) – Minimum resolution at which the registration is run.

cloudreg.scripts.registration.get_affine_matrix(translation, rotation, from_orientation, to_orientation, fixed_scale, s3_path, center=False)[source]

Get Neuroglancer-compatible affine matrix transfrming precomputed volume given set of translations and rotations

Parameters:
  • translation (list of float) – x,y,z translations respectively in microns

  • rotation (list of float) – x,y,z rotations respectively in degrees

  • from_orientation (str) – 3-letter orientation of source data

  • to_orientation (str) – 3-letter orientation of target data

  • fixed_scale (float) – Isotropic scale factor

  • s3_path (str) – S3 path to precomputed volume for source data

  • center (bool, optional) – If true, center image at it’s origin. Defaults to False.

Returns:

Returns 4x4 affine matrix representing the given translations and rotations of source data at S3 path

Return type:

np.ndarray

cloudreg.scripts.registration.register(input_s3_path, atlas_s3_path, parcellation_s3_path, atlas_orientation, output_s3_path, log_s3_path, orientation, fixed_scale, translation, rotation, missing_data_correction, grid_correction, bias_correction, regularization, num_iterations, registration_resolution, output_local_path='~/')[source]

Run EM-LDDMM registration on precomputed volume at input_s3_path

Parameters:
  • input_s3_path (str) – S3 path to precomputed data to be registered

  • atlas_s3_path (str) – S3 path to atlas to register to.

  • parcellation_s3_path (str) – S3 path to atlas to register to.

  • atlas_orientation (str) – 3-letter orientation of atlas

  • output_s3_path (str) – S3 path to store precomputed volume of atlas transformed to input data

  • log_s3_path (str) – S3 path to store intermediates at

  • orientation (str) – 3-letter orientation of input data

  • fixed_scale (float) – Isotropic scale factor on input data

  • translation (list of float) – Initial translations in x,y,z of input data

  • rotation (list) – Initial rotation in x,y,z for input data

  • missing_data_correction (bool) – Perform missing data correction to ignore zeros in image

  • grid_correction (bool) – Perform grid correction (for COLM data)

  • bias_correction (bool) – Perform illumination correction

  • regularization (float) – Regularization constat in cost function. Higher regularization constant means less regularization

  • num_iterations (int) – Number of iterations of EM-LDDMM to run

  • registration_resolution (int) – Minimum resolution at which the registration is run.