执行itk::writertype的update()时出现异常

Exception when execute update() of an itk::writertype

本文关键字:异常 update itk writertype 执行      更新时间:2023-10-16

我在" itk::image::Pointer salida "中有一个图像。我已经检查了它是否有正确的像素值。我想保存图像到一个文件,但在最后一行,它给了我一个异常,现在我不知道该怎么做:

// Saving the result into a file
salida = ui.imageframe->imagereader;
writer = itk::ImageFileWriter<ImageType>::New(); 
writer->SetInput( salida ) ; 
writer->SetFileName ( "output.jpeg");
writer->Update();// ---> EXCEPTION!!

异常指向xmlx .c文件(vc++中互斥[互斥]支持),它转到这部分代码的最后一行:

_RELIABILITY_CONTRACT
void  __CLRCALL_PURE_OR_CDECL _Mtxlock(_Rmtx *_Mtx)
{   /* lock mutex */
#ifdef _M_CEE
System::Threading::Thread::BeginThreadAffinity();
#endif
EnterCriticalSection(_Mtx);
}

你们中有人遇到过同样的问题吗?有修理它的提示吗?

Thanks in advance

Antonio Gómez Barquero

尝试捕获异常并查看其包含的内容。我不熟悉它,但看看API,以下应该工作:

try
{
    writer->Update();
}
catch( itk::ExceptionObject& ex )
{
    qDebug() << ex.what();
}