Skip to content

Transformations

John Bogovic edited this page Dec 20, 2018 · 7 revisions

Using transformations

This library provides several scripts for applying spatial transformations to images or points / skeletons.

Images

Use the script renderTransformed to transform images.

Skeletons

Use the script transformSwc to transform skeletons stored as swc files.

Points

Use the script transformPoints to transform skeletons stored as swc files.

Bridging transformations

We provide a number of spatial transformations that convert images or points/skeletons from one template space to another.

Supported transformation types

This library supports transformations created by both the ANTs and CMTK image registration packages as well as several custom formats.

ANTs

Affine

We do not support arbitrary affine transforms written by ANTs - a few different conventions / formats are possible. Rather, convert the affines to homogenious matrix and write plain text file using the ANTs utility: ConvertTransformFile.

Displacement fields

We support ANTs displacement fields as gzip-compressed Nifti files.

CMTK

Affine

We do not support arbitrary affine transforms written by CMTK. Rather, convert the affines to homogenious matrix and write plain text file using the CMTK utility: dof2mat

Displacement field

CMTK parametrizes the non-linear part of its spatial transformation with B-Splines, usually stored as a compressed text file. We do not currently support this format directly. However, one can convert from this format to a displacement field using the script: cmtk2DField.

Transform conversion

ANTs to CMTK

The script antsAffine2Cmtk converts the affine component of an ANTs transform to CMTK's format. antsDfield2Cmtk converts a displacement field generated by ANTs to a nrrd file that CMTK understands.

Clone this wiki locally