无法使用imebra Android加载DICOM

时间:2018-02-22 08:33:22

标签: java android c++ dicom imebra

我曾尝试使用imebra在Android中加载DICOM文件 我已多次检查我的代码(加载.jar lib,权限& ...),我不知道接下来要检查!

在此链接" https://bitbucket.org/binarno/imebra/commits/442896d56ebf8856ae8b02326bd44831626f0420"也问了同样的问题,但我无法找出解决方案是什么。

System.loadLibrary("imebra_lib");
       try {
          DataSet loadedDataSet = com.imebra.CodecFactory.load(content.getPath(),2048);
          // File auxFile = new File(content.getPath());
           //auxFile.getAbsoluteFile();
           ((TextView)state).setText("openFile Successful");
       }catch(Exception e){
           Log.e("Imebra openFile", "failure :",e );
           //e.printStackTrace();
           ((TextView)state).setText("openFile failed");
       }

我的错误日志是:

E/Imebra openFile: failure : java.io.IOException: [void imebra::implementation::fileStream::openFile(const std::wstring &, std::ios_base::openmode)]
 file: C:/FILES/WorkSpace/Programming/Android/projescts/Dicom/Imebra/imebra_4_0_15_1/wrappers/javaWrapper/jni/../../../library/implementation/fileStreamImpl.cpp  line: 129
 exception type: N6imebra15StreamOpenErrorE
 exception message: stream::openFile failure - error code: 2                                                                   
 [void imebra::implementation::fileStream::openFile(const std::wstring &, std::ios_base::openmode)]
 file: C:/FILES/WorkSpace/Programming/Android/projescts/Dicom/Imebra/imebra_4_0_15_1/wrappers/javaWrapper/jni/../../../library/implementation/fileStreamImpl.cpp  line: 132
 exception type: N6imebra15StreamOpenErrorE
 exception message: stream::openFile failure - error code: 2                                                                                                                                                                                       
 [imebra::implementation::fileStreamInput::fileStreamInput(const std::string &)]
 file: C:/FILES/WorkSpace/Programming/Android/projescts/Dicom/Imebra/imebra_4_0_15_1/wrappers/javaWrapper/jni/../../../library/implementation/fileStreamImpl.cpp  line: 199
 exception type: N6imebra15StreamOpenErrorE
 exception message: stream::openFile failure - error code: 2

 [static imebra::DataSet *imebra::CodecFactory::load(const std::string &, size_t)]
 file: C:/FILES/WorkSpace/Programming/Android/projescts/Dicom/Imebra/imebra_4_0_15_1/wrappers/javaWrapper/jni/../../../library/src/codecFactory.cpp  line: 63                                                                   
 exception type: N6imebra15StreamOpenErrorE
 exception message: stream::openFile failure - error code: 2

 at com.imebra.imebraJNI.CodecFactory_load__SWIG_2(Native Method)
 at com.imebra.CodecFactory.load(CodecFactory.java:49)
 at os.i.learnandtest.Dicom.openFile(Dicom.java:21)
 at os.i.learnandtest.Register.onActivityResult(Register.java:132)

1 个答案:

答案 0 :(得分:0)

错误可能是由于您将网址编码的文件名传递给Imebra(根据您传递的评论" / document / primary%3ADicom%20test%20Image%2FIM-0001-0002。 DCM"。)

尝试将url实体转换为chars并传递文件名" / document / primary:Dicom test Image / IM-0001-0002.dcm"