Skip to content

Commit f89eca5

Browse files
committed
Release 3.6.1
1 parent 6a96af4 commit f89eca5

2 files changed

Lines changed: 25 additions & 41 deletions

File tree

BioLib.csproj

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111
<PackageIcon>banner.jpg</PackageIcon>
1212
<PackageReadmeFile>README.md</PackageReadmeFile>
1313
<RepositoryUrl>https://github.com/BiologyTools/BioLib</RepositoryUrl>
14-
<AssemblyVersion>3.5.0</AssemblyVersion>
15-
<FileVersion>3.5.0</FileVersion>
16-
<PackageVersion>3.5.0</PackageVersion>
14+
<AssemblyVersion>3.6.1</AssemblyVersion>
15+
<FileVersion>3.6.1</FileVersion>
16+
<PackageVersion>3.6.1</PackageVersion>
1717
<PackageLicenseExpression>GPL-3.0-only</PackageLicenseExpression>
1818
<PackageRequireLicenseAcceptance>True</PackageRequireLicenseAcceptance>
1919
<PackageProjectUrl>https://biologytools.github.io/</PackageProjectUrl>
2020
<PackageTags>Biology; ImageJ; Bio-Formats; OMERO; Image-Stacks; Microscopy; Whole-Slide-Image; QuPath; </PackageTags>
21-
<PackageReleaseNotes>Added support for uploading images to OMERO.</PackageReleaseNotes>
21+
<PackageReleaseNotes>Updated BioFormats.NET and other dependency updates also bug fixes.</PackageReleaseNotes>
2222
<Authors>Erik Repo</Authors>
2323
<Platforms>AnyCPU;x64</Platforms>
2424
</PropertyGroup>
@@ -36,16 +36,16 @@
3636
</ItemGroup>
3737
<ItemGroup>
3838
<PackageReference Include="BitMiracle.LibTiff.NET" Version="2.4.660" />
39-
<PackageReference Include="CS-Script" Version="4.8.21" />
39+
<PackageReference Include="CS-Script" Version="4.9.7" />
4040
<PackageReference Include="ImageJ.NET" Version="154.0.0.2" />
4141
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
42-
<PackageReference Include="NuGet.Build.Tasks.Pack" Version="6.12.1">
42+
<PackageReference Include="NuGet.Build.Tasks.Pack" Version="6.14.0">
4343
<PrivateAssets>all</PrivateAssets>
4444
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
4545
</PackageReference>
4646
<PackageReference Include="OMERO.NET" Version="1.0.5" />
47-
<PackageReference Include="OpenSlideGTK" Version="2.1.1" />
48-
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.6" />
47+
<PackageReference Include="OpenSlideGTK" Version="2.1.2" />
48+
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.10" />
4949
</ItemGroup>
5050
<ItemGroup>
5151
<None Update="banner.jpg">

Source/Bio.cs

Lines changed: 17 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -3941,41 +3941,25 @@ public void To24Bit()
39413941
}
39423942
}
39433943
else
3944-
if (Buffers[0].PixelFormat == PixelFormat.Format16bppGrayScale || Buffers[0].PixelFormat == PixelFormat.Format8bppIndexed)
3944+
if (Buffers[0].PixelFormat == PixelFormat.Format16bppGrayScale)
39453945
{
3946-
if (Buffers[0].PixelFormat == PixelFormat.Format16bppGrayScale)
3946+
//We run 8bit so we get 24 bit rgb.
3947+
for (int i = 0; i < Buffers.Count; i++)
39473948
{
3948-
for (int i = 0; i < Buffers.Count; i++)
3949-
{
3950-
Buffers[i].Image = AForge.Imaging.Image.Convert16bppTo8bpp(Buffers[i]);
3951-
}
3952-
for (int c = 0; c < Channels.Count; c++)
3953-
{
3954-
for (int i = 0; i < Channels[c].range.Length; i++)
3955-
{
3956-
Channels[c].range[i].Min = (int)(((float)Channels[c].range[i].Min / (float)ushort.MaxValue) * byte.MaxValue);
3957-
Channels[c].range[i].Max = (int)(((float)Channels[c].range[i].Max / (float)ushort.MaxValue) * byte.MaxValue);
3958-
}
3959-
Channels[c].BitsPerPixel = 8;
3960-
}
3949+
Buffers[i] = AForge.Imaging.Image.Convert16bppTo8bpp(Buffers[i]);
39613950
}
3962-
List<Bitmap> bfs = new List<Bitmap>();
3963-
if (Buffers.Count % 3 != 0)
3964-
for (int i = 0; i < Buffers.Count; i++)
3965-
{
3966-
Bitmap bs = new Bitmap(ID, SizeX, SizeY, Buffers[i].PixelFormat, Buffers[i].Bytes, new ZCT(Buffers[i].Coordinate.Z, 0, Buffers[i].Coordinate.T), i, Buffers[i].Plane);
3967-
Bitmap bbs = Bitmap.RGB8To24(bs);
3968-
bs.Dispose();
3969-
bs = null;
3970-
bfs.Add(bbs);
3971-
}
3972-
else
3973-
for (int i = 0; i < Buffers.Count; i++)
3974-
{
3975-
Bitmap bs = Bitmap.GetBitmapRGB(Buffers[i].SizeX, Buffers[i].SizeY, PixelFormat.Format24bppRgb, Buffers[i].Bytes);
3976-
bfs.Add(bs);
3977-
}
3978-
Buffers = bfs;
3951+
To24Bit();
3952+
}
3953+
else if(Buffers[0].PixelFormat == PixelFormat.Format8bppIndexed)
3954+
{
3955+
List<Bitmap> bms = new List<Bitmap>();
3956+
//We run 8bit so we get 24 bit rgb.
3957+
for (int i = 0; i < Buffers.Count; i+=3)
3958+
{
3959+
bms.Add(Bitmap.RGB8To24(new Bitmap[] { Buffers[i], Buffers[i+1], Buffers[i+2] }));
3960+
}
3961+
Buffers.Clear();
3962+
Buffers.AddRange(bms);
39793963
UpdateCoords(SizeZ, 1, SizeT);
39803964
}
39813965
foreach (var item in Buffers)
@@ -7529,7 +7513,7 @@ public static BioImage OpenOME(string file, int serie, bool tab, bool addToImage
75297513
b.bitsPerPixel = 16;
75307514
b.series = serie;
75317515
string order = reader.getDimensionOrder();
7532-
if (vips)
7516+
if (vips && tile)
75337517
OpenVips(b);
75347518
//Lets get the channels and initialize them
75357519
int i = 0;

0 commit comments

Comments
 (0)