I am new to imebra and want to convert raw image to DICOM image. I have complied the imebra library to my virtual machine (ubuntu 16.04), and followed the tutorial from the website. I found that they do not show how to convert raw image to DICOM image.
Can anyone help me out or tell me the process of converting?
#include <imebra/imebra.h>
#include <iostream>
#include <fstream>
#include <stdlib.h>
#include <memory>
using namespace std;
int main()
{
//creat read stream
using namespace puntoexe;
ptr<stream> readStream(new stream);
readStream->openFile(NSStringToStringW(imagePath), std::ios::in);
// Create dataset
streamReader reader =new streamReader(readStream);
imebra::dataSet testDataSet = imebra::codecs::codecFactory::getCodecFactory()->load(reader);
// Set Tags
testSet->setString(0x0010,0,0x0010,0,"testSrt0");
testSet->setString(0x0010,0,0x0010,1,"testSrt1");
// Load jpeg
std::unique_ptr<imebra::DataSet> testSet(imebra::CodeFcactory::load("/home/lixingyu/care.raw"));
// Save as DICOM
imebra::CodecFactory::save(testSet, "/home/lixingyu/care.dcm", imebra::codecType_t::dicom);
*/
return 0;
}
I am not quiet sure about the code above. Is there anything wrong with this process??
When I tried this code: using namespace puntoexe;
an error occurred:
"error: ‘puntoexe’ is not a namespace-name" and "ptr" was also fault.
You are using a rather old version of Imebra.
With Imebra 4 and 5 you can:
In code, with Imebra5:
Imebra 4 code is similar but the functions returned pointers instead of objects.
Disclaimer: I'm the author of Imebra