Skip to content

register

Use gradient-based optimization to register XRAY to a CT/MR.

XRAY can be a space-separated list of DICOM files or a directory.

Usage:

register [OPTIONS] COMMAND [ARGS]...

Options:

  -h, --help  Show this message and exit.

dicom

Initialize from pose parameters in the DICOM header.

Usage:

register dicom [OPTIONS] XRAY...

Options:

  --orientation [AP|PA]          Orientation of the C-arm  [required]
  -v, --volume PATH              Input CT volume (3D image)  [required]
  -m, --mask PATH                Labelmap for the CT volume
  -o, --outpath PATH             Directory for saving registration results
                                 [required]
  --crop INTEGER                 Center crop the X-ray image  [default: 0]
  --subtract_background          Subtract mode X-ray image intensity
  --linearize                    Convert X-ray from exponential to linear form
  --equalize                     Apply histogram equalization to X-rays/DRRs
                                 during optimization
  --reducefn TEXT                If DICOM is multiframe, method to extract a
                                 single 2D image  [default: max]
  --labels TEXT                  Labels in mask to exclusively render (comma-
                                 separated)
  --scales TEXT                  Scales of downsampling for multiscale
                                 registration (comma-separated)  [default: 8]
  --n_itrs TEXT                  Number of iterations to run at each scale
                                 (comma-separated)  [default: 500]
  --reverse_x_axis               Enable to obey radiologic convention (e.g.,
                                 heart on right)
  --renderer [siddon|trilinear]  Renderer equation  [default: trilinear]
  --parameterization TEXT        Parameterization of SO(3) for regression
                                 [default: euler_angles]
  --convention TEXT              If parameterization is Euler angles, specify
                                 order  [default: ZXY]
  --voxel_shift FLOAT            Position of voxel (top left corner or center)
                                 [default: 0.0]
  --lr_rot FLOAT                 Initial step size for rotational parameters
                                 [default: 0.01]
  --lr_xyz FLOAT                 Initial step size for translational
                                 parameters  [default: 1.0]
  --patience INTEGER             Number of itrs without improvement before
                                 decreasing the learning rate  [default: 10]
  --threshold FLOAT              Threshold for measuring the new optimum
                                 [default: 0.0001]
  --max_n_plateaus INTEGER       Number of times loss can plateau before
                                 moving to next scale  [default: 3]
  --init_only                    Directly return the initial pose estimate (no
                                 iterative pose refinement)
  --saveimg                      Save ground truth X-ray and predicted DRRs
  --pattern TEXT                 Pattern rule for glob is XRAY is directory
                                 [default: *.dcm]
  --verbose INTEGER RANGE        Verbosity level for logging  [default: 1;
                                 0<=x<=3]
  -h, --help                     Show this message and exit.

fixed

Initialize from a fixed pose.

Usage:

register fixed [OPTIONS] XRAY...

Options:

  --orientation [AP|PA]          Orientation of the C-arm  [required]
  --rot TEXT                     Rotation (comma-separated); see
                                 `parameterization` and `convention`
                                 [required]
  --xyz TEXT                     Translation (comma-separated); see
                                 `parameterization` and `convention`
                                 [required]
  -v, --volume PATH              Input CT volume (3D image)  [required]
  -m, --mask PATH                Labelmap for the CT volume
  -o, --outpath PATH             Directory for saving registration results
                                 [required]
  --crop INTEGER                 Center crop the X-ray image  [default: 0]
  --subtract_background          Subtract mode X-ray image intensity
  --linearize                    Convert X-ray from exponential to linear form
  --equalize                     Apply histogram equalization to X-rays/DRRs
                                 during optimization
  --reducefn TEXT                If DICOM is multiframe, method to extract a
                                 single 2D image  [default: max]
  --labels TEXT                  Labels in mask to exclusively render (comma-
                                 separated)
  --scales TEXT                  Scales of downsampling for multiscale
                                 registration (comma-separated)  [default: 8]
  --n_itrs TEXT                  Number of iterations to run at each scale
                                 (comma-separated)  [default: 500]
  --reverse_x_axis               Enable to obey radiologic convention (e.g.,
                                 heart on right)
  --renderer [siddon|trilinear]  Renderer equation  [default: trilinear]
  --parameterization TEXT        Parameterization of SO(3) for regression
                                 [default: euler_angles]
  --convention TEXT              If parameterization is Euler angles, specify
                                 order  [default: ZXY]
  --voxel_shift FLOAT            Position of voxel (top left corner or center)
                                 [default: 0.0]
  --lr_rot FLOAT                 Initial step size for rotational parameters
                                 [default: 0.01]
  --lr_xyz FLOAT                 Initial step size for translational
                                 parameters  [default: 1.0]
  --patience INTEGER             Number of itrs without improvement before
                                 decreasing the learning rate  [default: 10]
  --threshold FLOAT              Threshold for measuring the new optimum
                                 [default: 0.0001]
  --max_n_plateaus INTEGER       Number of times loss can plateau before
                                 moving to next scale  [default: 3]
  --init_only                    Directly return the initial pose estimate (no
                                 iterative pose refinement)
  --saveimg                      Save ground truth X-ray and predicted DRRs
  --pattern TEXT                 Pattern rule for glob is XRAY is directory
                                 [default: *.dcm]
  --verbose INTEGER RANGE        Verbosity level for logging  [default: 1;
                                 0<=x<=3]
  -h, --help                     Show this message and exit.

