Skip to content

Commit

Permalink
5.7.0 Mac OS related bug fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
BiologyTools committed Nov 17, 2024
1 parent 49464f5 commit 9795c24
Show file tree
Hide file tree
Showing 15 changed files with 209 additions and 3,845 deletions.
33 changes: 9 additions & 24 deletions BioGTK.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,25 @@
<TargetFramework>net8.0</TargetFramework>
<OutputType>Library</OutputType>
<RuntimeIdentifiers>osx-x64;linux-x64;win-x64;win-arm64;linux-arm64;osx-arm64;</RuntimeIdentifiers>
<AssemblyVersion>5.6.1</AssemblyVersion>
<FileVersion>5.6.1</FileVersion>
<AssemblyVersion>5.7.0</AssemblyVersion>
<FileVersion>5.7.0</FileVersion>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<PackageId>BioGTK</PackageId>
<Title>BioGTK</Title>
<PackageProjectUrl>https://github.com/BiologyTools/BioGTK</PackageProjectUrl>
<PackageIcon>banner.jpg</PackageIcon>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageVersion>5.6.1</PackageVersion>
<PackageVersion>5.7.0</PackageVersion>
<RepositoryUrl>https://github.com/BiologyTools/BioGTK</RepositoryUrl>
<PackageTags>Biology; GTK; ImageJ; Bio-Formats; Image-Stacks; Microscopy; Whole-Slide-Image; Segment-Anything; SAM; QuPath;</PackageTags>
<PackageLicenseExpression> GPL-3.0-only</PackageLicenseExpression>
<PackageRequireLicenseAcceptance>True</PackageRequireLicenseAcceptance>
<Description>A .NET application &amp; library for editing &amp; annotating various microscopy image formats. Supports all bioformats supported images. Integrates with ImageJ, running ImageJ filters &amp; macro functions. Supports Windows, Linux and Mac.</Description>
<Version>5.6.1</Version>
<Version>5.7.0</Version>
<Platforms>AnyCPU</Platforms>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<PlatformTarget>AnyCPU</PlatformTarget>
<PackageReleaseNotes>CUDA support for Linux as well as MacOS related bug fixes.</PackageReleaseNotes>
<PackageReleaseNotes>CUDA support for Linux and Mac related bug fixes.</PackageReleaseNotes>
<Authors>Erik Repo</Authors>
</PropertyGroup>

Expand Down Expand Up @@ -49,13 +49,6 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<WarningLevel>7</WarningLevel>
</PropertyGroup>

