DICOM @ OFFIS

Discussion Forum for OFFIS DICOM Tools - For registration, send email with desired user name to the OFFIS DICOM team
It is currently Thu, 2018-08-16, 13:01

All times are UTC + 1 hour




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Mon, 2011-08-15, 02:38 
Offline

Joined: Mon, 2009-02-23, 19:57
Posts: 299
Hi, I'm trying to pass a DcmFileFormat instance to a shared library, to change some of it's tag values.

If I call saveFile before dlclose, the file is changed as expected, but if I call saveFile *after* dlclose, the file is not changed.

This is part of a bigger program, and I need to call dlclose before saving the file.

Here's the caller of the shared library:

Code:
    void* lhandle = dlopen("./libpreprocess.so", RTLD_NOW);

    if (lhandle) {
      typedef void (*processDataset)(DcmFileFormat *);
      processDataset lprocessDset = (processDataset) dlsym(lhandle, "processDataset");
      if (!lprocessDset) {
         DCMQRDB_INFO("Cannot load symbol 'processDataset': " << dlerror());
         dlclose(lhandle);
         return;
      }

      lprocessDset(ff);
    }
    dlclose(lhandle);
    ff->saveFile("output.dcm");


And here's the important part of the library:

Code:
extern "C" {
  void processDataset(DcmFileFormat * ff)
  {
    OFString lPatientName;
    DcmDataset * dataset = ff->getDataset();
    dataset->putAndInsertOFStringArray(DCM_PatientsName, "NEW VALUE");
  }
}


What I'm doing wrong?.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group