Loading...
Searching...
No Matches
itkTransformixFilter.h
Go to the documentation of this file.
/*=========================================================================
*
* Copyright NumFOCUS
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0.txt
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*=========================================================================*/
/*=========================================================================
*
* Copyright UMC Utrecht and contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0.txt
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*=========================================================================*/
#ifndef itkTransformixFilter_h
#define itkTransformixFilter_h
#include "itkElastixLogLevel.h"
#include "itkImageSource.h"
#include "itkMesh.h"
#include "itkTransformBase.h"
#include "elxElastixTemplate.h"
#include "elxTransformBase.h"
#include "elxTransformixMain.h"
#include "elxParameterObject.h"
namespace itk
{
template <typename TImage>
class ITK_TEMPLATE_EXPORT TransformixFilter : public ImageSource<TImage>
{
public:
ITK_DISALLOW_COPY_AND_MOVE(TransformixFilter);
using Self = TransformixFilter;
using Superclass = ImageSource<TImage>;
using Pointer = SmartPointer<Self>;
using ConstPointer = SmartPointer<const Self>;
itkNewMacro(Self);
itkTypeMacro(TransformixFilter, ImageSource);
using TransformixMainType = elx::TransformixMain;
using TransformixMainPointer = TransformixMainType::Pointer;
using ArgumentMapType = TransformixMainType::ArgumentMapType;
using ArgumentMapEntryType = ArgumentMapType::value_type;
using DataObjectPointer = ProcessObject::DataObjectPointer;
using DataObjectIdentifierType = ProcessObject::DataObjectIdentifierType;
using DataObjectContainerType = TransformixMainType::DataObjectContainerType;
using DataObjectContainerPointer = TransformixMainType::DataObjectContainerPointer;
using ParameterObjectType = elx::ParameterObject;
using ParameterMapVectorType = ParameterObjectType::ParameterMapVectorType;
using ParameterMapType = ParameterObjectType::ParameterMapType;
using ParameterValueVectorType = ParameterObjectType::ParameterValueVectorType;
using ParameterObjectPointer = typename ParameterObjectType::Pointer;
using ParameterObjectConstPointer = typename ParameterObjectType::ConstPointer;
using typename Superclass::OutputImageType;
using typename Superclass::OutputImagePixelType;
using OutputDeformationFieldType =
typename itk::Image<itk::Vector<float, TImage::ImageDimension>, TImage::ImageDimension>;
using DataObjectPointerArraySizeType = ProcessObject::DataObjectPointerArraySizeType;
using InputImageType = TImage;
itkStaticConstMacro(MovingImageDimension, unsigned int, TImage::ImageDimension);
using MeshType = Mesh<OutputImagePixelType, MovingImageDimension>;
using TransformType = Transform<double, MovingImageDimension, MovingImageDimension>;
using SpatialJacobianDeterminantImageType = itk::Image<float, MovingImageDimension>;
using SpatialJacobianMatrixImageType =
itk::Image<itk::Matrix<float, MovingImageDimension, MovingImageDimension>, MovingImageDimension>;
virtual void
SetMovingImage(TImage * inputImage);
const InputImageType *
GetMovingImage() const;
virtual void
RemoveMovingImage();
/* Standard filter indexed input / output methods */
void
SetInput(InputImageType * movingImage);
const InputImageType *
GetInput() const;
void
SetInput(DataObjectPointerArraySizeType index, DataObject * input);
const DataObject *
GetInput(DataObjectPointerArraySizeType index) const;
void SetTransformParameterFileName(std::string);
itkGetConstMacro(TransformParameterFileName, std::string);
itkSetMacro(FixedPointSetFileName, std::string);
itkGetConstMacro(FixedPointSetFileName, std::string);
virtual void
RemoveFixedPointSetFileName()
{
this->SetFixedPointSetFileName("");
}
itkSetMacro(ComputeSpatialJacobian, bool);
itkGetConstMacro(ComputeSpatialJacobian, bool);
itkBooleanMacro(ComputeSpatialJacobian);
itkSetMacro(ComputeDeterminantOfSpatialJacobian, bool);
itkGetConstMacro(ComputeDeterminantOfSpatialJacobian, bool);
itkBooleanMacro(ComputeDeterminantOfSpatialJacobian);
itkSetMacro(ComputeDeformationField, bool);
itkGetConstMacro(ComputeDeformationField, bool);
itkBooleanMacro(ComputeDeformationField);
virtual void
SetTransformParameterObject(ParameterObjectType * transformParameterObject);
ParameterObjectType *
GetTransformParameterObject();
const ParameterObjectType *
GetTransformParameterObject() const;
using Superclass::GetOutput;
DataObject *
GetOutput(unsigned int idx);
const DataObject *
GetOutput(unsigned int idx) const;
OutputImageType *
GetOutput();
const OutputImageType *
GetOutput() const;
OutputDeformationFieldType *
GetOutputDeformationField();
const OutputDeformationFieldType *
GetOutputDeformationField() const;
itkSetMacro(OutputDirectory, std::string);
itkGetConstMacro(OutputDirectory, std::string);
virtual void
RemoveOutputDirectory()
{
this->SetOutputDirectory("");
}
virtual void
SetLogFileName(std::string logFileName);
itkGetConstMacro(LogFileName, std::string);
virtual void
RemoveLogFileName();
itkSetMacro(LogToConsole, bool);
itkGetConstMacro(LogToConsole, bool);
itkBooleanMacro(LogToConsole);
itkSetMacro(LogToFile, bool);
itkGetConstMacro(LogToFile, bool);
itkBooleanMacro(LogToFile);
void
DisableOutput()
{
m_EnableOutput = false;
}
itkSetMacro(LogLevel, ElastixLogLevel);
itkGetConstMacro(LogLevel, ElastixLogLevel);
itkSetConstObjectMacro(InputMesh, MeshType);
const MeshType *
GetOutputMesh() const
{
return m_OutputMesh;
}
void
SetTransform(const TransformBase *);
void
SetExternalTransform(TransformType *);
itkSetObjectMacro(CombinationTransform, TransformType);
SmartPointer<SpatialJacobianDeterminantImageType>
ComputeSpatialJacobianDeterminantImage() const;
SmartPointer<SpatialJacobianMatrixImageType>
ComputeSpatialJacobianMatrixImage() const;
protected:
TransformixFilter();
DataObjectPointer
MakeOutput(const DataObjectIdentifierType & key) override;
void
GenerateOutputInformation() override;
void
GenerateData() override;
private:
using Superclass::SetInput;
using Superclass::MakeOutput;
static bool
IsEmpty(const InputImageType * inputImage);
using ProcessObject::RemoveInput;
using ElastixTransformBaseType = elx::TransformBase<elx::ElastixTemplate<TImage, TImage>>;
const ElastixTransformBaseType *
GetFirstElastixTransformBase() const;
SmartPointer<const elx::TransformixMain> m_TransformixMain{};
std::string m_TransformParameterFileName{};
std::string m_FixedPointSetFileName{};
bool m_ComputeSpatialJacobian{ false };
bool m_ComputeDeterminantOfSpatialJacobian{ false };
bool m_ComputeDeformationField{ false };
std::string m_OutputDirectory{};
std::string m_LogFileName{};
bool m_EnableOutput{ true };
bool m_LogToConsole{ false };
bool m_LogToFile{ false };
ElastixLogLevel m_LogLevel{};
SmartPointer<const MeshType> m_InputMesh{};
SmartPointer<MeshType> m_OutputMesh{};
SmartPointer<const TransformBase> m_Transform{};
SmartPointer<TransformType> m_ExternalTransform{};
SmartPointer<TransformType> m_CombinationTransform;
};
} // namespace itk
#ifndef ITK_MANUAL_INSTANTIATION
# include "itkTransformixFilter.hxx"
#endif
#endif
elastix::ParameterObject
Definition elxParameterObject.h:33
elastix::ParameterObject::Pointer
itk::SmartPointer< Self > Pointer
Definition elxParameterObject.h:36
elastix::ParameterObject::ParameterMapType
std::map< ParameterKeyType, ParameterValueVectorType > ParameterMapType
Definition elxParameterObject.h:45
elastix::ParameterObject::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition elxParameterObject.h:37
elastix::ParameterObject::ParameterValueVectorType
std::vector< ParameterValueType > ParameterValueVectorType
Definition elxParameterObject.h:43
elastix::ParameterObject::ParameterMapVectorType
std::vector< ParameterMapType > ParameterMapVectorType
Definition elxParameterObject.h:48
elastix::TransformBase
This class is the elastix base class for all Transforms.
Definition elxTransformBase.h:138
elastix::TransformixMain
A class with all functionality to configure transformix.
Definition elxTransformixMain.h:40
elastix::TransformixMain::DataObjectContainerType
ElastixBase::DataObjectContainerType DataObjectContainerType
Definition elxMainBase.h:67
elastix::TransformixMain::DataObjectContainerPointer
ElastixBase::DataObjectContainerPointer DataObjectContainerPointer
Definition elxMainBase.h:69
elastix::TransformixMain::Pointer
itk::SmartPointer< Self > Pointer
Definition elxTransformixMain.h:47
elastix::TransformixMain::ArgumentMapType
Configuration::CommandLineArgumentMapType ArgumentMapType
Definition elxMainBase.h:65
itk::TransformixFilter::m_Transform
SmartPointer< const TransformBase > m_Transform
Definition itkTransformixFilter.h:313
itk::TransformixFilter::m_ComputeDeformationField
bool m_ComputeDeformationField
Definition itkTransformixFilter.h:299
itk::TransformixFilter::m_ComputeDeterminantOfSpatialJacobian
bool m_ComputeDeterminantOfSpatialJacobian
Definition itkTransformixFilter.h:298
itk::TransformixFilter::SetInput
void SetInput(DataObjectPointerArraySizeType index, DataObject *input)
itk::TransformixFilter::GetMovingImage
const InputImageType * GetMovingImage() const
itk::TransformixFilter::SetLogFileName
virtual void SetLogFileName(std::string logFileName)
itk::TransformixFilter::SpatialJacobianMatrixImageType
itk::Image< itk::Matrix< float, MovingImageDimension, MovingImageDimension >, MovingImageDimension > SpatialJacobianMatrixImageType
Definition itkTransformixFilter.h:111
itk::TransformixFilter::m_LogToConsole
bool m_LogToConsole
Definition itkTransformixFilter.h:305
itk::TransformixFilter::SetOutputDirectory
virtual void SetOutputDirectory(std::string _arg)
itk::TransformixFilter::ParameterValueVectorType
ParameterObjectType::ParameterValueVectorType ParameterValueVectorType
Definition itkTransformixFilter.h:90
itk::TransformixFilter::TransformType
Transform< double, MovingImageDimension, MovingImageDimension > TransformType
Definition itkTransformixFilter.h:107
itk::TransformixFilter::m_TransformixMain
SmartPointer< const elx::TransformixMain > m_TransformixMain
Definition itkTransformixFilter.h:293
itk::TransformixFilter::DataObjectPointer
ProcessObject::DataObjectPointer DataObjectPointer
Definition itkTransformixFilter.h:82
itk::TransformixFilter::m_InputMesh
SmartPointer< const MeshType > m_InputMesh
Definition itkTransformixFilter.h:310
itk::TransformixFilter::MakeOutput
DataObjectPointer MakeOutput(const DataObjectIdentifierType &key) override
itk::TransformixFilter::GenerateOutputInformation
void GenerateOutputInformation() override
itk::TransformixFilter::RemoveLogFileName
virtual void RemoveLogFileName()
itk::TransformixFilter::TransformixMainType
elx::TransformixMain TransformixMainType
Definition itkTransformixFilter.h:77
itk::TransformixFilter::m_ExternalTransform
SmartPointer< TransformType > m_ExternalTransform
Definition itkTransformixFilter.h:314
itk::TransformixFilter::SetMovingImage
virtual void SetMovingImage(TImage *inputImage)
itk::TransformixFilter::DataObjectIdentifierType
ProcessObject::DataObjectIdentifierType DataObjectIdentifierType
Definition itkTransformixFilter.h:83
itk::TransformixFilter::DataObjectContainerType
TransformixMainType::DataObjectContainerType DataObjectContainerType
Definition itkTransformixFilter.h:84
itk::TransformixFilter::DisableOutput
void DisableOutput()
Definition itkTransformixFilter.h:214
itk::TransformixFilter::ITK_DISALLOW_COPY_AND_MOVE
ITK_DISALLOW_COPY_AND_MOVE(TransformixFilter)
itk::TransformixFilter::TransformixMainPointer
TransformixMainType::Pointer TransformixMainPointer
Definition itkTransformixFilter.h:78
itk::TransformixFilter::GetOutput
const DataObject * GetOutput(unsigned int idx) const
itk::TransformixFilter::m_EnableOutput
bool m_EnableOutput
Definition itkTransformixFilter.h:304
itk::TransformixFilter::SetInput
void SetInput(InputImageType *movingImage)
itk::TransformixFilter::SetFixedPointSetFileName
virtual void SetFixedPointSetFileName(std::string _arg)
itk::TransformixFilter::m_OutputMesh
SmartPointer< MeshType > m_OutputMesh
Definition itkTransformixFilter.h:311
itk::TransformixFilter::OutputDeformationFieldType
typename itk::Image< itk::Vector< float, TImage::ImageDimension >, TImage::ImageDimension > OutputDeformationFieldType
Definition itkTransformixFilter.h:97
itk::TransformixFilter::RemoveOutputDirectory
virtual void RemoveOutputDirectory()
Definition itkTransformixFilter.h:189
itk::TransformixFilter::m_FixedPointSetFileName
std::string m_FixedPointSetFileName
Definition itkTransformixFilter.h:296
itk::TransformixFilter::ParameterMapType
ParameterObjectType::ParameterMapType ParameterMapType
Definition itkTransformixFilter.h:89
itk::TransformixFilter::GenerateData
void GenerateData() override
itk::TransformixFilter::ComputeSpatialJacobianMatrixImage
SmartPointer< SpatialJacobianMatrixImageType > ComputeSpatialJacobianMatrixImage() const
itk::TransformixFilter::RemoveMovingImage
virtual void RemoveMovingImage()
itk::TransformixFilter::GetTransformParameterObject
const ParameterObjectType * GetTransformParameterObject() const
itk::TransformixFilter::TransformixFilter
TransformixFilter()
itk::TransformixFilter::Superclass
ImageSource< TImage > Superclass
Definition itkTransformixFilter.h:66
itk::TransformixFilter::DataObjectPointerArraySizeType
ProcessObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType
Definition itkTransformixFilter.h:100
itk::TransformixFilter::SetTransformParameterFileName
void SetTransformParameterFileName(std::string)
itk::TransformixFilter::GetInput
const InputImageType * GetInput() const
itk::TransformixFilter::SetTransform
void SetTransform(const TransformBase *)
itk::TransformixFilter::DataObjectContainerPointer
TransformixMainType::DataObjectContainerPointer DataObjectContainerPointer
Definition itkTransformixFilter.h:85
itk::TransformixFilter::GetOutput
OutputImageType * GetOutput()
itk::TransformixFilter::ParameterMapVectorType
ParameterObjectType::ParameterMapVectorType ParameterMapVectorType
Definition itkTransformixFilter.h:88
itk::TransformixFilter::GetOutputDeformationField
const OutputDeformationFieldType * GetOutputDeformationField() const
itk::TransformixFilter::GetOutput
const OutputImageType * GetOutput() const
itk::TransformixFilter::GetOutputMesh
const MeshType * GetOutputMesh() const
Definition itkTransformixFilter.h:227
itk::TransformixFilter::GetOutputDeformationField
OutputDeformationFieldType * GetOutputDeformationField()
itk::TransformixFilter::InputImageType
TImage InputImageType
Definition itkTransformixFilter.h:102
itk::TransformixFilter::m_LogLevel
ElastixLogLevel m_LogLevel
Definition itkTransformixFilter.h:308
itk::TransformixFilter::ComputeSpatialJacobianDeterminantImage
SmartPointer< SpatialJacobianDeterminantImageType > ComputeSpatialJacobianDeterminantImage() const
itk::TransformixFilter::m_LogFileName
std::string m_LogFileName
Definition itkTransformixFilter.h:302
itk::TransformixFilter::SetExternalTransform
void SetExternalTransform(TransformType *)
itk::TransformixFilter::ParameterObjectPointer
typename ParameterObjectType::Pointer ParameterObjectPointer
Definition itkTransformixFilter.h:91
itk::TransformixFilter::GetOutput
DataObject * GetOutput(unsigned int idx)
itk::TransformixFilter::m_CombinationTransform
SmartPointer< TransformType > m_CombinationTransform
Definition itkTransformixFilter.h:316
itk::TransformixFilter::ElastixTransformBaseType
elx::TransformBase< elx::ElastixTemplate< TImage, TImage > > ElastixTransformBaseType
Definition itkTransformixFilter.h:288
itk::TransformixFilter::itkStaticConstMacro
itkStaticConstMacro(MovingImageDimension, unsigned int, TImage::ImageDimension)
itk::TransformixFilter::m_LogToFile
bool m_LogToFile
Definition itkTransformixFilter.h:306
itk::TransformixFilter::GetFirstElastixTransformBase
const ElastixTransformBaseType * GetFirstElastixTransformBase() const
itk::TransformixFilter::SpatialJacobianDeterminantImageType
itk::Image< float, MovingImageDimension > SpatialJacobianDeterminantImageType
Definition itkTransformixFilter.h:110
itk::TransformixFilter::m_TransformParameterFileName
std::string m_TransformParameterFileName
Definition itkTransformixFilter.h:295
itk::TransformixFilter::ParameterObjectConstPointer
typename ParameterObjectType::ConstPointer ParameterObjectConstPointer
Definition itkTransformixFilter.h:92
itk::TransformixFilter::ConstPointer
SmartPointer< const Self > ConstPointer
Definition itkTransformixFilter.h:68
itk::TransformixFilter::m_OutputDirectory
std::string m_OutputDirectory
Definition itkTransformixFilter.h:301
itk::TransformixFilter::ArgumentMapType
TransformixMainType::ArgumentMapType ArgumentMapType
Definition itkTransformixFilter.h:79
itk::TransformixFilter::m_ComputeSpatialJacobian
bool m_ComputeSpatialJacobian
Definition itkTransformixFilter.h:297
itk::TransformixFilter::ArgumentMapEntryType
ArgumentMapType::value_type ArgumentMapEntryType
Definition itkTransformixFilter.h:80
itk::TransformixFilter::GetInput
const DataObject * GetInput(DataObjectPointerArraySizeType index) const
itk::TransformixFilter::ParameterObjectType
elx::ParameterObject ParameterObjectType
Definition itkTransformixFilter.h:87
itk::TransformixFilter::IsEmpty
static bool IsEmpty(const InputImageType *inputImage)
itk::TransformixFilter::Self
TransformixFilter Self
Definition itkTransformixFilter.h:65
itk::TransformixFilter::MeshType
Mesh< OutputImagePixelType, MovingImageDimension > MeshType
Definition itkTransformixFilter.h:105
itk::TransformixFilter::Pointer
SmartPointer< Self > Pointer
Definition itkTransformixFilter.h:67
itk::TransformixFilter::RemoveFixedPointSetFileName
virtual void RemoveFixedPointSetFileName()
Definition itkTransformixFilter.h:139
itk::TransformixFilter::GetTransformParameterObject
ParameterObjectType * GetTransformParameterObject()
itk::TransformixFilter::SetTransformParameterObject
virtual void SetTransformParameterObject(ParameterObjectType *transformParameterObject)
elxElastixTemplate.h
elxParameterObject.h
elxTransformBase.h
elxTransformixMain.h
itkElastixLogLevel.h
itk
Definition itkAdvancedImageToImageMetric.h:43
itk::ElastixLogLevel
ElastixLogLevel
Definition itkElastixLogLevel.h:44

Generated on 1768596610 for elastix by 1.15.0 |