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 authored and Enet4 committed Mar 24, 2024
1 parent 66985b7 commit 846a53e
Show file tree
Hide file tree
Showing 5 changed files with 331 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 @@ -427,7 +427,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 @@ -460,7 +460,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 846a53e

Please sign in to comment.