# HG changeset patch # User Sebastien Jodogne # Date 1449602016 -3600 # Node ID a1527502e0ebc0d081bd0ef96d84f220a6e771b0 # Parent eab1a2859fa25b20cc53a68184a4dc590a068a88 read image from memory diff -r eab1a2859fa2 -r a1527502e0eb Plugin/WadoRs.cpp --- a/Plugin/WadoRs.cpp Tue Dec 08 18:39:17 2015 +0100 +++ b/Plugin/WadoRs.cpp Tue Dec 08 20:13:36 2015 +0100 @@ -737,13 +737,6 @@ if (LocateInstance(output, uri, request) && OrthancPlugins::RestApiGetString(content, context_, uri + "/file")) { - //OrthancPlugins::ParsedDicomFile dicom(content); - { - FILE* fp = fopen("/tmp/toto.dcm", "wb"); - fwrite(content.c_str(), content.size(), 1, fp); - fclose(fp); - } - printf("RetrieveFrames: [%s] [%s]\n", uri.c_str(), request->groups[3]); gdcm::ImageChangeTransferSyntax change; @@ -758,9 +751,10 @@ //codec.SetLossless(true); change.SetUserCodec(&codec); + std::stringstream stream(content); + gdcm::ImageReader reader; - //reader.SetFile(dicom.GetFile()); - reader.SetFileName("/tmp/toto.dcm"); + reader.SetStream(stream); printf("Read: %d\n", reader.Read()); change.SetInput(reader.GetImage());