Skip to content

Commit

Permalink
Add new example
Browse files Browse the repository at this point in the history
  • Loading branch information
nagayev committed Dec 8, 2022
1 parent 9b01701 commit 5ba8567
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ To compile and install the shared library to your system, take the following ste
mkdir build
cd build
cmake ..
cd ../
sudo make -j8 install
```

Expand Down
22 changes: 22 additions & 0 deletions examples/edit.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#include <iostream>
#include <cstdlib>
#include <string>

#include "vega/dictionary/dictionary.h"
#include "vega/dicom/file.h"

int main(int argc, char *argv[]) {
if (argc < 3){
std::cout<<"Usage: edit input_file output_file"<<std::endl;
return 1;
}
// Optional you can set the dictionary file
// vega::dictionary::Dictionary::set_dictionary("/path/to/dictionary/dictionary.txt");
vega::dicom::File file(argv[1]);

std::string& name = file.data_set()->element<vega::dictionary::PatientName>()->manipulator()->at(0);
name = "Smith^Alice";

file.write(argv[2]);
return 0;
}

0 comments on commit 5ba8567

Please sign in to comment.