[Dcmlib] Writing Dicom to Raw

Clemens Hentschke husky22 at web.de
Tue Dec 12 02:01:51 CET 2006


Hello,

i have a DICOM and just want to convert this into a image-raw-format (without image header), just the pixel-values as they are in the dicom. 

My code is:
file = gdcm::File::New( );
   file->SetLoadMode ( gdcm::LD_ALL );
   file->SetFileName("test.dcm");

   bool res = file->Load();   
   if (!res) {
       std::cerr << "Sorry, " << " not a gdcm-readable " << "DICOM / ACR File" << std::endl;
       file->Delete();
       return -1;
   }
 gdcm::FileHelper *fh = gdcm::FileHelper::New(file);
  fh->SetWriteModeToRaw();
  fh->WriteRawData("Neu.IMG");
 but there is always the error: Error: In /usr/gdcm/src/gdcmFileHelper.cxx, line 603, function bool gdcm::FileHelper::WriteRawData(const std::string&)
Nothing written.

where is my error? I have the cvs version of gdcm, downloaded about two weeks ago
Thanks
   -Clemens

______________________________________________________________________________
"Ein Herz für Kinder" - Ihre Spende hilft! Aktion: www.deutschlandsegelt.de
Unser Dankeschön: Ihr Name auf dem Segel der 1. deutschen America's Cup-Yacht!





More information about the Dcmlib mailing list