Skip to content

Commit

Permalink
Move development from fo-dicom/netstandard to dev-branch
Browse files Browse the repository at this point in the history
continue developing on dev-branch instead of separate branch
  • Loading branch information
gofal committed Apr 19, 2020
2 parents ba53825 + c9dd291 commit 52abdf7
Show file tree
Hide file tree
Showing 510 changed files with 103,032 additions and 17 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: build

on:
push:
branches:
- netstandard
pull_request:
branches:
- netstandard

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-2019] #, ubuntu-18.04, macOS-latest]
dotnet-version: [2.1.803]

steps:
- uses: actions/checkout@v1

- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ matrix.dotnet-version }}

- name: Build solution
run: dotnet build ./FO-DICOM.Core/FO-DICOM.Core.csproj --configuration Release

- name: Run tests on .NET Core
run: dotnet test ./Tests/FO-DICOM.Tests/FO-DICOM.Tests.csproj --configuration Release --framework netcoreapp2.1

- name: Run tests on .NET Framework
run: dotnet test ./Tests/FO-DICOM.Tests/FO-DICOM.Tests.csproj --configuration Release --framework net461
if: matrix.os == 'windows-2019'
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,4 @@ Platform/Mono/Dictionaries/*.xml.gz
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
/Platform/Mono/.vs/DICOM.Mono/v16
/Platform/Mono/.vs/DICOM.Mono
45 changes: 45 additions & 0 deletions ChangeLog5.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#### 5.0.0

##### Changes:

* There is only one library built in NetStandard 2.0 *fo-dicom.core*.*
* Use `Microsoft.Extensions.DependencyInjection`. There is an extension method to `IServiceCollection.AddDefaultDicomServices()` to add all default implementations for the required interfaces.
* *IFileReferenceFactory:* creates a `IFileReference` instance. Is used internally whenever a Reference to a file is created.
* *IImageManager:* creates a `IImage` instance. Default is `RawImageManager`, that returns a byte array. call `IServiceCollection.UseImageManager<MyImageManager>()` to register an other implementation.
* *ITranscoderManager:* manages the codecs, used by `DicomTranscoder`. Call `IServiceCollection.useTranscoderManager<MyTranscoderManager>()` to register an other implementation.
* *ILogManager:* creates a concrete implementation of `ILogger`.
* *INetworkManager:* creates a listner, opens streams or checks connection status.
* *IDicomClientFactory:* is responsible to return an `IDicomClient` instance. This may be a new instance everytime or a reused instance per host or whateever.
* *IDicomServerFactory:* creates server instances, manages available ports, etc.
* If there is no DI container provided, fo-dicom creates its own internally. To configure it, call `new DicomSetupBuilder().RegisterServices(s => ...).Build();`
There are extension methods for this DicomSetupBuilder like `.SkipValidation()` or `SetDicomServiceLogging(logDataPdus, log DimseDataset)`.
The new interface `IServiceProviderHost` manages, if there is an internal ServiceProvider or if to use a given Asp.Net Service Provider.
* DicomServer uses DI to create the instances of your `DicomService`. You can use constructor injection there.
* Make server providers asynchronous
* A new class `DicomClientOptions` holds all the options of a DicomClient to be passed instead of the huge list of parameters.
* `DicomServerRegistration` manages the started servers per IP/Port.
* Some little memory consumption emprovements in IByteBuffer classes.
* new methods in `IByteBuffer` to directly manipulate/use the data instead of copying it around multiple times.

##### Breaking changes:

* namespace changed from `Dicom` to `FellowOakDicom`
* `IOManager` is removed. Instead of calling `IOManager.CreateFileReference(path)` now directly create a new instance `new Filereference(path)`. The same is true for `DirecotryReference`.
* In general: all *Manager classes with their static `.SetImplementation` initializers have been replaced by Dependency Injection.
* By default there is only `RawImageManager` implementation for `IImageManager`. To have `WinFormsImageManager` or `WPFImageManager` you have to reference the package *fo-dicom.Imaging.Desktop*. To use `ImageSharpImageManager` you have to reference *fo-dicom.Imaging.ImageSharp*.
* There are only asynchronous server provider interfaces. All synchronous methods have been replaced by asynchronous.
* Instances of `DicomClient` and `DicomServer` are not created directly, but via a `DicomClientFactory` or a `DicomServerFactory`.
If you are in a "DI-Environment" like Asp.Net, then inject a `IDicomClientFactory` instance and use this to create a DicomClient. otherwise call `DicomClientFactory.CreateDicomClient(...)`. This is a wrapper around accessing the internal DI container , getting the registered IDicomClientFactory and then calling this. So this is more overhead.
* Removed obsolte methods/classes/properties
* `DicomValidation.AutoValidation`: Call `DicomSetupBuilder.SkipValidation()` instead.
* `Dicom.Network.DicomClient`: use `FellowOakDicom.Network.Client.DicomClient` instead.
* `Dicom.Network.IDicomServiceUser`: use `IDicomClientConnection` instead.
* `ChangeTransferSyntax(..)` extension methods for `DicomFile` and `DicomDataset`: use the method `Clone(..)` instead.
* `DicomDataset.Get<T>`: use `GetValue`, `GetValues`, `GetSingleValue` or `GetSequence` instead.
* `DicomDataset.AddOrUpdatePixelData`: use `DicomPixelData.AddFrame(IByteBuffer)` to add pixel data to underlying dataset.
* `DicomUID.Generate(name)`: use `DicomUID.Generate()` instead.
* `DicomUID.IsValid(uid)`: use `DicomUID.IsValidUid(uid)` instead.
* `DicomUIDGenerator.Generate()` and `DicomUIDGenerator.GenerateNew()`: use `DicomUIDGenerator.GenerateDerivedFromUUID()`
* `DicomImage.Dataset`, `DicomImage.PixelData` and `DicomImage.PhotometricInterpretation`: do not load the DicomImage directly from filename if you also need access to the dataset, but load the DicomDataset from file first and then construct the DicomImage from this loaded DicomDataset. Then you can access both.


12 changes: 12 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<Project>
<PropertyGroup>
<Product>fo-dicom</Product>
<Company>fo-dicom</Company>
<Copyright>Copyright © fo-dicom contributors 2012-2020</Copyright>
<Description>fo-dicom</Description>

<AssemblyVersion>5.0.0</AssemblyVersion>
<FileVersion>5.0.0.0</FileVersion>
<InformationalVersion>5.0.0</InformationalVersion>
</PropertyGroup>
</Project>
210 changes: 210 additions & 0 deletions FO-DICOM.Core/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,210 @@
# Entfernen Sie die folgende Zeile, wenn Sie EDITORCONFIG-Einstellungen von höheren Verzeichnissen vererben möchten.
root = true

# C#-Dateien
[*.cs]

#### Wichtige EditorConfig-Optionen ####

# Einzüge und Abstände
indent_size = 4
indent_style = space
tab_width = 4

# Einstellungen für neue Zeilen
end_of_line = crlf
insert_final_newline = false

#### .NET-Codierungskonventionen ####

# Using-Direktiven organisieren
dotnet_separate_import_directive_groups = false
dotnet_sort_system_directives_first = false

# this.- und Me.-Einstellungen
dotnet_style_qualification_for_event = false:suggestion
dotnet_style_qualification_for_field = false:suggestion
dotnet_style_qualification_for_method = false:suggestion
dotnet_style_qualification_for_property = false:suggestion

# Einstellungen für Sprachschlüsselwörter und BCL-Typen
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
dotnet_style_predefined_type_for_member_access = true:suggestion

# Einstellungen für Klammern
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent
dotnet_style_parentheses_in_other_operators = always_for_clarity:silent
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent

# Einstellungen für Modifizierer
dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent

# Einstellungen für Ausdrucksebene
csharp_style_deconstructed_variable_declaration = true:suggestion
csharp_style_inlined_variable_declaration = true:suggestion
csharp_style_throw_expression = true:suggestion
dotnet_style_coalesce_expression = true:suggestion
dotnet_style_collection_initializer = true:suggestion
dotnet_style_explicit_tuple_names = true:suggestion
dotnet_style_null_propagation = true:suggestion
dotnet_style_object_initializer = true:suggestion
dotnet_style_prefer_auto_properties = true:warning
dotnet_style_prefer_compound_assignment = true:suggestion
dotnet_style_prefer_conditional_expression_over_assignment = true:suggestion
dotnet_style_prefer_conditional_expression_over_return = true:suggestion
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
dotnet_style_prefer_inferred_tuple_names = true:suggestion
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion

# Einstellungen für Felder
dotnet_style_readonly_field = true:suggestion

# Einstellungen für Parameter
dotnet_code_quality_unused_parameters = all:suggestion

#### C#-Codierungskonventionen ####

# Var-Einstellungen
csharp_style_var_elsewhere = false:silent
csharp_style_var_for_built_in_types = false:silent
csharp_style_var_when_type_is_apparent = true:suggestion

# Ausdruckskörpermember
csharp_style_expression_bodied_accessors = true:suggestion
csharp_style_expression_bodied_constructors = false:silent
csharp_style_expression_bodied_indexers = true:suggestion
csharp_style_expression_bodied_lambdas = true:suggestion
csharp_style_expression_bodied_local_functions = true:silent
csharp_style_expression_bodied_methods = true:suggestion
csharp_style_expression_bodied_operators = true:silent
csharp_style_expression_bodied_properties = true:suggestion

# Einstellungen für den Musterabgleich
csharp_style_pattern_matching_over_as_with_null_check = true:warning
csharp_style_pattern_matching_over_is_with_cast_check = true:warning
csharp_style_prefer_switch_expression = true:suggestion

# Einstellungen für NULL-Überprüfung
csharp_style_conditional_delegate_call = true:suggestion

# Einstellungen für Modifizierer
csharp_prefer_static_local_function = true:suggestion
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async

# Einstellungen für Codeblöcke
csharp_prefer_braces = true:suggestion
csharp_prefer_simple_using_statement = true:suggestion

# Einstellungen für Ausdrucksebene
csharp_prefer_simple_default_expression = true:suggestion
csharp_style_pattern_local_over_anonymous_function = true:suggestion
csharp_style_prefer_index_operator = true:suggestion
csharp_style_prefer_range_operator = true:suggestion
csharp_style_unused_value_assignment_preference = discard_variable:silent
csharp_style_unused_value_expression_statement_preference = discard_variable:silent

# Einstellungen für using-Anweisungen
csharp_using_directive_placement = outside_namespace:suggestion

#### C#-Formatierungsregeln ####

# Einstellungen für neue Zeilen
csharp_new_line_before_catch = true
csharp_new_line_before_else = true
csharp_new_line_before_finally = true
csharp_new_line_before_members_in_anonymous_types = true
csharp_new_line_before_members_in_object_initializers = true
csharp_new_line_before_open_brace = all
csharp_new_line_between_query_expression_clauses = true

# Einstellungen für Einrückung
csharp_indent_block_contents = true
csharp_indent_braces = false
csharp_indent_case_contents = true
csharp_indent_case_contents_when_block = true
csharp_indent_labels = no_change
csharp_indent_switch_labels = true

# Einstellungen für Abstände
csharp_space_after_cast = false
csharp_space_after_colon_in_inheritance_clause = true
csharp_space_after_comma = true
csharp_space_after_dot = false
csharp_space_after_keywords_in_control_flow_statements = true
csharp_space_after_semicolon_in_for_statement = true
csharp_space_around_binary_operators = before_and_after
csharp_space_around_declaration_statements = false
csharp_space_before_colon_in_inheritance_clause = true
csharp_space_before_comma = false
csharp_space_before_dot = false
csharp_space_before_open_square_brackets = false
csharp_space_before_semicolon_in_for_statement = false
csharp_space_between_empty_square_brackets = false
csharp_space_between_method_call_empty_parameter_list_parentheses = false
csharp_space_between_method_call_name_and_opening_parenthesis = false
csharp_space_between_method_call_parameter_list_parentheses = false
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
csharp_space_between_method_declaration_name_and_open_parenthesis = false
csharp_space_between_method_declaration_parameter_list_parentheses = false
csharp_space_between_parentheses = false
csharp_space_between_square_brackets = false

# Einstellungen für Umbrüche
csharp_preserve_single_line_blocks = true
csharp_preserve_single_line_statements = true

#### Benennungsstile ####

# Benennungsregeln

dotnet_naming_rule.interface_should_be_beginnt_mit_i.severity = suggestion
dotnet_naming_rule.interface_should_be_beginnt_mit_i.symbols = interface
dotnet_naming_rule.interface_should_be_beginnt_mit_i.style = beginnt_mit_i

dotnet_naming_rule.typen_should_be_pascal_schreibweise.severity = suggestion
dotnet_naming_rule.typen_should_be_pascal_schreibweise.symbols = typen
dotnet_naming_rule.typen_should_be_pascal_schreibweise.style = pascal_schreibweise

dotnet_naming_rule.nicht_feldmember_should_be_pascal_schreibweise.severity = suggestion
dotnet_naming_rule.nicht_feldmember_should_be_pascal_schreibweise.symbols = nicht_feldmember
dotnet_naming_rule.nicht_feldmember_should_be_pascal_schreibweise.style = pascal_schreibweise

dotnet_naming_rule.privates_oder_internes_feld_should_be_beginnt_mit__.severity = suggestion
dotnet_naming_rule.privates_oder_internes_feld_should_be_beginnt_mit__.symbols = privates_oder_internes_feld
dotnet_naming_rule.privates_oder_internes_feld_should_be_beginnt_mit__.style = beginnt_mit__

# Symbolspezifikationen

dotnet_naming_symbols.interface.applicable_kinds = interface
dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal
dotnet_naming_symbols.interface.required_modifiers =

dotnet_naming_symbols.privates_oder_internes_feld.applicable_kinds = field
dotnet_naming_symbols.privates_oder_internes_feld.applicable_accessibilities = internal, private
dotnet_naming_symbols.privates_oder_internes_feld.required_modifiers =

dotnet_naming_symbols.typen.applicable_kinds = class, struct, interface, enum
dotnet_naming_symbols.typen.applicable_accessibilities = public, internal, private, protected, protected_internal
dotnet_naming_symbols.typen.required_modifiers =

dotnet_naming_symbols.nicht_feldmember.applicable_kinds = property, event, method
dotnet_naming_symbols.nicht_feldmember.applicable_accessibilities = public, internal, private, protected, protected_internal
dotnet_naming_symbols.nicht_feldmember.required_modifiers =

# Benennungsstile

dotnet_naming_style.pascal_schreibweise.required_prefix =
dotnet_naming_style.pascal_schreibweise.required_suffix =
dotnet_naming_style.pascal_schreibweise.word_separator =
dotnet_naming_style.pascal_schreibweise.capitalization = pascal_case

dotnet_naming_style.beginnt_mit_i.required_prefix = I
dotnet_naming_style.beginnt_mit_i.required_suffix =
dotnet_naming_style.beginnt_mit_i.word_separator =
dotnet_naming_style.beginnt_mit_i.capitalization = pascal_case

dotnet_naming_style.beginnt_mit__.required_prefix = _
dotnet_naming_style.beginnt_mit__.required_suffix =
dotnet_naming_style.beginnt_mit__.word_separator =
dotnet_naming_style.beginnt_mit__.capitalization = camel_case
17 changes: 17 additions & 0 deletions FO-DICOM.Core/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Copyright (c) 2012-2020 fo-dicom contributors.
// Licensed under the Microsoft Public License (MS-PL).

using System.Runtime.CompilerServices;

[assembly: InternalsVisibleTo("FO-DICOM.Tests, PublicKey=" +
"00240000048000009400000006020000002400005253413100040000010001007d5f00794554cd" +
"cb3905e27fc311b1bdb7f0aca2ce20b83e1d647c2ff7674cbb5b9557d3add3d3a69c9445f8d0df" +
"f7cdf5b251cc4e0b2df984a778fc82dd68987f574c1867f414c23ee8b65d3d6b688368624b772e" +
"3b8d272eb0e3e8eff6bd7bd5a57abcdd47fb323682cc68b2d2693cc22895daff7afb4fede61ae6" +
"3216b8bf")]
[assembly: InternalsVisibleTo("FO-DICOM.Tests.Desktop, PublicKey=" +
"00240000048000009400000006020000002400005253413100040000010001007d5f00794554cd" +
"cb3905e27fc311b1bdb7f0aca2ce20b83e1d647c2ff7674cbb5b9557d3add3d3a69c9445f8d0df" +
"f7cdf5b251cc4e0b2df984a778fc82dd68987f574c1867f414c23ee8b65d3d6b688368624b772e" +
"3b8d272eb0e3e8eff6bd7bd5a57abcdd47fb323682cc68b2d2693cc22895daff7afb4fede61ae6" +
"3216b8bf")]
Loading

0 comments on commit 52abdf7

Please sign in to comment.