Finding The Rotation Center

There are two interactive and two non-interactive method for finding the rotation center of a CT scan through TomoSuitePY. Below details how one can accomplish these tasks through the provided package.

Interactive Fine Tune Rotation Center

Although this second method for finding the rotation center requires manual identiication of the proper rotation center, it is more reliable than the method above.

One can choose to set the rot_center_shift_check variable to the amount of rotation centers to check before and after the absolute center of the 2D projection images.

Then one can either view the reconstructed rotation center images interactivley through plot_reconstruction_centers(interactive=True), or non-interactivley by setting interactive=False.

# Defining reconstruction function
def tomo_recon(prj, theta, rot_center, user_extra=None):

    recon = tomopy.recon(prj, theta,
                        center=rot_center,
                        algorithm='gridrec',
                        ncore=6, filter_name='parzen')

    return recon, user_extra
# Importing the proper functions through tomosuitpy
from tomosuite.base.reconstruct import reconstruct_data, plot_reconstruction_centers
basedir = '/path/2/project/'

# Obtaining the rotation center test slices to be plotted at a later time.
slcs, user_extra = reconstruct_data(basedir,
                    rot_center=616, # This has no relevence when rot_center_shift_check is enabled
                    start_row=500, # Keep this to a single image for rotation_center_check
                    end_row=501, # Keep this to a single image for rotation_center_check
                    reconstruct_func=tomo_recon, # Allows the user to define their own recon function
                    network=None, #  Keep this to None for rotation_center_check
                    power2pad=False, #  Pad to the nearest power of 2 - set True for better recon
                    edge_transition=None, # Crop sinogram edges - 15-25 are good values for better recon
                    chunk_recon_size=1,
                    rot_center_shift_check=40 # Number of rotation centers to try before and after absolute image center
                                   )

# plotting the rotation centers
plot_reconstruction_centers(slcs, basedir, clim=(None, None),  figsize=(20, 20))

One must add jupyter widgets to jupyter lab through the install instructions.

_images/human_tuned_v2.png