model

Initialize from a pose regression model.

Usage:

register model [OPTIONS] XRAY...

Options:

  -c, --ckptpath PATH            Checkpoint of a pretrained pose regressor
                                 [required]
  --warp PATH                    SimpleITK transform to warp input CT to a
                                 template reference frame
  --invert                       Whether to invert the warp or not
  --antipodal                    Initialize from antipode of predicted pose
  -v, --volume PATH              Input CT volume (3D image)  [required]
  -m, --mask PATH                Labelmap for the CT volume
  -o, --outpath PATH             Directory for saving registration results
                                 [required]
  --crop INTEGER                 Center crop the X-ray image  [default: 0]
  --subtract_background          Subtract mode X-ray image intensity
  --linearize                    Convert X-ray from exponential to linear form
  --equalize                     Apply histogram equalization to X-rays/DRRs
                                 during optimization
  --reducefn TEXT                If DICOM is multiframe, method to extract a
                                 single 2D image  [default: max]
  --labels TEXT                  Labels in mask to exclusively render (comma-
                                 separated)
  --scales TEXT                  Scales of downsampling for multiscale
                                 registration (comma-separated)  [default: 8]
  --n_itrs TEXT                  Number of iterations to run at each scale
                                 (comma-separated)  [default: 500]
  --reverse_x_axis               Enable to obey radiologic convention (e.g.,
                                 heart on right)
  --renderer [siddon|trilinear]  Renderer equation  [default: trilinear]
  --parameterization TEXT        Parameterization of SO(3) for regression
                                 [default: euler_angles]
  --convention TEXT              If parameterization is Euler angles, specify
                                 order  [default: ZXY]
  --voxel_shift FLOAT            Position of voxel (top left corner or center)
                                 [default: 0.0]
  --lr_rot FLOAT                 Initial step size for rotational parameters
                                 [default: 0.01]
  --lr_xyz FLOAT                 Initial step size for translational
                                 parameters  [default: 1.0]
  --patience INTEGER             Number of itrs without improvement before
                                 decreasing the learning rate  [default: 10]
  --threshold FLOAT              Threshold for measuring the new optimum
                                 [default: 0.0001]
  --max_n_plateaus INTEGER       Number of times loss can plateau before
                                 moving to next scale  [default: 3]
  --init_only                    Directly return the initial pose estimate (no
                                 iterative pose refinement)
  --saveimg                      Save ground truth X-ray and predicted DRRs
  --pattern TEXT                 Pattern rule for glob is XRAY is directory
                                 [default: *.dcm]
  --verbose INTEGER RANGE        Verbosity level for logging  [default: 1;
                                 0<=x<=3]
  -h, --help                     Show this message and exit.

restart

Initialize from a previous final pose estimate.

Usage:

register restart [OPTIONS] XRAY...

Options:

  --orientation [AP|PA]          Orientation of the C-arm  [required]
  -c, --ckpt PATH                Path to `parameters.pt` for previous
                                 iterative optimization run  [required]
  -v, --volume PATH              Input CT volume (3D image)  [required]
  -m, --mask PATH                Labelmap for the CT volume
  -o, --outpath PATH             Directory for saving registration results
                                 [required]
  --crop INTEGER                 Center crop the X-ray image  [default: 0]
  --subtract_background          Subtract mode X-ray image intensity
  --linearize                    Convert X-ray from exponential to linear form
  --equalize                     Apply histogram equalization to X-rays/DRRs
                                 during optimization
  --reducefn TEXT                If DICOM is multiframe, method to extract a
                                 single 2D image  [default: max]
  --labels TEXT                  Labels in mask to exclusively render (comma-
                                 separated)
  --scales TEXT                  Scales of downsampling for multiscale
                                 registration (comma-separated)  [default: 8]
  --n_itrs TEXT                  Number of iterations to run at each scale
                                 (comma-separated)  [default: 500]
  --reverse_x_axis               Enable to obey radiologic convention (e.g.,
                                 heart on right)
  --renderer [siddon|trilinear]  Renderer equation  [default: trilinear]
  --parameterization TEXT        Parameterization of SO(3) for regression
                                 [default: euler_angles]
  --convention TEXT              If parameterization is Euler angles, specify
                                 order  [default: ZXY]
  --voxel_shift FLOAT            Position of voxel (top left corner or center)
                                 [default: 0.0]
  --lr_rot FLOAT                 Initial step size for rotational parameters
                                 [default: 0.01]
  --lr_xyz FLOAT                 Initial step size for translational
                                 parameters  [default: 1.0]
  --patience INTEGER             Number of itrs without improvement before
                                 decreasing the learning rate  [default: 10]
  --threshold FLOAT              Threshold for measuring the new optimum
                                 [default: 0.0001]
  --max_n_plateaus INTEGER       Number of times loss can plateau before
                                 moving to next scale  [default: 3]
  --init_only                    Directly return the initial pose estimate (no
                                 iterative pose refinement)
  --saveimg                      Save ground truth X-ray and predicted DRRs
  --pattern TEXT                 Pattern rule for glob is XRAY is directory
                                 [default: *.dcm]
  --verbose INTEGER RANGE        Verbosity level for logging  [default: 1;
                                 0<=x<=3]
  -h, --help                     Show this message and exit.