[Insight-users] Issues with IO Examples
Luis Ibanez
luis.ibanez at kitware.com
Tue Mar 23 16:01:59 EDT 2010
Hi Agnes,
Welcome to ITK !
Thanks for the detailed report of the error that you are facing.
This seems to be an unusual error.
1) Can you please post to the list the filenames of the images
that you are trying to read ?
2) The actual error looks more like the result of an incorrect
build. Can you please post to the list details about:
a) The version of your compiler
b) Version of ITK that you are using
c) Compilation mode that you are using (Release/Debug?)
d) Did you get ANY warnings at link time ?
e) Are you building ITK as Shared libraries ?
3) If (e) is true,
Then,
Any chance that you have multiple builds of ITK
in your machine ?
and that the application if finding old versions
of the shared libraries ?
Please let us know,
Thanks
Luis
--------------------------------------------------------------------------------------------
On Mon, Mar 22, 2010 at 12:46 PM, Agnes Masson-Sibut
<agnes.massonsibut at gmail.com> wrote:
> Hello everybody,
>
> I am a new user of the Insight Toolkit, and I have issues to simply read and
> write an image. When I try to execute the exemple ImageReadWrite, I get an
> error inside the CreateImageIO function from itkImageIOFactory file :
>
> ImageIOBase::Pointer
> ImageIOFactory::CreateImageIO(const char* path, FileModeType mode)
> {
>
> RegisterBuiltInFactories();
>
> std::list<ImageIOBase::Pointer> possibleImageIO;
> std::list<LightObject::Pointer> allobjects =
> ObjectFactoryBase::CreateAllInstance("itkImageIOBase");
> for(std::list<LightObject::Pointer>::iterator i = allobjects.begin();
> i != allobjects.end(); ++i)
> {
> ImageIOBase* io = dynamic_cast<ImageIOBase*>(i->GetPointer());
> if(io)
> {
> possibleImageIO.push_back(io);
> }
> else
> {
> std::cerr << "Error ImageIO factory did not return an ImageIOBase: "
> << (*i)->GetNameOfClass()
> << std::endl;
> }
> }
> for(std::list<ImageIOBase::Pointer>::iterator k = possibleImageIO.begin();
> k != possibleImageIO.end(); ++k)
> {
> if( mode == ReadMode )
> {
> if((*k)->CanReadFile(path))
> {
> return *k;
> }
> }
> else if( mode == WriteMode )
> {
> if(/*(*k)->CanWriteFile(path)*/false)
> {
> return *k;
> }
>
> }
> ==> } Here, the list can't be deleted because of a memory issue
> return 0;
> }
>
> It seems that the program isn't able to delete the list . Here is the call
> list :
>
> ntdll.dll!7c91120e()
> ntdll.dll!7c97e139()
> ntdll.dll!7c97e576()
> ntdll.dll!7c9722e8()
> kernel32.dll!7c85f9a7()
> ImageReadWrite.exe!_CrtIsValidHeapPointer(const void *
> pUserData=0x01790b58) Ligne 1807 C
> ImageReadWrite.exe!_free_dbg_lk(void * pUserData=0x01790b58, int
> nBlockUse=1) Ligne 1132 + 0x9 C
> ImageReadWrite.exe!_free_dbg(void * pUserData=0x01790b58, int
> nBlockUse=1) Ligne 1070 + 0xd C
> ImageReadWrite.exe!operator delete(void * pUserData=0x01790b58) Ligne
> 54 + 0x10 C++
>
> ImageReadWrite.exe!std::allocator<std::_List_nod<itk::SmartPointer<itk::LightObject>,std::allocator<itk::SmartPointer<itk::LightObject>
>>
>>::_Node>::deallocate(std::_List_nod<itk::SmartPointer<itk::LightObject>,std::allocator<itk::SmartPointer<itk::LightObject>
>> >::_Node * _Ptr=0x01790b58, unsigned int __formal=1) Ligne 132 + 0x9
> C++
>
> ImageReadWrite.exe!std::list<itk::SmartPointer<itk::LightObject>,std::allocator<itk::SmartPointer<itk::LightObject>
>> >::clear() Ligne 622 C++
>
> ImageReadWrite.exe!std::list<itk::SmartPointer<itk::LightObject>,std::allocator<itk::SmartPointer<itk::LightObject>
>> >::_Tidy() Ligne 931 C++
>
> ImageReadWrite.exe!std::list<itk::SmartPointer<itk::LightObject>,std::allocator<itk::SmartPointer<itk::LightObject>
>>
>>::~list<itk::SmartPointer<itk::LightObject>,std::allocator<itk::SmartPointer<itk::LightObject>
>> >() Ligne 366 C++
> ImageReadWrite.exe!itk::ImageIOFactory::CreateImageIO(const char *
> path=0x00382a44, itk::ImageIOFactory::FileModeType mode=ReadMode) Ligne 75
> + 0x26 C++
>
> ImageReadWrite.exe!itk::ImageFileReader<itk::Image<short,2>,itk::DefaultConvertPixelTraits<short>
>>::GenerateOutputInformation() Ligne 118 + 0x1d C++
> ITKCommon.dll!itk::ProcessObject::UpdateOutputInformation() Ligne 751
> + 0x10 C++
> ImageReadWrite.exe!itk::ImageBase<2>::UpdateOutputInformation() Ligne
> 226 + 0x3e C++
> ITKCommon.dll!itk::DataObject::Update() Ligne 342 + 0xd C++
> ITKCommon.dll!itk::ProcessObject::Update() Ligne 615 + 0x1a C++
> ImageReadWrite.exe!main(int argc=3, char * * argv=0x003939a0) Ligne
> 164 + 0x1e C++
> ImageReadWrite.exe!mainCRTStartup() Ligne 259 + 0x19 C
> kernel32.dll!7c817077()
> ntdll.dll!7c925d47()
>
> I tried with different image types, but the result is the same. Is the bug
> known ? Is there something I can do to help the thing working out ?
>
> Thanks a lot,
>
>
> --
> Agnès Masson-Sibut
> Étudiante au doctorat
> Lissi, Université Paris Est Créteil
> Aesculap SAS, Dpt R&D Software
> tél : 06-73-60-52-91
>
> _____________________________________
> 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.html
>
> 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://www.itk.org/mailman/listinfo/insight-users
>
>
More information about the Insight-users
mailing list