Skip to content
This repository has been archived by the owner on Apr 23, 2024. It is now read-only.

Commit

Permalink
Started preparing tagger plugin to be able to draw the tagged points …
Browse files Browse the repository at this point in the history
…in the image overlay once again.
  • Loading branch information
rold2007 committed Sep 28, 2017
1 parent 5a5e802 commit 8305fc8
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 3 deletions.
3 changes: 2 additions & 1 deletion ImagingInterface.v3.ncrunchsolution
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<SolutionConfiguration>
<Settings>
<AllowParallelTestExecution>False</AllowParallelTestExecution>
<AllowParallelTestExecution>True</AllowParallelTestExecution>
<AutoPinNewTests>True</AutoPinNewTests>
<MetricsExclusionList>
<Value>ImagingInterface.Controllers.Tests\ImagingInterface.Controllers.Tests.csproj</Value>
<Value>ImagingInterface.Views\ImagingInterface.Views.csproj</Value>
Expand Down
10 changes: 8 additions & 2 deletions Plugins/ImageProcessing/Controllers/Services/TaggerService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@ public class TaggerService : IImageProcessingService
private static readonly string TaggerDisplayName = "Tagger";

private Tagger tagger;
private IImageProcessingManagerService imageProcessingService;

public TaggerService(Tagger tagger)
public TaggerService(Tagger tagger, IImageProcessingManagerService imageProcessingService)
{
this.tagger = tagger;
this.imageProcessingService = imageProcessingService;
}

public string DisplayName
Expand Down Expand Up @@ -91,7 +93,9 @@ public List<Point> GetPoints(string label)
foreach (string tag in this.tagger.DataPoints.Keys)
{
////Color color = this.taggerModel.LabelColors[tag];
Color color = this.LabelColors[tag];
////Color color = this.LabelColors[tag];

Color color = Color.Red;
byte red = Convert.ToByte(color.R);
byte green = Convert.ToByte(color.G);
byte blue = Convert.ToByte(color.B);
Expand All @@ -113,6 +117,8 @@ public List<Point> GetPoints(string label)
public void SelectPixel(IImageSource imageSource, string label, Point pixelPosition)
{
this.tagger.AddPoint(label, pixelPosition);

this.imageProcessingService.AddOneShotImageProcessingToActiveImage(this);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="Castle.Core, Version=4.1.1.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
<HintPath>..\..\..\..\packages\Castle.Core.4.1.1\lib\net45\Castle.Core.dll</HintPath>
</Reference>
<Reference Include="Moq, Version=4.7.99.0, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
<HintPath>..\..\..\..\packages\Moq.4.7.99\lib\net45\Moq.dll</HintPath>
</Reference>
<Reference Include="Shouldly, Version=2.8.3.0, Culture=neutral, PublicKeyToken=6042cbcb05cbc941, processorArchitecture=MSIL">
<HintPath>..\..\..\..\packages\Shouldly.2.8.3\lib\net451\Shouldly.dll</HintPath>
</Reference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ namespace ImageProcessing.Controllers.Tests
using ImageProcessing.Controllers;
using ImageProcessing.Controllers.Services;
using ImageProcessing.ObjectDetection;
using ImagingInterface.Plugins;
using Moq;
using Shouldly;
using Xunit;

Expand All @@ -21,6 +23,7 @@ public TaggerControllerTest()
this.Container.Register<Tagger>();
this.Container.Register<TaggerService>();
this.Container.Register<TaggerController>();
this.Container.Register<IImageProcessingManagerService>(() => { return new Mock<IImageProcessingManagerService>().Object; });
}

[Fact]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Castle.Core" version="4.1.1" targetFramework="net462" />
<package id="Moq" version="4.7.99" targetFramework="net462" />
<package id="Shouldly" version="2.8.3" targetFramework="net462" />
<package id="SimpleInjector" version="4.0.11" targetFramework="net462" />
<package id="StyleCop.Analyzers" version="1.0.2" targetFramework="net462" developmentDependency="true" />
Expand Down

0 comments on commit 8305fc8

Please sign in to comment.