<ItemGroup>
<Content Remove="C:\Users\Erikr\.nuget\packages\biolib\2.9.0.1\contentFiles\any\net8.0\tile_copy.cu" />
<Content Remove="C:\Users\Erikr\.nuget\packages\biolib\2.9.0.1\contentFiles\any\net8.0\tile_copy.ptx" />
<Content Remove="C:\Users\Erikr\.nuget\packages\biolib\2.9.0\contentFiles\any\net8.0\tile_copy.cu" />
<Content Remove="C:\Users\Erikr\.nuget\packages\biolib\2.9.0\contentFiles\any\net8.0\tile_copy.ptx" />
</ItemGroup>
<ItemGroup>
<Content Include="bio.icns">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
Expand Down Expand Up @@ -411,16 +404,6 @@
<Pack>True</Pack>
<PackageCopyToOutput>true</PackageCopyToOutput>
</Content>
<Content Include="macro-commands.csv">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Pack>True</Pack>
<PackageCopyToOutput>true</PackageCopyToOutput>
</Content>
<Content Include="macro-functions.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Pack>True</Pack>
<PackageCopyToOutput>true</PackageCopyToOutput>
</Content>
<Content Include="tile_copy.cu">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
Expand Down Expand Up @@ -472,14 +455,16 @@
<CFBundleName>BioGTK</CFBundleName>
<CFBundleDisplayName>BioGTK</CFBundleDisplayName>
<CFBundleIdentifier>com.BioGTK</CFBundleIdentifier>
<CFBundleVersion>5.6.1</CFBundleVersion>
<CFBundleVersion>5.7.0</CFBundleVersion>
<CFBundlePackageType>APPL</CFBundlePackageType>
<CFBundleSignature>????</CFBundleSignature>
<CFBundleExecutable>BioGTKApp</CFBundleExecutable>
<CFBundleIconFile>bio.icns</CFBundleIconFile>
<CFBundleShortVersionString>5.6.1</CFBundleShortVersionString>
<CFBundleShortVersionString>5.7.0</CFBundleShortVersionString>
<NSPrincipalClass>NSApplication</NSPrincipalClass>
<NSHighResolutionCapable>true</NSHighResolutionCapable>
<ImplicitUsings>enable</ImplicitUsings>
<CFBundleDocumentTypes>.ome.tif</CFBundleDocumentTypes>
<CFBundleTypeName>OME-TIFF</CFBundleTypeName>
</PropertyGroup>
</Project>
86 changes: 81 additions & 5 deletions Source/App.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Bio;
using Gtk;
using javax.swing.filechooser;
using OpenSlideGTK;
using System;
using System.Collections.Generic;
Expand Down Expand Up @@ -87,15 +88,90 @@ private static void UpdateStitching()
SlideBase.UseVips = useVips;

}
public static bool UseFiji = false;
public static bool ToConsole
{
get
{
return BioLib.Recorder.outputConsole;
}
set
{
BioLib.Recorder.outputConsole = value;
}
}
static bool useFiji = true;
public static bool UseFiji
{
get
{
if (OperatingSystem.IsMacOS())
{
return true;
}
else
{
if(Fiji.ImageJPath.Contains("Fiji"))
return true;
else
return false;
}
}
}
/// This function creates a file chooser dialog that allows the user to select the location of
/// the ImageJ executable
///
/// @return A boolean value.
public static bool SetFijiOrImageJPath()
{
bool ifb;
string st = BioLib.Settings.GetSettings("ImageJPath");
if (st != "")
{
if (st.Contains("Fiji"))
{
BioLib.Fiji.ImageJPath = st;
}
else
BioLib.ImageJ.ImageJPath = st;
return true;
}
string title = "Select ImageJ Executable Location";
if (OperatingSystem.IsMacOS())
title = "Select ImageJ Executable Location (Fiji.app/Contents/MacOS/ImageJ-macosx)";
Gtk.FileChooserDialog filechooser =
new Gtk.FileChooserDialog(title, Scripting.window,
FileChooserAction.Open,
"Cancel", ResponseType.Cancel,
"Save", ResponseType.Accept);
filechooser.SetCurrentFolder(System.IO.Path.GetDirectoryName(Environment.ProcessPath));
if (filechooser.Run() != (int)ResponseType.Accept)
return false;
if(filechooser.Filename.Contains("Fiji"))
Fiji.ImageJPath = filechooser.Filename;
else
ImageJ.ImageJPath = filechooser.Filename;
BioLib.Settings.AddSettings("ImageJPath", filechooser.Filename);
filechooser.Destroy();
BioLib.Settings.Save();
return true;
}
/// Initialize() is a function that initializes the BioImage Suite Web
public static void Initialize(bool requireImageJ = false)
public static void Initialize()
{
Console.WriteLine("Initializing components.");
BioImage.Initialize();
SetFijiOrImageJPath();
if (Fiji.ImageJPath == "")
{
ImageJ.Initialize(ImageJ.ImageJPath);
BioImage.Initialize(ImageJ.ImageJPath);
}
else
{
Fiji.Initialize(Fiji.ImageJPath);
BioImage.Initialize(Fiji.ImageJPath);
}
Console.WriteLine("Loading settings.");
Settings.Load();
Fiji.Initialize(requireImageJ);
BioLib.Settings.Load();
updater = Updater.Create();
tools = Tools.Create();
filters = FiltersView.Create();
Expand Down
2 changes: 1 addition & 1 deletion Source/BioConsole.cs
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ private void ImagejBut_Clicked(object sender, EventArgs e)
{
if (ImageView.SelectedImage == null)
return;
Fiji.RunOnImage(textBox.Buffer.Text, headless, onTab, useBioformats, resultsBox.Active);
Fiji.RunOnImage(ImageView.SelectedImage,textBox.Buffer.Text, headless, onTab, useBioformats, resultsBox.Active);
consoleBox.Buffer.Text += textBox.Buffer.Text + Environment.NewLine;
textBox.Buffer.Text = "";
}
Expand Down
Loading

0 comments on commit 9795c24

Please sign in to comment.