API

sitkibex.registration(fixed_image: Image, moving_image: Image, *, do_fft_initialization=True, do_affine2d=False, do_affine3d=True, ignore_spacing=True, sigma=1.0, auto_mask=False, samples_per_parameter=5000, expand=None) Transform

Robust multi-phase registration for multi-panel confocal microscopy images.

The fixed and moving image are expected to be the same molecular labeling, and the same imaged regioned.

The phase available are:
  • fft initialization for translation estimation

  • 2D affine which can correct rotational acquisition problems, this phase is done on z-projections to optimize a 2D similarity transform followed by 2D affine

  • 3D affine robust mulit-level registration

Parameters:
  • fixed_image – a scalar SimpleITK 3D Image

  • moving_image – a scalar SimpleITK 3D Image

  • do_fft_initialization – perform FFT based cross correlation for initialize translation

  • do_affine2d – perform registration on 2D images from z-projection

  • do_affine3d – multi-level affine transform

  • ignore_spacing – internally adjust spacing magnitude to be near 1 to avoid numeric stability issues with micro sized spacing

  • sigma – scalar to change the amount of Gaussian smoothing performed

  • auto_mask – ignore zero valued pixels connected to the image boarder

  • samples_per_parameter – the number of image samples to used per transform parameter at full resolution

  • expand – Perform super-sampling to increase number of z-slices by an integer factor. Super-sampling is automatically performed when the number of z-slices is less than 5.

Returns:

A SimpleITK transform mapping points from the fixed image to the moving. This may be a CompositeTransform.

sitkibex.resample(fixed_image: Image, moving_image: Image, transform: Transform = None, *, fusion=False, projection=False, combine=False, invert=False) Image

Resample fixed_image onto the coordinates of moving_image with transform results from registration.

The registration process results in a transform which maps points from the coordinates of the fixed_image to the moving_image. This method is next used to resample the the fixed_image with the transform to produce an image with the fixed_image aligned with the moving_image.

If no transform is provided, then an identity transform is assumed and the moving_image is still resampled onto the fixed_image. This operation is useful to see alignment of images before registration.

Parameters:
  • fixed_image – A 3D SimpleITK Image whose pixel values are resampled

  • moving_image – A 3D SimpleITK Image whose coordinates are used for the output image

  • transform – (optional) A 3D SimpleITK Transform mapping from points from the fixed_image to the moving_image.

  • fusion – Enable fusing the resampled moving_image and the fixed_image into a RGB image.

  • projection – Enable perform a z-projection to reduce the dimensionality to 2D.

  • combine – Enable combining the resampled moving_image and the fixed_image into a 2-channel vector image.

  • invert – Invert the input transform.

Returns:

The processed SimpleITK Image.

sitkibex.globals.default_random_seed = 100

Random seed used for each registration called for reproducible results. If it is set to 0 the time will be used to initialized a seed.

sitkibex.globals.logger = <RootLogger root (WARNING)>

The parent logger object for all sub-loggers. It can be used to control the level of output and how the warning, info, and debug messages are handled.

sitkibex.io.im_read_channel(filename, channel=None)

Read a channel from an image file.

SimpleITK is used to read a channel from the file. Channel names can be used if the image file contains meta-data which can be parsed and provides names for the channels. Otherwise channel index should be used.

Parameters:
  • filename – The path to an image file.

  • channel – An integer for the channel index or string for the name of the channel. If None then all channel are

read.

Returns:

A SimpleITK Image.