Difference between revisions of "Documentation/4.2/Developers/Tutorials/PortingCLIToITKv4"

From Slicer Wiki
Jump to: navigation, search
Line 1: Line 1:
 
== ITKv4 ==
 
== ITKv4 ==
  
[http://www.itk.org/Wiki/ITK/Getting_Started Getting started with ITKv4]
+
[http://www.itk.org/Wiki/ITK/Getting_Started Getting started with ITKv4] - has general information on ITKv4
Links to ITKv4
+
 
Links to Migration guide
+
[http://itk.org/migrationv4/index.php?action=news&newsid=2&newslang=en ITKv4 Migration Guide] - has a migration guide that explains API changes.
  
 
== Known issues in porting CLIs ==
 
== Known issues in porting CLIs ==

Revision as of 20:18, 6 December 2012

Home < Documentation < 4.2 < Developers < Tutorials < PortingCLIToITKv4

ITKv4

Getting started with ITKv4 - has general information on ITKv4

ITKv4 Migration Guide - has a migration guide that explains API changes.

Known issues in porting CLIs

My filter doesn't run.

The API to ThreadedGenerateData() changed in ITKv4.

ITKv3 version of ThreadedGenerateData()

     virtual  void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread,  int threadId );

ITKv4 version of ThreadedGenerateData()

    virtual  void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread, ThreadIdType threadId);

Note the use of ThreadIdType.

If you have written a mulit-threaded filter, you need to update the signature of the method. Your ITKv3 version of the method may be defining a new function instead of overriding the version called by the pipeline. ITKv4 attempts to emit a run-time exception but there are circumstances where the exception cannot be thrown. Specifically, if your filter is a subclass of a filter that does implement ThreadedGenerateData(), then ITKv4's attempt to inform of the issue is circumvented.

If your filter is not executing in ITKv4, check the declaration of ThreadedGenerateData().

DICOM/GDCM

ITKv4 updated the version of GDM used to version 2. GDCM version 2 has many API changes from version 1. If your CLI used GDCM directly, you will need to port your CLI to ITKv4. If you used ITK abstractions to access DICOM, then the changes to GDCM will not affect your CLI.