ITK
6.0.0
Insight Toolkit
|
#include <itkTransformGeometryImageFilter.h>
Modify an image's geometric meta-data, changing its "physical" extent.
The TransformGeometryImageFilter "physically" changes the image in space using the given transformation. The resulting image is an image with the same voxel values as the input, but with different physical space representation as affected by the transform.
The specific transformation type can be any type derived from the MatrixOffsetTransformBase and the TranslationTransform. The modification of the geometric meta-data is an alternative to resampling the moving image onto the fixed image grid, after registration. The advantages of using this approach over resampling are two-fold, it does not introduce artifacts into the result because the original intensity information is not modified, and it is computationally more efficient.
When the filter is used with a rigid or translation transformation the resulting image can be saved in any desired format. When the filter is used with an affine transformation the resulting image should be saved in a format that supports a non ortho-normal direction cosine matrix (e.g. nrrd).
Let us call the transform operation from the fixed image to moving image TfmF2M
. Given a set of points from the fixed image in physical space (i.e. physicalFixedImagePoints
), the aim is to convert those points into the moving image physical space as physicalMovingImagePoints = TfmF2M( physicalFixedImagePoints )
, and then be able to get the image values as movingContinuousIndexPoints = movingImage->TransformPhysicalPointToContinuousIndex( physicalMovingImagePoints )
.
We desire to change the moving image direction cosine \(\mathbf{D}\) and origin \(\mathbf{o}\) such that we can compute the moving image points as movingContinuousIndexPoints = newMovingImage->TransformPhysicalPointToContinuousIndex( physicalFixedImagePoints )
Let us introduce the notation that will be used to formalize the transformation:
The TransformPhysicalPointToContinuousIndex
method performs then:
\begin{eqnarray*} \mathbf{ci} &= \mathbf{S}^{-1}\mathbf{D}^{-1}( \mathbf{m}_{p} - \mathbf{o} ) \\ \mathbf{m}_{p} &= \mathbf{R}(\mathbf{f}_{p} - \mathbf{c}) + \mathbf{c} + \mathbf{t} \end{eqnarray*}
After substitution:
\begin{eqnarray*} \mathbf{m}_{c} &= \underbrace{\mathbf{R}^{-1}\mathbf{D}}_\text{new cosine}\mathbf{S} * \mathbf{i} + \underbrace{\mathbf{R}^{-1} * \mathbf{o} - \mathbf{R}^{-1} * \mathbf{c} - \mathbf{R}^{-1}*t}_\text{new origin} + \mathbf{c} \\ \\ \mathbf{D}^{'} &= \mathbf{R}^{-1}\mathbf{D} \\ \mathbf{o}^{'} &= \mathbf{R}^{-1} * ( \mathbf{o} - \mathbf{c} - \mathbf{t} ) + \mathbf{c} \end{eqnarray*}
Definition at line 101 of file itkTransformGeometryImageFilter.h.
Static Public Member Functions | |
static Pointer | New () |
Static Public Member Functions inherited from itk::ImageToImageFilter< TInputImage, TOutputImage > | |
static double | GetGlobalDefaultCoordinateTolerance () |
static double | GetGlobalDefaultDirectionTolerance () |
static void | SetGlobalDefaultCoordinateTolerance (double) |
static void | SetGlobalDefaultDirectionTolerance (double) |
Static Public Member Functions inherited from itk::Object | |
static bool | GetGlobalWarningDisplay () |
static void | GlobalWarningDisplayOff () |
static void | GlobalWarningDisplayOn () |
static Pointer | New () |
static void | SetGlobalWarningDisplay (bool val) |
Static Public Member Functions inherited from itk::LightObject | |
static void | BreakOnError () |
static Pointer | New () |
Static Public Attributes | |
static constexpr unsigned int | InputImageDimension = TInputImage::ImageDimension |
static constexpr unsigned int | OutputImageDimension = TOutputImage::ImageDimension |
Static Public Attributes inherited from itk::InPlaceImageFilter< TInputImage, TOutputImage > | |
static constexpr unsigned int | InputImageDimension = TInputImage::ImageDimension |
static constexpr unsigned int | OutputImageDimension = TOutputImage::ImageDimension |
Static Public Attributes inherited from itk::ImageToImageFilter< TInputImage, TOutputImage > | |
static constexpr unsigned int | InputImageDimension = TInputImage::ImageDimension |
static constexpr unsigned int | OutputImageDimension = TOutputImage::ImageDimension |
Static Public Attributes inherited from itk::ImageSource< TOutputImage > | |
static constexpr unsigned int | OutputImageDimension = TOutputImage::ImageDimension |
using itk::TransformGeometryImageFilter< TInputImage, TOutputImage >::ConstPointer = SmartPointer<const Self> |
Definition at line 110 of file itkTransformGeometryImageFilter.h.
using itk::TransformGeometryImageFilter< TInputImage, TOutputImage >::InputImagePixelType = typename InputImageType::PixelType |
Definition at line 122 of file itkTransformGeometryImageFilter.h.
using itk::TransformGeometryImageFilter< TInputImage, TOutputImage >::InputImagePointer = typename InputImageType::Pointer |
Definition at line 120 of file itkTransformGeometryImageFilter.h.
using itk::TransformGeometryImageFilter< TInputImage, TOutputImage >::InputImagePointType = typename InputImageType::PointType |
Definition at line 123 of file itkTransformGeometryImageFilter.h.
using itk::TransformGeometryImageFilter< TInputImage, TOutputImage >::InputImageRegionType = typename InputImageType::RegionType |
Definition at line 121 of file itkTransformGeometryImageFilter.h.
using itk::TransformGeometryImageFilter< TInputImage, TOutputImage >::InputImageType = TInputImage |
input/output image type alias
Definition at line 119 of file itkTransformGeometryImageFilter.h.
using itk::TransformGeometryImageFilter< TInputImage, TOutputImage >::OutputImagePixelType = typename OutputImageType::PixelType |
Definition at line 128 of file itkTransformGeometryImageFilter.h.
using itk::TransformGeometryImageFilter< TInputImage, TOutputImage >::OutputImagePointer = typename OutputImageType::Pointer |
Definition at line 126 of file itkTransformGeometryImageFilter.h.
using itk::TransformGeometryImageFilter< TInputImage, TOutputImage >::OutputImageRegionType = typename OutputImageType::RegionType |
Definition at line 127 of file itkTransformGeometryImageFilter.h.
using itk::TransformGeometryImageFilter< TInputImage, TOutputImage >::OutputImageType = TOutputImage |
Definition at line 125 of file itkTransformGeometryImageFilter.h.
using itk::TransformGeometryImageFilter< TInputImage, TOutputImage >::Pointer = SmartPointer<Self> |
Definition at line 109 of file itkTransformGeometryImageFilter.h.
using itk::TransformGeometryImageFilter< TInputImage, TOutputImage >::Self = TransformGeometryImageFilter |
Standard class type alias
Definition at line 107 of file itkTransformGeometryImageFilter.h.
using itk::TransformGeometryImageFilter< TInputImage, TOutputImage >::Superclass = InPlaceImageFilter<TInputImage, TOutputImage> |
Definition at line 108 of file itkTransformGeometryImageFilter.h.
using itk::TransformGeometryImageFilter< TInputImage, TOutputImage >::TransformConstPointer = typename TransformType::ConstPointer |
Definition at line 141 of file itkTransformGeometryImageFilter.h.
using itk::TransformGeometryImageFilter< TInputImage, TOutputImage >::TransformType = Transform<double, InputImageDimension, OutputImageDimension> |
Transform type alias
Definition at line 140 of file itkTransformGeometryImageFilter.h.
|
protected |
|
overrideprotecteddefault |
|
overrideprotectedvirtual |
A version of GenerateData() specific for image processing filters. This implementation will split the processing across multiple threads. The buffer is allocated by this method. Then the BeforeThreadedGenerateData() method is called (if provided). Then, a series of threads are spawned each calling DynamicThreadedGenerateData(). After all the threads have completed processing, the AfterThreadedGenerateData() method is called (if provided). If an image processing filter cannot be threaded, the filter should provide an implementation of GenerateData(). That implementation is responsible for allocating the output buffer. If a filter can be threaded, it should NOT provide a GenerateData() method but should provide a DynamicThreadedGenerateData() instead.
Reimplemented from itk::ImageSource< TOutputImage >.
|
overrideprotectedvirtual |
Generate the information describing the output data. The default implementation of this method will copy information from the input to the output. A filter may override this method if its output will have different information than its input. For instance, a filter that shrinks an image will need to provide an implementation for this method that changes the spacing of the pixels. Such filters should call their superclass' implementation of this method prior to changing the information values they need (i.e. GenerateOutputInformation() should call Superclass::GenerateOutputInformation() prior to changing the information.
Reimplemented from itk::ProcessObject.
|
virtual |
Set/Get required input image.
|
overridevirtual |
Reimplemented from itk::InPlaceImageFilter< TInputImage, TOutputImage >.
|
static |
Method for creation through the object factory
|
virtual |
Set/Get required input image.
|
virtual |
Set/Get required rigid transform.
|
overrideprotectedvirtual |
Verifies that the process object has been configured correctly, that all required inputs are set, and needed parameters are set appropriately. If not valid an exceptions will be thrown.
This method is called before UpdateOutputInformation() is propagated to the inputs.
The ProcessObject's implementation verifies that the m_NumberOfRequiredInputs are set and not null.
Reimplemented from itk::ProcessObject.
|
staticconstexpr |
ImageDimension constants
Definition at line 131 of file itkTransformGeometryImageFilter.h.
|
staticconstexpr |
Definition at line 132 of file itkTransformGeometryImageFilter.h.