ITK v4 Migration Guide

From mitk.org
Revision as of 16:44, 26 June 2013 by SaschaZelzer (talk | contribs) (Make it viewable for the public)
Jump to navigation Jump to search

Migration Guide

Histogram Initialization

MeasurementVectorSize and histogramSize has to be set explicitly when initializing a histogram

Old:


m_EmptyHistogram = HistogramType::New();
 HistogramType::SizeType histogramSize;
 histogramSize.Fill( 256 );
 m_EmptyHistogram->Initialize( histogramSize );

New:


m_EmptyHistogram = HistogramType::New();
m_EmptyHistogram->SetMeasurementVectorSize(2);
HistogramType::SizeType histogramSize(2);
histogramSize.Fill( 256 );
m_EmptyHistogram->Initialize( histogramSize );

get/Set Output

Subclasses of itk::ImageSource

mitk::PixelType

The mitk::PixelType class was adapted to changes in itk::ImageIOBase and its interface was cleaned up.

Old New Comment
itk::ImageIOBase::IOPixelType GetPixelTypeId() itk::ImageIOBase::IOPixelType GetPixelType() Renamed
const std::type_info& GetTypeId() int GetComponentType() To compare the component type, use either the itk::ImageIOBase::IOComponentType enum directly or use mitk::MapPixelComponentType<T>::value to map a pixel component type to an integer value (this will also work for user component types not known to the itk::ImageIOBase class
std::string GetItkTypeAsString() std::string GetPixelTypeAsString() Renamed

Rigid3DTransform

Remove WeakPointer Workaround

  • remove all MITK_WEAKPOINTER_PROBLEM_WORKAROUND_ENABLED
  • remove m_SmartSourcePointer from mitkBaseData

Deformation vs. Displacement

BaseProcess vs. BaseDataSource or "cannot allocate an object of abstract type"

  • Due to changes in the ITK Filterpipeline we decided to mark mitk::BaseProcess as deprecated.
  • The new class mitk::BaseDataSource should be used by now
  • mitk::BaseDataSource has some pure virtual functions (actually the MakeOutput(..) functions)
  • These functions must be implemented by each subclass

Clone() const' cannot be overloaded"

  • ITK 4 implements various new clone() methods which we used to implement in MITK in the past resulting in the error mentioned above.
  • Most of the time, the Clone() method in MITK can just be removed.
  • If there is anything happening except for the call to InternalClone() this code should be moved to the InternalClone() method.

itk::PointSet does not have a boundingbox anymore