[ITK-users] [ITK] Buffered Region out of Range error
Michael Jackson
mike.jackson at bluequartz.net
Wed Oct 28 10:59:40 EDT 2015
That did not work either. Still have the same errors. We compiled ITK 4.8.1 using the USE_COMPIILER_HIDDEN_VISIBILITY=OFF CMake flag. Have you seen this error before and if so how was it fixed?
--
Mike Jackson [mike.jackson at bluequartz.net]
> On Oct 28, 2015, at 10:40 AM, Michael Jackson <mike.jackson at bluequartz.net> wrote:
>
> So we built on an OS X 10.8.5 machine and now the code works completely and gives the correct output. On the 10.8.5 machine all the libraries are linked against “libstdc++” EXCEPT Qt. Where-as on OS X 10.9 and 10.10 they are all linked against libc++. So I am thinking, at least for ITK 4.7.2 we have stumbled upon an issue with the C++ library? We are now recompiling ITK using the USE_COMPIILER_HIDDEN_VISIBILITY=OFF as you have suggested and will report back those findings.
> --
> Mike Jackson [mike.jackson at bluequartz.net]
>
>
>> On Oct 28, 2015, at 9:21 AM, Bradley Lowekamp <blowekamp at mail.nih.gov> wrote:
>>
>> I believe if Qt used libstdc++ then it would show up on that list. I'd run an otool -L on one of those libraries to double check.
>>
>> I'd try to build against OSX 10.8 or on a 10.8 system, just to rule out C++ library compatibility issues. I have had very odd things happen when these don't match.
>>
>> The other issue I have seen some time is run-time information problems when ITK classes are instantiated in different libraries and shared between them. Things like dynamic_cast can fail, along with specific exception types not being caught. We have recently improved the export specification in ITK, and you should upgrade. This may be a larger architectural problem, and techniques like explicit instantiation of object which can be shared can help.
>>
>> *shameless plug* You could also look into using SimpleITK, which provides a clean interface. It does this by provided a full export specified interface free from templates, and explicitly instantiating many parts of ITK. The SimpleITK object could be the objects that are shared between libraries.
>>
>> You could try compiling ITK with USE_COMPIILER_HIDDEN_VISIBILITY OFF this will disable the harsh hidden visibility and may help problematic symbols be shared.
>>
>> HTH,
>> Brad
>>
>>
>>
>>
>> On Oct 28, 2015, at 8:31 AM, Michael Jackson <mike.jackson at bluequartz.net> wrote:
>>
>>> Yes, All dependent libraries are shared.
>>>
>>> otool -L for one of our plugins:
>>> @rpath/libDREAM3DWidgetsLib_debug.dylib (compatibility version 0.0.0, current version 0.0.0)
>>> /Users/Shared/DREAM3D_SDK/ITK-4.7.2-Debug/lib/libITKReview-4.7.1.dylib (compatibility version 0.0.0, current version 0.0.0)
>>> /Users/Shared/DREAM3D_SDK/ITK-4.7.2-Debug/lib/libITKLabelMap-4.7.1.dylib (compatibility version 0.0.0, current version 0.0.0)
>>> /Users/Shared/DREAM3D_SDK/ITK-4.7.2-Debug/lib/libITKQuadEdgeMesh-4.7.1.dylib (compatibility version 0.0.0, current version 0.0.0)
>>> /Users/Shared/DREAM3D_SDK/ITK-4.7.2-Debug/lib/libITKBiasCorrection-4.7.1.dylib (compatibility version 0.0.0, current version 0.0.0)
>>> /Users/Shared/DREAM3D_SDK/ITK-4.7.2-Debug/lib/libITKPolynomials-4.7.1.dylib (compatibility version 0.0.0, current version 0.0.0)
>>> /Users/Shared/DREAM3D_SDK/ITK-4.7.2-Debug/lib/libITKBioCell-4.7.1.dylib (compatibility version 0.0.0, current version 0.0.0)
>>> /Users/Shared/DREAM3D_SDK/ITK-4.7.2-Debug/lib/libITKFEM-4.7.1.dylib (compatibility version 0.0.0, current version 0.0.0)
>>> /Users/Shared/DREAM3D_SDK/ITK-4.7.2-Debug/lib/libITKIOSpatialObjects-4.7.1.dylib (compatibility version 0.0.0, current version 0.0.0)
>>> /Users/Shared/DREAM3D_SDK/ITK-4.7.2-Debug/lib/libITKIOXML-4.7.1.dylib (compatibility version 0.0.0, current version 0.0.0)
>>> /Users/Shared/DREAM3D_SDK/ITK-4.7.2-Debug/lib/libITKIOBioRad-4.7.1.dylib (compatibility version 0.0.0, current version 0.0.0)
>>> /Users/Shared/DREAM3D_SDK/ITK-4.7.2-Debug/lib/libITKIOGDCM-4.7.1.dylib (compatibility version 0.0.0, current version 0.0.0)
>>> /Users/Shared/DREAM3D_SDK/ITK-4.7.2-Debug/lib/libitkgdcmMSFF-4.7.1.dylib (compatibility version 0.0.0, current version 0.0.0)
>>> /Users/Shared/DREAM3D_SDK/ITK-4.7.2-Debug/lib/libitkopenjpeg-4.7.1.dylib (compatibility version 0.0.0, current version 0.0.0)
>>> /Users/Shared/DREAM3D_SDK/ITK-4.7.2-Debug/lib/libITKIOGIPL-4.7.1.dylib (compatibility version 0.0.0, current version 0.0.0)
>>> /Users/Shared/DREAM3D_SDK/ITK-4.7.2-Debug/lib/libITKIOMeta-4.7.1.dylib (compatibility version 0.0.0, current version 0.0.0)
>>> /Users/Shared/DREAM3D_SDK/ITK-4.7.2-Debug/lib/libITKIONIFTI-4.7.1.dylib (compatibility version 0.0.0, current version 0.0.0)
>>> /Users/Shared/DREAM3D_SDK/ITK-4.7.2-Debug/lib/libITKniftiio-4.7.1.dylib (compatibility version 0.0.0, current version 0.0.0)
>>> /Users/Shared/DREAM3D_SDK/ITK-4.7.2-Debug/lib/libITKIONRRD-4.7.1.dylib (compatibility version 0.0.0, current version 0.0.0)
>>> /Users/Shared/DREAM3D_SDK/ITK-4.7.2-Debug/lib/libITKNrrdIO-4.7.1.dylib (compatibility version 0.0.0, current version 0.0.0)
>>> /Users/Shared/DREAM3D_SDK/ITK-4.7.2-Debug/lib/libITKIOSiemens-4.7.1.dylib (compatibility version 0.0.0, current version 0.0.0)
>>> /Users/Shared/DREAM3D_SDK/ITK-4.7.2-Debug/lib/libITKIOStimulate-4.7.1.dylib (compatibility version 0.0.0, current version 0.0.0)
>>> /Users/Shared/DREAM3D_SDK/ITK-4.7.2-Debug/lib/libITKIOTransformHDF5-4.7.1.dylib (compatibility version 0.0.0, current version 0.0.0)
>>> /Users/Shared/DREAM3D_SDK/hdf5-1.8.15-Debug/lib/libhdf5_debug.10.0.1.dylib (compatibility version 10.0.1, current version 1.8.15)
>>> /Users/Shared/DREAM3D_SDK/hdf5-1.8.15-Debug/lib/libhdf5_cpp_debug.10.0.1.dylib (compatibility version 10.0.1, current version 1.8.15)
>>> /Users/Shared/DREAM3D_SDK/ITK-4.7.2-Debug/lib/libITKIOTransformInsightLegacy-4.7.1.dylib (compatibility version 0.0.0, current version 0.0.0)
>>> /Users/Shared/DREAM3D_SDK/ITK-4.7.2-Debug/lib/libITKIOTransformMatlab-4.7.1.dylib (compatibility version 0.0.0, current version 0.0.0)
>>> /Users/Shared/DREAM3D_SDK/ITK-4.7.2-Debug/lib/libITKIOVTK-4.7.1.dylib (compatibility version 0.0.0, current version 0.0.0)
>>> /Users/Shared/DREAM3D_SDK/ITK-4.7.2-Debug/lib/libITKKLMRegionGrowing-4.7.1.dylib (compatibility version 0.0.0, current version 0.0.0)
>>> /Users/Shared/DREAM3D_SDK/ITK-4.7.2-Debug/lib/libITKVTK-4.7.1.dylib (compatibility version 0.0.0, current version 0.0.0)
>>> @rpath/libQtSupportLib_debug.dylib (compatibility version 0.0.0, current version 0.0.0)
>>> @rpath/libSIMPLib_debug.dylib (compatibility version 0.0.0, current version 0.0.0)
>>> /Users/Shared/DREAM3D_SDK/tbb43_20150611oss/lib/libtbb_debug.dylib (compatibility version 0.0.0, current version 0.0.0)
>>> /Users/Shared/DREAM3D_SDK/tbb43_20150611oss/lib/libtbbmalloc_debug.dylib (compatibility version 0.0.0, current version 0.0.0)
>>> /Users/Shared/DREAM3D_SDK/Qt5.4.2/5.4/clang_64/lib/QtWidgets.framework/Versions/5/QtWidgets (compatibility version 5.4.0, current version 5.4.2)
>>> /Users/Shared/DREAM3D_SDK/Qt5.4.2/5.4/clang_64/lib/QtGui.framework/Versions/5/QtGui (compatibility version 5.4.0, current version 5.4.2)
>>> @rpath/libH5Support_debug.dylib (compatibility version 0.0.0, current version 0.0.0)
>>> /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1213.0.0)
>>> /Users/Shared/DREAM3D_SDK/Qt5.4.2/5.4/clang_64/lib/QtNetwork.framework/Versions/5/QtNetwork (compatibility version 5.4.0, current version 5.4.2)
>>> /Users/Shared/DREAM3D_SDK/Qt5.4.2/5.4/clang_64/lib/QtCore.framework/Versions/5/QtCore (compatibility version 5.4.0, current version 5.4.2)
>>> /Users/Shared/DREAM3D_SDK/ITK-4.7.2-Debug/lib/libITKIOBMP-4.7.1.dylib (compatibility version 0.0.0, current version 0.0.0)
>>> /Users/Shared/DREAM3D_SDK/ITK-4.7.2-Debug/lib/libITKIOJPEG-4.7.1.dylib (compatibility version 0.0.0, current version 0.0.0)
>>> /Users/Shared/DREAM3D_SDK/ITK-4.7.2-Debug/lib/libITKIOPNG-4.7.1.dylib (compatibility version 0.0.0, current version 0.0.0)
>>> /Users/Shared/DREAM3D_SDK/ITK-4.7.2-Debug/lib/libitkpng-4.7.1.dylib (compatibility version 0.0.0, current version 0.0.0)
>>> /Users/Shared/DREAM3D_SDK/ITK-4.7.2-Debug/lib/libITKIOTIFF-4.7.1.dylib (compatibility version 0.0.0, current version 0.0.0)
>>> /Users/Shared/DREAM3D_SDK/ITK-4.7.2-Debug/lib/libitktiff-4.7.1.dylib (compatibility version 0.0.0, current version 0.0.0)
>>> /Users/Shared/DREAM3D_SDK/ITK-4.7.2-Debug/lib/libitkjpeg-4.7.1.dylib (compatibility version 0.0.0, current version 0.0.0)
>>> /Users/Shared/DREAM3D_SDK/ITK-4.7.2-Debug/lib/libITKWatersheds-4.7.1.dylib (compatibility version 0.0.0, current version 0.0.0)
>>> /Users/Shared/DREAM3D_SDK/ITK-4.7.2-Debug/lib/libITKPath-4.7.1.dylib (compatibility version 0.0.0, current version 0.0.0)
>>> /Users/Shared/DREAM3D_SDK/ITK-4.7.2-Debug/lib/libITKOptimizers-4.7.1.dylib (compatibility version 0.0.0, current version 0.0.0)
>>> /Users/Shared/DREAM3D_SDK/ITK-4.7.2-Debug/lib/libITKSpatialObjects-4.7.1.dylib (compatibility version 0.0.0, current version 0.0.0)
>>> /Users/Shared/DREAM3D_SDK/ITK-4.7.2-Debug/lib/libITKMesh-4.7.1.dylib (compatibility version 0.0.0, current version 0.0.0)
>>> /Users/Shared/DREAM3D_SDK/ITK-4.7.2-Debug/lib/libitkgdcmDICT-4.7.1.dylib (compatibility version 0.0.0, current version 0.0.0)
>>> /Users/Shared/DREAM3D_SDK/ITK-4.7.2-Debug/lib/libitkgdcmIOD-4.7.1.dylib (compatibility version 0.0.0, current version 0.0.0)
>>> /Users/Shared/DREAM3D_SDK/ITK-4.7.2-Debug/lib/libITKEXPAT-4.7.1.dylib (compatibility version 0.0.0, current version 0.0.0)
>>> /Users/Shared/DREAM3D_SDK/ITK-4.7.2-Debug/lib/libitkgdcmDSED-4.7.1.dylib (compatibility version 0.0.0, current version 0.0.0)
>>> /Users/Shared/DREAM3D_SDK/ITK-4.7.2-Debug/lib/libitkgdcmCommon-4.7.1.dylib (compatibility version 0.0.0, current version 0.0.0)
>>> /Users/Shared/DREAM3D_SDK/ITK-4.7.2-Debug/lib/libITKMetaIO-4.7.1.dylib (compatibility version 0.0.0, current version 0.0.0)
>>> /Users/Shared/DREAM3D_SDK/ITK-4.7.2-Debug/lib/libITKznz-4.7.1.dylib (compatibility version 0.0.0, current version 0.0.0)
>>> /Users/Shared/DREAM3D_SDK/ITK-4.7.2-Debug/lib/libitkzlib-4.7.1.dylib (compatibility version 0.0.0, current version 0.0.0)
>>> /Users/Shared/DREAM3D_SDK/ITK-4.7.2-Debug/lib/libITKIOGE-4.7.1.dylib (compatibility version 0.0.0, current version 0.0.0)
>>> /Users/Shared/DREAM3D_SDK/ITK-4.7.2-Debug/lib/libITKIOIPL-4.7.1.dylib (compatibility version 0.0.0, current version 0.0.0)
>>> /Users/Shared/DREAM3D_SDK/ITK-4.7.2-Debug/lib/libITKIOTransformBase-4.7.1.dylib (compatibility version 0.0.0, current version 0.0.0)
>>> /Users/Shared/DREAM3D_SDK/ITK-4.7.2-Debug/lib/libITKStatistics-4.7.1.dylib (compatibility version 0.0.0, current version 0.0.0)
>>> /Users/Shared/DREAM3D_SDK/ITK-4.7.2-Debug/lib/libitkNetlibSlatec-4.7.1.dylib (compatibility version 0.0.0, current version 0.0.0)
>>> /Users/Shared/DREAM3D_SDK/ITK-4.7.2-Debug/lib/libITKIOImageBase-4.7.1.dylib (compatibility version 0.0.0, current version 0.0.0)
>>> /Users/Shared/DREAM3D_SDK/ITK-4.7.2-Debug/lib/libITKCommon-4.7.1.dylib (compatibility version 0.0.0, current version 0.0.0)
>>> /Users/Shared/DREAM3D_SDK/ITK-4.7.2-Debug/lib/libitkdouble-conversion-4.7.1.dylib (compatibility version 0.0.0, current version 0.0.0)
>>> /Users/Shared/DREAM3D_SDK/ITK-4.7.2-Debug/lib/libitksys-4.7.1.dylib (compatibility version 0.0.0, current version 0.0.0)
>>> /Users/Shared/DREAM3D_SDK/ITK-4.7.2-Debug/lib/libITKVNLInstantiation-4.7.1.dylib (compatibility version 0.0.0, current version 0.0.0)
>>> /Users/Shared/DREAM3D_SDK/ITK-4.7.2-Debug/lib/libitkvnl_algo-4.7.1.dylib (compatibility version 0.0.0, current version 0.0.0)
>>> /Users/Shared/DREAM3D_SDK/ITK-4.7.2-Debug/lib/libitkv3p_lsqr-4.7.1.dylib (compatibility version 0.0.0, current version 0.0.0)
>>> /Users/Shared/DREAM3D_SDK/ITK-4.7.2-Debug/lib/libitkvnl-4.7.1.dylib (compatibility version 0.0.0, current version 0.0.0)
>>> /Users/Shared/DREAM3D_SDK/ITK-4.7.2-Debug/lib/libitkvcl-4.7.1.dylib (compatibility version 0.0.0, current version 0.0.0)
>>> /Users/Shared/DREAM3D_SDK/ITK-4.7.2-Debug/lib/libitkv3p_netlib-4.7.1.dylib (compatibility version 0.0.0, current version 0.0.0)
>>> /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.0.0)
>>>
>>> We are using Qt 5.4.2 for our GUI. Looks like libc++. How do I change this? We use the precompiled Qt 5.4 binaries from qtproject.io and I am not sure if they use libstdC++ or libc++. We compile everything else: HDF5, Boost, Qwt, ITK, Eigen and TBB.
>>>
>>> The “.lock()” is for a boost::weak_ptr variable that stores one of our own malloc’ed arrays. No threading (at this level).
>>>
>>> --
>>> Mike Jackson [mike.jackson at bluequartz.net]
>>>
>>>
>>>> On Oct 28, 2015, at 8:21 AM, Bradley Lowekamp <blowekamp at mail.nih.gov> wrote:
>>>>
>>>> Hello,
>>>>
>>>> There could also be some symbol resolution issues/ conflicts. Are you using shared libraries? What is the output of otool -L? What GUI library are you using? What C++ library (libc++ vs libstdc++)? Are you consistently using the same c++ library? If you set the CMAKE_OSX_DEPLOYMENT_TARGET to 10.8 you can easily use libstdc++ by default.
>>>>
>>>> I see a use of a "lock" in your code. What do you have going on with threads?
>>>>
>>>> HTH,
>>>> Brad
>>>>
>>>> On Oct 28, 2015, at 7:57 AM, Michael Jackson <mike.jackson at bluequartz.net> wrote:
>>>>
>>>>> Nope. It does not help. I’m going to add some more information and see where that takes the discussion. We are trying to integrate ITK into our project DREAM.3D (github.com/dream3d) which uses a plugin system to load user developed data analysis filters. The failure mode we are seeing is when 2 filters, in different plugins, use the same ITK code. The DREAM.3D plugin that contains the DREAM.3D Filter that gets loaded first will run through without issues. The second DREAM.3D Plugin that contains the second DREAM.3D Filter will fail with the exception message. The ITK code is exactly the same except for the name of the c++ class that holds the code. We have replicated this on OS X 10.9 and 10.10. We can NOT replicate the issue on Windows (VS2013) or Linux (Clang 3.6). We have it down to a fairly simple DREAM.3D test case but not an ITK test case. After moving some codes around and moving some of our looping code inside the “try-catch” block we finally started seeing the exception messages. I am hoping we are just using ITK incorrectly and OS X is just exposing the incorrect use. The weird part is that we get the correct results on the other systems so it is not like the other platforms have a silent failure.
>>>>>
>>>>> Thanks for any help.
>>>>> --
>>>>> Mike Jackson [mike.jackson at bluequartz.net]
>>>>>
>>>>>
>>>>>> On Oct 27, 2015, at 6:22 PM, Matt McCormick <matt.mccormick at kitware.com> wrote:
>>>>>>
>>>>>> Hi Mike,
>>>>>>
>>>>>> Does calling
>>>>>>
>>>>>> UpdateLargestPossibleRegion()
>>>>>>
>>>>>> instead of
>>>>>>
>>>>>> Update()
>>>>>>
>>>>>> help?
>>>>>>
>>>>>> Matt
>>>>>>
>>>>>> On Tue, Oct 27, 2015 at 5:59 PM, Michael Jackson
>>>>>> <mike.jackson at bluequartz.net> wrote:
>>>>>>> I have been struggling with this error all afternoon and I just can not “see” what I am doing wrong. I am getting the following exception message from our program:
>>>>>>>
>>>>>>> Failed to execute itk::SignedMaurerDistanceMapImage filter for Feature 9. Error Message returned from ITK:
>>>>>>> itk::ERROR: MultiThreader(0x7fb53486e200): Exception occurred during SingleMethodExecute
>>>>>>> /Users/Shared/DREAM3D_SDK/InsightToolkit-4.7.2/Modules/Core/Common/include/itkImageConstIterator.h:211:
>>>>>>> itk::ERROR: Region ImageRegion (0x12e6f6730)
>>>>>>> Dimension: 3
>>>>>>> Index: [0, 0, 0]
>>>>>>> Size: [64, 64, 4]
>>>>>>> is outside of buffered region ImageRegion (0x7fb53c0a8040)
>>>>>>> Dimension: 3
>>>>>>> Index: [0, 0, 0]
>>>>>>> Size: [0, 0, 0]
>>>>>>>
>>>>>>> So what are the reasons that this can happen? Basically we creating an unsigned char image where we fill in the pixels, then run the Itk filter on each unsigned char image. Finally we want to copy the final output data into one of our own arrays. I will post the code under here. Any help is greatly appreciated.
>>>>>>>
>>>>>>> size_t iDims[3] = { 0, 0, 0 };
>>>>>>> float origin[3] = { 0.0f, 0.0f, 0.0f };
>>>>>>> float resolution[3] = { 0.0f, 0.0f, 0.0f };
>>>>>>>
>>>>>>> image->getDimensions(iDims);
>>>>>>> image->getOrigin(origin);
>>>>>>> image->getResolution(resolution);
>>>>>>>
>>>>>>> int32_t numFeatures = m_SignedDistanceFields.size();
>>>>>>>
>>>>>>> typedef itk::Image<unsigned char, 3> BoolImageType;
>>>>>>> typedef itk::Image<float, 3> FloatImageType;
>>>>>>> std::vector<BoolImageType::Pointer> booleanFeatureImages(numFeatures);
>>>>>>> BoolImageType::IndexType start;
>>>>>>> BoolImageType::SizeType size;
>>>>>>> BoolImageType::RegionType region;
>>>>>>>
>>>>>>> start.Fill(0);
>>>>>>>
>>>>>>> size[0] = iDims[0];
>>>>>>> size[1] = iDims[1];
>>>>>>> size[2] = iDims[2];
>>>>>>>
>>>>>>> region.SetIndex(start);
>>>>>>> region.SetSize(size);
>>>>>>>
>>>>>>> for (int32_t i = 0; i < numFeatures; i++)
>>>>>>> {
>>>>>>> BoolImageType::Pointer tmpBoolImage = BoolImageType::New();
>>>>>>> tmpBoolImage->SetRegions(region);
>>>>>>> tmpBoolImage->Allocate();
>>>>>>> tmpBoolImage->SetOrigin(origin);
>>>>>>> tmpBoolImage->SetSpacing(resolution);
>>>>>>> tmpBoolImage->FillBuffer(0);
>>>>>>> booleanFeatureImages[i] = tmpBoolImage;
>>>>>>> }
>>>>>>>
>>>>>>> size_t zStride = 0;
>>>>>>> size_t yStride = 0;
>>>>>>> size_t index = 0;
>>>>>>>
>>>>>>> for (size_t z = 0; z < iDims[2]; z++)
>>>>>>> {
>>>>>>> zStride = z * iDims[1] * iDims[2];
>>>>>>> for (size_t y = 0; y < iDims[1]; y++)
>>>>>>> {
>>>>>>> yStride = y * iDims[0];
>>>>>>> for (size_t x = 0; x < iDims[0]; x++)
>>>>>>> {
>>>>>>> index = zStride + yStride + x;
>>>>>>> BoolImageType::IndexType pixelIndex;
>>>>>>> pixelIndex[0] = x;
>>>>>>> pixelIndex[1] = y;
>>>>>>> pixelIndex[2] = z;
>>>>>>> if (x == y && y == z) { booleanFeatureImages[0]->SetPixel(pixelIndex, 255); }
>>>>>>> booleanFeatureImages[m_FeatureIds[index]]->SetPixel(pixelIndex, 255);
>>>>>>> }
>>>>>>> }
>>>>>>> }
>>>>>>> // Compute signed distance field for each Feature
>>>>>>> typedef itk::SignedMaurerDistanceMapImageFilter<BoolImageType, FloatImageType> SignedMaurerFilter;
>>>>>>>
>>>>>>> for (int32_t i = 0; i < numFeatures; i++)
>>>>>>> {
>>>>>>> if (getCancel() == true) { return; }
>>>>>>> SignedMaurerFilter::Pointer signedDistMap = SignedMaurerFilter::New();
>>>>>>> float* tmpDistField = m_SignedDistanceFields[i].lock()->getPointer(0);
>>>>>>> signedDistMap->SetInsideIsPositive(false);
>>>>>>> signedDistMap->SetSquaredDistance(true);
>>>>>>> signedDistMap->SetUseImageSpacing(true);
>>>>>>> signedDistMap->SetInput(booleanFeatureImages[i]);
>>>>>>> try
>>>>>>> {
>>>>>>> signedDistMap->Update();
>>>>>>>
>>>>>>> for (size_t z = 0; z < iDims[2]; z++)
>>>>>>> {
>>>>>>> zStride = z * iDims[1] * iDims[2];
>>>>>>> for (size_t y = 0; y < iDims[1]; y++)
>>>>>>> {
>>>>>>> yStride = y * iDims[0];
>>>>>>> for (size_t x = 0; x < iDims[0]; x++)
>>>>>>> {
>>>>>>> index = zStride + yStride + x;
>>>>>>> BoolImageType::IndexType pixelIndex;
>>>>>>> pixelIndex[0] = x;
>>>>>>> pixelIndex[1] = y;
>>>>>>> pixelIndex[2] = z;
>>>>>>> FloatImageType::Pointer out = signedDistMap->GetOutput();
>>>>>>> out->SetBufferedRegion(region);
>>>>>>> tmpDistField[index] = out->GetPixel(pixelIndex);
>>>>>>> }
>>>>>>> }
>>>>>>> }
>>>>>>> }
>>>>>>> catch (itk::ExceptionObject& err)
>>>>>>> {
>>>>>>> setErrorCondition(-5);
>>>>>>> QString ss = QObject::tr("Failed to execute itk::SignedMaurerDistanceMapImage filter for Feature %1. Error Message returned from ITK:\n %2").arg(i).arg(err.GetDescription());
>>>>>>> notifyErrorMessage(getHumanLabel(), ss, getErrorCondition());
>>>>>>> }
>>>>>>> }
>>>>>>> --
>>>>>>> Mike Jackson
>>>>>>> BlueQuartz Software, LLC
>>>>>>> [e]: mike.jackson at bluequartz.net
>>>>>>>
>>>>>>> _____________________________________
>>>>>>> Powered by www.kitware.com
>>>>>>>
>>>>>>> Visit other Kitware open-source projects at
>>>>>>> http://www.kitware.com/opensource/opensource.html
>>>>>>>
>>>>>>> Kitware offers ITK Training Courses, for more information visit:
>>>>>>> http://www.kitware.com/products/protraining.php
>>>>>>>
>>>>>>> Please keep messages on-topic and check the ITK FAQ at:
>>>>>>> http://www.itk.org/Wiki/ITK_FAQ
>>>>>>>
>>>>>>> Follow this link to subscribe/unsubscribe:
>>>>>>> http://public.kitware.com/mailman/listinfo/insight-users
>>>>>
>>>>> _____________________________________
>>>>> Powered by www.kitware.com
>>>>>
>>>>> Visit other Kitware open-source projects at
>>>>> http://www.kitware.com/opensource/opensource.html
>>>>>
>>>>> Kitware offers ITK Training Courses, for more information visit:
>>>>> http://www.kitware.com/products/protraining.php
>>>>>
>>>>> Please keep messages on-topic and check the ITK FAQ at:
>>>>> http://www.itk.org/Wiki/ITK_FAQ
>>>>>
>>>>> Follow this link to subscribe/unsubscribe:
>>>>> http://public.kitware.com/mailman/listinfo/insight-users
>>>>> _______________________________________________
>>>>> Community mailing list
>>>>> Community at itk.org
>>>>> http://public.kitware.com/mailman/listinfo/community
>>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/insight-users/attachments/20151028/99bdcf48/attachment-0001.html>
More information about the Insight-users
mailing list