执行 itk::writertype 的 update() 时出现异常
我在“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!!
异常转到 xmtx.c 文件( VC++ 的互斥[互斥]支持) , 它转到这部分代码的最后一行:
_RELIABILITY_CONTRACT
void __CLRCALL_PURE_OR_CDECL _Mtxlock(_Rmtx *_Mtx)
{ /* lock mutex */
#ifdef _M_CEE
System::Threading::Thread::BeginThreadAffinity();
#endif
EnterCriticalSection(_Mtx);
}
你们中有人遇到过同样的问题吗?有修复它的提示吗?
预先感谢
安东尼奥·戈麦斯·巴克罗
I have an image in an “itk::image::Pointer salida”. I have checked that it has the correct pixelvalues. I want to save the image into a file, but in the last line, it gives me an exception and now I don’t know what to do:
// 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!!
The exception goes to xmtx.c file ( mutex[mutual exclusion] support for VC++),
It goes to the last line of this part of the code:
_RELIABILITY_CONTRACT
void __CLRCALL_PURE_OR_CDECL _Mtxlock(_Rmtx *_Mtx)
{ /* lock mutex */
#ifdef _M_CEE
System::Threading::Thread::BeginThreadAffinity();
#endif
EnterCriticalSection(_Mtx);
}
Does any of you have had the same problem? Any hint for fixing it?
Thanks in advance
Antonio Gómez Barquero
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试捕获异常并查看它包含什么。我不熟悉 itk,但查看 API,以下内容应该有效:
这应该会引导您找到异常的来源。
Try catching the exception and see what it contains. I am not familiar with itk but looking at the API, the following should work:
This should lead you to the source of the exception.