Skip to content

Commit

Permalink
4.2.0 ImageJ.NET
Browse files Browse the repository at this point in the history
  • Loading branch information
BiologyTools committed Aug 1, 2024
1 parent df7a8dc commit 405d16e
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
5 changes: 3 additions & 2 deletions BioCore/Source/Fiji.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ internal static void Initialize()
foreach (string s in cs)
{
string[] v = s.Split(',');
if (!Commands.ContainsKey(v[0]))
Commands.Add(v[0], new Command(v[0], v[1], ""));
}
}
Expand Down Expand Up @@ -334,13 +335,13 @@ public static void RunOnImage(string con, bool headless, bool onTab, bool biofor
/// This function is used to initialize the path of the ImageJ.exe file
///
/// @param path The path to the ImageJ executable.
public static bool Initialize(bool imagej)
public static bool Initialize(bool imagej = false)
{
Macro.Initialize();
if (!imagej)
return false;
if (!SetImageJPath())
return false;
Macro.Initialize();
string[] ds = Directory.GetFiles(ImageJMacroPath);
foreach (string s in ds)
{
Expand Down
2 changes: 1 addition & 1 deletion BioCore/Source/FunctionForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ public object PerformFunction(bool imagej)
}
if (FuncType == Function.FunctionType.ImageJ)
{
ImageJ.RunOnImage(script, false, BioConsole.onTab, BioConsole.useBioformats, BioConsole.newTab);
Fiji.RunOnImage(script, false, BioConsole.onTab, BioConsole.useBioformats, BioConsole.newTab);
}

if (FuncType == Function.FunctionType.Key)
Expand Down
2 changes: 2 additions & 0 deletions BioCore/Source/ImageView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3559,6 +3559,8 @@ private void layersToolStripMenuItem_Click(object sender, EventArgs e)
/// @param EventArgs
private void pictureBox_SizeChanged(object sender, EventArgs e)
{
if (SelectedImage == null)
return;
if (ViewWidth < 2 || ViewHeight < 2) return;
if (SelectedImage.isPyramidal)
{
Expand Down
4 changes: 2 additions & 2 deletions BioCore/Source/Scripting.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ private static void RunScript()
try
{
rn.done = false;
ImageJ.RunString(rn.scriptString, "", false);
Fiji.RunString(rn.scriptString, "", false);
rn.done = true;
}
catch (Exception e)
Expand Down Expand Up @@ -543,7 +543,7 @@ private void runButton_Click(object sender, EventArgs e)
{
if (scriptLabel.Text.EndsWith(".ijm"))
{
ImageJ.RunString(textBox.Text, ImageView.SelectedImage.ID, headlessBox.Checked);
Fiji.RunString(textBox.Text, ImageView.SelectedImage.ID, headlessBox.Checked);
}
else
Run();
Expand Down
1 change: 1 addition & 0 deletions BioCore/Source/TabsView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ private void Init()
App.tabsView = this;
Plugins.Initialize();
filters = new Filter();
Fiji.Initialize(false);
string a = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
foreach (char c in a)
{
Expand Down

0 comments on commit 405d16e

Please sign in to comment.