Imebra Stream Open error in Android
Every time I try to open a DICOM file in Android using
DataSet dicomDataSet = CodecFactory.load(directoryPath, 2048);
I get an exception for the stream opener
Process: com.dicomviewer, PID: 25653 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.dicomviewer/com.dicomviewer.MainActivity}: java.io.IOException: [void imebra::implementation::fileStream::openFile(const std::wstring &, std::ios_base::openmode)] file: /home/paolo/Desktop/newImebra/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: /home/paolo/Desktop/newImebra/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: /home/paolo/Desktop/newImebra/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: /home/paolo/Desktop/newImebra/wrappers/javaWrapper/jni/../../../library/src/codecFactory.cpp line: 63
exception type: N6imebra15StreamOpenErrorE
exception message: stream::openFile failure - error code: 2
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2678)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2743)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1490)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6165)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:888)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:778)
Caused by: java.io.IOException: [void imebra::implementation::fileStream::openFile(const std::wstring &, std::ios_base::openmode)]
file: /home/paolo/Desktop/newImebra/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: /home/paolo/Desktop/newImebra/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: /home/paolo/Desktop/newImebra/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: /home/paolo/Desktop/newImebra/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 com.dicomviewer.MainActivity.displayImage(MainActivity.java:52)
at com.dicomviewer.MainActivity.onCreate(MainActivity.java:48)
at android.app.Activity.performCreate(Activity.java:6687)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1140)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2631)
... 9 more
Hence I am unable to load the image into the imageview
Comments (3)
-
repo owner -
repo owner - changed status to invalid
Cannot reproduce
-
I had passed the directoryPath as the fully qualified path name in Android
"/Internal storage/DICOMViewer/image1.dcm"
The image I was trying to open can be found here:
- Log in to comment
Which file are you trying to open (full path)? Can you open it using simple Java streams?