Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gems and gemsbindings itk5 migration #7

Merged
merged 2 commits into from
Dec 21, 2023
Merged

Conversation

yhuang43
Copy link
Contributor

No description provided.

  Freesurfer CentOS9 build now support ITK5.4.

  This commit includes the ITK5 migration related to gems and gemsbindings.
  See ITK v5 Migration Guide for details (https://github.com/InsightSoftwareConsortium/ITK/blob/master/Documentation/docs/migration_guides/itk_5_migration_guide.md).

  1. Enhancements in nullptr behavior in ITKv5 provide more clear type checking and respect the nullptr identifier.
     The 'long 0' value known as NULL causes an ambiguity for overload compilations of the ITKv5 smartpointers.
     To be backwards compatible with pre C++11 compilers use the ITK_NULLPTR designation, otherwise replace NULL and 0 initialization of itk::SmartPointer with nullptr.
  2. Since ITK 5.0, ITK_THREAD_RETURN_TYPE is now in the itk:: namespace, and ITK_THREAD_RETURN_VALUE is named itk::ITK_THREAD_RETURN_DEFAULT_VALUE
  3. replace SimpleFastMutexLock with std::mutex, and #include "itkSimpleFastMutexLock.h" with #include <mutex>
  4. For ITK_VERSION_MAJOR >= 5, use itk::MultiThreaderBase::SetGlobalDefaultNumberOfThreads()/GetGlobalDefaultNumberOfThreads()
     instead of itk::MultiThreader::SetGlobalDefaultNumberOfThreads()/GetGlobalDefaultNumberOfThreads()
  5. Adapt to new multi-threading naming convention. Specifically:
     Change MultiThreader::ThreadInfoStruct to MultiThreaderBase::WorkUnitInfo
     Change (threadInfo)->ThreadID to (threadInfo)->WorkUnitID
     Change (threadInfo)->NumberOfThreads to (threadInfo)->NumberOfWorkUnits
  6. For filter multi-threading, a new signature has been introduced: void DynamicThreadedGenerateData( const OutputRegionType& threadRegion ).
     By default, this new signature is invoked instead of the classic void ThreadedGenerateData( const OutputRegionType& threadRegion, ThreadIdType threadId ).
     To temporarily obtain the old behavior (classic signature invoked by default), set ITKV4_COMPATIBILITY to ON in ITK's CMake configuration.
     To permanently have your filter use the classic threading model, invoke this->DynamicMultiThreadingOff(); in the filter constructor.

     invoke 'this->DynamicMultiThreadingOff();' in the following likelihoodImageFilters to use the clasic signature ThreadedGenerateData():
     kvlGMMLikelihoodImageFilter, kvlDSWbetaMMLikelihoodImageFilter, kvlFrobMMLikelihoodImageFilter, and kvlWMMLikelihoodImageFilter.
  7. include "itkMacro.h" instead of "itkExceptionObject.h" for ITK_VERSION_MAJOR >= 5
  Change library search order - search ZLIB_LIBRARIES before ITK_LIBRARIES.

  We compile with -DITK_USE_SYSTEM_ZLIB to use system installed zlib library.
  This should fix "Multiple defines" linking error.
@yhuang43 yhuang43 requested review from ste93ste and oulap December 19, 2023 20:27
@ste93ste ste93ste merged commit 74ba9c2 into freesurfer:dev Dec 21, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants