Skip to content

Commit

Permalink
Add function for changing charset with unit test.
Browse files Browse the repository at this point in the history
- Creates a function to change the charset
- Adds a unit test to test if the sequences have invalid length when converting into tokens
- When putting the 'specific charset' token, set a flag to invalidate all lengths when writing the dicom
- In the token generation code, check and pass this token, marking all lengths as UNDEFINED
  • Loading branch information
Thomas Duindam committed Feb 27, 2024
1 parent 7cc9689 commit 693c671
Show file tree
Hide file tree
Showing 5 changed files with 332 additions and 37 deletions.
4 changes: 2 additions & 2 deletions object/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ where
let cs = SpecificCharacterSet::Default;
let mut dset_writer = DataSetWriter::with_ts_cs(to, ts, cs).context(CreatePrinterSnafu)?;

// write object
// We use the default options, because only the inner object knows if something needs to change
dset_writer
.write_sequence((&self.obj).into_tokens())
.context(PrintDataSetSnafu)?;
Expand Down Expand Up @@ -462,7 +462,7 @@ where
let cs = SpecificCharacterSet::Default;
let mut dset_writer = DataSetWriter::with_ts_cs(to, ts, cs).context(CreatePrinterSnafu)?;

// write object
// We use the default options, because only the inner object knows if something needs to change
dset_writer
.write_sequence((&self.obj).into_tokens())
.context(PrintDataSetSnafu)?;
Expand Down
Loading

0 comments on commit 693c671

Please sign in to comment.