Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply fallbackencoding of DicomServices to the DicomDatasets that are sent through this DicomService #1780

Open
wants to merge 7 commits into
base: development
Choose a base branch
from

Conversation

gofal
Copy link
Contributor

@gofal gofal commented May 2, 2024

Fixes #1642 .

Checklist

  • The pull request branch is in sync with latest commit on the fo-dicom/development branch
  • I have updated API documentation
  • I have included unit tests
  • I have updated the change log
  • I am listed in the CONTRIBUTORS file

Changes proposed in this pull request:

  • If a DicomServer or a DicomClient has a fallbackencoding set, then until now only the reader of incomming data uses this. Now also the writer of outgoing messages applies this fallbackencoding

@@ -24,7 +24,7 @@ public partial class DicomDataset : IEnumerable<DicomItem>, IEquatable<DicomData
private readonly IDictionary<DicomTag, DicomItem> _items;

private DicomTransferSyntax _syntax;
private Encoding[] _fallbackEncodings = DicomEncoding.DefaultArray;
internal Encoding[] _fallbackEncodings = DicomEncoding.DefaultArray;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of making this internal, wouldn't it make more sense to move the Clone method back to DicomDataset? If you look at how records are implemented in C#, they are also responsible for their own cloning, this is not implemented externally.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't necessarily make more sense. Records play a certain role in .net, they are short syntactic sugar where the compiler generates a lot of stuff around.
With the internal method SetFallbackEncoding, the fallbackencoding has to be changeable internally anyway. so if the internal field bothers you, then I will make a internal property from that. Then the internal function SetFallbackEncoding can be removed.

@amoerie
Copy link
Collaborator

amoerie commented May 23, 2024

One minor consideration related to cloning, but other than that a nice improvement! 👍

Copy link

codecov bot commented May 31, 2024

Codecov Report

Attention: Patch coverage is 90.90909% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 76.35%. Comparing base (b45ffe1) to head (e91b27b).
Report is 27 commits behind head on development.

Files Patch % Lines
FO-DICOM.Core/Network/DicomService.cs 66.66% 1 Missing ⚠️
Additional details and impacted files
@@               Coverage Diff               @@
##           development    #1780      +/-   ##
===============================================
- Coverage        76.42%   76.35%   -0.07%     
===============================================
  Files              275      275              
  Lines            25410    25417       +7     
  Branches          3043     3046       +3     
===============================================
- Hits             19419    19407      -12     
- Misses            5062     5075      +13     
- Partials           929      935       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Setting FallbackEncoding on AdvancedDicomClientConnectionRequest has no effect on C-Find requests
3 participants