[ITK] [ITK-dev] Exception in itk::ResampleImageFilter multithreaded part after ITK migration from 3.20.1 to 4.6.1

Simon ESNEAULT simon.esneault at gmail.com
Tue Dec 2 04:51:52 EST 2014


Hi Bill,

Thanks for your reply. I have downloaded and executed succesfully the
Upsampling example (
http://itk.org/Wiki/ITK/Examples/ImageProcessing/Upsampling), using the
version of ITK (4.6.1) we used in the framework.

It appears our problem is probably related with our framework architecture,
and some dll import/export on windows. We wrapped all our ITK code in a
library WrapItk.dll. And there are some others libraries, all of them can
make use of native ITK code or wrapped ITK code. This used to work fine
with ITK 3.20.1, but it's seems broken in 4.6.1.

Not only the Resample filter raise an exception but all the MultiThreaded
filter in ITK. When debugging, we go through
itk::ResampleImageFilter::BeforeThreadedGenerateData() just fine, and
somehow, when ThreadedGenerateData() is called we fall back in the mother
class ImageSource method, hence raising the exception.

Anyone know how to use properly ITK code with multiple DLL's on windows ?
ie having an image loaded with ITK code from one DLL, and some ITK filter
executed in another DLL without trouble ?
We use that sort of mechanism to export functions properly between DLLs.
#if SOME_DLL_DEFINITIONS
#define MY_EXPORT __declspec(dllexport)
#else
#define MY_EXPORT __declspec(dllimport)

I will try to sum things up in scheme  if that can help ...

Thanks
Simon


2014-12-01 14:51 GMT+01:00 Bill Lorensen <bill.lorensen at gmail.com>:

> Very strange.
>
> Could you try building and running this example:
> http://itk.org/Wiki/ITK/Examples/ImageProcessing/ResampleImageFilter
>
> Bill
>
> On Mon, Dec 1, 2014 at 7:53 AM, Simon ESNEAULT <simon.esneault at gmail.com>
> wrote:
> > Hello ITK community
> >
> > After the migration from ITK 3.20.1 to ITK 4.6.1, I'm getting a runtime
> > exception when using itk::ResampleImageFilter in our framework. The
> output
> > looks like this :
> >
> > Problem during Resample filtering:
> >
> D:\Dev\DevCpp-Qt5\cmake-externals\ITK\src\Modules\Core\Common\src\itkMultiThreader.cxx:358:
> > itk::ERROR: MultiThreader(31CAAD18): Exception occurred during
> > SingleMethodExecute
> > c:\dev\Dev_qt5\externals\itk-4.6.1\win32\include\itkImageSource.hxx:267:
> > itk::ERROR: ResampleImageFilter(31AC2E90): Subclass should override this
> > method!!!
> > The signature of ThreadedGenerateData() has been changed in ITK v4 to use
> > the new ThreadIdType.
> > ResampleImageFilter::ThreadedGenerateData() might need to be updated to
> used
> > it.
> >
> > That is weird, because the itkResampleImageFilter is the one delivered
> with
> > ITK 4.6.1, so it must have followed the API changed ...
> >
> > The context is :
> > Visual Studio 2013 community, 32 bit build, ITK build in shared library
> > mode. That's quite a big project, with VTK, Qt, OpenCV, DCMTK, zlib ...
> > I'm not using cmake in the usual way (ie no find_package(ITK)
> > include(${ITK_USE_FILE}) ) but we list the libraries and includes. I know
> > there are some factories to register in that case, we're doing this in
> the
> > main.cpp :
> > itk::TransformFactoryBase::RegisterDefaultTransforms();
> > itk::PNGImageIOFactory::RegisterOneFactory();
> > itk::MetaImageIOFactory::RegisterOneFactory();
> > itk::NrrdImageIOFactory::RegisterOneFactory();
> >
> > Am I missing some others factories to register in order to run properly
> the
> > resampleImageFilter ?
> > Anyone else had a similar runtime exception with a native ITK filte, or
> know
> > what would raise such an exception ?
> >
> > Thanks
> >
> > --
> > ------------------------------------------------------------------
> > Simon Esneault
> > ------------------------------------------------------------------
> >
> > _______________________________________________
> > 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://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-developers
> >
>
>
>
> --
> Unpaid intern in BillsBasement at noware dot com
>



-- 
------------------------------------------------------------------
Simon Esneault
------------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20141202/7f0c97b0/attachment.html>
-------------- next part --------------
_______________________________________________
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://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-developers


More information about the Community mailing list