Skip to content

MacOS itk vtk glue #2067

@okaerin

Description

@okaerin

Description

I have a segmentation pipeline relying on itk 4.13 and vtk 8.1 . It is supposed to load a *.vtk structured points file. Somehow I get errors of "Determinant must not be 0" or "slice spacing is zero".
The header of the vtk volume producing the outcome:

# vtk DataFile Version 3.0
VTK File Generated by Insight Segmentation and Registration Toolkit (ITK)
BINARY
DATASET STRUCTURED_POINTS
DIMENSIONS 369 369 160 
SPACING 1.0000000000000000e+00 1.0000000000000000e+00 2.5000000000000000e+00 
ORIGIN -1.9830000305175781e+02 -1.8500000000000000e+02 -4.0750000000000000e+02 
POINT_DATA 21785760
SCALARS scalars short 1
LOOKUP_TABLE default

After doing further investigation I noticed that the ITKVtkglue tests fail on my machine:

Total Test time (real) = 404.70 sec

The following tests FAILED:
	1296 - itkCastImageFilterTest (Failed)
	2539 - itkVtkMedianImageFilterTest (SEGFAULT)
	2543 - QuickViewTest (SEGFAULT)
	2544 - itkVtkConnectedComponentImageFilterTest (Failed)
[ERROR_MESSAGE] 
Errors while running CTest

I am thinking that it might be connected.

Steps to Reproduce

Reproduce reading

      typedef itk::Image<short, 3> ImageType;
      typedef itk::ImageFileReader<ImageType> ImageFileReaderType;
      ImageFileReaderType::Pointer reader = ImageFileReaderType::New();
      try {
         reader->SetFileName(imageDataPath);
         reader->Update();
      } catch (itk::ExceptionObject &err) {
         std::cerr << err << std::endl;
      }

Reproduce test outcome

  1. Build Vtk 8.1
cmake .. \
      -DCMAKE_CXX_STANDARD=11 \
      -DCMAKE_BUILD_TYPE=Release \
      -DBUILD_SHARED_LIBS=ON \
      -DVTK_LEGACY_REMOVE=ON \
      -DCMAKE_MACOSX_RPATH=ON \
      -DCMAKE_INSTALL_RPATH=\$ORIGIN \
      -DBUILD_TESTING=OFF \
      -DBUILD_EXAMPLES=OFF \
      -DModule_vtkRenderingExternal=ON
cmake --build . -j`nproc`
  1. Build itk 4.13-release
cmake .. \
      -DVTK_DIR=${VTK_DIR} \
      -DCMAKE_CXX_STANDARD=11 \
      -DCMAKE_CXX_EXTENSIONS=OFF \
      -DCMAKE_CXX_STANDARD_REQUIRED=ON \
      -DCMAKE_BUILD_TYPE=Release \
      -DBUILD_SHARED_LIBS=ON \
      -DITK_LEGACY_REMOVE=ON \
      -DCMAKE_INSTALL_RPATH=\$ORIGIN \
      -DModule_ITKVtkGlue=ON \
      -DModule_IOSTL=ON \
      -DModule_LesionSizingToolkit=ON \
      -DBUILD_TESTING=ON \
      -DBUILD_EXAMPLES=OFF \
      -DITK_SKIP_PATH_LENGTH_CHECKS=ON 
cmake --build . -j`nproc`
  1. Run tests

Expected behavior

Tests to complete without errors

Actual behavior

itkVtkConnectedComponentImageFilterTest

* thread #1, stop reason = signal SIGSTOP
  * frame #0: 0x00007fff796376f2 libsystem_platform.dylib`_platform_strlen + 18
    frame #1: 0x000000010e5393a5 ITKVtkGlueTestDriver`std::__1::char_traits<char>::length(__s=0x0000000000000000) at __string:218:53
    frame #2: 0x000000010e523f9c ITKVtkGlueTestDriver`std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::operator<<<std::__1::char_traits<char> >(__os=0x00007fffaf1a1770, __str=0x0000000000000000) at ostream:865:57
    frame #3: 0x000000010e71f93e ITKVtkGlueTestDriver`itkVtkConnectedComponentImageFilterTest(argc=0, argv=0x00007ffee16f0a98) at itkVtkConnectedComponentImageFilterTest.cxx:45:28
    frame #4: 0x000000010e5333df ITKVtkGlueTestDriver`main(ac=0, av=0x00007ffee16f0a98) at ITKVtkGlueTestDriver.cxx:162:14
    frame #5: 0x00007fff7944f3d5 libdyld.dylib`start + 1

Tests fail or segfault

Reproducibility

100%

Versions

4.13.3

Environment

ProductName:	Mac OS X
ProductVersion:	10.14.6
BuildVersion:	18G5033
Apple clang version 11.0.0 (clang-1100.0.33.17)
Target: x86_64-apple-darwin18.7.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
cmake version 3.17.3

Additional Information

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:BugInconsistencies or issues which will cause an incorrect result under some or all circumstances

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions