Skip to content

Commit db00b6b

Browse files
committed
Merge from develop
Signed-off-by: Victor Chang <[email protected]>
2 parents c21c524 + 321abbb commit db00b6b

22 files changed

+184
-84
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ jobs:
364364

365365
- name: Anchore container scan
366366
id: anchore-scan
367-
uses: anchore/scan-action@v3.2.5
367+
uses: anchore/scan-action@v3.3.0
368368
if: ${{ (matrix.os == 'ubuntu-latest') }}
369369
with:
370370
image: ${{ fromJSON(steps.meta.outputs.json).tags[0] }}

doc/dependency_decisions.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -811,6 +811,13 @@
811811
:versions:
812812
- 17.3.1
813813
:when: 2022-09-01 23:06:18.619013325 Z
814+
- - :approve
815+
- Microsoft.Toolkit.HighPerformance
816+
- :who: mocsharp
817+
:why: MIT (https://github.com/CommunityToolkit/WindowsCommunityToolkit/raw/main/License.md)
818+
:versions:
819+
- 7.1.2
820+
:when: 2022-09-20 00:42:18.619013325 Z
814821
- - :approve
815822
- Microsoft.Win32.Primitives
816823
- :who: mocsharp
@@ -1871,7 +1878,7 @@
18711878
- :who: mocsharp
18721879
:why: Microsoft Public License (https://github.com/fo-dicom/fo-dicom/raw/development/License.txt)
18731880
:versions:
1874-
- 5.0.2
1881+
- 5.0.3
18751882
:when: 2022-08-16 23:07:29.574869349 Z
18761883
- - :approve
18771884
- runtime.any.System.Collections
@@ -2405,4 +2412,3 @@
24052412
:versions:
24062413
- 4.0.1
24072414
:when: 2022-08-16 23:10:21.184627612 Z
2408-

docker-compose/docker-compose.dev.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ services:
3939
- ./.run/minio/data:/data
4040
- ./.run/minio/config:/root/.minio
4141
ports:
42-
- "9000:9000"
42+
- 9000:9000
43+
- 9001:9001
4344
environment:
4445
MINIO_ROOT_USER: minioadmin
4546
MINIO_ROOT_PASSWORD: minioadmin

docs/compliance/third-party-licenses.md

Lines changed: 55 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6574,6 +6574,41 @@ SOFTWARE.
65746574
</details>
65756575

65766576

6577+
<details>
6578+
<summary>Microsoft.Toolkit.HighPerformance 7.1.2</summary>
6579+
6580+
## Microsoft.Toolkit.HighPerformance
6581+
6582+
- Version: 7.1.2
6583+
- Authors: Microsoft
6584+
- Owners: Microsoft.Toolkit,dotnetfoundation
6585+
- Project URL: https://dot.net/
6586+
- Source: [NuGet](https://www.nuget.org/packages/Microsoft.Toolkit.HighPerformance/7.1.2)
6587+
- License: [MIT]( https://github.com/CommunityToolkit/WindowsCommunityToolkit/raw/main/License.md)
6588+
6589+
6590+
```
6591+
# Windows Community Toolkit
6592+
6593+
Copyright © .NET Foundation and Contributors
6594+
6595+
All rights reserved.
6596+
6597+
## MIT License (MIT)
6598+
6599+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”),
6600+
to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
6601+
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6602+
6603+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6604+
6605+
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
6606+
FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
6607+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
6608+
IN THE SOFTWARE.
6609+
```
6610+
6611+
</details>
65776612
<details>
65786613
<summary>Microsoft.Win32.Primitives 4.3.0</summary>
65796614

@@ -9195,22 +9230,22 @@ resources
91959230
legal and licencing
91969231
contributors
91979232

9198-
 
9233+
91999234

92009235

92019236
Please note: our license is an adaptation of the MIT X11 License and should be read as such.
92029237
Please also note: this licensing model is made possible through funding from donations and the sale of support contracts.
92039238
License
92049239
Copyright (c) 2000 - 2017 The Legion of the Bouncy Castle Inc. (http://www.bouncycastle.org)
9205-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
9206-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
9207-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
9240+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
9241+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
9242+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
92089243

9209-
9210-
 
9244+
9245+
92119246

92129247

9213-
 
9248+
92149249

92159250

92169251
Site hosted by Tau Ceti Co-operative Ltd.
@@ -27516,14 +27551,14 @@ SOFTWARE.
2751627551

2751727552

2751827553
<details>
27519-
<summary>fo-dicom 5.0.2</summary>
27554+
<summary>fo-dicom 5.0.3</summary>
2752027555

2752127556
## fo-dicom
2752227557

27523-
- Version: 5.0.2
27558+
- Version: 5.0.3
2752427559
- Authors: fo-dicom contributors
2752527560
- Project URL: https://github.com/fo-dicom/fo-dicom
27526-
- Source: [NuGet](https://www.nuget.org/packages/fo-dicom/5.0.2)
27561+
- Source: [NuGet](https://www.nuget.org/packages/fo-dicom/5.0.3)
2752727562
- License: [Microsoft Public License](https://github.com/fo-dicom/fo-dicom/raw/development/License.txt)
2752827563

2752927564

@@ -27549,13 +27584,13 @@ A "contributor" is any person that distributes its contribution under this licen
2754927584
2. Grant of Rights
2755027585
(A) Copyright Grant- Subject to the terms of this license, including the license conditions
2755127586
and limitations in section 3, each contributor grants you a non-exclusive, worldwide,
27552-
royalty-free copyright license to reproduce its contribution, prepare derivative works
27553-
of its contribution, and distribute its contribution or any derivative works that you create.
27587+
royalty-free copyright license to reproduce its contribution, prepare derivative works
27588+
of its contribution, and distribute its contribution or any derivative works that you create.
2755427589
(B) Patent Grant- Subject to the terms of this license, including the license conditions and
2755527590
limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free
27556-
license under its licensed patents to make, have made, use, sell, offer for sale, import,
27557-
and/or otherwise dispose of its contribution in the software or derivative works of the
27558-
contribution in the software.
27591+
license under its licensed patents to make, have made, use, sell, offer for sale, import,
27592+
and/or otherwise dispose of its contribution in the software or derivative works of the
27593+
contribution in the software.
2755927594

2756027595
3. Conditions and Limitations
2756127596
(A) No Trademark License- This license does not grant you rights to use any contributors' name,
@@ -27566,13 +27601,13 @@ A "contributor" is any person that distributes its contribution under this licen
2756627601
and attribution notices that are present in the software.
2756727602
(D) If you distribute any portion of the software in source code form, you may do so only under this
2756827603
license by including a complete copy of this license with your distribution. If you distribute
27569-
any portion of the software in compiled or object code form, you may only do so under a license
27570-
that complies with this license.
27604+
any portion of the software in compiled or object code form, you may only do so under a license
27605+
that complies with this license.
2757127606
(E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express
2757227607
warranties, guarantees or conditions. You may have additional consumer rights under your local
27573-
laws which this license cannot change. To the extent permitted under your local laws, the
27574-
contributors exclude the implied warranties of merchantability, fitness for a particular purpose
27575-
and non-infringement.
27608+
laws which this license cannot change. To the extent permitted under your local laws, the
27609+
contributors exclude the implied warranties of merchantability, fitness for a particular purpose
27610+
and non-infringement.
2757627611

2757727612

2757827613

src/Common/Monai.Deploy.InformaticsGateway.Common.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
<ItemGroup>
3030
<PackageReference Include="Ardalis.GuardClauses" Version="4.0.1" />
31-
<PackageReference Include="fo-dicom" Version="5.0.2" />
31+
<PackageReference Include="fo-dicom" Version="5.0.3" />
3232
<PackageReference Include="GitVersion.MsBuild" Version="5.10.3">
3333
<PrivateAssets>All</PrivateAssets>
3434
</PackageReference>

src/Configuration/DicomConfiguration.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,11 @@ public class DicomConfiguration
4141
/// </summary>
4242
[ConfigurationKeyName("writeDicomJson")]
4343
public DicomJsonOptions WriteDicomJson { get; set; } = DicomJsonOptions.IgnoreOthers;
44+
45+
/// <summary>
46+
/// Gets or sets whether to automatically validate the DICOM values when serializing to JSON.
47+
/// Defaults to False.
48+
/// </summary>
49+
public bool ValidateDicomOnSerialization { get; set; } = false;
4450
}
4551
}

src/DicomWebClient/CLI/Monai.Deploy.InformaticsGateway.DicomWeb.Client.CLI.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
<ItemGroup>
3737
<PackageReference Include="ConsoleAppFramework" Version="4.2.2" />
38-
<PackageReference Include="fo-dicom" Version="5.0.2" />
38+
<PackageReference Include="fo-dicom" Version="5.0.3" />
3939
<PackageReference Include="Microsoft.Extensions.Http" Version="6.0.0" />
4040
</ItemGroup>
4141
</Project>

src/DicomWebClient/Monai.Deploy.InformaticsGateway.DicomWeb.Client.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343

4444
<ItemGroup>
4545
<PackageReference Include="Ardalis.GuardClauses" Version="4.0.1" />
46-
<PackageReference Include="fo-dicom" Version="5.0.2" />
46+
<PackageReference Include="fo-dicom" Version="5.0.3" />
4747
<PackageReference Include="GitVersion.MsBuild" Version="5.10.3">
4848
<PrivateAssets>All</PrivateAssets>
4949
</PackageReference>

src/InformaticsGateway/Common/DicomExtensions.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,15 @@ public static DicomTransferSyntax[] ToDicomTransferSyntaxArray(this IEnumerable<
5252
return dicomTransferSyntaxes.ToArray();
5353
}
5454

55-
public static string ToJson(this DicomFile dicomFile, DicomJsonOptions dicomJsonOptions)
55+
public static string ToJson(this DicomFile dicomFile, DicomJsonOptions dicomJsonOptions, bool validateDicom)
5656
{
5757
Guard.Against.Null(dicomFile, nameof(dicomFile));
5858

5959
var options = new JsonSerializerOptions();
60-
options.Converters.Add(new DicomJsonConverter(writeTagsAsKeywords: false, autoValidate: true));
60+
options.Converters.Add(new DicomJsonConverter(
61+
writeTagsAsKeywords: false,
62+
autoValidate: validateDicom,
63+
numberSerializationMode: validateDicom ? NumberSerializationMode.AsNumber : NumberSerializationMode.PreferablyAsNumber));
6164
options.WriteIndented = false;
6265

6366
if (dicomJsonOptions == DicomJsonOptions.Complete)

src/InformaticsGateway/Monai.Deploy.InformaticsGateway.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
<ItemGroup>
3535
<PackageReference Include="Ardalis.GuardClauses" Version="4.0.1" />
3636
<PackageReference Include="DotNext.Threading" Version="4.7.2" />
37-
<PackageReference Include="fo-dicom" Version="5.0.2" />
37+
<PackageReference Include="fo-dicom" Version="5.0.3" />
3838
<PackageReference Include="Karambolo.Extensions.Logging.File" Version="3.3.1" />
3939
<PackageReference Include="HL7-dotnetcore" Version="2.29.0" />
4040
<PackageReference Include="GitVersion.MsBuild" Version="5.10.3">

src/InformaticsGateway/Services/Connectors/DataRetrievalService.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ private async Task RetrieveInstances(string transactionId, IDicomWebClient dicom
509509
}
510510

511511
var dicomFileStorageMetadata = SaveFile(transactionId, file, uids);
512-
await dicomFileStorageMetadata.SetDataStreams(file, file.ToJson(_options.Value.Dicom.WriteDicomJson)).ConfigureAwait(false);
512+
await dicomFileStorageMetadata.SetDataStreams(file, file.ToJson(_options.Value.Dicom.WriteDicomJson, _options.Value.Dicom.ValidateDicomOnSerialization)).ConfigureAwait(false);
513513
retrievedInstance.Add(uids.Identifier, dicomFileStorageMetadata);
514514
count++;
515515
}
@@ -539,7 +539,7 @@ private async Task SaveFiles(string transactionId, IAsyncEnumerable<DicomFile> f
539539
}
540540

541541
var dicomFileStorageMetadata = SaveFile(transactionId, file, uids);
542-
await dicomFileStorageMetadata.SetDataStreams(file, file.ToJson(_options.Value.Dicom.WriteDicomJson)).ConfigureAwait(false);
542+
await dicomFileStorageMetadata.SetDataStreams(file, file.ToJson(_options.Value.Dicom.WriteDicomJson, _options.Value.Dicom.ValidateDicomOnSerialization)).ConfigureAwait(false);
543543
retrievedInstance.Add(uids.Identifier, dicomFileStorageMetadata);
544544
}
545545
}

src/InformaticsGateway/Services/DicomWeb/IStreamsWriter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ private async Task SaveInstance(Stream stream, string studyInstanceUid, string w
165165
dicomInfo.SetWorkflows(workflowName);
166166
}
167167

168-
await dicomInfo.SetDataStreams(dicomFile, dicomFile.ToJson(_configuration.Value.Dicom.WriteDicomJson)).ConfigureAwait(false);
168+
await dicomInfo.SetDataStreams(dicomFile, dicomFile.ToJson(_configuration.Value.Dicom.WriteDicomJson, _configuration.Value.Dicom.ValidateDicomOnSerialization)).ConfigureAwait(false);
169169
_uploadQueue.Queue(dicomInfo);
170170

171171
// for DICOMweb, use correlation ID as the grouping key

src/InformaticsGateway/Services/Export/ScuExportService.cs

Lines changed: 29 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ private async Task HandleDesination(ExportRequestDataMessage exportRequestData,
7878
Guard.Against.Null(exportRequestData, nameof(exportRequestData));
7979

8080
var manualResetEvent = new ManualResetEvent(false);
81-
IDicomClient client = null;
8281
DestinationApplicationEntity destination = null;
8382
try
8483
{
@@ -93,38 +92,38 @@ private async Task HandleDesination(ExportRequestDataMessage exportRequestData,
9392

9493
try
9594
{
96-
client = DicomClientFactory.Create(
97-
destination.HostIp,
98-
destination.Port,
99-
false,
100-
_configuration.Value.Dicom.Scu.AeTitle,
101-
destination.AeTitle);
102-
103-
client.AssociationAccepted += (sender, args) => _logger.AssociationAccepted();
104-
client.AssociationRejected += (sender, args) => _logger.AssociationRejected();
105-
client.AssociationReleased += (sender, args) => _logger.AssociationReleased();
106-
client.ServiceOptions.LogDataPDUs = _configuration.Value.Dicom.Scu.LogDataPdus;
107-
client.ServiceOptions.LogDimseDatasets = _configuration.Value.Dicom.Scu.LogDimseDatasets;
108-
109-
client.NegotiateAsyncOps();
110-
if (GenerateRequests(exportRequestData, client, manualResetEvent))
111-
{
112-
await Policy
113-
.Handle<Exception>()
114-
.WaitAndRetryAsync(
115-
_configuration.Value.Export.Retries.RetryDelays,
116-
(exception, timeSpan, retryCount, context) =>
117-
{
118-
_logger.DimseExportErrorWithRetry(timeSpan, retryCount, exception);
119-
})
120-
.ExecuteAsync(async () =>
95+
await Policy
96+
.Handle<Exception>()
97+
.WaitAndRetryAsync(
98+
_configuration.Value.Export.Retries.RetryDelays,
99+
(exception, timeSpan, retryCount, context) =>
100+
{
101+
_logger.DimseExportErrorWithRetry(timeSpan, retryCount, exception);
102+
})
103+
.ExecuteAsync(async () =>
104+
{
105+
var client = DicomClientFactory.Create(
106+
destination.HostIp,
107+
destination.Port,
108+
false,
109+
_configuration.Value.Dicom.Scu.AeTitle,
110+
destination.AeTitle);
111+
112+
client.AssociationAccepted += (sender, args) => _logger.AssociationAccepted();
113+
client.AssociationRejected += (sender, args) => _logger.AssociationRejected();
114+
client.AssociationReleased += (sender, args) => _logger.AssociationReleased();
115+
client.ServiceOptions.LogDataPDUs = _configuration.Value.Dicom.Scu.LogDataPdus;
116+
client.ServiceOptions.LogDimseDatasets = _configuration.Value.Dicom.Scu.LogDimseDatasets;
117+
118+
client.NegotiateAsyncOps();
119+
if (await GenerateRequestsAsync(exportRequestData, client, manualResetEvent))
121120
{
122121
_logger.DimseExporting(destination.AeTitle, destination.HostIp, destination.Port);
123122
await client.SendAsync(cancellationToken).ConfigureAwait(false);
124123
manualResetEvent.WaitOne();
125124
_logger.DimseExportComplete(destination.AeTitle);
126-
}).ConfigureAwait(false);
127-
}
125+
}
126+
}).ConfigureAwait(false);
128127
}
129128
catch (Exception ex)
130129
{
@@ -151,7 +150,7 @@ private DestinationApplicationEntity LookupDestination(string destinationName)
151150
return destination;
152151
}
153152

154-
private bool GenerateRequests(
153+
private async Task<bool> GenerateRequestsAsync(
155154
ExportRequestDataMessage exportRequestData,
156155
IDicomClient client,
157156
ManualResetEvent manualResetEvent)
@@ -177,7 +176,7 @@ private bool GenerateRequests(
177176
manualResetEvent.Set();
178177
};
179178

180-
client.AddRequestAsync(request).ConfigureAwait(false);
179+
await client.AddRequestAsync(request).ConfigureAwait(false);
181180
return true;
182181
}
183182
catch (Exception exception)

0 commit comments

Comments
 (0)