Skip to content

Instantly share code, notes, and snippets.

@kenavolic
Created October 1, 2024 18:47
Show Gist options
  • Save kenavolic/acd6a544e58a995f395812c6e404b9de to your computer and use it in GitHub Desktop.
Save kenavolic/acd6a544e58a995f395812c6e404b9de to your computer and use it in GitHub Desktop.
itk::RelabelComponentImageFilter GetSizeOfObjectInPhysicalUnits compilation error
cmake_minimum_required(VERSION 3.10.2)
project(RelabelComponentTest)
# Find ITK.
find_package(ITK REQUIRED)
include(${ITK_USE_FILE})
add_executable(RelabelComponentTest main.cpp)
target_compile_options(RelabelComponentTest PRIVATE -Wall -Werror)
target_link_libraries(RelabelComponentTest ${ITK_LIBRARIES})
#include "itkImage.h"
#include "itkRelabelComponentImageFilter.h"
int main()
{
using ImageType = itk::Image< signed short, 3 >;
using FilterType = itk::RelabelComponentImageFilter<ImageType, ImageType>;
using LabelType = FilterType::LabelType;
LabelType l{};
//itk::SizeValueType i{};
auto relabeler = FilterType::New();
relabeler->GetSizeOfObjectInPhysicalUnits(l);
//relabeler->GetSizeOfObjectInPhysicalUnits(i); // i converted to LabelType leading to same error
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment